Tesseract
3.02
|
#include <fpchop.h>
Public Member Functions | |
C_OUTLINE_FRAG () | |
~C_OUTLINE_FRAG () | |
C_OUTLINE_FRAG (ICOORD start_pt, ICOORD end_pt, C_OUTLINE *outline, inT16 start_index, inT16 end_index) | |
C_OUTLINE_FRAG (C_OUTLINE_FRAG *head, inT16 tail_y) | |
C_OUTLINE * | close () |
C_OUTLINE_FRAG & | operator= (const C_OUTLINE_FRAG &src) |
Public Attributes | |
ICOORD | start |
ICOORD | end |
DIR128 * | steps |
inT32 | stepcount |
C_OUTLINE_FRAG * | other_end |
inT16 | ycoord |
C_OUTLINE_FRAG::C_OUTLINE_FRAG | ( | ) | [inline] |
C_OUTLINE_FRAG::~C_OUTLINE_FRAG | ( | ) | [inline] |
C_OUTLINE_FRAG::C_OUTLINE_FRAG | ( | ICOORD | start_pt, |
ICOORD | end_pt, | ||
C_OUTLINE * | outline, | ||
inT16 | start_index, | ||
inT16 | end_index | ||
) |
Definition at line 814 of file fpchop.cpp.
{ start = start_pt; end = end_pt; ycoord = start_pt.y (); stepcount = end_index - start_index; if (stepcount < 0) stepcount += outline->pathlength (); ASSERT_HOST (stepcount > 0); steps = new DIR128[stepcount]; if (end_index > start_index) { for (int i = start_index; i < end_index; ++i) steps[i - start_index] = outline->step_dir(i); } else { int len = outline->pathlength(); int i = start_index; for (; i < len; ++i) steps[i - start_index] = outline->step_dir(i); if (end_index > 0) for (; i < end_index + len; ++i) steps[i - start_index] = outline->step_dir(i - len); } other_end = NULL; delete close(); }
C_OUTLINE_FRAG::C_OUTLINE_FRAG | ( | C_OUTLINE_FRAG * | head, |
inT16 | tail_y | ||
) |
C_OUTLINE * C_OUTLINE_FRAG::close | ( | ) |
Definition at line 1031 of file fpchop.cpp.
{ //join pieces DIR128 *new_steps; //new steps inT32 new_stepcount; //no of steps inT16 fake_count; //fake steps DIR128 fake_step; //step entry ASSERT_HOST (start.x () == end.x ()); fake_count = start.y () - end.y (); if (fake_count < 0) { fake_count = -fake_count; fake_step = 32; } else fake_step = 96; new_stepcount = stepcount + fake_count; new_steps = new DIR128[new_stepcount]; memmove(new_steps, steps, stepcount); memset (new_steps + stepcount, fake_step.get_dir(), fake_count); C_OUTLINE* result = new C_OUTLINE (start, new_steps, new_stepcount); delete [] new_steps; return result; }
C_OUTLINE_FRAG & C_OUTLINE_FRAG::operator= | ( | const C_OUTLINE_FRAG & | src | ) |