CVS update: php3/functions

From: Date: Mon, 12 Oct 1998 22:40:36 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-1832@lists.php.net to get a copy of this message
Date: Monday October 12, 1998 @ 18:40 Author: zeev Update of /repository/php3/functions In directory asf:/u2/tmp/cvs-serv15828/functions Modified Files: gd.c php3_gd.h Log Message: Add ImageCopy() from Marko Karppinen Index: php3/functions/gd.c diff -c php3/functions/gd.c:1.95 php3/functions/gd.c:1.96 *** php3/functions/gd.c:1.95 Mon Oct 12 08:20:03 1998 --- php3/functions/gd.c Mon Oct 12 18:40:35 1998 *************** *** 29,35 **** +----------------------------------------------------------------------+ */ ! /* $Id: gd.c,v 1.95 1998/10/12 12:20:03 rasmus Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ --- 29,35 ---- +----------------------------------------------------------------------+ */ ! /* $Id: gd.c,v 1.96 1998/10/12 22:40:35 zeev Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ *************** *** 111,116 **** --- 111,117 ---- {"imagecolortransparent", php3_imagecolortransparent, NULL}, {"imagecolorstotal", php3_imagecolorstotal, NULL}, {"imagecolorsforindex", php3_imagecolorsforindex, NULL}, + {"imagecopy", php3_imagecopy, NULL}, {"imagecopyresized", php3_imagecopyresized, NULL}, {"imagecreate", php3_imagecreate, NULL}, {"imagecreatefromgif", php3_imagecreatefromgif, NULL}, *************** *** 1460,1465 **** --- 1461,1512 ---- _php3_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); } + void php3_imagecopy(INTERNAL_FUNCTION_PARAMETERS) + { + pval *SIM, *DIM, *SX, *SY, *SW, *SH, *DX, *DY; + gdImagePtr im_dst; + gdImagePtr im_src; + int srcH, srcW, srcY, srcX, dstY, dstX; + int ind_type; + GD_TLS_VARS; + + if (ARG_COUNT(ht) != 8 || + getParameters(ht, 8, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) + == FAILURE) { + WRONG_PARAM_COUNT; + } + + convert_to_long(SIM); + convert_to_long(DIM); + convert_to_long(SX); + convert_to_long(SY); + convert_to_long(SW); + convert_to_long(SH); + convert_to_long(DX); + convert_to_long(DY); + + srcX = SX->value.lval; + srcY = SY->value.lval; + srcH = SH->value.lval; + srcW = SW->value.lval; + dstX = DX->value.lval; + dstY = DY->value.lval; + + im_src = php3_list_find(SIM->value.lval, &ind_type); + if (!im_src || ind_type != GD_GLOBAL(le_gd)) { + php3_error(E_WARNING, "Unable to find image pointer"); + RETURN_FALSE; + } + + im_dst = php3_list_find(DIM->value.lval, &ind_type); + if (!im_dst || ind_type != GD_GLOBAL(le_gd)) { + php3_error(E_WARNING, "Unable to find image pointer"); + RETURN_FALSE; + } + + gdImageCopy(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH); + RETURN_TRUE; + } void php3_imagecopyresized(INTERNAL_FUNCTION_PARAMETERS) { Index: php3/functions/php3_gd.h diff -c php3/functions/php3_gd.h:1.24 php3/functions/php3_gd.h:1.25 *** php3/functions/php3_gd.h:1.24 Mon Oct 12 08:20:04 1998 --- php3/functions/php3_gd.h Mon Oct 12 18:40:35 1998 *************** *** 29,35 **** */ ! /* $Id: php3_gd.h,v 1.24 1998/10/12 12:20:04 rasmus Exp $ */ #ifndef _PHP3_GD_H #define _PHP3_GD_H --- 29,35 ---- */ ! /* $Id: php3_gd.h,v 1.25 1998/10/12 22:40:35 zeev Exp $ */ #ifndef _PHP3_GD_H #define _PHP3_GD_H *************** *** 64,69 **** --- 64,70 ---- extern void php3_imagecolorstotal(INTERNAL_FUNCTION_PARAMETERS); extern void php3_imagecolorsforindex(INTERNAL_FUNCTION_PARAMETERS); extern void php3_imagecolortransparent(INTERNAL_FUNCTION_PARAMETERS); + extern void php3_imagecopy(INTERNAL_FUNCTION_PARAMETERS); extern void php3_imagecopyresized(INTERNAL_FUNCTION_PARAMETERS); extern void php3_imagecreate(INTERNAL_FUNCTION_PARAMETERS); extern void php3_imagecreatefromgif (INTERNAL_FUNCTION_PARAMETERS); -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#1832) next »