From e2fc23d7da00ce7530e4486448268b297f04a213 Mon Sep 17 00:00:00 2001 From: Nicolas Vion Date: Mon, 27 Oct 2008 19:35:48 +0000 Subject: [PATCH] * Add a "caca_create_dither_gd" function that create the proper dither for a given gd resource. --- caca-php/examples/dithering.php | 10 ++++++---- caca-php/php_caca.c | 15 +++++++++++++++ caca-php/php_caca.h | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/caca-php/examples/dithering.php b/caca-php/examples/dithering.php index bb67827..dc9eb2c 100755 --- a/caca-php/examples/dithering.php +++ b/caca-php/examples/dithering.php @@ -1,12 +1,14 @@ #!/usr/bin/php5 trueColor) { + RETURN_FALSE; + } + caca_dither_t *dither = caca_create_dither(sizeof(int) * 8, img->sx, img->sy, img->sx * sizeof(int), 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000); + ZEND_REGISTER_RESOURCE(return_value, dither, le_caca_dither); +} + PHP_FUNCTION(caca_set_dither_palette) { } diff --git a/caca-php/php_caca.h b/caca-php/php_caca.h index 626fd78..fedcf1f 100644 --- a/caca-php/php_caca.h +++ b/caca-php/php_caca.h @@ -105,6 +105,7 @@ PHP_FUNCTION(caca_set_frame_name); PHP_FUNCTION(caca_create_frame); PHP_FUNCTION(caca_free_frame); PHP_FUNCTION(caca_create_dither); +PHP_FUNCTION(caca_create_dither_gd); PHP_FUNCTION(caca_set_dither_palette); PHP_FUNCTION(caca_set_dither_brightness); PHP_FUNCTION(caca_get_dither_brightness);