wordrec/olutil.h

Go to the documentation of this file.
00001 
00020 #ifndef OLUTIL_H
00021 #define OLUTIL_H
00022 
00023 /*----------------------------------------------------------------------
00024               I n c l u d e s
00025 ----------------------------------------------------------------------*/
00026 #include "tessclas.h"
00027 #include "general.h"
00028 
00029 /*----------------------------------------------------------------------
00030               M a c r o s
00031 ----------------------------------------------------------------------*/
00032 /* ================== */
00038 #define is_inside_angle(pt)                                  \
00039 (angle_change ((pt)->prev, (pt), (pt)->next) < inside_angle)
00040 
00041 /* ================== */
00049 #define point_in_outline(p,o)         \
00050 ((p)->pos.x >= (o)->topleft.x  &&   \
00051    (p)->pos.y <= (o)->topleft.y  &&   \
00052    (p)->pos.x <= (o)->botright.x &&   \
00053    (p)->pos.y >= (o)->botright.y)     \
00054 
00055 
00056 /* ================== */
00060 #define same_outline_bounds(outline,other_outline)     \
00061 (outline->topleft.x  == other_outline->topleft.x  && \
00062    outline->topleft.y  == other_outline->topleft.y  && \
00063    outline->botright.x == other_outline->botright.x && \
00064    outline->botright.y == other_outline->botright.y)   \
00065 
00066 
00067 /* ================== */
00071 #define weighted_edgept_dist(p1,p2,x_y_weight)  \
00072 (((p1)->pos.x - (p2)->pos.x) *                \
00073    ((p1)->pos.x - (p2)->pos.x) * x_y_weight +  \
00074    ((p1)->pos.y - (p2)->pos.y) *               \
00075    ((p1)->pos.y - (p2)->pos.y))
00076 
00077 /*----------------------------------------------------------------------
00078               F u n c t i o n s
00079 ----------------------------------------------------------------------*/
00080 void check_outline_mem(); 
00081 
00082 void correct_blob_order(TBLOB *blob1, TBLOB *blob2); 
00083 
00084 void eliminate_duplicate_outlines(TBLOB *blob); 
00085 
00086 void setup_outline(TESSLINE *outline); 
00087 
00088 void setup_blob_outlines(TBLOB *blob); 
00089 
00090 /*
00091 #if defined(__STDC__) || defined(__cplusplus)
00092 # define _ARGS(s) s
00093 #else
00094 # define _ARGS(s) ()
00095 #endif*/
00096 
00097 /* olutil.c
00098 void check_outline_mem
00099   _ARGS((void));
00100 
00101 void correct_blob_order
00102   _ARGS((BLOB *blob1,
00103   BLOB *blob2));
00104 
00105 void eliminate_duplicate_outlines
00106   _ARGS((BLOB *blob));
00107 
00108 void setup_outline
00109   _ARGS((TESSLINE *outline));
00110 
00111 void setup_blob_outlines
00112   _ARGS((BLOB *blob));
00113 
00114 #undef _ARGS
00115 */
00116 #endif

Generated on Wed Feb 28 19:49:13 2007 for Tesseract by  doxygen 1.5.1