20 #include "config_auto.h" 27 #define TO_WIN_XPOS 0 //default window pos 29 #define TO_WIN_NAME "Textord" 35 "Draw fixed pitch cell boundaries");
44 #ifndef GRAPHICS_DISABLED 49 page_tr.
x() + 1, page_tr.
y() + 1,
50 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);
104 left = it.data ()->bounding_box ().left ();
106 right = it.data ()->bounding_box ().right ();
110 plot_pt.
rotate (rotation);
113 plot_pt.
rotate (rotation);
134 float fleft = (float) left;
139 right = it.data ()->bounding_box ().right ();
142 plot_pt =
FCOORD (fleft, gradient * left + row->
max_y ());
143 plot_pt.
rotate (rotation);
145 plot_pt =
FCOORD (fleft, gradient * left + row->
min_y ());
146 plot_pt.
rotate (rotation);
149 plot_pt.
rotate (rotation);
152 plot_pt.
rotate (rotation);
169 int32_t max_y, int32_t occupation[],
174 float fleft = (float) xleft;
179 for (line_index = min_y; line_index <= max_y; line_index++) {
180 if (occupation[line_index - min_y] < thresholds[line_index - min_y]) {
192 to_win->
DrawTo(fleft + occupation[line_index - min_y] / 10.0, (
float) line_index);
197 for (line_index = min_y; line_index <= max_y; line_index++) {
198 to_win->
DrawTo(fleft + thresholds[line_index - min_y] / 10.0, (
float) line_index);
218 TO_ROW_IT row_it = block->
get_rows ();
223 for (row_it.mark_cycle_pt (); !row_it.cycled_list (); row_it.forward ()) {
224 row = row_it.data ();
226 blob_it.move_to_last ();
227 right = blob_it.data ()->bounding_box ().right ();
231 plot_pt.
rotate (rotation);
236 plot_pt.
rotate (rotation);
262 BLOBNBOX_IT start_it = blob_it;
267 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list (); blob_it.forward ()) {
268 blob = blob_it.data ();
293 win->
Brush(rect_colour);
295 blob_box.
left (), blob_box.
top ());
299 prev_x = blob_box.
right();
300 if (blob->
cblob () !=
nullptr)
301 blob->
cblob ()->
plot (win, colour, colour);
322 BLOBNBOX_IT *blob_it,
326 int16_t projection_left,
327 int16_t projection_right,
328 float projection_scale) {
331 FPSEGPT_LIST seg_list;
335 if (pitsync_linear_version)
337 projection_left, projection_right,
338 projection_scale, occupation, &seg_list, 0, 0);
341 word_box = blob_it->data ()->bounding_box ();
342 for (; blob_count > 0; blob_count--)
344 seg_it.set_to_list (&seg_list);
345 for (seg_it.mark_cycle_pt (); !seg_it.cycled_list (); seg_it.forward ()) {
346 segpt = seg_it.data ();
367 FPSEGPT_LIST *seg_list
370 FPSEGPT_IT seg_it = seg_list;
375 word_box = blob_it.data ()->bounding_box ();
376 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();)
378 for (seg_it.mark_cycle_pt (); !seg_it.cycled_list (); seg_it.forward ()) {
379 segpt = seg_it.data ();
401 ICOORDELT_LIST *cells
404 ICOORDELT_IT cell_it = cells;
409 word_box = blob_it.data ()->bounding_box ();
410 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();)
413 for (cell_it.mark_cycle_pt (); !cell_it.cycled_list (); cell_it.forward ()) {
414 cell = cell_it.data ();
415 win->
Line(cell->
x () + xshift, word_box.
bottom (), cell->
x () + xshift, word_box.
top ());
419 #endif // GRAPHICS_DISABLED
void DrawTo(int x, int y)
#define BOOL_VAR(name, val, comment)
void rotate(const FCOORD vec)
int16_t y() const
access_function
void plot_box_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour)
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_word_decisions(ScrollView *win, int16_t pitch, TO_ROW *row)
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)
void plot_blob_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour)
void SetCursor(int x, int y)
void draw_meanlines(TO_BLOCK *block, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation)
TBOX box_next(BLOBNBOX_IT *it)
EXTERN double textord_projection_scale
void plot_row_cells(ScrollView *win, ScrollView::Color colour, TO_ROW *row, float xshift, ICOORDELT_LIST *cells)
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)
int16_t x() const
access function
bool joined_to_prev() const
EXTERN bool textord_show_fixed_cuts
DLLSYM void tprintf(const char *format,...)
void plot_parallel_row(TO_ROW *row, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation)
void plot_to_row(TO_ROW *row, ScrollView::Color colour, FCOORD rotation)
EXTERN ScrollView * to_win
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
void plot(ScrollView *window, ScrollView::Color blob_colour, ScrollView::Color child_colour)
void Rectangle(int x1, int y1, int x2, int y2)
ScrollView * create_to_win(ICOORD page_tr)
void plot_fp_cells2(ScrollView *win, ScrollView::Color colour, TO_ROW *row, FPSEGPT_LIST *seg_list)
BLOBNBOX_LIST * blob_list()
void Line(int x1, int y1, int x2, int y2)