X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fconvert.h;h=0ab09dbccb7ac56b2076cb870d9956f701af6f09;hb=579edbc3e615ade4ac65296eeaff383ac19fe9b1;hp=83be1e8bced1ab8fce05d7233588595792f74530;hpb=9334b48a221df6f96a88933be8fde35e2ef41b35;p=ypp-sc-tools.web-live.git diff --git a/pctb/convert.h b/pctb/convert.h index 83be1e8..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);