37 ICOORDELT_LIST chop_cells;
39 BLOBNBOX_LIST residual_underlines;
40 C_OUTLINE_LIST left_coutlines;
41 C_OUTLINE_LIST right_coutlines;
42 ICOORDELT_IT cell_it = &chop_cells;
45 BLOBNBOX_IT ru_it = &residual_underlines;
49 for (under_it.mark_cycle_pt (); !under_it.cycled_list ();
50 under_it.forward ()) {
51 u_line = under_it.extract ();
59 cell_it.set_to_list (&chop_cells);
60 for (cell_it.mark_cycle_pt (); !cell_it.cycled_list ();
62 chop_coord = cell_it.data ()->x ();
68 if (!left_coutlines.empty()) {
69 ru_it.add_after_then_move(
new BLOBNBOX(
new C_BLOB(&left_coutlines)));
71 chop_coord = cell_it.data ()->y ();
73 &left_coutlines, &right_coutlines);
74 if (!left_coutlines.empty()) {
79 delete cell_it.extract();
81 if (!right_coutlines.empty ()) {
83 &left_coutlines, &right_coutlines);
84 if (!left_coutlines.empty())
85 ru_it.add_after_then_move(
new BLOBNBOX(
new C_BLOB(&left_coutlines)));
87 if (u_line !=
nullptr) {
88 delete u_line->
cblob();
93 ru_it.move_to_first();
94 for (ru_it.mark_cycle_pt(); !ru_it.cycled_list(); ru_it.forward()) {
95 under_it.add_after_then_move(ru_it.extract());
113 TO_ROW_IT row_it = rows;
120 bestover = static_cast<float>(-INT32_MAX);
123 row = row_it.data ();
124 row_it.mark_cycle_pt ();
126 && !row_it.cycled_list ()) {
131 row = row_it.data ();
143 if (overlap > bestover) {
148 row = row_it.data ();
168 float baseline_offset,
169 ICOORDELT_LIST *chop_cells
175 ICOORDELT_IT cell_it = chop_cells;
184 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
187 &lower_proj, &middle_proj, &upper_proj);
190 for (x = blob_box.
left (); x < blob_box.
right (); x++) {
191 if (middle_proj.pile_count (x) > 0) {
193 y < blob_box.
right () && middle_proj.pile_count (y) > 0; y++);
194 blob_chop =
ICOORD (x, y);
195 cell_it.add_after_then_move (
new ICOORDELT (blob_chop));
213 float baseline_offset,
220 int16_t lower_y, upper_y;
223 C_OUTLINE_IT out_it = outline->
child ();
227 for (stepindex = 0; stepindex < length; stepindex++) {
228 step = outline->
step (stepindex);
231 static_cast<int16_t>(floor (
baseline->y (pos.
x ()) + baseline_offset + 0.5));
233 static_cast<int16_t>(floor (
baseline->y (pos.
x ()) + baseline_offset +
235 if (pos.
y () >= lower_y) {
236 lower_proj->
add (pos.
x (), -lower_y);
237 if (pos.
y () >= upper_y) {
238 middle_proj->
add (pos.
x (), lower_y - upper_y);
239 upper_proj->
add (pos.
x (), upper_y - pos.
y ());
242 middle_proj->
add (pos.
x (), lower_y - pos.
y ());
245 lower_proj->
add (pos.
x (), -pos.
y ());
247 else if (step.
x () < 0) {
249 static_cast<int16_t>(floor (
baseline->y (pos.
x () - 1) + baseline_offset +
252 static_cast<int16_t>(floor (
baseline->y (pos.
x () - 1) + baseline_offset +
254 if (pos.
y () >= lower_y) {
255 lower_proj->
add (pos.
x () - 1, lower_y);
256 if (pos.
y () >= upper_y) {
257 middle_proj->
add (pos.
x () - 1, upper_y - lower_y);
258 upper_proj->
add (pos.
x () - 1, pos.
y () - upper_y);
261 middle_proj->
add (pos.
x () - 1, pos.
y () - lower_y);
264 lower_proj->
add (pos.
x () - 1, pos.
y ());
269 for (out_it.mark_cycle_pt (); !out_it.cycled_list (); out_it.forward ()) {
272 lower_proj, middle_proj, upper_proj);