00001
00020 #ifndef OLUTIL_H
00021 #define OLUTIL_H
00022
00023
00024
00025
00026 #include "tessclas.h"
00027 #include "general.h"
00028
00029
00030
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
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
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 #endif