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 d38c38efab83362a3ec7cb22e30dcc8539565cfb..0ab09dbccb7ac56b2076cb870d9956f701af6f09 100644 (file)
@@ -51,17 +51,28 @@ 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);
+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(void);
+void find_islandname(RgbImage *ri);
 void check_correct_commodities(void);
 void read_screenshots(void);
 void read_one_screenshot(void);
@@ -116,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;