00001 /* -*-C-*- 00002 ******************************************************************************** 00003 * 00004 * File: blobs.h (Formerly blobs.h) 00005 * Description: Blob definition 00006 * Author: Mark Seaman, OCR Technology 00007 * Created: Fri Oct 27 15:39:52 1989 00008 * Modified: Thu Mar 28 15:33:38 1991 (Mark Seaman) marks@hpgrlt 00009 * Language: C 00010 * Package: N/A 00011 * Status: Experimental (Do Not Distribute) 00012 * 00013 * (c) Copyright 1989, Hewlett-Packard Company. 00014 ** Licensed under the Apache License, Version 2.0 (the "License"); 00015 ** you may not use this file except in compliance with the License. 00016 ** You may obtain a copy of the License at 00017 ** http://www.apache.org/licenses/LICENSE-2.0 00018 ** Unless required by applicable law or agreed to in writing, software 00019 ** distributed under the License is distributed on an "AS IS" BASIS, 00020 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00021 ** See the License for the specific language governing permissions and 00022 ** limitations under the License. 00023 * 00024 *********************************************************************************/ 00025 00026 #ifndef BLOBS_H 00027 #define BLOBS_H 00028 00029 /*---------------------------------------------------------------------- 00030 I n c l u d e s 00031 ----------------------------------------------------------------------*/ 00032 #include "vecfuncs.h" 00033 #include "tessclas.h" 00034 00035 /*---------------------------------------------------------------------- 00036 T y p e s 00037 ----------------------------------------------------------------------*/ 00038 typedef struct 00039 { /* Widths of pieces */ 00040 int num_chars; 00041 int widths[1]; 00042 } WIDTH_RECORD; 00043 00044 /*---------------------------------------------------------------------- 00045 M a c r o s 00046 ----------------------------------------------------------------------*/ 00047 /********************************************************************** 00048 * free_widths 00049 * 00050 * Free the memory taken up by a width array. 00051 **********************************************************************/ 00052 #define free_widths(w) \ 00053 if (w) memfree (w) 00054 00055 /*---------------------------------------------------------------------- 00056 F u n c t i o n s 00057 ----------------------------------------------------------------------*/ 00058 void blob_origin(TBLOB *blob, /*blob to compute on */ 00059 TPOINT *origin); /*return value */ 00060 00061 /*blob to compute on */ 00062 void blob_bounding_box(TBLOB *blob, 00063 register TPOINT *topleft, /*bounding box */ 00064 register TPOINT *botright); 00065 00066 void blobs_bounding_box(TBLOB *blobs, TPOINT *topleft, TPOINT *botright); 00067 00068 void blobs_origin(TBLOB *blobs, /*blob to compute on */ 00069 TPOINT *origin); /*return value */ 00070 00071 /*blob to compute on */ 00072 WIDTH_RECORD *blobs_widths(TBLOB *blobs); 00073 00074 int count_blobs(TBLOB *blobs); 00075 00076 void delete_word(TWERD *word); 00077 00078 void delete_edgepts(register EDGEPT *edgepts); 00079 00080 /* 00081 #if defined(__STDC__) || defined(__cplusplus) 00082 # define _ARGS(s) s 00083 #else 00084 # define _ARGS(s) () 00085 #endif*/ 00086 00087 /* blobs.c 00088 void blob_origin 00089 _ARGS((BLOB *blob, 00090 TPOINT *origin)); 00091 00092 void blob_bounding_box 00093 _ARGS((BLOB *blob, 00094 TPOINT *topleft, 00095 TPOINT *botright)); 00096 00097 void blobs_bounding_box 00098 _ARGS((BLOB *blobs, 00099 TPOINT *topleft, 00100 TPOINT *botright)); 00101 00102 void blobs_origin 00103 _ARGS((BLOB *blobs, 00104 TPOINT *origin)); 00105 00106 WIDTH_RECORD *blobs_widths 00107 _ARGS((BLOB *blobs)); 00108 00109 int count_blobs 00110 _ARGS((BLOB *blobs)); 00111 00112 void delete_word 00113 _ARGS((TWERD *word)); 00114 00115 void delete_edgepts 00116 _ARGS((EDGEPT *edgepts)); 00117 #undef _ARGS 00118 */ 00119 #endif