chiark / gitweb /
antialiasing text conversion: seems to handle it in the C code so far ....
[ypp-sc-tools.web-live.git] / pctb / convert.h
index 83be1e8bced1ab8fce05d7233588595792f74530..0ab09dbccb7ac56b2076cb870d9956f701af6f09 100644 (file)
@@ -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);