tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
drawtord.h
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.
36 ScrollView* create_to_win(ICOORD page_tr);
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
Color
Definition: scrollview.h:105
Definition: scrollview.h:102
Definition: blobbox.h:556
Definition: statistc.h:33
integer coordinate
Definition: points.h:32
Definition: blobbox.h:705
Definition: points.h:189