37 STATS xht_stats (0, 128);
42 row_it.set_to_list (block->
get_rows ());
51 for (row_it.mark_cycle_pt (); !row_it.cycled_list (); row_it.forward ()) {
57 start_of_row = blob_it.data ()->bounding_box ().left ();
58 end_of_row = blob_it.data_relative (-1)->bounding_box ().right ();
59 if (min_left > start_of_row)
60 min_left = start_of_row;
61 if (max_right < end_of_row)
62 max_right = end_of_row;
65 if ((total_rows < 3) || (min_left >= max_right)) {
67 min_left = max_right = 0;
70 bucket_size = (
inT16) floor (xht_stats.median () + 0.5) / 2;
71 map_max = (max_right - min_left) / bucket_size;
73 for (i = 0; i <= map_max; i++)
76 for (row_it.mark_cycle_pt (); !row_it.cycled_list (); row_it.forward ()) {
80 blob_it.mark_cycle_pt ();
82 prev_blob_box = blob_box;
85 gap_width = blob_box.
left () - min_left;
88 max_quantum = (blob_box.
left () - min_left) / bucket_size;
89 if (max_quantum > map_max) max_quantum = map_max;
90 for (i = 0; i <= max_quantum; i++)
94 while (!blob_it.cycled_list ()) {
96 gap_width = blob_box.
left () - prev_blob_box.
right ();
100 (prev_blob_box.
right () - min_left) / bucket_size;
101 max_quantum = (blob_box.
left () - min_left) / bucket_size;
102 if (max_quantum > map_max) max_quantum = map_max;
103 for (i = min_quantum; i <= max_quantum; i++)
106 prev_blob_box = blob_box;
110 gap_width = max_right - prev_blob_box.
right ();
114 (prev_blob_box.
right () - min_left) / bucket_size;
115 if (min_quantum < 0) min_quantum = 0;
116 for (i = min_quantum; i <= map_max; i++)
122 for (i = 0; i <= map_max; i++) {
123 if (map[i] > total_rows / 2) {
126 (map[i + 1] <= total_rows / 2)) ||
128 (map[i - 1] <= total_rows / 2)) ||
131 (map[i - 1] <= total_rows / 2) &&
132 (map[i + 1] <= total_rows / 2)))) {
EXTERN bool gapmap_no_isolated_quanta
BLOBNBOX_LIST * blob_list()
EXTERN double gapmap_big_gaps
TBOX box_next(BLOBNBOX_IT *it)
EXTERN bool gapmap_use_ends
void * alloc_mem(inT32 count)