tesseract  5.0.0-alpha-619-ge9db
gap_map.h
Go to the documentation of this file.
1 // Licensed under the Apache License, Version 2.0 (the "License");
2 // you may not use this file except in compliance with the License.
3 // You may obtain a copy of the License at
4 // http://www.apache.org/licenses/LICENSE-2.0
5 // Unless required by applicable law or agreed to in writing, software
6 // distributed under the License is distributed on an "AS IS" BASIS,
7 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8 // See the License for the specific language governing permissions and
9 // limitations under the License.
10 
11 #ifndef GAP_MAP_H
12 #define GAP_MAP_H
13 
14 #include "blobbox.h"
15 
16 class GAPMAP
17 {
18  public:
19  GAPMAP( //constructor
20  TO_BLOCK *block);
21 
22  ~GAPMAP () { //destructor
23  delete[] map;
24  }
25 
26  bool table_gap( //Is gap a table?
27  int16_t left, //From here
28  int16_t right); //To here
29 
30  private:
31  int16_t total_rows; //in block
32  int16_t min_left; //Left extreme
33  int16_t max_right; //Right extreme
34  int16_t bucket_size; // half an x ht
35  int16_t *map; //empty counts
36  int16_t map_max; //map[0..max_map] defined
37  bool any_tabs;
38 };
39 
40 /*-----------------------------*/
41 
42 extern BOOL_VAR_H (gapmap_debug, false, "Say which blocks have tables");
43 extern BOOL_VAR_H (gapmap_use_ends, false,
44 "Use large space at start and end of rows");
46 "Ensure gaps not less than 2quanta wide");
47 extern double_VAR_H (gapmap_big_gaps, 1.75, "xht multiplier");
48 
49 #endif
gapmap_use_ends
bool gapmap_use_ends
Definition: gap_map.cpp:15
blobbox.h
GAPMAP::GAPMAP
GAPMAP(TO_BLOCK *block)
Definition: gap_map.cpp:33
TO_BLOCK
Definition: blobbox.h:691
double_VAR_H
#define double_VAR_H(name, val, comment)
Definition: params.h:298
GAPMAP::~GAPMAP
~GAPMAP()
Definition: gap_map.h:22
gapmap_big_gaps
double gapmap_big_gaps
Definition: gap_map.cpp:18
GAPMAP
Definition: gap_map.h:16
gapmap_debug
bool gapmap_debug
Definition: gap_map.cpp:14
BOOL_VAR_H
#define BOOL_VAR_H(name, val, comment)
Definition: params.h:294
gapmap_no_isolated_quanta
bool gapmap_no_isolated_quanta
Definition: gap_map.cpp:17
GAPMAP::table_gap
bool table_gap(int16_t left, int16_t right)
Definition: gap_map.cpp:159