diff options
author | Henning Makholm <henning@makholm.net> | 2006-01-27 18:00:00 (EST) |
---|---|---|
committer | Julien Jorge <julien.jorge@stuff-o-matic.com> | 2013-01-10 16:00:40 (EST) |
commit | 7b7cd6da61b1fcc0f2a3ecce2cb9e6c42782c717 (patch) | |
tree | 98d2772f50aaddb02ac94492d2b8b151aa3e9465 /test/source/mkmodebase.c | |
download | xcftools-7b7cd6da61b1fcc0f2a3ecce2cb9e6c42782c717.zip xcftools-7b7cd6da61b1fcc0f2a3ecce2cb9e6c42782c717.tar.gz xcftools-7b7cd6da61b1fcc0f2a3ecce2cb9e6c42782c717.tar.bz2 |
Import of release 0.7
Diffstat (limited to 'test/source/mkmodebase.c')
-rw-r--r-- | test/source/mkmodebase.c | 50 |
1 files changed, 50 insertions, 0 deletions
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" |