chiark / gitweb /
constify CanonImage->rgb and make a copy in find_islandname
[ypp-sc-tools.db-live.git] / pctb / structure.c
index a0b1060d9c48475c053c16ef35c88d1806cf03a0..967de1e990a778049f4aaaad2d32823a4812b54c 100644 (file)
@@ -543,7 +543,7 @@ static void find_table_entry(Rect commod, int colno, Rect *cell) {
 
   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,
@@ -663,9 +663,13 @@ Rect find_sunshine_widget(void) {
   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];