/* ** ** This is the header file for program newsample.c ** ** */ #define RANDOM(M) (int) ((float)rand()/RAND_MAX*(M)); #define TRUE 1 #define FALSE 0 typedef struct pixel { /* structure for linked list of sampled points */ int x; /* Coords X and Y */ int y; short red; /* Colour RGB */ short green; short blue; struct pixel *next; /* link list pointer */ } dot; typedef struct RGBpixel { /* structure for 2D array */ short red; short green; short blue; } colorPixel; typedef colorPixel *colorPixelArray; /* pointer to pixel */ struct globstruct { colorPixel** theImage; /* 2D dyn array */ int xSize; /* size of window */ int ySize; int numPtsAdded; /* number of sampled points */ dot* head; /* head & tail of sampled pt list */ dot* tail; }; struct globstruct global = {NULL, 200, 200, 0, NULL, NULL}; /* FUNCTION PROTOTYPES */ int check_duplicates(int x, int y); void store_points(int x, int y, int red, int grn, int blue); void add_point(dot *newPoint); void read_samples(void); void writeout(void); void display(void); void procInputData(int argc, char** argv); void dumpCommands(void); void plot_previous_points(void); void keyboard(unsigned char key, int x, int y); void reshape(int x, int y);