1 /********************************************************************** 2 * File: scanedg.h (Formerly scanedge.h) 3 * Description: Raster scanning crack based edge extractor. 4 * Author: Ray Smith 5 * Created: Fri Mar 22 16:11:50 GMT 1991 6 * 7 * (C) Copyright 1991, Hewlett-Packard Ltd. 8 ** Licensed under the Apache License, Version 2.0 (the "License"); 9 ** you may not use this file except in compliance with the License. 10 ** You may obtain a copy of the License at 11 ** http://www.apache.org/licenses/LICENSE-2.0 12 ** Unless required by applicable law or agreed to in writing, software 13 ** distributed under the License is distributed on an "AS IS" BASIS, 14 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 ** See the License for the specific language governing permissions and 16 ** limitations under the License. 17 * 18 **********************************************************************/ 19 20 #ifndef SCANEDG_H 21 #define SCANEDG_H 22 23 #include "varable.h" 24 #include "scrollview.h" 25 #include "img.h" 26 #include "pdblock.h" 27 #include "crakedge.h" 28 29 DLLSYM void block_edges( //get edges in a block 30 IMAGE *t_image, //threshold image 31 PDBLK *block, //block in image 32 ICOORD page_tr //corner of page 33 ); 34 void make_margins( //get a line 35 PDBLK *block, //block in image 36 BLOCK_LINE_IT *line_it, //for old style 37 uinT8 *pixels, //pixels to strip 38 uinT8 margin, //white-out pixel 39 inT16 left, //block edges 40 inT16 right, 41 inT16 y //line coord 42 ); 43 void whiteout_block( //clean it 44 IMAGE *t_image, //threshold image 45 PDBLK *block //block in image 46 ); 47 void line_edges ( //scan for edges 48 inT16 x, //coord of line start 49 inT16 y, //coord of line 50 inT16 xext, //width of line 51 uinT8 uppercolour, //start of prev line 52 uinT8 * bwpos, //thresholded line 53 CRACKEDGE ** prevline //edges in progress 54 ); 55 CRACKEDGE *h_edge ( //horizontal edge 56 inT16 x, //xposition 57 inT16 y, //y position 58 inT8 sign, //sign of edge 59 CRACKEDGE * join //edge to join to 60 ); 61 CRACKEDGE *v_edge ( //vertical edge 62 inT16 x, //xposition 63 inT16 y, //y position 64 inT8 sign, //sign of edge 65 CRACKEDGE * join //edge to join to 66 ); 67 void join_edges( //join edge fragments 68 CRACKEDGE *edge1, //edges to join 69 CRACKEDGE *edge2 //no specific order 70 ); 71 void free_crackedges( //really free them 72 CRACKEDGE *start //start of loop 73 ); 74 #endif 75