9 unsigned long rgb; /* on screen */
10 char c; /* canonical */
13 extern const CanonColourInfo canoncolourinfos[];
15 CanonImage *alloc_canon_image(int w, int h);
17 #define CANONICALISE_IMAGE(im,w,h, COMPUTE_RGB) do{ \
18 /* compute_rgb should be a number of statements, or \
19 * a block, which assigns to \
20 * unsigned long rgb; \
21 * given the values of \
23 * all of which are anamorphic. Result is stored in im. \
24 * The COMPUTE_RGB is executed exactly once for \
25 * each pixel in reading order. \
27 (im)= alloc_canon_image((w), (h)); \
30 for (y=0; y<(h); y++) { \
31 for (x=0; x<(w); x++) { \
32 const CanonColourInfo *cci; \
35 for (cci=canoncolourinfos; cci->c; cci++) \
36 if (cci->rgb == rgb) { \
37 (im)->d[y*(w) + x]= cci->c; \
42 fprintf(debug, "%4d ",y); \
43 int r= fwrite(im->d + y*w, 1,w, debug); \
52 #endif /*STRUCTURE_H*/