1 /**********************************************************************
2  * File:        underlin.h  (Formerly undrline.h)
3  * Description: Code to chop blobs apart from underlines.
4  * Author:      Ray Smith
5  *
6  * (C) Copyright 1994, 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 UNDERLIN_H
20 #define UNDERLIN_H
21 
22 #include "fpchop.h"
23 
24 namespace tesseract {
25 
26 extern double_VAR_H(textord_underline_offset);
27 extern BOOL_VAR_H(textord_restore_underlines);
28 void restore_underlined_blobs( // get chop points
29     TO_BLOCK *block            // block to do
30 );
31 TO_ROW *most_overlapping_row( // find best row
32     TO_ROW_LIST *rows,        // list of rows
33     BLOBNBOX *blob            // blob to place
34 );
35 void find_underlined_blobs(    // get chop points
36     BLOBNBOX *u_line,          // underlined unit
37     QSPLINE *baseline,         // actual baseline
38     float xheight,             // height of line
39     float baseline_offset,     // amount to shrinke it
40     ICOORDELT_LIST *chop_cells // places to chop
41 );
42 void vertical_cunderline_projection( // project outlines
43     C_OUTLINE *outline,              // outline to project
44     QSPLINE *baseline,               // actual baseline
45     float xheight,                   // height of line
46     float baseline_offset,           // amount to shrinke it
47     STATS *lower_proj,               // below baseline
48     STATS *middle_proj,              // centre region
49     STATS *upper_proj                // top region
50 );
51 
52 } // namespace tesseract
53 
54 #endif
55