tesseract
3.03
|
00001 /********************************************************************** 00002 * File: scanedg.h (Formerly scanedge.h) 00003 * Description: Raster scanning crack based edge extractor. 00004 * Author: Ray Smith 00005 * Created: Fri Mar 22 16:11:50 GMT 1991 00006 * 00007 * (C) Copyright 1991, Hewlett-Packard Ltd. 00008 ** Licensed under the Apache License, Version 2.0 (the "License"); 00009 ** you may not use this file except in compliance with the License. 00010 ** You may obtain a copy of the License at 00011 ** http://www.apache.org/licenses/LICENSE-2.0 00012 ** Unless required by applicable law or agreed to in writing, software 00013 ** distributed under the License is distributed on an "AS IS" BASIS, 00014 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 ** See the License for the specific language governing permissions and 00016 ** limitations under the License. 00017 * 00018 **********************************************************************/ 00019 00020 #ifndef SCANEDG_H 00021 #define SCANEDG_H 00022 00023 #include "params.h" 00024 #include "scrollview.h" 00025 #include "pdblock.h" 00026 #include "crakedge.h" 00027 00028 class C_OUTLINE_IT; 00029 00030 struct CrackPos { 00031 CRACKEDGE** free_cracks; // Freelist for fast allocation. 00032 int x; // Position of new edge. 00033 int y; 00034 }; 00035 00036 struct Pix; 00037 00038 void block_edges(Pix *t_image, // thresholded image 00039 PDBLK *block, // block in image 00040 C_OUTLINE_IT* outline_it); 00041 void make_margins(PDBLK *block, // block in image 00042 BLOCK_LINE_IT *line_it, // for old style 00043 uinT8 *pixels, // pixels to strip 00044 uinT8 margin, // white-out pixel 00045 inT16 left, // block edges 00046 inT16 right, 00047 inT16 y); // line coord ); 00048 void line_edges(inT16 x, // coord of line start 00049 inT16 y, // coord of line 00050 inT16 xext, // width of line 00051 uinT8 uppercolour, // start of prev line 00052 uinT8 * bwpos, // thresholded line 00053 CRACKEDGE ** prevline, // edges in progress 00054 CRACKEDGE **free_cracks, 00055 C_OUTLINE_IT* outline_it); 00056 CRACKEDGE *h_edge(int sign, // sign of edge 00057 CRACKEDGE * join, // edge to join to 00058 CrackPos* pos); 00059 CRACKEDGE *v_edge(int sign, // sign of edge 00060 CRACKEDGE * join, // edge to join to 00061 CrackPos* pos); 00062 void join_edges(CRACKEDGE *edge1, // edges to join 00063 CRACKEDGE *edge2, // no specific order 00064 CRACKEDGE **free_cracks, 00065 C_OUTLINE_IT* outline_it); 00066 void free_crackedges(CRACKEDGE *start); 00067 00068 #endif