diff options
| -rw-r--r-- | ext/gd/gd.c | 19 | ||||
| -rw-r--r-- | ext/gd/php_gd.h | 5 | 
2 files changed, 23 insertions, 1 deletions
| diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 733d0ff730..1b0c2f3235 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -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) diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index 7fe24d1cab..6000733ca2 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -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); | 
