13
/*#########################################################################
15
#########################################################################*/
18
typedef struct GrayMap_def GrayMap;
20
#define GRAYMAP_BLACK 0
21
#define GRAYMAP_WHITE 765
36
void (*setPixel)(GrayMap *me, int x, int y, unsigned long val);
41
unsigned long (*getPixel)(GrayMap *me, int x, int y);
46
int (*writePPM)(GrayMap *me, char *fileName);
53
void (*destroy)(GrayMap *me);
74
unsigned long *pixels;
77
* Pointer to the beginning of each row
87
GrayMap *GrayMapCreate(int width, int height);
96
/*#########################################################################
97
### P A C K E D P I X E L M A P
98
#########################################################################*/
101
typedef struct PackedPixelMap_def PackedPixelMap;
106
struct PackedPixelMap_def
116
void (*setPixel)(PackedPixelMap *me, int x, int y, int r, int g, int b);
122
void (*setPixelLong)(PackedPixelMap *me, int x, int y, unsigned long rgb);
128
unsigned long (*getPixel)(PackedPixelMap *me, int x, int y);
134
int (*writePPM)(PackedPixelMap *me, char *fileName);
141
void (*destroy)(PackedPixelMap *me);
160
* The allocated array of pixels
162
unsigned long *pixels;
165
* Pointers to the beginning of each row of pixels
167
unsigned long **rows;
178
PackedPixelMap *PackedPixelMapCreate(int width, int height);
186
/*#########################################################################
188
#########################################################################*/
199
typedef struct RgbMap_def RgbMap;
214
void (*setPixel)(RgbMap *me, int x, int y, int r, int g, int b);
220
void (*setPixelRGB)(RgbMap *me, int x, int y, RGB rgb);
225
RGB (*getPixel)(RgbMap *me, int x, int y);
230
int (*writePPM)(RgbMap *me, char *fileName);
237
void (*destroy)(RgbMap *me);
256
* The allocated array of pixels
261
* Pointers to the beginning of each row of pixels
273
RgbMap *RgbMapCreate(int width, int height);
282
/*#########################################################################
283
### I N D E X E D M A P
284
#########################################################################*/
287
typedef struct IndexedMap_def IndexedMap;
292
struct IndexedMap_def
302
void (*setPixel)(IndexedMap *me, int x, int y, unsigned int index);
308
unsigned int (*getPixel)(IndexedMap *me, int x, int y);
313
RGB (*getPixelValue)(IndexedMap *me, int x, int y);
318
int (*writePPM)(IndexedMap *me, char *fileName);
325
void (*destroy)(IndexedMap *me);
344
* The allocated array of pixels
346
unsigned int *pixels;
349
* Pointers to the beginning of each row of pixels
359
* Color look up table
371
IndexedMap *IndexedMapCreate(int width, int height);
380
#endif /* __IMAGEMAP_H__ */
382
/*#########################################################################
383
### E N D O F F I L E
384
#########################################################################*/