20# include "config_auto.h"
32#define TO_WIN_NAME "Textord"
39#ifndef GRAPHICS_DISABLED
52 page_tr.
x(), page_tr.
y(),
true);
74 BLOBNBOX_IT it = list;
76 win->
Pen(body_colour);
78 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
79 it.data()->bounding_box().plot(win);
103 left = it.data()->bounding_box().left();
105 right = it.data()->bounding_box().right();
132 auto fleft =
static_cast<float>(left);
137 right = it.data()->bounding_box().right();
140 plot_pt =
FCOORD(fleft, gradient * left + row->
max_y());
143 plot_pt =
FCOORD(fleft, gradient * left + row->
min_y());
165 int32_t max_y, int32_t occupation[],
170 auto fleft =
static_cast<float>(xleft);
175 for (line_index = min_y; line_index <= max_y; line_index++) {
176 if (occupation[line_index - min_y] < thresholds[line_index - min_y]) {
187 to_win->
DrawTo(fleft + occupation[line_index - min_y] / 10.0,
static_cast<float>(line_index));
192 for (line_index = min_y; line_index <= max_y; line_index++) {
193 to_win->
DrawTo(fleft + thresholds[line_index - min_y] / 10.0,
static_cast<float>(line_index));
212 TO_ROW_IT row_it = block->
get_rows();
217 for (row_it.mark_cycle_pt(); !row_it.cycled_list(); row_it.forward()) {
220 blob_it.move_to_last();
221 right = blob_it.data()->bounding_box().right();
251 BLOBNBOX_IT start_it = blob_it;
256 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list(); blob_it.forward()) {
257 blob = blob_it.data();
283 win->
Brush(rect_colour);
288 prev_x = blob_box.
right();
290 if (blob->
cblob() !=
nullptr) {
291 blob->
cblob()->
plot(win, colour, colour);
312 BLOBNBOX_IT *blob_it,
316 int16_t projection_left,
317 int16_t projection_right,
float projection_scale) {
320 FPSEGPT_LIST seg_list;
325 check_pitch_sync2(blob_it, blob_count, pitch, 2, projection, projection_left, projection_right,
326 projection_scale, occupation, &seg_list, 0, 0);
330 word_box = blob_it->data()->bounding_box();
331 for (; blob_count > 0; blob_count--) {
334 seg_it.set_to_list(&seg_list);
335 for (seg_it.mark_cycle_pt(); !seg_it.cycled_list(); seg_it.forward()) {
336 segpt = seg_it.data();
357 FPSEGPT_LIST *seg_list
360 FPSEGPT_IT seg_it = seg_list;
365 word_box = blob_it.data()->bounding_box();
366 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list();) {
369 for (seg_it.mark_cycle_pt(); !seg_it.cycled_list(); seg_it.forward()) {
370 segpt = seg_it.data();
392 ICOORDELT_LIST *cells
395 ICOORDELT_IT cell_it = cells;
400 word_box = blob_it.data()->bounding_box();
401 for (blob_it.mark_cycle_pt(); !blob_it.cycled_list();) {
405 for (cell_it.mark_cycle_pt(); !cell_it.cycled_list(); cell_it.forward()) {
406 cell = cell_it.data();
407 win->
Line(cell->
x() + xshift, word_box.
bottom(), cell->
x() + xshift, word_box.
top());
#define BOOL_VAR(name, val, comment)
void plot_fp_cells(ScrollView *win, ScrollView::Color colour, BLOBNBOX_IT *blob_it, int16_t pitch, int16_t blob_count, STATS *projection, int16_t projection_left, int16_t projection_right, float projection_scale)
void plot_fp_cells2(ScrollView *win, ScrollView::Color colour, TO_ROW *row, FPSEGPT_LIST *seg_list)
void tprintf(const char *format,...)
bool textord_show_fixed_cuts
int pitsync_linear_version
double textord_projection_scale
void plot_blob_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour)
double check_pitch_sync2(BLOBNBOX_IT *blob_it, int16_t blob_count, int16_t pitch, int16_t pitch_error, STATS *projection, int16_t projection_left, int16_t projection_right, float projection_scale, int16_t &occupation_count, FPSEGPT_LIST *seg_list, int16_t start, int16_t end)
void plot_box_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour)
void plot_to_row(TO_ROW *row, ScrollView::Color colour, FCOORD rotation)
void plot_parallel_row(TO_ROW *row, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation)
void draw_meanlines(TO_BLOCK *block, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation)
void plot_word_decisions(ScrollView *win, int16_t pitch, TO_ROW *row)
ScrollView * create_to_win(ICOORD page_tr)
void plot_row_cells(ScrollView *win, ScrollView::Color colour, TO_ROW *row, float xshift, ICOORDELT_LIST *cells)
double check_pitch_sync(BLOBNBOX_IT *blob_it, int16_t blob_count, int16_t pitch, int16_t pitch_error, STATS *projection, FPSEGPT_LIST *seg_list)
TBOX box_next(BLOBNBOX_IT *it)
void draw_occupation(int32_t xleft, int32_t ybottom, int32_t min_y, int32_t max_y, int32_t occupation[], int32_t thresholds[])
const TBOX & bounding_box() const
bool joined_to_prev() const
BLOBNBOX_LIST * blob_list()
TDimension y() const
access_function
TDimension x() const
access function
void rotate(const FCOORD vec)
TDimension bottom() const
void plot(ScrollView *window, ScrollView::Color blob_colour, ScrollView::Color child_colour)
void Line(int x1, int y1, int x2, int y2)
void Rectangle(int x1, int y1, int x2, int y2)
void SetCursor(int x, int y)
void DrawTo(int x, int y)