tesseract  5.0.0
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 namespace tesseract {
17 
18 class GAPMAP {
19 public:
20  GAPMAP( // constructor
21  TO_BLOCK *block);
22 
23  ~GAPMAP() { // destructor
24  delete[] map;
25  }
26 
27  bool table_gap( // Is gap a table?
28  int16_t left, // From here
29  int16_t right); // To here
30 
31 private:
32  int16_t total_rows; // in block
33  int16_t min_left; // Left extreme
34  int16_t max_right; // Right extreme
35  int16_t bucket_size; // half an x ht
36  int16_t *map; // empty counts
37  int16_t map_max; // map[0..max_map] defined
38  bool any_tabs;
39 };
40 
41 /*-----------------------------*/
42 
47 
48 } // namespace tesseract
49 
50 #endif
bool gapmap_no_isolated_quanta
Definition: gap_map.cpp:19
double gapmap_big_gaps
Definition: gap_map.cpp:20
bool gapmap_use_ends
Definition: gap_map.cpp:18
double_VAR_H(classify_min_slope)
bool gapmap_debug
Definition: gap_map.cpp:17
BOOL_VAR_H(wordrec_display_splits)
GAPMAP(TO_BLOCK *block)
Definition: gap_map.cpp:36
bool table_gap(int16_t left, int16_t right)
Definition: gap_map.cpp:166