Tesseract  3.02
tesseract-ocr/textord/scanedg.h
Go to the documentation of this file.
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          "img.h"
00026 #include          "pdblock.h"
00027 #include          "crakedge.h"
00028 
00029 class C_OUTLINE_IT;
00030 
00031 struct CrackPos {
00032   CRACKEDGE** free_cracks;   // Freelist for fast allocation.
00033   int x;                     // Position of new edge.
00034   int y;
00035 };
00036 
00037 void block_edges(IMAGE *t_image,       // thresholded image
00038                  PDBLK *block,         // block in image
00039                  C_OUTLINE_IT* outline_it);
00040 void make_margins(PDBLK *block,            // block in image
00041                   BLOCK_LINE_IT *line_it,  // for old style
00042                   uinT8 *pixels,           // pixels to strip
00043                   uinT8 margin,            // white-out pixel
00044                   inT16 left,              // block edges
00045                   inT16 right,
00046                   inT16 y);                // line coord                 );
00047 void whiteout_block(IMAGE *t_image,        // thresholded image
00048                     PDBLK *block);         // block in image
00049 void line_edges(inT16 x,                     // coord of line start
00050                 inT16 y,                     // coord of line
00051                 inT16 xext,                  // width of line
00052                 uinT8 uppercolour,           // start of prev line
00053                 uinT8 * bwpos,               // thresholded line
00054                 CRACKEDGE ** prevline,       // edges in progress
00055                 CRACKEDGE **free_cracks,
00056                 C_OUTLINE_IT* outline_it);
00057 CRACKEDGE *h_edge(int sign,                  // sign of edge
00058                   CRACKEDGE * join,          // edge to join to
00059                   CrackPos* pos);
00060 CRACKEDGE *v_edge(int sign,                  // sign of edge
00061                   CRACKEDGE * join,          // edge to join to
00062                   CrackPos* pos);
00063 void join_edges(CRACKEDGE *edge1,            // edges to join
00064                 CRACKEDGE *edge2,            // no specific order
00065                 CRACKEDGE **free_cracks,
00066                 C_OUTLINE_IT* outline_it);
00067 void free_crackedges(CRACKEDGE *start);
00068 
00069 #endif