#include "pithsync.h"
#include "topitch.h"
#include "drawtord.h"
Go to the source code of this file.
|
ScrollView * | create_to_win (ICOORD page_tr) |
|
void | close_to_win () |
|
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_occupation (int32_t xleft, int32_t ybottom, int32_t min_y, int32_t max_y, int32_t occupation[], int32_t thresholds[]) |
|
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) |
|
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 | plot_row_cells (ScrollView *win, ScrollView::Color colour, TO_ROW *row, float xshift, ICOORDELT_LIST *cells) |
|
◆ TO_WIN_NAME
#define TO_WIN_NAME "Textord" |
◆ TO_WIN_XPOS
◆ TO_WIN_YPOS
◆ close_to_win()
◆ create_to_win()
Definition at line 44 of file drawtord.cpp.
47 page_tr.
x() + 1, page_tr.
y() + 1,
48 page_tr.
x(), page_tr.
y(),
true);
◆ draw_meanlines()
Definition at line 207 of file drawtord.cpp.
216 TO_ROW_IT row_it = block->
get_rows ();
221 for (row_it.mark_cycle_pt (); !row_it.cycled_list (); row_it.forward ()) {
222 row = row_it.data ();
224 blob_it.move_to_last ();
225 right = blob_it.data ()->bounding_box ().right ();
227 FCOORD (
static_cast<float>(left),
229 plot_pt.
rotate (rotation);
234 plot_pt.
rotate (rotation);
◆ draw_occupation()
void draw_occupation |
( |
int32_t |
xleft, |
|
|
int32_t |
ybottom, |
|
|
int32_t |
min_y, |
|
|
int32_t |
max_y, |
|
|
int32_t |
occupation[], |
|
|
int32_t |
thresholds[] |
|
) |
| |
Definition at line 163 of file drawtord.cpp.
172 auto fleft =
static_cast<float>(xleft);
177 for (line_index = min_y; line_index <= max_y; line_index++) {
178 if (occupation[line_index - min_y] < thresholds[line_index - min_y]) {
190 to_win->
DrawTo(fleft + occupation[line_index - min_y] / 10.0,
static_cast<float>(line_index));
195 for (line_index = min_y; line_index <= max_y; line_index++) {
196 to_win->
DrawTo(fleft + thresholds[line_index - min_y] / 10.0,
static_cast<float>(line_index));
◆ plot_box_list()
Definition at line 67 of file drawtord.cpp.
72 BLOBNBOX_IT it = list;
74 win->
Pen(body_colour);
76 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
77 it.data ()->bounding_box ().plot (win);
◆ plot_fp_cells()
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 |
|
) |
| |
Definition at line 317 of file drawtord.cpp.
329 FPSEGPT_LIST seg_list;
333 if (pitsync_linear_version)
335 projection_left, projection_right,
336 projection_scale, occupation, &seg_list, 0, 0);
339 word_box = blob_it->data ()->bounding_box ();
340 for (; blob_count > 0; blob_count--)
342 seg_it.set_to_list (&seg_list);
343 for (seg_it.mark_cycle_pt (); !seg_it.cycled_list (); seg_it.forward ()) {
344 segpt = seg_it.data ();
◆ plot_fp_cells2()
Definition at line 361 of file drawtord.cpp.
368 FPSEGPT_IT seg_it = seg_list;
373 word_box = blob_it.data ()->bounding_box ();
374 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();)
376 for (seg_it.mark_cycle_pt (); !seg_it.cycled_list (); seg_it.forward ()) {
377 segpt = seg_it.data ();
◆ plot_parallel_row()
Definition at line 122 of file drawtord.cpp.
132 auto fleft =
static_cast<float>(left);
137 right = it.data ()->bounding_box ().right ();
140 plot_pt =
FCOORD (fleft, gradient * left + row->
max_y ());
141 plot_pt.
rotate (rotation);
143 plot_pt =
FCOORD (fleft, gradient * left + row->
min_y ());
144 plot_pt.
rotate (rotation);
147 plot_pt.
rotate (rotation);
150 plot_pt.
rotate (rotation);
◆ plot_row_cells()
Definition at line 394 of file drawtord.cpp.
402 ICOORDELT_IT cell_it = cells;
407 word_box = blob_it.data ()->bounding_box ();
408 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();)
411 for (cell_it.mark_cycle_pt (); !cell_it.cycled_list (); cell_it.forward ()) {
412 cell = cell_it.data ();
413 win->
Line(cell->
x () + xshift, word_box.
bottom (), cell->
x () + xshift, word_box.
top ());
◆ plot_to_row()
Definition at line 88 of file drawtord.cpp.
102 left = it.data ()->bounding_box ().left ();
104 right = it.data ()->bounding_box ().right ();
108 plot_pt.
rotate (rotation);
111 plot_pt.
rotate (rotation);
◆ plot_word_decisions()
Definition at line 247 of file drawtord.cpp.
260 BLOBNBOX_IT start_it = blob_it;
265 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list (); blob_it.forward ()) {
266 blob = blob_it.data ();
291 win->
Brush(rect_colour);
293 blob_box.
left (), blob_box.
top ());
297 prev_x = blob_box.
right();
298 if (blob->
cblob () !=
nullptr)
299 blob->
cblob ()->
plot (win, colour, colour);
◆ textord_show_fixed_cuts
bool textord_show_fixed_cuts = false |
"Draw fixed pitch cell boundaries"
Definition at line 33 of file drawtord.cpp.
◆ to_win
void Line(int x1, int y1, int x2, int y2)
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)
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)
const TBOX & bounding_box() const
void plot(ScrollView *window, ScrollView::Color blob_colour, ScrollView::Color child_colour)
bool joined_to_prev() const
int16_t y() const
access_function
void plot_blob_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour)
void rotate(const FCOORD vec)
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)
DLLSYM void tprintf(const char *format,...)
double textord_projection_scale
bool textord_show_fixed_cuts
void Rectangle(int x1, int y1, int x2, int y2)
TBOX box_next(BLOBNBOX_IT *it)
BLOBNBOX_LIST * blob_list()
void DrawTo(int x, int y)
void SetCursor(int x, int y)
int16_t x() const
access function