tesseract
3.03
|
00001 /********************************************************************** 00002 * File: drawtord.h (Formerly drawto.h) 00003 * Description: Draw things to do with textord. 00004 * Author: Ray Smith 00005 * Created: Thu Jul 30 15:40:57 BST 1992 00006 * 00007 * (C) Copyright 1992, Hewlett-Packard Ltd. 00008 ** Licensed under the Apache License, Version 2.0 (the "License"); 00009 ** you may not use this file except in compliance with the License. 00010 ** You may obtain a copy of the License at 00011 ** http://www.apache.org/licenses/LICENSE-2.0 00012 ** Unless required by applicable law or agreed to in writing, software 00013 ** distributed under the License is distributed on an "AS IS" BASIS, 00014 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 ** See the License for the specific language governing permissions and 00016 ** limitations under the License. 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef DRAWTORD_H 00021 #define DRAWTORD_H 00022 00023 #include "params.h" 00024 #include "scrollview.h" 00025 #include "pitsync1.h" 00026 #include "blobbox.h" 00027 00028 #define NO_SMD "none" 00029 00030 extern BOOL_VAR_H (textord_show_fixed_cuts, FALSE, 00031 "Draw fixed pitch cell boundaries"); 00032 extern STRING_VAR_H (to_debugfile, DEBUG_WIN_NAME, "Name of debugfile"); 00033 extern STRING_VAR_H (to_smdfile, NO_SMD, "Name of SMD file"); 00034 extern ScrollView* to_win; 00035 extern FILE *to_debug; 00036 // Creates a static display window for textord, and returns a pointer to it. 00037 ScrollView* create_to_win(ICOORD page_tr); 00038 void close_to_win(); // Destroy the textord window. 00039 void create_todebug_win(); //make gradients win 00040 void plot_box_list( //make gradients win 00041 ScrollView* win, //window to draw in 00042 BLOBNBOX_LIST *list, //blob list 00043 ScrollView::Color body_colour //colour to draw 00044 ); 00045 void plot_to_row( //draw a row 00046 TO_ROW *row, //row to draw 00047 ScrollView::Color colour, //colour to draw in 00048 FCOORD rotation //rotation for line 00049 ); 00050 void plot_parallel_row( //draw a row 00051 TO_ROW *row, //row to draw 00052 float gradient, //gradients of lines 00053 inT32 left, //edge of block 00054 ScrollView::Color colour, //colour to draw in 00055 FCOORD rotation //rotation for line 00056 ); 00057 void draw_occupation ( //draw projection 00058 inT32 xleft, //edge of block 00059 inT32 ybottom, //bottom of block 00060 inT32 min_y, //coordinate limits 00061 inT32 max_y, inT32 occupation[], //projection counts 00062 inT32 thresholds[] //for drop out 00063 ); 00064 void draw_meanlines( //draw a block 00065 TO_BLOCK *block, //block to draw 00066 float gradient, //gradients of lines 00067 inT32 left, //edge of block 00068 ScrollView::Color colour, //colour to draw in 00069 FCOORD rotation //rotation for line 00070 ); 00071 void plot_word_decisions( //draw words 00072 ScrollView* win, //window tro draw in 00073 inT16 pitch, //of block 00074 TO_ROW *row //row to draw 00075 ); 00076 void plot_fp_cells( //draw words 00077 ScrollView* win, //window tro draw in 00078 ScrollView::Color colour, //colour of lines 00079 BLOBNBOX_IT *blob_it, //blobs 00080 inT16 pitch, //of block 00081 inT16 blob_count, //no of real blobs 00082 STATS *projection, //vertical 00083 inT16 projection_left, //edges //scale factor 00084 inT16 projection_right, 00085 float projection_scale); 00086 void plot_fp_cells2( //draw words 00087 ScrollView* win, //window tro draw in 00088 ScrollView::Color colour, //colour of lines 00089 TO_ROW *row, //for location 00090 FPSEGPT_LIST *seg_list //segments to plot 00091 ); 00092 void plot_row_cells( //draw words 00093 ScrollView* win, //window tro draw in 00094 ScrollView::Color colour, //colour of lines 00095 TO_ROW *row, //for location 00096 float xshift, //amount of shift 00097 ICOORDELT_LIST *cells //cells to draw 00098 ); 00099 #endif