tesseract  5.0.0-alpha-619-ge9db
scanedg.h
Go to the documentation of this file.
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
53  CRACKEDGE **free_cracks,
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
63  CRACKEDGE **free_cracks,
64  C_OUTLINE_IT* outline_it);
65 void free_crackedges(CRACKEDGE *start);
66 
67 #endif
pdblock.h
line_edges
void line_edges(int16_t x, int16_t y, int16_t xext, uint8_t uppercolour, uint8_t *bwpos, CRACKEDGE **prevline, CRACKEDGE **free_cracks, C_OUTLINE_IT *outline_it)
Definition: scanedg.cpp:138
params.h
CrackPos::x
int x
Definition: scanedg.h:30
CrackPos
Definition: scanedg.h:28
v_edge
CRACKEDGE * v_edge(int sign, CRACKEDGE *join, CrackPos *pos)
Definition: scanedg.cpp:270
BLOCK_LINE_IT
rectangle iterator
Definition: pdblock.h:143
block_edges
void block_edges(Pix *t_image, PDBLK *block, C_OUTLINE_IT *outline_it)
Definition: scanedg.cpp:35
join_edges
void join_edges(CRACKEDGE *edge1, CRACKEDGE *edge2, CRACKEDGE **free_cracks, C_OUTLINE_IT *outline_it)
Definition: scanedg.cpp:321
make_margins
void make_margins(PDBLK *block, BLOCK_LINE_IT *line_it, uint8_t *pixels, uint8_t margin, int16_t left, int16_t right, int16_t y)
Definition: scanedg.cpp:84
PDBLK
page block
Definition: pdblock.h:30
free_crackedges
void free_crackedges(CRACKEDGE *start)
Definition: scanedg.cpp:353
h_edge
CRACKEDGE * h_edge(int sign, CRACKEDGE *join, CrackPos *pos)
Definition: scanedg.cpp:220
CRACKEDGE
Definition: crakedge.h:25
crakedge.h
CrackPos::y
int y
Definition: scanedg.h:31
scrollview.h
CrackPos::free_cracks
CRACKEDGE ** free_cracks
Definition: scanedg.h:29