--- gd.c.orig Mon Jan 20 22:06:50 2003 +++ gd.c Mon Jan 20 22:19:44 2003 @@ -153,6 +153,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) @@ -890,6 +891,28 @@ } /* }}} */ #endif + +/* {{{ proto int imagecolorallocatealpha(resource im, int red, int green, int blue, int alpha) + Allocate a colour with an alpha level. Works for true colour and palette based images */ +PHP_FUNCTION(imagecolorallocatealpha) +{ + zval **IM, ** red, **green, **blue, **alpha; + gdImagePtr im; + + if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { + ZEND_WRONG_PARAM_COUNT(); + } + + ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); + + convert_to_long_ex(red); + convert_to_long_ex(green); + convert_to_long_ex(blue); + convert_to_long_ex(alpha); + + RETURN_LONG(gdImageColorAllocateAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(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_gd.h.orig Mon Jan 20 22:06:45 2003 +++ php_gd.h Mon Jan 20 22:07:37 2003 @@ -90,6 +90,7 @@ PHP_FUNCTION(imagefilledellipse); PHP_FUNCTION(imagefilledarc); PHP_FUNCTION(imagealphablending); +PHP_FUNCTION(imagecolorallocatealpha); PHP_FUNCTION(imagecolorresolvealpha); PHP_FUNCTION(imagecolorclosestalpha); PHP_FUNCTION(imagecolorexactalpha);