summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2002-12-06 02:16:06 +0000
committerPierre Joye <pajoye@php.net>2002-12-06 02:16:06 +0000
commitdda7acaad558d5faa76dfcd7b3a97048c091c8b8 (patch)
tree085c41a1c7f93e8801c510113e7761c046ebec0e
parent1ef49991ffd63b57aa6decea02f10172135d1d19 (diff)
downloadphp-git-dda7acaad558d5faa76dfcd7b3a97048c091c8b8.tar.gz
Add imageistruecolor
-rw-r--r--ext/gd/gd.c20
-rw-r--r--ext/gd/php_gd.h1
2 files changed, 20 insertions, 1 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index bf4b358679..f3c2e163db 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -156,12 +156,13 @@ function_entry gd_functions[] = {
PHP_FE(imageellipse, NULL)
PHP_FE(imagechar, NULL)
PHP_FE(imagecharup, NULL)
+ PHP_FE(imagecolorat, NULL)
PHP_FE(imagecolorallocate, NULL)
#if HAVE_LIBGD15
PHP_FE(imagepalettecopy, NULL)
PHP_FE(imagecreatefromstring, NULL)
#endif
- PHP_FE(imagecolorat, NULL)
+ PHP_FE(imageistruecolor, NULL)
PHP_FE(imagecolorclosest, NULL)
#if HAVE_COLORCLOSESTHWB
PHP_FE(imagecolorclosesthwb, NULL)
@@ -1752,6 +1753,23 @@ PHP_FUNCTION(imagedestroy)
/* {{{ proto int imagecolorallocate(int im, int red, int green, int blue)
Allocate a color for an image */
+PHP_FUNCTION(imageistruecolor)
+{
+ zval **IM;
+ gdImagePtr im;
+
+ if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) {
+ ZEND_WRONG_PARAM_COUNT();
+ }
+
+ ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd);
+
+ RETURN_BOOL(im->trueColor);
+}
+/* }}} */
+
+/* {{{ proto int imagecolorallocate(int im, int red, int green, int blue)
+ Allocate a color for an image */
PHP_FUNCTION(imagecolorallocate)
{
zval **IM, **red, **green, **blue;
diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h
index 0ac89c2a38..90a229f450 100644
--- a/ext/gd/php_gd.h
+++ b/ext/gd/php_gd.h
@@ -64,6 +64,7 @@ PHP_FUNCTION(gd_info);
PHP_FUNCTION(imagearc);
PHP_FUNCTION(imagechar);
PHP_FUNCTION(imagecharup);
+PHP_FUNCTION(imageistruecolor);
PHP_FUNCTION(imagecolorallocate);
PHP_FUNCTION(imagepalettecopy);
PHP_FUNCTION(imagecolorat);