tesseract  5.0.0-alpha-619-ge9db
drawtord.h
Go to the documentation of this file.
1 /**********************************************************************
2  * File: drawtord.h (Formerly drawto.h)
3  * Description: Draw things to do with textord.
4  * Author: Ray Smith
5  *
6  * (C) Copyright 1992, Hewlett-Packard Ltd.
7  ** Licensed under the Apache License, Version 2.0 (the "License");
8  ** you may not use this file except in compliance with the License.
9  ** You may obtain a copy of the License at
10  ** http://www.apache.org/licenses/LICENSE-2.0
11  ** Unless required by applicable law or agreed to in writing, software
12  ** distributed under the License is distributed on an "AS IS" BASIS,
13  ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  ** See the License for the specific language governing permissions and
15  ** limitations under the License.
16  *
17  **********************************************************************/
18 
19 #ifndef DRAWTORD_H
20 #define DRAWTORD_H
21 
22 #include "params.h"
23 #include "scrollview.h"
24 #include "pitsync1.h"
25 #include "blobbox.h"
26 
27 #define NO_SMD "none"
28 
29 extern BOOL_VAR_H (textord_show_fixed_cuts, false,
30 "Draw fixed pitch cell boundaries");
31 extern STRING_VAR_H (to_debugfile, DEBUG_WIN_NAME, "Name of debugfile");
32 extern STRING_VAR_H (to_smdfile, NO_SMD, "Name of SMD file");
33 extern ScrollView* to_win;
34 extern FILE *to_debug;
35 // Creates a static display window for textord, and returns a pointer to it.
37 void close_to_win(); // Destroy the textord window.
38 void create_todebug_win(); //make gradients win
39 void plot_box_list( //make gradients win
40  ScrollView* win, //window to draw in
41  BLOBNBOX_LIST *list, //blob list
42  ScrollView::Color body_colour //colour to draw
43  );
44 void plot_to_row( //draw a row
45  TO_ROW *row, //row to draw
46  ScrollView::Color colour, //colour to draw in
47  FCOORD rotation //rotation for line
48  );
49 void plot_parallel_row( //draw a row
50  TO_ROW *row, //row to draw
51  float gradient, //gradients of lines
52  int32_t left, //edge of block
53  ScrollView::Color colour, //colour to draw in
54  FCOORD rotation //rotation for line
55  );
56 void draw_occupation ( //draw projection
57 int32_t xleft, //edge of block
58 int32_t ybottom, //bottom of block
59 int32_t min_y, //coordinate limits
60 int32_t max_y, int32_t occupation[], //projection counts
61 int32_t thresholds[] //for drop out
62 );
63 void draw_meanlines( //draw a block
64  TO_BLOCK *block, //block to draw
65  float gradient, //gradients of lines
66  int32_t left, //edge of block
67  ScrollView::Color colour, //colour to draw in
68  FCOORD rotation //rotation for line
69  );
70 void plot_word_decisions( //draw words
71  ScrollView* win, //window tro draw in
72  int16_t pitch, //of block
73  TO_ROW *row //row to draw
74  );
75 void plot_fp_cells( //draw words
76  ScrollView* win, //window tro draw in
77  ScrollView::Color colour, //colour of lines
78  BLOBNBOX_IT *blob_it, //blobs
79  int16_t pitch, //of block
80  int16_t blob_count, //no of real blobs
81  STATS *projection, //vertical
82  int16_t projection_left, //edges //scale factor
83  int16_t projection_right,
84  float projection_scale);
85 void plot_fp_cells2( //draw words
86  ScrollView* win, //window tro draw in
87  ScrollView::Color colour, //colour of lines
88  TO_ROW *row, //for location
89  FPSEGPT_LIST *seg_list //segments to plot
90  );
91 void plot_row_cells( //draw words
92  ScrollView* win, //window tro draw in
93  ScrollView::Color colour, //colour of lines
94  TO_ROW *row, //for location
95  float xshift, //amount of shift
96  ICOORDELT_LIST *cells //cells to draw
97  );
98 #endif
ScrollView
Definition: scrollview.h:97
create_to_win
ScrollView * create_to_win(ICOORD page_tr)
Definition: drawtord.cpp:42
close_to_win
void close_to_win()
Definition: drawtord.cpp:51
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: drawtord.cpp:157
blobbox.h
params.h
ICOORD
integer coordinate
Definition: points.h:30
NO_SMD
#define NO_SMD
Definition: drawtord.h:26
DEBUG_WIN_NAME
#define DEBUG_WIN_NAME
Definition: drawfx.cpp:36
TO_BLOCK
Definition: blobbox.h:691
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: drawtord.cpp:308
plot_word_decisions
void plot_word_decisions(ScrollView *win, int16_t pitch, TO_ROW *row)
Definition: drawtord.cpp:239
draw_meanlines
void draw_meanlines(TO_BLOCK *block, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation)
Definition: drawtord.cpp:200
FCOORD
Definition: points.h:187
create_todebug_win
void create_todebug_win()
to_win
ScrollView * to_win
Definition: drawtord.cpp:34
plot_row_cells
void plot_row_cells(ScrollView *win, ScrollView::Color colour, TO_ROW *row, float xshift, ICOORDELT_LIST *cells)
Definition: drawtord.cpp:383
plot_to_row
void plot_to_row(TO_ROW *row, ScrollView::Color colour, FCOORD rotation)
Definition: drawtord.cpp:84
plot_fp_cells2
void plot_fp_cells2(ScrollView *win, ScrollView::Color colour, TO_ROW *row, FPSEGPT_LIST *seg_list)
Definition: drawtord.cpp:351
STATS
Definition: statistc.h:30
to_smdfile
char * to_smdfile
BOOL_VAR_H
#define BOOL_VAR_H(name, val, comment)
Definition: params.h:294
plot_box_list
void plot_box_list(ScrollView *win, BLOBNBOX_LIST *list, ScrollView::Color body_colour)
Definition: drawtord.cpp:64
TO_ROW
Definition: blobbox.h:543
to_debugfile
char * to_debugfile
ScrollView::Color
Color
Definition: scrollview.h:100
plot_parallel_row
void plot_parallel_row(TO_ROW *row, float gradient, int32_t left, ScrollView::Color colour, FCOORD rotation)
Definition: drawtord.cpp:117
pitsync1.h
scrollview.h
textord_show_fixed_cuts
bool textord_show_fixed_cuts
Definition: drawtord.cpp:32
STRING_VAR_H
#define STRING_VAR_H(name, val, comment)
Definition: params.h:296
to_debug
FILE * to_debug