X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=pctb%2Fconvert.h;h=0ab09dbccb7ac56b2076cb870d9956f701af6f09;hp=80979ec2e885829f8d15faccd887c9c63a6812b0;hb=a4b2def5d1dfcc917b5797f4ffdfc572b2d2c076;hpb=8d6cf0f224b5df9866eba9350343067edcee78dd diff --git a/pctb/convert.h b/pctb/convert.h index 80979ec..0ab09db 100644 --- a/pctb/convert.h +++ b/pctb/convert.h @@ -51,6 +51,8 @@ typedef struct RgbImage { */ } RgbImage; +typedef unsigned long Rgb; + void identify_rgbimage(const RgbImage *base, Rect portion, char result[MAXIMGIDENT], const char *what); RgbImage *alloc_rgb_image(int w, int h); @@ -58,9 +60,16 @@ void fwrite_ppmraw(FILE *f, const RgbImage *ri); #define RI_PIXEL(ri,x,y) ((ri)->data + ((y)*(ri)->w + (x)) * 3) +static inline Rgb ri_rgb(const RgbImage *ri, int x, int y) { + const unsigned char *rip= RI_PIXEL(ri,x,y); + return (rip[0] << 16) | + (rip[1] << 8) | + (rip[2] ); +} + /*----- from structure.c -----*/ -void find_structure(const CanonImage *im, int *max_relevant_y_r); +void find_structure(CanonImage *im, int *max_relevant_y_r); Rect find_sunshine_widget(void); void find_islandname(RgbImage *ri); @@ -118,7 +127,6 @@ void take_one_screenshot(void); #define MAX_PAGES 100 extern CanonImage *page_images[MAX_PAGES]; extern int npages; -RgbImage *page0_rgbimage; extern const char *ocean, *pirate; extern char *archipelago, *island;