]> granicus.if.org Git - php/commitdiff
Feature Request #21784 Added: imagecolorallocatealpha (pollita@php.net,jasper@pointl...
authorSara Golemon <pollita@php.net>
Sun, 26 Jan 2003 01:15:02 +0000 (01:15 +0000)
committerSara Golemon <pollita@php.net>
Sun, 26 Jan 2003 01:15:02 +0000 (01:15 +0000)
ext/gd/gd.c
ext/gd/php_gd.h

index 733d0ff730595558219124e6445f25968753c845..1b0c2f32354c22af9804c72f9e9e09a156a4b0f6 100644 (file)
@@ -188,6 +188,7 @@ function_entry gd_functions[] = {
        PHP_FE(imagefilledarc,                                                  NULL)
        PHP_FE(imagefilledellipse,                                              NULL)
        PHP_FE(imagealphablending,                                              NULL)
+       PHP_FE(imagecolorallocatealpha,                                 NULL)
        PHP_FE(imagecolorresolvealpha,                                  NULL)
        PHP_FE(imagecolorclosestalpha,                                  NULL)
        PHP_FE(imagecolorexactalpha,                                    NULL)
@@ -972,6 +973,24 @@ PHP_FUNCTION(imagelayereffect)
 /* }}} */
 #endif
 
+/* {{{ proto int imagecolorallocatealpha(resource im, int red, int green, int blue, int alpha)
+   Allocate a color with an alpha level.  Works for true color and palette based images */
+PHP_FUNCTION(imagecolorallocatealpha)
+{
+       zval *IM;
+       int red, green, blue, alpha;
+       gdImagePtr im;
+
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zllll", &IM, &red, &green, &blue, &alpha) == FAILURE) {
+               RETURN_FALSE;
+       }
+
+       ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
+
+       RETURN_LONG(gdImageColorAllocateAlpha(im, red, green, blue, alpha));
+}
+/* }}} */
+
 /* {{{ proto int imagecolorresolvealpha(resource im, int red, int green, int blue, int alpha)
    Resolve/Allocate a colour with an alpha level.  Works for true colour and palette based images */
 PHP_FUNCTION(imagecolorresolvealpha)
index 7fe24d1cabf5dfd8df9a4d268f25f204a99d0c6a..6000733ca2632677ac0d2e9ddbc61add371d0750 100644 (file)
@@ -62,6 +62,7 @@ PHP_RSHUTDOWN_FUNCTION(gd);
 
 PHP_FUNCTION(gd_info);
 PHP_FUNCTION(imagearc);
+PHP_FUNCTION(imageellipse);
 PHP_FUNCTION(imagechar);
 PHP_FUNCTION(imagecharup);
 PHP_FUNCTION(imageistruecolor);
@@ -85,17 +86,19 @@ PHP_FUNCTION(imagecreate);
 PHP_FUNCTION(imageftbbox);
 PHP_FUNCTION(imagefttext);
 
+#ifdef HAVE_LIBGD20
 PHP_FUNCTION(imagecreatetruecolor);
 PHP_FUNCTION(imagetruecolortopalette);
 PHP_FUNCTION(imagesetthickness);
-PHP_FUNCTION(imageellipse);
 PHP_FUNCTION(imagefilledellipse);
 PHP_FUNCTION(imagefilledarc);
 PHP_FUNCTION(imagealphablending);
+PHP_FUNCTION(imagecolorallocatealpha);
 PHP_FUNCTION(imagecolorresolvealpha);
 PHP_FUNCTION(imagecolorclosestalpha);
 PHP_FUNCTION(imagecolorexactalpha);
 PHP_FUNCTION(imagecopyresampled);
+#endif
 
 #ifdef HAVE_GD_BUNDLED
 PHP_FUNCTION(imagerotate);