Check to see if the blob is an underline. Return true if it is.
53 {
54 int16_t occ;
55 int16_t blob_width;
57 int32_t desc_occ;
58 int32_t x_occ;
59 int32_t asc_occ;
61
65 if (testing_on) {
66
67
68
69
70
71
73 ("Testing underline on blob at (%d,%d)->(%d,%d), base=%d\nOccs:",
77 }
78 horizontal_cblob_projection(blob, &projection);
79 desc_occ = 0;
81 if (occ <= blob_box.
top () && projection.
pile_count (occ) > desc_occ)
82
84 x_occ = 0;
86 if (occ >= blob_box.
bottom () && occ <= blob_box.
top ()
88
90 asc_occ = 0;
91 for (occ =
baseline + xheight + 1; occ <= blob_box.
top (); occ++)
94 if (testing_on) {
95 tprintf (
"%d %d %d\n", desc_occ, x_occ, asc_occ);
96 }
97 if (desc_occ == 0 && x_occ == 0 && asc_occ == 0) {
98 tprintf (
"Bottom=%d, top=%d, base=%d, x=%d\n",
101 }
102 if (desc_occ > x_occ + x_occ
104 return true;
105 return asc_occ > x_occ + x_occ &&
107
108}
DLLSYM void tprintf(const char *format,...)
double textord_underline_threshold
int32_t pile_count(int32_t value) const
bool set_range(int32_t min_bucket_value, int32_t max_bucket_value_plus_1)
TBOX bounding_box() const