summaryrefslogtreecommitdiffstats
path: root/test/source
diff options
context:
space:
mode:
Diffstat (limited to 'test/source')
-rw-r--r--test/source/comptest.xcf.gzbin0 -> 1788 bytes
-rw-r--r--test/source/i255.xcf.gzbin0 -> 1211 bytes
-rw-r--r--test/source/i256.xcf.gzbin0 -> 1215 bytes
-rw-r--r--test/source/indextest.xcf.gzbin0 -> 941 bytes
-rw-r--r--test/source/mkbase.i60
-rw-r--r--test/source/mkgradient256.pl6
-rw-r--r--test/source/mkmodebase.c50
-rw-r--r--test/source/mktile0.pl15
-rw-r--r--test/source/mktile1.c35
-rw-r--r--test/source/modetest.xcf.gzbin0 -> 836 bytes
-rw-r--r--test/source/tiletest.xcf.gzbin0 -> 11130 bytes
11 files changed, 166 insertions, 0 deletions
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 <png.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+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<TEST_IMAGE_HEIGHT; y++ ) {
+ for( x=0; x<TEST_IMAGE_WIDTH; x++ ) {
+ makepixel(x,y,&r,&g,&b,&a);
+ row[x*4+0] = r ;
+ row[x*4+1] = g ;
+ row[x*4+2] = b ;
+ row[x*4+3] = a ;
+ }
+ png_write_row(libpng,row);
+ }
+ png_write_end(libpng,libpng2);
+ return 0 ;
+}
diff --git a/test/source/mkgradient256.pl b/test/source/mkgradient256.pl
new file mode 100644
index 0000000..e03912c
--- /dev/null
+++ b/test/source/mkgradient256.pl
@@ -0,0 +1,6 @@
+print "P2 256 256 255\n" ;
+for $y ( 0 .. 255 ) {
+ for $x ( 0 .. 255 ) {
+ print "$x\n" ;
+ }
+}
diff --git a/test/source/mkmodebase.c b/test/source/mkmodebase.c
new file mode 100644
index 0000000..3e5c656
--- /dev/null
+++ b/test/source/mkmodebase.c
@@ -0,0 +1,50 @@
+/* This program is written by Henning Makholm, and is in the
+ * public domain.
+ */
+
+#define TEST_IMAGE_WIDTH 64
+#define TEST_IMAGE_HEIGHT 64
+
+void
+makepixel(int x,int y,int *r,int *g,int *b,int *a) {
+ if( y < 3 || 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 <math.h>
+#include <stdlib.h>
+
+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