diff options
Diffstat (limited to 'Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled')
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/Makemodule.am | 16 | ||||
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic.c | 37 | ||||
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_alpha.c | 40 | ||||
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_alpha_exp.png | bin | 2668 -> 0 bytes | |||
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_exp.png | bin | 2144 -> 0 bytes | |||
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201.c | 71 | ||||
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201_exp.png | bin | 11853 -> 0 bytes | |||
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201_src.png | bin | 1219 -> 0 bytes | |||
-rw-r--r-- | Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/exact_alpha.c | 67 |
10 files changed, 0 insertions, 243 deletions
diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/CMakeLists.txt b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/CMakeLists.txt deleted file mode 100644 index 00351ca4c70..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -LIST(APPEND TESTS_FILES - exact_alpha -) -IF(PNG_FOUND) -LIST(APPEND TESTS_FILES - basic - basic_alpha - bug00201 -) -ENDIF(PNG_FOUND) - -ADD_GD_TESTS() diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/Makemodule.am b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/Makemodule.am deleted file mode 100644 index d42eab559c2..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/Makemodule.am +++ /dev/null @@ -1,16 +0,0 @@ -libgd_test_programs += \ - gdimagecopyresampled/exact_alpha - -if HAVE_LIBPNG -libgd_test_programs += \ - gdimagecopyresampled/basic \ - gdimagecopyresampled/basic_alpha \ - gdimagecopyresampled/bug00201 -endif - -EXTRA_DIST += \ - gdimagecopyresampled/CMakeLists.txt \ - gdimagecopyresampled/basic_exp.png \ - gdimagecopyresampled/basic_alpha_exp.png \ - gdimagecopyresampled/bug00201_src.png \ - gdimagecopyresampled/bug00201_exp.png diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic.c b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic.c deleted file mode 100644 index 2847947e55b..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Testing basic gdImageCopyResampled() functionality */ - -#include "gd.h" -#include "gdtest.h" - -int main() -{ - gdImagePtr im, copy; - int white, yellow, magenta, cyan; - - im = gdImageCreateTrueColor(400, 300); - - /* allocate some colors */ - white = gdImageColorAllocate(im, 255, 255, 255); - yellow = gdImageColorAllocate(im, 128, 0, 128); - magenta = gdImageColorAllocate(im, 128, 128, 0); - cyan = gdImageColorAllocate(im, 0, 128, 128); - - /* draw background */ - gdImageFilledRectangle(im, 0,0, 399,299, white); - - /* draw some basic shapes */ - gdImageFilledEllipse(im, 100,100, 150,100, yellow); - gdImageSetThickness(im, 5); - gdImageLine(im, 50,250, 350,50, magenta); - gdImageRectangle(im, 200,100, 350,250, cyan); - - /* create a diminished, resampled copy of the original image */ - copy = gdImageCreateTrueColor(200, 200); - gdImageCopyResampled(copy, im, 0,0, 0,0, 200,200, 400,300); - gdImageDestroy(im); - - gdAssertImageEqualsToFile("gdimagecopyresampled/basic_exp.png", copy); - - gdImageDestroy(copy); - return gdNumFailures(); -} diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_alpha.c b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_alpha.c deleted file mode 100644 index 4daee685b6a..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_alpha.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Testing basic gdImageCopyResampled() functionality with alpha channel */ - -#include "gd.h" -#include "gdtest.h" - -int main() -{ - gdImagePtr im, copy; - int white, yellow, magenta, cyan; - - im = gdImageCreateTrueColor(400, 300); - gdImageAlphaBlending(im, 0); - - /* allocate some alpha colors */ - white = gdImageColorAllocateAlpha(im, 255, 255, 255, 31); - yellow = gdImageColorAllocateAlpha(im, 128, 0, 128, 63); - magenta = gdImageColorAllocateAlpha(im, 128, 128, 0, 95); - cyan = gdImageColorAllocateAlpha(im, 0, 128, 128, 127); - - /* draw background */ - gdImageFilledRectangle(im, 0,0, 399,299, white); - - /* draw some basic shapes */ - gdImageFilledEllipse(im, 100,100, 150,100, yellow); - gdImageSetThickness(im, 5); - gdImageLine(im, 50,250, 350,50, magenta); - gdImageRectangle(im, 200,100, 350,250, cyan); - - /* create a diminished, resampled copy of the original image */ - copy = gdImageCreateTrueColor(200, 200); - gdImageAlphaBlending(copy, 0); - gdImageSaveAlpha(copy, 1); - gdImageCopyResampled(copy, im, 0,0, 0,0, 200,200, 400,300); - gdImageDestroy(im); - - gdAssertImageEqualsToFile("gdimagecopyresampled/basic_alpha_exp.png", copy); - - gdImageDestroy(copy); - return gdNumFailures(); -} diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_alpha_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_alpha_exp.png Binary files differdeleted file mode 100644 index 29dfc2713bf..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_alpha_exp.png +++ /dev/null diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_exp.png Binary files differdeleted file mode 100644 index dccc2f981a2..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/basic_exp.png +++ /dev/null diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201.c b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201.c deleted file mode 100644 index 0287267e6f2..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201.c +++ /dev/null @@ -1,71 +0,0 @@ -#include "gd.h" -#include "gdtest.h" - - -#define SRC_WIDTH 80 -#define SRC_HEIGHT 42 -#define DEST_WIDTH 200 -#define DEST_HEIGHT 200 - - -/* Create an image and fill it with true transparency */ -gdImagePtr blank_image(int width, int height) -{ - gdImagePtr img; - int c; - - img = gdImageCreateTrueColor(width, height); - gdImageAlphaBlending(img, 0); - c = gdImageColorAllocateAlpha(img, 255, 0, 255, 127); - gdImageFilledRectangle(img, 0, 0, width-1, height-1, c); - return img; -} - - -/* Merge layers on top of each other */ -gdImagePtr flatten(gdImagePtr *layers, int layer_count, int width, int height) -{ - gdImagePtr img; - int i; - - img = blank_image(width,height); - gdImageAlphaBlending(img, 1); - for (i = 0; i < layer_count; i++) { - gdImageCopy(img, layers[i], 0,0, 0,0, width,height); - } - gdImageSaveAlpha(img, 1); - return img; -} - - -int main() -{ - gdImagePtr layers[2], background, logo_source, logo, scaled_logo, img; - FILE *fp; - - background = blank_image(DEST_WIDTH,DEST_HEIGHT); - - fp = gdTestFileOpen2("gdimagecopyresampled", "bug00201_src.png"); - logo_source = gdImageCreateFromPng(fp); - fclose(fp); - - logo = blank_image(SRC_WIDTH,SRC_HEIGHT); - gdImageAlphaBlending(logo, 0); - gdImageCopy(logo, logo_source, 0,0, 0,0, SRC_WIDTH,SRC_HEIGHT); - gdImageDestroy(logo_source); - - scaled_logo = blank_image(DEST_WIDTH,DEST_HEIGHT); - gdImageAlphaBlending(scaled_logo, 0); - gdImageCopyResampled(scaled_logo, logo, 0,0, 0,0, 200,105, SRC_WIDTH,SRC_HEIGHT); - gdImageDestroy(logo); - - layers[0] = background; - layers[1] = scaled_logo; - img = flatten(layers, 2, DEST_WIDTH, DEST_HEIGHT); - gdImageDestroy(background); - gdImageDestroy(scaled_logo); - - gdAssertImageEqualsToFile("gdimagecopyresampled/bug00201_exp.png", img); - gdImageDestroy(img); - return gdNumFailures(); -} diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201_exp.png b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201_exp.png Binary files differdeleted file mode 100644 index 9ffe1551743..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201_exp.png +++ /dev/null diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201_src.png b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201_src.png Binary files differdeleted file mode 100644 index 86c0eaced32..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/bug00201_src.png +++ /dev/null diff --git a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/exact_alpha.c b/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/exact_alpha.c deleted file mode 100644 index 581ad017534..00000000000 --- a/Build/source/libs/gd/libgd-src/tests/gdimagecopyresampled/exact_alpha.c +++ /dev/null @@ -1,67 +0,0 @@ -/* Test for exact colors of gdImageCopyResampled */ - -#include "gd.h" -#include "gdtest.h" - - -#define EXP_RED 66 -#define EXP_GREEN 66 -#define EXP_BLUE 133 -#define EXP_ALPHA 32 - - -int main() -{ - gdImagePtr im, copy; - int solid, transparent, color; - int red, green, blue, alpha; - int i, j; - - /* create the source image */ - im = gdImageCreateTrueColor(10, 10); - gdImageAlphaBlending(im, 0); - solid = gdImageColorAllocate(im, 0, 100, 150); - transparent = gdImageColorAllocateAlpha(im, 200, 0, 100, 64); - - /* draw a checker pattern */ - for (i = 0; i < gdImageSX(im); i++) { - for (j = 0; j < gdImageSY(im); j++) { - gdImageSetPixel(im, i, j, (i%2 != j%2 ? solid : transparent)); - } - } - - /* create the destination image */ - copy = gdImageCreateTrueColor(5, 5); - gdImageAlphaBlending(copy, 0); - gdImageSaveAlpha(copy, 1); - gdImageCopyResampled(copy, im, 0,0, 0,0, 5,5, 10, 10); - - /* assert all pixels have the same color */ - color = gdImageTrueColorPixel(copy, 3, 3); - for (i = 0; i < gdImageSX(copy); i++) { - for (j = 0; j < gdImageSY(copy); j++) { - gdTestAssert(gdImageTrueColorPixel(copy, i, j) == color); - } - } - - /* assign actual component values */ - red = gdTrueColorGetRed(color); - green = gdTrueColorGetGreen(color); - blue = gdTrueColorGetBlue(color); - alpha = gdTrueColorGetAlpha(color); - - /* test for expected component values */ - gdTestAssertMsg(red >= EXP_RED - 1 && red <= EXP_RED + 1, - "red: expected roughly %d, got %d\n", EXP_RED, red); - gdTestAssertMsg(green >= EXP_GREEN - 1 && green <= EXP_GREEN + 1, - "green: expected roughly %d, got %d\n", EXP_GREEN, green); - gdTestAssertMsg(blue >= EXP_BLUE - 1 && blue <= EXP_BLUE + 1, - "blue: expected roughly %d, got %d\n", EXP_BLUE, blue); - gdTestAssertMsg(alpha >= EXP_ALPHA - 1 && alpha <= EXP_ALPHA + 1, - "alpha: expected roughly %d, got %d\n", EXP_ALPHA, alpha); - - gdImageDestroy(copy); - gdImageDestroy(im); - - return gdNumFailures(); -} |