cvs: gd /libgd/examples crop.c /libgd/src gd.h

From: Date: Fri, 14 Mar 2008 21:45:12 +0000
Subject: cvs: gd /libgd/examples crop.c /libgd/src gd.h
Groups: php.gd.cvs 
Request: Send a blank email to php-gd-cvs+get-456@lists.php.net to get a copy of this message
pajoye Fri Mar 14 21:45:12 2008 UTC Modified files: /gd/libgd/examples crop.c /gd/libgd/src gd.h Log: - #136, update the threshold crop to use color distance in the rgb cube (3d distance) and normalize the threshold level from 0..1.0 http://cvs.php.net/viewvc.cgi/gd/libgd/examples/crop.c?r1=1.3&r2=1.4&diff_format=u Index: gd/libgd/examples/crop.c diff -u gd/libgd/examples/crop.c:1.3 gd/libgd/examples/crop.c:1.4 --- gd/libgd/examples/crop.c:1.3 Mon Jan 28 14:11:43 2008 +++ gd/libgd/examples/crop.c Fri Mar 14 21:45:12 2008 @@ -1,4 +1,4 @@ -/* $Id: crop.c,v 1.3 2008/01/28 14:11:43 pajoye Exp $ */ +/* $Id: crop.c,v 1.4 2008/03/14 21:45:12 pajoye Exp $ */ #include "gd.h" #include <stdio.h> @@ -58,19 +58,7 @@ return 1; } - im2 = gdImageThresholdCrop(im, 0xFFFFFF, 120); - if (im2) { - save_png(im2, "a3.png"); - gdImageDestroy(im2); - } - gdImageDestroy(im); - - im = read_png("test_crop_threshold.png"); - if (!im) { - return 1; - } - - im2 = gdImageThresholdCrop(im, 0xFFFFFF, 70); + im2 = gdImageThresholdCrop(im, 0xFFFFFF, 0.6); if (im2) { save_png(im2, "a4.png"); gdImageDestroy(im2); http://cvs.php.net/viewvc.cgi/gd/libgd/src/gd.h?r1=1.45&r2=1.46&diff_format=u Index: gd/libgd/src/gd.h diff -u gd/libgd/src/gd.h:1.45 gd/libgd/src/gd.h:1.46 --- gd/libgd/src/gd.h:1.45 Sun Jan 13 21:13:01 2008 +++ gd/libgd/src/gd.h Fri Mar 14 21:45:12 2008 @@ -748,7 +748,7 @@ BGD_DECLARE(gdImagePtr) gdImageCrop(gdImagePtr src, const gdRect *crop); BGD_DECLARE(gdImagePtr) gdImageAutoCrop(gdImagePtr im, const unsigned int mode); -BGD_DECLARE(gdImagePtr) gdImageThresholdCrop(gdImagePtr im, const unsigned int color, const int threshold); +BGD_DECLARE(gdImagePtr) gdImageThresholdCrop(gdImagePtr im, const unsigned int color, const float threshold); BGD_DECLARE(void) gdImageFlipHorizontal(gdImagePtr im); BGD_DECLARE(void) gdImageFlipVertical(gdImagePtr im);

« previous php.gd.cvs (#456) next »