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 "varable.h" 00024 #include "scrollview.h" 00025 #include "img.h" 00026 #include "pdblock.h" 00027 #include "crakedge.h" 00028 00029 DLLSYM void block_edges( //get edges in a block 00030 IMAGE *t_image, //threshold image 00031 PDBLK *block, //block in image 00032 ICOORD page_tr //corner of page 00033 ); 00034 void make_margins( //get a line 00035 PDBLK *block, //block in image 00036 BLOCK_LINE_IT *line_it, //for old style 00037 uinT8 *pixels, //pixels to strip 00038 uinT8 margin, //white-out pixel 00039 inT16 left, //block edges 00040 inT16 right, 00041 inT16 y //line coord 00042 ); 00043 void whiteout_block( //clean it 00044 IMAGE *t_image, //threshold image 00045 PDBLK *block //block in image 00046 ); 00047 void line_edges ( //scan for edges 00048 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 ); 00055 CRACKEDGE *h_edge ( //horizontal edge 00056 inT16 x, //xposition 00057 inT16 y, //y position 00058 inT8 sign, //sign of edge 00059 CRACKEDGE * join //edge to join to 00060 ); 00061 CRACKEDGE *v_edge ( //vertical edge 00062 inT16 x, //xposition 00063 inT16 y, //y position 00064 inT8 sign, //sign of edge 00065 CRACKEDGE * join //edge to join to 00066 ); 00067 void join_edges( //join edge fragments 00068 CRACKEDGE *edge1, //edges to join 00069 CRACKEDGE *edge2 //no specific order 00070 ); 00071 void free_crackedges( //really free them 00072 CRACKEDGE *start //start of loop 00073 ); 00074 #endif