src/pt_image.h

Mon, 03 Aug 2009 14:09:20 +0100

author
Philip Pemberton <philpem@philpem.me.uk>
date
Mon, 03 Aug 2009 14:09:20 +0100
changeset 5
1204ebf9340d
parent 3
4aec27d9d4da
permissions
-rw-r--r--

added P-touch decoder source

philpem@3 1 #ifndef PT_IMAGE_H
philpem@3 2 #define PT_IMAGE_H
philpem@3 3
philpem@3 4 /**
philpem@3 5 * A storage class for simple images.
philpem@3 6 *
philpem@3 7 * Data is stored as bytes, as this makes the math easier (and modern
philpem@3 8 * computer systems have plenty of RAM anyway).
philpem@3 9 */
philpem@3 10 typedef struct {
philpem@3 11 unsigned long width, height;
philpem@3 12 unsigned char *data;
philpem@3 13 } pt_Image;
philpem@3 14
philpem@3 15 pt_Image *ptimage_Create(unsigned long width, unsigned long height);
philpem@3 16 void ptimage_Free(pt_Image *image);
philpem@3 17 int ptimage_GetPixel(pt_Image *image, unsigned long x, unsigned long y);
philpem@3 18 int ptimage_SetPixel(pt_Image *image, unsigned long x, unsigned long y, unsigned char val);
philpem@3 19
philpem@3 20 #endif // PT_IMAGE_H