From 7b7cd6da61b1fcc0f2a3ecce2cb9e6c42782c717 Mon Sep 17 00:00:00 2001 From: Henning Makholm Date: Fri, 27 Jan 2006 18:00:00 -0500 Subject: Import of release 0.7 --- (limited to 'test/source') diff --git a/test/source/comptest.xcf.gz b/test/source/comptest.xcf.gz new file mode 100644 index 0000000..4a69918 --- /dev/null +++ b/test/source/comptest.xcf.gz Binary files differ diff --git a/test/source/i255.xcf.gz b/test/source/i255.xcf.gz new file mode 100644 index 0000000..086bafb --- /dev/null +++ b/test/source/i255.xcf.gz Binary files differ diff --git a/test/source/i256.xcf.gz b/test/source/i256.xcf.gz new file mode 100644 index 0000000..38c23c4 --- /dev/null +++ b/test/source/i256.xcf.gz Binary files differ diff --git a/test/source/indextest.xcf.gz b/test/source/indextest.xcf.gz new file mode 100644 index 0000000..b782acf --- /dev/null +++ b/test/source/indextest.xcf.gz Binary files differ diff --git a/test/source/mkbase.i b/test/source/mkbase.i new file mode 100644 index 0000000..ec408ef --- /dev/null +++ b/test/source/mkbase.i @@ -0,0 +1,60 @@ +/* -*- C -*- + * This program is written by Henning Makholm, and is in the + * public domain. + */ + +#include +#include +#include + +static void +error(png_structp png_ptr, png_const_charp errormsg) +{ + fprintf(stderr,"PNG error: %s\n",errormsg); + exit(1); +} + + +int +main(void) +{ + png_structp libpng = NULL ; + png_infop libpng2 = NULL ; + unsigned char row[TEST_IMAGE_WIDTH*4] ; + unsigned x,y ; + int r,g,b,a ; + + libpng = png_create_write_struct(PNG_LIBPNG_VER_STRING, + png_voidp_NULL, + error, + png_error_ptr_NULL); + if( !libpng ) + error(libpng,"Couldn't initialize libpng library"); + + libpng2 = png_create_info_struct(libpng); + if( !libpng2 ) + error(libpng,"Couldn't create PNG info structure"); + + png_init_io(libpng,stdout); + + png_set_IHDR(libpng,libpng2,TEST_IMAGE_WIDTH,TEST_IMAGE_HEIGHT, + 8, PNG_COLOR_TYPE_RGB_ALPHA, + PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_DEFAULT, + PNG_FILTER_TYPE_DEFAULT); + + png_write_info(libpng,libpng2); + + for( y=0; y= 61 ) { + *a = 0 ; + return ; + } + if( x < 3 || x >= 61 || + y < 6 || y >= 58 ) { + *r=*g=*b=*a=255 ; + return ; + } + if( x < 6 || x >= 58 ) { + *a=0 ; + return ; + } + x -= 6 ; + if( x <= 17 ) { + *a = x*15 ; + *r = 255 ; + *g = 0 ; + *b = 17*7 ; + return ; + } + *a = 255 ; + x -= 17 ; + if( x <= 17 ) { + *r = 255 ; + *g = x*15 ; + *b = (17-x)*7 ; + return ; + } + x -= 17 ; + if( x <= 17 ) { + *r = (17-x)*15 ; + *g = 255 ; + *b = x*15 ; + return ; + } + *r=255 ; + *g=*b=0 ; +} + +#include "mkbase.i" diff --git a/test/source/mktile0.pl b/test/source/mktile0.pl new file mode 100644 index 0000000..b932ed0 --- /dev/null +++ b/test/source/mktile0.pl @@ -0,0 +1,15 @@ +$L = 64 ; +print "P3 $L $L 255\n" ; +for $y ( 0 .. $L-1 ) { + for $x ( 0 .. $L-1 ) { + $m = int($y / 4)*16 + int($x/4) ; + if( $m < 216 ) { + print( 51 * ($m % 6), " ", + 51 * (int($m/6) % 6), " ", + 51 * (int($m/36)), "\n" ); + } else { + $m = ($m-216) * 6 + 10 ; + print( "$m $m $m\n" ); + } + } +} diff --git a/test/source/mktile1.c b/test/source/mktile1.c new file mode 100644 index 0000000..50709df --- /dev/null +++ b/test/source/mktile1.c @@ -0,0 +1,35 @@ +/* This program is written by Henning Makholm, and is in the + * public domain. + */ + +#define TEST_IMAGE_WIDTH 50 +#define TEST_IMAGE_HEIGHT 50 + +#include +#include + +void +makepixel(int x,int y,int *r,int *g,int *b,int *a) { + double yy = 2*(double)y/(TEST_IMAGE_HEIGHT-1) - 1 ; + double xx = 2*(double)x/(TEST_IMAGE_WIDTH-1) - 1 ; + double rad = sqrt(xx*xx+yy*yy) ; + unsigned t = x + abs((y - TEST_IMAGE_HEIGHT/2)) ; + t = t / 10 + ((600 + y - TEST_IMAGE_HEIGHT/2) / 10)*77 ; + if( rad < 0.9 ) + *a = 255 ; + else if( rad < 1 ) + *a = 190 ; + else if( rad < 1.2 ) + *a = 73 ; + else + *a = 0 ; + + t *= 3847822 ; + t ^= 29938132 ; + t %= 2093847 ; + *r = 120 * ((t >> 3) % 3) + 3 ; + *g = 120 * ((t >> 7) % 3) + 3 ; + *b = 120 * ((t >> 10) % 3) + 3 ; +} + +#include "mkbase.i" diff --git a/test/source/modetest.xcf.gz b/test/source/modetest.xcf.gz new file mode 100644 index 0000000..c2d7f8a --- /dev/null +++ b/test/source/modetest.xcf.gz Binary files differ diff --git a/test/source/tiletest.xcf.gz b/test/source/tiletest.xcf.gz new file mode 100644 index 0000000..c2fbc45 --- /dev/null +++ b/test/source/tiletest.xcf.gz Binary files differ -- cgit v0.9.1