Tesseract 3.02

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes
C_OUTLINE_FRAG Class Reference

`#include <fpchop.h>`

Inheritance diagram for C_OUTLINE_FRAG:

List of all members.

## 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 Member Functions inherited from ELIST_LINK
| ELIST_LINK ()
| ELIST_LINK (const ELIST_LINK &)
void | operator= (const ELIST_LINK &)

## Public Attributes
ICOORD | start
ICOORD | end
DIR128 * | steps
inT32 | stepcount
C_OUTLINE_FRAG * | other_end
inT16 | ycoord

## Detailed Description

Definition at line 28 of file fpchop.h.

## Constructor & Destructor Documentation

C_OUTLINE_FRAG::C_OUTLINE_FRAG | ( |  | ) |
| inline

Definition at line 31 of file fpchop.h.

{ //empty constructor
steps = NULL;
stepcount = 0;
}

C_OUTLINE_FRAG::~C_OUTLINE_FRAG | ( |  | ) |
| inline

Definition at line 35 of file fpchop.h.

{
if (steps != NULL)
delete [] steps;
}

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
| ) |  |

Definition at line 846 of file fpchop.cpp.

{
ycoord = tail_y;
other_end = head;
start = head->start;
end = head->end;
steps = NULL;
stepcount = 0;
}

## Member Function Documentation

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 | ) |

Definition at line 1063 of file fpchop.cpp.

{
if (steps != NULL)
delete [] steps;
stepcount = src.stepcount;
steps = new DIR128[stepcount];
memmove (steps, src.steps, stepcount);
start = src.start;
end = src.end;
ycoord = src.ycoord;
return *this;
}

## Member Data Documentation

ICOORD C_OUTLINE_FRAG::end

Definition at line 52 of file fpchop.h.

C_OUTLINE_FRAG* C_OUTLINE_FRAG::other_end

Definition at line 55 of file fpchop.h.

ICOORD C_OUTLINE_FRAG::start

Definition at line 51 of file fpchop.h.

inT32 C_OUTLINE_FRAG::stepcount

Definition at line 54 of file fpchop.h.

DIR128* C_OUTLINE_FRAG::steps

Definition at line 53 of file fpchop.h.

inT16 C_OUTLINE_FRAG::ycoord

Definition at line 56 of file fpchop.h.

The documentation for this class was generated from the following files:

- /mnt/data/src/tesseract-ocr/textord/fpchop.h
- /mnt/data/src/tesseract-ocr/textord/fpchop.cpp