24#include "config_auto.h"
27#define MINEDGELENGTH 8
36 C_OUTLINE_IT* outline_it) {
48 outline =
new C_OUTLINE (start, botleft, topright, looplength);
50 outline_it->add_after_then_move (outline);
73 constexpr ERRCODE ED_ILLEGAL_SUM(
"Illegal sum of chain codes");
81 if (edgept->
stepdir != lastchain) {
83 chaindiff = edgept->
stepdir - lastchain;
86 else if (chaindiff < -2)
88 chainsum += chaindiff;
91 edgept = edgept->
next;
95 if ((chainsum != 4 && chainsum != -4)
97 if (edgept != start) {
102 ED_ILLEGAL_SUM.
error (
"check_path_legal",
TESSLOG,
"chainsum=%d",
129 leftmost = edgept->
pos.
x ();
132 edgept = edgept->
next;
133 if (edgept->
pos.
x () < botleft.
x ())
136 else if (edgept->
pos.
x () > topright.
x ())
138 if (edgept->
pos.
y () < botleft.
y ())
141 else if (edgept->
pos.
y () > topright.
y ()) {
143 leftmost = edgept->
pos.
x ();
146 else if (edgept->
pos.
y () == topright.
y ()
147 && edgept->
pos.
x () < leftmost) {
149 leftmost = edgept->
pos.
x ();
154 while (edgept != start);
int16_t 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)
static const int kMaxOutlineLength
void set_x(int16_t xin)
rewrite function
int16_t y() const
access_function
void set_y(int16_t yin)
rewrite function
int16_t x() const
access function
void error(const char *caller, TessErrorLogCode action, const char *format,...) const