pajoye          Thu Dec  5 21:16:07 2002 EDT

  Modified files:              
    /php4/ext/gd        gd.c php_gd.h 
  Log:
  Add imageistruecolor
  
  
Index: php4/ext/gd/gd.c
diff -u php4/ext/gd/gd.c:1.234 php4/ext/gd/gd.c:1.235
--- php4/ext/gd/gd.c:1.234      Wed Dec  4 18:21:30 2002
+++ php4/ext/gd/gd.c    Thu Dec  5 21:16:06 2002
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: gd.c,v 1.234 2002/12/04 23:21:30 rasmus Exp $ */
+/* $Id: gd.c,v 1.235 2002/12/06 02:16:06 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, 
    Cold Spring Harbor Labs. */
@@ -156,12 +156,13 @@
        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)
@@ -1747,6 +1748,23 @@
        zend_list_delete(Z_LVAL_PP(IM));
 
        RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ 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);
 }
 /* }}} */
 
Index: php4/ext/gd/php_gd.h
diff -u php4/ext/gd/php_gd.h:1.46 php4/ext/gd/php_gd.h:1.47
--- php4/ext/gd/php_gd.h:1.46   Sat Nov 23 17:11:59 2002
+++ php4/ext/gd/php_gd.h        Thu Dec  5 21:16:06 2002
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_gd.h,v 1.46 2002/11/23 22:11:59 moriyoshi Exp $ */
+/* $Id: php_gd.h,v 1.47 2002/12/06 02:16:06 pajoye Exp $ */
 
 #ifndef PHP_GD_H
 #define PHP_GD_H
@@ -64,6 +64,7 @@
 PHP_FUNCTION(imagearc);
 PHP_FUNCTION(imagechar);
 PHP_FUNCTION(imagecharup);
+PHP_FUNCTION(imageistruecolor);
 PHP_FUNCTION(imagecolorallocate);
 PHP_FUNCTION(imagepalettecopy);
 PHP_FUNCTION(imagecolorat);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to