X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=pctb%2Fstructure.c;h=d053b448bf458b9f1c4f5d45559ccd8482f3b92a;hb=c66cfd9d90974888907605f6d9888bcadd5fa433;hp=6ccbb5e76b217518c54b7dcd66c84cb66e1554c4;hpb=ab4295d148c3112ab2859fac0349152d9b6987be;p=ypp-sc-tools.db-test.git diff --git a/pctb/structure.c b/pctb/structure.c index 6ccbb5e..d053b44 100644 --- a/pctb/structure.c +++ b/pctb/structure.c @@ -525,23 +525,9 @@ void analyse(FILE *tsv_output) { DEBUG_DEFINE_SOME_DEBUGF(structcolon,colondebugf) -void find_islandname(void) { +Rect find_sunshine_widget(void) { Rect sunshiner; - char sunshine[MAXIMGIDENT], archisland[MAXIMGIDENT]; - RgbImage *ri= alloc_rgb_image(page0_rgbimage->w, page0_rgbimage->h); - const unsigned char *srcp; - unsigned char *destp, *endp; - for (srcp=page0_rgbimage->data, destp=ri->data, - endp= ri->data + 3 * ri->w * ri->h; - destp < endp; - srcp++, destp++) { - unsigned char c= *srcp & 0xf0; - *destp= c | (c>>4); - } - - cim= page_images[0]; - sunshiner.tl.x= cim->w - 1034 + 885; sunshiner.br.x= cim->w - 1034 + 1020; sunshiner.tl.y= 227; @@ -557,6 +543,22 @@ void find_islandname(void) { ADJUST_BOX(sunshiner,"o",20, (cim->w - 1034 + 700), MUST, tl,x,-1); ADJUST_BOX(sunshiner,"o",20, cim->w, MUST, br,x,+1); debug_rect("sunshiner",1, sunshiner); + return sunshiner; +} + +void find_islandname(RgbImage *ri) { + Rect sunshiner= find_sunshine_widget(); + char sunshine[MAXIMGIDENT], archisland[MAXIMGIDENT]; + + const unsigned char *srcp; + unsigned char *destp, *endp; + for (srcp=page0_rgbimage->data, destp=ri->data, + endp= ri->data + 3 * ri->w * ri->h; + destp < endp; + srcp++, destp++) { + unsigned char c= *srcp & 0xf0; + *destp= c | (c>>4); + } identify_rgbimage(ri, sunshiner, sunshine, "sunshine widget"); @@ -626,6 +628,7 @@ void find_islandname(void) { Point p; int nspaces=1, might_be_colon=0; uint32_t colon_pattern= 0; + p.y=-1; for (p.x=islandnamer.br.x; p.x>islandnamer.tl.x; p.x--) { colondebugf("structcolon: x=%4d nsp=%2d mbc=%d cp=%08"PRIx32" ",