Tesseract
3.02
|
#include <blobs.h>
Public Member Functions | |
TESSLINE () | |
TESSLINE (const TESSLINE &src) | |
~TESSLINE () | |
TESSLINE & | operator= (const TESSLINE &src) |
void | CopyFrom (const TESSLINE &src) |
void | Clear () |
void | Normalize (const DENORM &denorm) |
void | Rotate (const FCOORD rotation) |
void | Move (const ICOORD vec) |
void | Scale (float factor) |
void | SetupFromPos () |
void | ComputeBoundingBox () |
void | MinMaxCrossProduct (const TPOINT vec, int *min_xp, int *max_xp) const |
TBOX | bounding_box () const |
bool | Contains (const TPOINT &pt) |
void | plot (ScrollView *window, ScrollView::Color color, ScrollView::Color child_color) |
int | BBArea () const |
Static Public Member Functions | |
static TESSLINE * | BuildFromOutlineList (EDGEPT *outline) |
Public Attributes | |
TPOINT | topleft |
TPOINT | botright |
TPOINT | start |
bool | is_hole |
EDGEPT * | loop |
TESSLINE * | next |
TESSLINE::TESSLINE | ( | ) | [inline] |
TESSLINE::TESSLINE | ( | const TESSLINE & | src | ) | [inline] |
int TESSLINE::BBArea | ( | ) | const [inline] |
TBOX TESSLINE::bounding_box | ( | ) | const |
void TESSLINE::Clear | ( | ) |
void TESSLINE::ComputeBoundingBox | ( | ) |
Definition at line 170 of file blobs.cpp.
{ int minx = MAX_INT32; int miny = MAX_INT32; int maxx = -MAX_INT32; int maxy = -MAX_INT32; // Find boundaries. start = loop->pos; EDGEPT* this_edge = loop; do { if (!this_edge->IsHidden() || !this_edge->prev->IsHidden()) { if (this_edge->pos.x < minx) minx = this_edge->pos.x; if (this_edge->pos.y < miny) miny = this_edge->pos.y; if (this_edge->pos.x > maxx) maxx = this_edge->pos.x; if (this_edge->pos.y > maxy) maxy = this_edge->pos.y; } this_edge = this_edge->next; } while (this_edge != loop); // Reset bounds. topleft.x = minx; topleft.y = maxy; botright.x = maxx; botright.y = miny; }
bool TESSLINE::Contains | ( | const TPOINT & | pt | ) | [inline] |
void TESSLINE::CopyFrom | ( | const TESSLINE & | src | ) |
Definition at line 71 of file blobs.cpp.
{ Clear(); topleft = src.topleft; botright = src.botright; start = src.start; is_hole = src.is_hole; if (src.loop != NULL) { EDGEPT* prevpt = NULL; EDGEPT* newpt = NULL; EDGEPT* srcpt = src.loop; do { newpt = new EDGEPT(*srcpt); if (prevpt == NULL) { loop = newpt; } else { newpt->prev = prevpt; prevpt->next = newpt; } prevpt = newpt; srcpt = srcpt->next; } while (srcpt != src.loop); loop->prev = newpt; newpt->next = loop; } }
void TESSLINE::MinMaxCrossProduct | ( | const TPOINT | vec, |
int * | min_xp, | ||
int * | max_xp | ||
) | const |
void TESSLINE::Move | ( | const ICOORD | vec | ) |
void TESSLINE::Normalize | ( | const DENORM & | denorm | ) |
Definition at line 112 of file blobs.cpp.
{ EDGEPT* pt = loop; do { denorm.LocalNormTransform(pt->pos, &pt->pos); pt = pt->next; } while (pt != loop); SetupFromPos(); }
void TESSLINE::plot | ( | ScrollView * | window, |
ScrollView::Color | color, | ||
ScrollView::Color | child_color | ||
) |
Definition at line 222 of file blobs.cpp.
{ #ifndef GRAPHICS_DISABLED if (is_hole) window->Pen(child_color); else window->Pen(color); window->SetCursor(start.x, start.y); EDGEPT* pt = loop; do { bool prev_hidden = pt->IsHidden(); pt = pt->next; if (prev_hidden) window->SetCursor(pt->pos.x, pt->pos.y); else window->DrawTo(pt->pos.x, pt->pos.y); } while (pt != loop); #endif // GRAPHICS_DISABLED }
void TESSLINE::Rotate | ( | const FCOORD | rotation | ) |
void TESSLINE::Scale | ( | float | factor | ) |
void TESSLINE::SetupFromPos | ( | ) |
bool TESSLINE::is_hole |