#include <blobs.h>
Definition at line 211 of file blobs.h.
◆ TESSLINE() [1/2]
tesseract::TESSLINE::TESSLINE |
( |
| ) |
|
|
inline |
◆ TESSLINE() [2/2]
tesseract::TESSLINE::TESSLINE |
( |
const TESSLINE & |
src | ) |
|
|
inline |
Definition at line 213 of file blobs.h.
void CopyFrom(const TESSLINE &src)
◆ ~TESSLINE()
tesseract::TESSLINE::~TESSLINE |
( |
| ) |
|
|
inline |
◆ BBArea()
int tesseract::TESSLINE::BBArea |
( |
| ) |
const |
|
inline |
◆ bounding_box()
TBOX tesseract::TESSLINE::bounding_box |
( |
| ) |
const |
◆ BuildFromOutlineList()
TESSLINE * tesseract::TESSLINE::BuildFromOutlineList |
( |
EDGEPT * |
outline | ) |
|
|
static |
Definition at line 91 of file blobs.cpp.
93 result->loop = outline;
94 if (outline->src_outline !=
nullptr) {
100 EDGEPT *pt = outline;
102 pt->step_count = pt->next->start_step - pt->start_step;
103 if (pt->step_count < 0) {
104 pt->step_count += pt->src_outline->pathlength();
107 }
while (pt != outline);
109 result->SetupFromPos();
◆ Clear()
void tesseract::TESSLINE::Clear |
( |
| ) |
|
Definition at line 141 of file blobs.cpp.
142 if (
loop ==
nullptr) {
146 EDGEPT *this_edge =
loop;
148 EDGEPT *next_edge = this_edge->
next;
150 this_edge = next_edge;
151 }
while (this_edge !=
loop);
◆ ComputeBoundingBox()
void tesseract::TESSLINE::ComputeBoundingBox |
( |
| ) |
|
Definition at line 212 of file blobs.cpp.
213 int minx = INT32_MAX;
214 int miny = INT32_MAX;
215 int maxx = -INT32_MAX;
216 int maxy = -INT32_MAX;
220 EDGEPT *this_edge =
loop;
222 if (!this_edge->IsHidden() || !this_edge->prev->IsHidden()) {
223 if (this_edge->pos.x < minx) {
224 minx = this_edge->
pos.
x;
226 if (this_edge->pos.y < miny) {
227 miny = this_edge->pos.y;
229 if (this_edge->pos.x > maxx) {
230 maxx = this_edge->pos.x;
232 if (this_edge->pos.y > maxy) {
233 maxy = this_edge->pos.y;
236 this_edge = this_edge->next;
237 }
while (this_edge !=
loop);
◆ Contains()
bool tesseract::TESSLINE::Contains |
( |
const TPOINT & |
pt | ) |
const |
|
inline |
◆ CopyFrom()
void tesseract::TESSLINE::CopyFrom |
( |
const TESSLINE & |
src | ) |
|
Definition at line 114 of file blobs.cpp.
120 if (src.loop !=
nullptr) {
121 EDGEPT *prevpt =
nullptr;
122 EDGEPT *newpt =
nullptr;
123 EDGEPT *srcpt = src.loop;
125 newpt =
new EDGEPT(*srcpt);
126 if (prevpt ==
nullptr) {
129 newpt->
prev = prevpt;
130 prevpt->
next = newpt;
134 }
while (srcpt != src.loop);
◆ FindBestStartPt()
EDGEPT * tesseract::TESSLINE::FindBestStartPt |
( |
| ) |
const |
Definition at line 290 of file blobs.cpp.
291 EDGEPT *best_start =
loop;
296 if (pt->IsHidden()) {
299 if (pt->prev->IsHidden() || pt->prev->src_outline != pt->src_outline) {
302 if (pt->start_step < best_step) {
306 }
while ((pt = pt->next) !=
loop);
◆ MinMaxCrossProduct()
void tesseract::TESSLINE::MinMaxCrossProduct |
( |
const TPOINT |
vec, |
|
|
int * |
min_xp, |
|
|
int * |
max_xp |
|
) |
| const |
Definition at line 250 of file blobs.cpp.
253 EDGEPT *this_edge =
loop;
255 if (!this_edge->IsHidden() || !this_edge->prev->IsHidden()) {
256 int product = this_edge->
pos.
cross(vec);
259 this_edge = this_edge->next;
260 }
while (this_edge !=
loop);
void UpdateRange(const T1 &x, T2 *lower_bound, T2 *upper_bound)
int cross(const TPOINT &other) const
◆ Move()
void tesseract::TESSLINE::Move |
( |
const ICOORD |
vec | ) |
|
Definition at line 178 of file blobs.cpp.
181 pt->
pos.
x += vec.x();
182 pt->pos.y += vec.y();
184 }
while (pt !=
loop);
◆ Normalize()
void tesseract::TESSLINE::Normalize |
( |
const DENORM & |
denorm | ) |
|
Definition at line 156 of file blobs.cpp.
159 denorm.LocalNormTransform(pt->pos, &pt->pos);
161 }
while (pt !=
loop);
◆ operator=()
◆ plot()
Definition at line 268 of file blobs.cpp.
270 window->Pen(child_color);
280 window->SetCursor(pt->pos.x, pt->pos.y);
282 window->DrawTo(pt->pos.x, pt->pos.y);
284 }
while (pt !=
loop);
◆ Rotate()
void tesseract::TESSLINE::Rotate |
( |
const FCOORD |
rotation | ) |
|
Definition at line 166 of file blobs.cpp.
169 int tmp =
static_cast<int>(floor(pt->pos.x * rot.x() - pt->pos.y * rot.y() + 0.5));
170 pt->
pos.
y =
static_cast<int>(floor(pt->pos.y * rot.x() + pt->pos.x * rot.y() + 0.5));
173 }
while (pt !=
loop);
◆ SameBox()
bool tesseract::TESSLINE::SameBox |
( |
const TESSLINE & |
other | ) |
const |
|
inline |
◆ Scale()
void tesseract::TESSLINE::Scale |
( |
float |
factor | ) |
|
Definition at line 189 of file blobs.cpp.
192 pt->
pos.
x =
static_cast<int>(floor(pt->pos.x * factor + 0.5));
193 pt->pos.y =
static_cast<int>(floor(pt->pos.y * factor + 0.5));
195 }
while (pt !=
loop);
◆ SegmentCrosses()
bool tesseract::TESSLINE::SegmentCrosses |
( |
const TPOINT & |
pt1, |
|
|
const TPOINT & |
pt2 |
|
) |
| const |
|
inline |
Definition at line 254 of file blobs.h.
262 }
while (pt !=
loop);
static bool IsCrossed(const TPOINT &a0, const TPOINT &a1, const TPOINT &b0, const TPOINT &b1)
bool Contains(const TPOINT &pt) const
◆ SetupFromPos()
void tesseract::TESSLINE::SetupFromPos |
( |
| ) |
|
Definition at line 200 of file blobs.cpp.
203 pt->
vec.
x = pt->next->pos.x - pt->pos.x;
204 pt->vec.y = pt->next->pos.y - pt->pos.y;
206 }
while (pt !=
loop);
void ComputeBoundingBox()
◆ botright
TPOINT tesseract::TESSLINE::botright |
◆ is_hole
bool tesseract::TESSLINE::is_hole |
◆ loop
EDGEPT* tesseract::TESSLINE::loop |
◆ next
◆ start
TPOINT tesseract::TESSLINE::start |
◆ topleft
TPOINT tesseract::TESSLINE::topleft |
The documentation for this struct was generated from the following files: