typedef struct {
int w,h;
- struct RgbImage *rgb;
+ const struct RgbImage *rgb;
char d[];
} CanonImage;
}
if (o_mode & mf_analyse) {
if (o_flags & ff_needisland) {
- find_islandname(page_images[0]->rgb);
+ find_islandname();
if (o_flags & ff_printisland)
printf("%s, %s\n", archipelago, island);
sysassert(! setenv("YPPSC_ISLAND",island,1) );
Rect find_sunshine_widget(void);
void canon_colour_prepare(void);
-void find_islandname(RgbImage *ri);
+void find_islandname(void);
void check_correct_commodities(void);
void read_screenshots(void);
void read_one_screenshot(void);
debugf("PAGING raise_and_set_focus done.\n");
}
-static CanonImage *convert_page(Snapshot *sn) {
+static CanonImage *convert_page(const Snapshot *sn) {
CanonImage *im;
fwrite_ppmraw(screenshot_file, sn);
- unsigned char *pixel= sn->data;
+ const unsigned char *pixel= sn->data;
CANONICALISE_IMAGE(im, sn->w, sn->h, {
r= *pixel++;
g= *pixel++;
MUST( !!dark_count != !!light_count,
MR(*cell);MIL(total_count);MIL(bg_count);
- MIL(light_count);MIL(dark_count) );
+ MIL(light_count);MIL(dark_count);MRGB(background); );
debugf("TABLEENTRY col=%d %d,%d..%d,%d bg=%ld light=%ld dark=%ld\n",
colno, cell->tl.x,cell->tl.y, cell->br.x,cell->br.y,
return sunshiner;
}
-void find_islandname(RgbImage *ri) {
+void find_islandname(void) {
find_structure(page_images[0], 0);
+ RgbImage *ri= alloc_rgb_image(page_images[0]->rgb->w,
+ page_images[0]->rgb->h);
+ memcpy(ri->data, page_images[0]->rgb->data, ri->w * ri->h * 3);
+
Rect sunshiner= find_sunshine_widget();
char sunshine[MAXIMGIDENT], archisland[MAXIMGIDENT];
* each pixel in reading order. \
*/ \
(im)= alloc_canon_image((w), (h)); \
- (im)->rgb= alloc_rgb_image((w), (h)); \
+ RgbImage *rgb_save; \
+ (im)->rgb= rgb_save= alloc_rgb_image((w), (h)); \
\
int x,y; \
for (y=0; y<(h); y++) { \
for (x=0; x<(w); x++) { \
unsigned char r,g,b; \
COMPUTE_RGB; \
- CANONIMG_ALSO_STORERGB((im)->rgb); \
+ CANONIMG_ALSO_STORERGB(rgb_save); \
(im)->d[y*(w) + x]= canon_lookup_colour(r,g,b); \
} \
if (DEBUGP(rect)) { \