tesseract  v4.0.0-17-g361f3264
Open Source OCR Engine
scanedg.h
1 /**********************************************************************
2  * File: scanedg.h (Formerly scanedge.h)
3  * Description: Raster scanning crack based edge extractor.
4  * Author: Ray Smith
5  *
6  * (C) Copyright 1991, 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 SCANEDG_H
20 #define SCANEDG_H
21 
22 #include "params.h"
23 #include "scrollview.h"
24 #include "pdblock.h"
25 #include "crakedge.h"
26 
27 class C_OUTLINE_IT;
28 
29 struct CrackPos {
30  CRACKEDGE** free_cracks; // Freelist for fast allocation.
31  int x; // Position of new edge.
32  int y;
33 };
34 
35 struct Pix;
36 
37 void block_edges(Pix *t_image, // thresholded image
38  PDBLK *block, // block in image
39  C_OUTLINE_IT* outline_it);
40 void make_margins(PDBLK *block, // block in image
41  BLOCK_LINE_IT *line_it, // for old style
42  uint8_t *pixels, // pixels to strip
43  uint8_t margin, // white-out pixel
44  int16_t left, // block edges
45  int16_t right,
46  int16_t y); // line coord );
47 void line_edges(int16_t x, // coord of line start
48  int16_t y, // coord of line
49  int16_t xext, // width of line
50  uint8_t uppercolour, // start of prev line
51  uint8_t * bwpos, // thresholded line
52  CRACKEDGE ** prevline, // edges in progress
54  C_OUTLINE_IT* outline_it);
55 CRACKEDGE *h_edge(int sign, // sign of edge
56  CRACKEDGE * join, // edge to join to
57  CrackPos* pos);
58 CRACKEDGE *v_edge(int sign, // sign of edge
59  CRACKEDGE * join, // edge to join to
60  CrackPos* pos);
61 void join_edges(CRACKEDGE *edge1, // edges to join
62  CRACKEDGE *edge2, // no specific order
64  C_OUTLINE_IT* outline_it);
65 void free_crackedges(CRACKEDGE *start);
66 
67 #endif
CRACKEDGE ** free_cracks
Definition: scanedg.h:30
page block
Definition: pdblock.h:32
rectangle iterator
Definition: pdblock.h:145
int x
Definition: scanedg.h:31
int y
Definition: scanedg.h:32
Definition: crakedge.h:26
Definition: scanedg.h:29