00001 /********************************************************************** 00002 * File: tessout.h (Formerly tessconv.h) 00003 * Description: Code to convert from tesseract data to mithras data. 00004 * Author: Ray Smith 00005 * Created: Tue Oct 22 12:54:38 BST 1991 00006 * 00007 * (C) Copyright 1991, 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 TESSOUT_H 00021 #define TESSOUT_H 00022 00023 #include "ocrblock.h" 00024 #include "tessclas.h" 00025 #include "statistc.h" 00026 #include "notdll.h" 00027 00028 BOOL8 make_blocks_from_rows( //make thresholds 00029 TEXTROW *tessrows, //old style rows 00030 const char *name, //name of image 00031 ICOORD page_tr, //page size 00032 BOOL8 copy_poly, //true to copy poly 00033 BLOCK_IT *block_it //blocks to make 00034 ); 00035 ROW *convert_row( //convert a row 00036 TEXTROW *tessrow, //row to convert 00037 BOOL8 do_shift, //true do do shift 00038 inT16 &top, //top of row 00039 inT16 &bottom //bottom of row 00040 ); 00041 void convert_words( //convert a row 00042 TEXTROW *tessrow, //row to convert 00043 BOOL8 do_shift, //true do do shift 00044 ROW *row //destination 00045 ); 00046 PBLOB *convert_blob( //convert a blob 00047 TBLOB *tblob, //blob to convert 00048 BOOL8 do_shift //true do do shift 00049 ); 00050 void convert_outline( //convert a outline 00051 TESSLINE *tessline, //outline to convert 00052 BOOL8 do_shift, //true do do shift 00053 BOOL8 reverse, //reverse it 00054 OUTLINE_IT *it //output list 00055 ); 00056 void accumulate_word_stats( //get stats 00057 TWERD *word, //word to do 00058 STATS *kern_stats, //kerning 00059 ICOORD &bleft, //corners 00060 ICOORD &tright); 00061 void blob_bounding_box( //get bounding box 00062 TBLOB *blob, //blob to do 00063 inT16 &xmin, //bounding box 00064 inT16 &ymin, 00065 inT16 &xmax, //of blob 00066 inT16 &ymax); 00067 void free_blob( //free tess blob 00068 TBLOB *blob //blob to free 00069 ); 00070 void free_tree( //free outlines 00071 TESSLINE *outline //outlines to free 00072 ); 00073 void free_outline( //free one 00074 TESSLINE *outline //outline to free 00075 ); 00076 #endif