36 static void horizontal_cblob_projection(
C_BLOB *blob,
38 static void horizontal_coutline_projection(
C_OUTLINE *outline,
73 (
"Testing underline on blob at (%d,%d)->(%d,%d), base=%d\nOccs:",
78 horizontal_cblob_projection(blob, &projection);
81 if (occ <= blob_box.
top () && projection.
pile_count (occ) > desc_occ)
86 if (occ >= blob_box.
bottom () && occ <= blob_box.
top ()
91 for (occ =
baseline + xheight + 1; occ <= blob_box.
top (); occ++)
95 tprintf (
"%d %d %d\n", desc_occ, x_occ, asc_occ);
97 if (desc_occ == 0 && x_occ == 0 && asc_occ == 0) {
98 tprintf (
"Bottom=%d, top=%d, base=%d, x=%d\n",
102 if (desc_occ > x_occ + x_occ
105 return asc_occ > x_occ + x_occ &&
118 static void horizontal_cblob_projection(
123 C_OUTLINE_IT out_it = blob->
out_list ();
125 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
126 horizontal_coutline_projection (out_it.data (), stats);
138 static void horizontal_coutline_projection(
146 C_OUTLINE_IT out_it = outline->
child ();
150 for (stepindex = 0; stepindex < length; stepindex++) {
151 step = outline->
step (stepindex);
153 stats->
add (pos.
y (), pos.
x ());
155 else if (step.
y () < 0) {
156 stats->
add (pos.
y () - 1, -pos.
x ());
161 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
162 horizontal_coutline_projection (out_it.data (), stats);