41 static void horizontal_cblob_projection(
C_BLOB *blob,
43 static void horizontal_coutline_projection(
C_OUTLINE *outline,
78 (
"Testing underline on blob at (%d,%d)->(%d,%d), base=%d\nOccs:",
83 horizontal_cblob_projection(blob, &projection);
86 if (occ <= blob_box.
top () && projection.
pile_count (occ) > desc_occ)
91 if (occ >= blob_box.
bottom () && occ <= blob_box.
top ()
96 for (occ =
baseline + xheight + 1; occ <= blob_box.
top (); occ++)
100 tprintf (
"%d %d %d\n", desc_occ, x_occ, asc_occ);
102 if (desc_occ == 0 && x_occ == 0 && asc_occ == 0) {
103 tprintf (
"Bottom=%d, top=%d, base=%d, x=%d\n",
107 if (desc_occ > x_occ + x_occ
110 return asc_occ > x_occ + x_occ &&
123 static void horizontal_cblob_projection(
128 C_OUTLINE_IT out_it = blob->
out_list ();
130 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
131 horizontal_coutline_projection (out_it.data (), stats);
143 static void horizontal_coutline_projection(
151 C_OUTLINE_IT out_it = outline->
child ();
155 for (stepindex = 0; stepindex < length; stepindex++) {
156 step = outline->
step (stepindex);
158 stats->
add (pos.
y (), pos.
x ());
160 else if (step.
y () < 0) {
161 stats->
add (pos.
y () - 1, -pos.
x ());
166 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
167 horizontal_coutline_projection (out_it.data (), stats);
int32_t pile_count(int32_t value) const
double textord_underline_threshold
#define double_VAR(name, val, comment)
int16_t y() const
access_function
const ICOORD & start_pos() const
int16_t x() const
access function
bool set_range(int32_t min_bucket_value, int32_t max_bucket_value_plus_1)
int32_t pathlength() const
DLLSYM void tprintf(const char *format,...)
bool test_underline(bool testing_on, C_BLOB *blob, int16_t baseline, int16_t xheight)
void add(int32_t value, int32_t count)
TBOX bounding_box() const
C_OUTLINE_LIST * out_list()
ICOORD step(int index) const