tesseract  4.0.0-1-g2a2b
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
void join_edges(CRACKEDGE *edge1, CRACKEDGE *edge2, CRACKEDGE **free_cracks, C_OUTLINE_IT *outline_it)
Definition: scanedg.cpp:329
int x
Definition: scanedg.h:31
CRACKEDGE ** free_cracks
Definition: scanedg.h:30
void free_crackedges(CRACKEDGE *start)
Definition: scanedg.cpp:362
CRACKEDGE * v_edge(int sign, CRACKEDGE *join, CrackPos *pos)
Definition: scanedg.cpp:277
int y
Definition: scanedg.h:32
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:87
LIST join(LIST list1, LIST list2)
Definition: oldlist.cpp:231
CRACKEDGE * h_edge(int sign, CRACKEDGE *join, CrackPos *pos)
Definition: scanedg.cpp:226
page block
Definition: pdblock.h:32
void block_edges(Pix *t_image, PDBLK *block, C_OUTLINE_IT *outline_it)
Definition: scanedg.cpp:37
rectangle iterator
Definition: pdblock.h:145
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:142