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