#include "mfcpch.h"
#include "scanedg.h"
#include "drawedg.h"
#include "edgloop.h"
Go to the source code of this file.
Macro Definition Documentation
Function Documentation
Definition at line 70 of file edgloop.cpp.
{
int lastchain;
int chaindiff;
const ERRCODE ED_ILLEGAL_SUM =
"Illegal sum of chain codes";
length = 0;
chainsum = 0;
edgept = start;
do {
length++;
if (edgept->
stepdir != lastchain) {
chaindiff = edgept->
stepdir - lastchain;
if (chaindiff > 2)
chaindiff -= 4;
else if (chaindiff < -2)
chaindiff += 4;
chainsum += chaindiff;
}
}
if ((chainsum != 4 && chainsum != -4)
if (edgept != start) {
} else {
ED_ILLEGAL_SUM.
error (
"check_path_legal",
TESSLOG,
"chainsum=%d",
chainsum);
}
}
}
void complete_edge |
( |
CRACKEDGE * |
start, |
|
|
C_OUTLINE_IT * |
outline_it |
|
) |
| |
Definition at line 40 of file edgloop.cpp.
{
outline =
new C_OUTLINE (start, botleft, topright, looplength);
outline_it->add_after_then_move (outline);
}
}
Definition at line 122 of file edgloop.cpp.
{
edgept = start;
realstart = start;
leftmost = edgept->
pos.
x ();
length = 0;
do {
if (edgept->
pos.
x () < botleft.
x ())
else if (edgept->
pos.
x () > topright.
x ())
if (edgept->
pos.
y () < botleft.
y ())
else if (edgept->
pos.
y () > topright.
y ()) {
realstart = edgept;
leftmost = edgept->
pos.
x ();
}
else if (edgept->
pos.
y () == topright.
y ()
&& edgept->
pos.
x () < leftmost) {
leftmost = edgept->
pos.
x ();
realstart = edgept;
}
length++;
}
while (edgept != start);
start = realstart;
return length;
}
Variable Documentation
int edges_maxedgelength = 16000 |
"Max steps in any outline"
Definition at line 32 of file edgloop.cpp.