@@ -50,16 +50,11 @@ bool test_underline( // look for underlines
50
50
int16_t baseline, // /< coords of baseline
51
51
int16_t xheight // /< height of line
52
52
) {
53
- int16_t occ;
54
- int16_t blob_width; // width of blob
55
- TBOX blob_box; // bounding box
56
- int32_t desc_occ;
57
- int32_t x_occ;
58
- int32_t asc_occ;
53
+ int32_t occ;
59
54
STATS projection;
60
55
61
- blob_box = blob->bounding_box ();
62
- blob_width = blob->bounding_box ().width ();
56
+ auto blob_box = blob->bounding_box ();
57
+ auto blob_width = blob->bounding_box ().width ();
63
58
projection.set_range (blob_box.bottom (), blob_box.top () + 1 );
64
59
if (testing_on) {
65
60
// blob->plot(to_win,GOLDENROD,GOLDENROD);
@@ -73,21 +68,21 @@ bool test_underline( // look for underlines
73
68
blob->bounding_box ().right (), blob->bounding_box ().top (), baseline);
74
69
}
75
70
horizontal_cblob_projection (blob, &projection);
76
- desc_occ = 0 ;
71
+ int32_t desc_occ = 0 ;
77
72
for (occ = blob_box.bottom (); occ < baseline; occ++) {
78
73
if (occ <= blob_box.top () && projection.pile_count (occ) > desc_occ) {
79
74
// max in region
80
75
desc_occ = projection.pile_count (occ);
81
76
}
82
77
}
83
- x_occ = 0 ;
78
+ int32_t x_occ = 0 ;
84
79
for (occ = baseline; occ <= baseline + xheight; occ++) {
85
80
if (occ >= blob_box.bottom () && occ <= blob_box.top () && projection.pile_count (occ) > x_occ) {
86
81
// max in region
87
82
x_occ = projection.pile_count (occ);
88
83
}
89
84
}
90
- asc_occ = 0 ;
85
+ int32_t asc_occ = 0 ;
91
86
for (occ = baseline + xheight + 1 ; occ <= blob_box.top (); occ++) {
92
87
if (occ >= blob_box.bottom () && projection.pile_count (occ) > asc_occ) {
93
88
asc_occ = projection.pile_count (occ);
0 commit comments