26 #include "config_auto.h"
29 #define MINEDGELENGTH 8 // min decent length
38 C_OUTLINE_IT* outline_it) {
50 outline =
new C_OUTLINE (start, botleft, topright, looplength);
52 outline_it->add_after_then_move (outline);
75 const ERRCODE ED_ILLEGAL_SUM =
"Illegal sum of chain codes";
83 if (edgept->
stepdir != lastchain) {
85 chaindiff = edgept->
stepdir - lastchain;
88 else if (chaindiff < -2)
90 chainsum += chaindiff;
93 edgept = edgept->
next;
97 if ((chainsum != 4 && chainsum != -4)
99 if (edgept != start) {
104 ED_ILLEGAL_SUM.
error (
"check_path_legal",
TESSLOG,
"chainsum=%d",
131 leftmost = edgept->
pos.
x ();
134 edgept = edgept->
next;
135 if (edgept->
pos.
x () < botleft.
x ())
138 else if (edgept->
pos.
x () > topright.
x ())
140 if (edgept->
pos.
y () < botleft.
y ())
143 else if (edgept->
pos.
y () > topright.
y ()) {
145 leftmost = edgept->
pos.
x ();
148 else if (edgept->
pos.
y () == topright.
y ()
149 && edgept->
pos.
x () < leftmost) {
151 leftmost = edgept->
pos.
x ();
156 while (edgept != start);
void set_x(inT16 xin)
rewrite function
inT16 loop_bounding_box(CRACKEDGE *&start, ICOORD &botleft, ICOORD &topright)
ScrollView::Color check_path_legal(CRACKEDGE *start)
void complete_edge(CRACKEDGE *start, C_OUTLINE_IT *outline_it)
inT16 y() const
access_function
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
static const int kMaxOutlineLength
void set_y(inT16 yin)
rewrite function
inT16 x() const
access function