tesseract  4.00.00dev
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 #ifndef GAP_MAP_H
11 #define GAP_MAP_H
12 
13 #include "blobbox.h"
14 
15 class GAPMAP
16 {
17  public:
18  GAPMAP( //constructor
19  TO_BLOCK *block);
20 
21  ~GAPMAP () { //destructor
22  if (map != NULL)
23  free_mem(map);
24  }
25 
26  BOOL8 table_gap( //Is gap a table?
27  inT16 left, //From here
28  inT16 right); //To here
29 
30  private:
31  inT16 total_rows; //in block
32  inT16 min_left; //Left extreme
33  inT16 max_right; //Right extreme
34  inT16 bucket_size; // half an x ht
35  inT16 *map; //empty counts
36  inT16 map_max; //map[0..max_map] defind
37  BOOL8 any_tabs;
38 };
39 
40 /*-----------------------------*/
41 
42 extern BOOL_VAR_H (gapmap_debug, FALSE, "Say which blocks have tables");
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 #endif
void free_mem(void *oldchunk)
Definition: memry.cpp:47
int16_t inT16
Definition: host.h:36
BOOL8 table_gap(inT16 left, inT16 right)
Definition: gap_map.cpp:159
GAPMAP(TO_BLOCK *block)
Definition: gap_map.cpp:35
unsigned char BOOL8
Definition: host.h:44
#define FALSE
Definition: capi.h:46
double gapmap_big_gaps
Definition: gap_map.cpp:19
#define double_VAR_H(name, val, comment)
Definition: params.h:273
bool gapmap_debug
Definition: gap_map.cpp:14
#define BOOL_VAR_H(name, val, comment)
Definition: params.h:267
bool gapmap_no_isolated_quanta
Definition: gap_map.cpp:18
Definition: gap_map.h:15
bool gapmap_use_ends
Definition: gap_map.cpp:16
~GAPMAP()
Definition: gap_map.h:21