28 #define TO_WIN_XPOS 0 //default window pos 30 #define TO_WIN_NAME "Textord" 36 "Draw fixed pitch cell boundaries");
45 #ifndef GRAPHICS_DISABLED 50 page_tr.
x() + 1, page_tr.
y() + 1,
51 page_tr.
x(), page_tr.
y(),
true);
75 BLOBNBOX_IT it = list;
77 win->
Pen(body_colour);
79 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
80 it.data ()->bounding_box ().plot (win);
105 left = it.data ()->bounding_box ().left ();
107 right = it.data ()->bounding_box ().right ();
111 plot_pt.
rotate (rotation);
114 plot_pt.
rotate (rotation);
135 float fleft = (float) left;
140 right = it.data ()->bounding_box ().right ();
143 plot_pt =
FCOORD (fleft, gradient * left + row->
max_y ());
144 plot_pt.
rotate (rotation);
146 plot_pt =
FCOORD (fleft, gradient * left + row->
min_y ());
147 plot_pt.
rotate (rotation);
150 plot_pt.
rotate (rotation);
153 plot_pt.
rotate (rotation);
175 float fleft = (float) xleft;
180 for (line_index = min_y; line_index <= max_y; line_index++) {
181 if (occupation[line_index - min_y] < thresholds[line_index - min_y]) {
193 to_win->
DrawTo(fleft + occupation[line_index - min_y] / 10.0, (
float) line_index);
198 for (line_index = min_y; line_index <= max_y; line_index++) {
199 to_win->
DrawTo(fleft + thresholds[line_index - min_y] / 10.0, (
float) line_index);
219 TO_ROW_IT row_it = block->
get_rows ();
224 for (row_it.mark_cycle_pt (); !row_it.cycled_list (); row_it.forward ()) {
225 row = row_it.data ();
227 blob_it.move_to_last ();
228 right = blob_it.data ()->bounding_box ().right ();
232 plot_pt.
rotate (rotation);
237 plot_pt.
rotate (rotation);
263 BLOBNBOX_IT start_it = blob_it;
268 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list (); blob_it.forward ()) {
269 blob = blob_it.data ();
294 win->
Brush(rect_colour);
296 blob_box.
left (), blob_box.
top ());
300 prev_x = blob_box.
right();
301 if (blob->
cblob () != NULL)
302 blob->
cblob ()->
plot (win, colour, colour);
323 BLOBNBOX_IT *blob_it,
327 inT16 projection_left,
328 inT16 projection_right,
329 float projection_scale) {
332 FPSEGPT_LIST seg_list;
336 if (pitsync_linear_version)
338 projection_left, projection_right,
339 projection_scale, occupation, &seg_list, 0, 0);
342 word_box = blob_it->data ()->bounding_box ();
343 for (; blob_count > 0; blob_count--)
345 seg_it.set_to_list (&seg_list);
346 for (seg_it.mark_cycle_pt (); !seg_it.cycled_list (); seg_it.forward ()) {
347 segpt = seg_it.data ();
368 FPSEGPT_LIST *seg_list
371 FPSEGPT_IT seg_it = seg_list;
376 word_box = blob_it.data ()->bounding_box ();
377 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();)
379 for (seg_it.mark_cycle_pt (); !seg_it.cycled_list (); seg_it.forward ()) {
380 segpt = seg_it.data ();
402 ICOORDELT_LIST *cells
405 ICOORDELT_IT cell_it = cells;
410 word_box = blob_it.data ()->bounding_box ();
411 for (blob_it.mark_cycle_pt (); !blob_it.cycled_list ();)
414 for (cell_it.mark_cycle_pt (); !cell_it.cycled_list (); cell_it.forward ()) {
415 cell = cell_it.data ();
416 win->
Line(cell->
x () + xshift, word_box.
bottom (), cell->
x () + xshift, word_box.
top ());
420 #endif // GRAPHICS_DISABLED
void DrawTo(int x, int y)
void draw_meanlines(TO_BLOCK *block, float gradient, inT32 left, ScrollView::Color colour, FCOORD rotation)
const TBOX & bounding_box() const
ScrollView * create_to_win(ICOORD page_tr)
EXTERN double textord_projection_scale
void draw_occupation(inT32 xleft, inT32 ybottom, inT32 min_y, inT32 max_y, inT32 occupation[], inT32 thresholds[])
void SetCursor(int x, int y)
void plot(ScrollView *window, ScrollView::Color blob_colour, ScrollView::Color child_colour)
void plot_row_cells(ScrollView *win, ScrollView::Color colour, TO_ROW *row, float xshift, ICOORDELT_LIST *cells)
void Line(int x1, int y1, int x2, int y2)
double check_pitch_sync(BLOBNBOX_IT *blob_it, inT16 blob_count, inT16 pitch, inT16 pitch_error, STATS *projection, FPSEGPT_LIST *seg_list)
void plot_word_decisions(ScrollView *win, inT16 pitch, TO_ROW *row)
void plot_box_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour)
void plot_fp_cells2(ScrollView *win, ScrollView::Color colour, TO_ROW *row, FPSEGPT_LIST *seg_list)
BLOBNBOX_LIST * blob_list()
EXTERN bool textord_show_fixed_cuts
void rotate(const FCOORD vec)
void plot_to_row(TO_ROW *row, ScrollView::Color colour, FCOORD rotation)
bool joined_to_prev() const
inT16 x() const
access function
TBOX box_next(BLOBNBOX_IT *it)
void plot_blob_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour, ScrollView::Color child_colour)
void Rectangle(int x1, int y1, int x2, int y2)
double check_pitch_sync2(BLOBNBOX_IT *blob_it, inT16 blob_count, inT16 pitch, inT16 pitch_error, STATS *projection, inT16 projection_left, inT16 projection_right, float projection_scale, inT16 &occupation_count, FPSEGPT_LIST *seg_list, inT16 start, inT16 end)
void plot_fp_cells(ScrollView *win, ScrollView::Color colour, BLOBNBOX_IT *blob_it, inT16 pitch, inT16 blob_count, STATS *projection, inT16 projection_left, inT16 projection_right, float projection_scale)
EXTERN ScrollView * to_win
#define BOOL_VAR(name, val, comment)
void plot_parallel_row(TO_ROW *row, float gradient, inT32 left, ScrollView::Color colour, FCOORD rotation)
inT16 y() const
access_function