CVS update: php3/functions
| From: | rasmus | Date: | Mon, 12 Oct 1998 12:20:04 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-1823@lists.php.net to get a copy of this message | ||
Date: Monday October 12, 1998 @ 8:20
Author: rasmus
Update of /repository/php3/functions
In directory asf:/u2/tmp/cvs-serv11173/functions
Modified Files:
gd.c php3_gd.h
Log Message:
colordeallocate() function
Index: php3/functions/gd.c
diff -c php3/functions/gd.c:1.94 php3/functions/gd.c:1.95
*** php3/functions/gd.c:1.94 Sat Oct 10 18:35:50 1998
--- php3/functions/gd.c Mon Oct 12 08:20:03 1998
***************
*** 29,35 ****
+----------------------------------------------------------------------+
*/
! /* $Id: gd.c,v 1.94 1998/10/10 22:35:50 jim Exp $ */
/* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
--- 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. */
***************
*** 104,109 ****
--- 104,110 ----
{"imagecolorallocate", php3_imagecolorallocate, NULL},
{"imagecolorat", php3_imagecolorat, NULL},
{"imagecolorclosest", php3_imagecolorclosest, NULL},
+ {"imagecolordeallocate", php3_imagecolordeallocate, NULL},
{"imagecolorresolve", php3_imagecolorresolve, NULL},
{"imagecolorexact", php3_imagecolorexact, NULL},
{"imagecolorset", php3_imagecolorset, NULL},
***************
*** 541,546 ****
--- 542,578 ----
}
col = gdImageColorClosest(im, r, g, b);
RETURN_LONG(col);
+ }
+
+ void php3_imagecolordeallocate(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *imgind, *index;
+ int ind, ind_type, col;
+ gdImagePtr im;
+ GD_TLS_VARS;
+
+ if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &imgind, &index) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long(imgind);
+ convert_to_long(index);
+ ind = imgind->value.lval;
+ col = index->value.lval;
+
+ im = php3_list_find(ind, &ind_type);
+ if (!im || ind_type != GD_GLOBAL(le_gd)) {
+ php3_error(E_WARNING, "ImageColorDeallocate: Unable to find image pointer");
+ RETURN_FALSE;
+ }
+
+ if (col >= 0 && col < gdImageColorsTotal(im)) {
+ gdImageColorDeallocate(im, col);
+ RETURN_TRUE;
+ }
+ else {
+ php3_error(E_WARNING, "Color index out of range");
+ RETURN_FALSE;
+ }
}
void php3_imagecolorresolve(INTERNAL_FUNCTION_PARAMETERS) {
Index: php3/functions/php3_gd.h
diff -c php3/functions/php3_gd.h:1.23 php3/functions/php3_gd.h:1.24
*** php3/functions/php3_gd.h:1.23 Sat Jul 11 17:57:25 1998
--- php3/functions/php3_gd.h Mon Oct 12 08:20:04 1998
***************
*** 29,35 ****
*/
! /* $Id: php3_gd.h,v 1.23 1998/07/11 21:57:25 rasmus Exp $ */
#ifndef _PHP3_GD_H
#define _PHP3_GD_H
--- 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
***************
*** 57,62 ****
--- 57,63 ----
extern void php3_imagecolorallocate(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_imagecolorat(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_imagecolorclosest(INTERNAL_FUNCTION_PARAMETERS);
+ extern void php3_imagecolordeallocate(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_imagecolorresolve(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_imagecolorexact(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_imagecolorset(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