43 static void horizontal_cblob_projection(
C_BLOB *blob,
45 static void horizontal_coutline_projection(
C_OUTLINE *outline,
80 (
"Testing underline on blob at (%d,%d)->(%d,%d), base=%d\nOccs:",
85 horizontal_cblob_projection(blob, &projection);
88 if (occ <= blob_box.
top () && projection.
pile_count (occ) > desc_occ)
92 for (occ = baseline; occ <= baseline + xheight; occ++)
93 if (occ >= blob_box.
bottom () && occ <= blob_box.
top ()
98 for (occ = baseline + xheight + 1; occ <= blob_box.
top (); occ++)
102 tprintf (
"%d %d %d\n", desc_occ, x_occ, asc_occ);
104 if (desc_occ == 0 && x_occ == 0 && asc_occ == 0) {
105 tprintf (
"Bottom=%d, top=%d, base=%d, x=%d\n",
109 if (desc_occ > x_occ + x_occ
112 if (asc_occ > x_occ + x_occ
113 && asc_occ > blob_width * textord_underline_threshold)
126 static void horizontal_cblob_projection(
131 C_OUTLINE_IT out_it = blob->
out_list ();
133 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
134 horizontal_coutline_projection (out_it.data (), stats);
146 static void horizontal_coutline_projection(
154 C_OUTLINE_IT out_it = outline->
child ();
158 for (stepindex = 0; stepindex < length; stepindex++) {
159 step = outline->
step (stepindex);
161 stats->
add (pos.
y (), pos.
x ());
163 else if (step.
y () < 0) {
164 stats->
add (pos.
y () - 1, -pos.
x ());
169 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
170 horizontal_coutline_projection (out_it.data (), stats);