1.1 diff -r 81b0d2551776 -r 4aec27d9d4da src/pt_image.h 1.2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.3 +++ b/src/pt_image.h Sat Aug 01 12:42:34 2009 +0100 1.4 @@ -0,0 +1,20 @@ 1.5 +#ifndef PT_IMAGE_H 1.6 +#define PT_IMAGE_H 1.7 + 1.8 +/** 1.9 + * A storage class for simple images. 1.10 + * 1.11 + * Data is stored as bytes, as this makes the math easier (and modern 1.12 + * computer systems have plenty of RAM anyway). 1.13 + */ 1.14 +typedef struct { 1.15 + unsigned long width, height; 1.16 + unsigned char *data; 1.17 +} pt_Image; 1.18 + 1.19 +pt_Image *ptimage_Create(unsigned long width, unsigned long height); 1.20 +void ptimage_Free(pt_Image *image); 1.21 +int ptimage_GetPixel(pt_Image *image, unsigned long x, unsigned long y); 1.22 +int ptimage_SetPixel(pt_Image *image, unsigned long x, unsigned long y, unsigned char val); 1.23 + 1.24 +#endif // PT_IMAGE_H