pollita         Sat Jan 25 20:15:03 2003 EDT

  Modified files:              
    /php4/ext/gd        php_gd.h gd.c 
  Log:
  Feature Request #21784  Added: imagecolorallocatealpha 
([EMAIL PROTECTED],[EMAIL PROTECTED])
  
  
Index: php4/ext/gd/php_gd.h
diff -u php4/ext/gd/php_gd.h:1.50 php4/ext/gd/php_gd.h:1.51
--- php4/ext/gd/php_gd.h:1.50   Tue Dec 31 11:06:40 2002
+++ php4/ext/gd/php_gd.h        Sat Jan 25 20:15:02 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_gd.h,v 1.50 2002/12/31 16:06:40 sebastian Exp $ */
+/* $Id: php_gd.h,v 1.51 2003/01/26 01:15:02 pollita Exp $ */
 
 #ifndef PHP_GD_H
 #define PHP_GD_H
@@ -62,6 +62,7 @@
 
 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(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);
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.248 php4/ext/gd/gd.c:1.249
--- php4/ext/gd/gd.c:1.248      Fri Jan 24 14:23:53 2003
+++ php4/ext/gd/gd.c    Sat Jan 25 20:15:02 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: gd.c,v 1.248 2003/01/24 19:23:53 iliaa Exp $ */
+/* $Id: gd.c,v 1.249 2003/01/26 01:15:02 pollita Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
    Cold Spring Harbor Labs. */
@@ -188,6 +188,7 @@
        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)
@@ -971,6 +972,24 @@
 }
 /* }}} */
 #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 CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to