#include <blobs.h>
|
| TBLOB () |
|
| TBLOB (const TBLOB &src) |
|
| ~TBLOB () |
|
TBLOB & | operator= (const TBLOB &src) |
|
TBLOB * | ClassifyNormalizeIfNeeded () const |
|
void | CopyFrom (const TBLOB &src) |
|
void | Clear () |
|
void | Normalize (const BLOCK *block, const FCOORD *rotation, const DENORM *predecessor, float x_origin, float y_origin, float x_scale, float y_scale, float final_xshift, float final_yshift, bool inverse, Pix *pix) |
|
void | Rotate (const FCOORD rotation) |
|
void | Move (const ICOORD vec) |
|
void | Scale (float factor) |
|
void | ComputeBoundingBoxes () |
|
int | NumOutlines () const |
|
TBOX | bounding_box () const |
|
bool | SegmentCrossesOutline (const TPOINT &pt1, const TPOINT &pt2) const |
|
bool | Contains (const TPOINT &pt) const |
|
void | EliminateDuplicateOutlines () |
|
void | CorrectBlobOrder (TBLOB *next) |
|
const DENORM & | denorm () const |
|
void | plot (ScrollView *window, ScrollView::Color color, ScrollView::Color child_color) |
|
int | BBArea () const |
|
int | ComputeMoments (FCOORD *center, FCOORD *second_moments) const |
|
void | GetPreciseBoundingBox (TBOX *precise_box) const |
|
void | GetEdgeCoords (const TBOX &box, GenericVector< GenericVector< int > > *x_coords, GenericVector< GenericVector< int > > *y_coords) const |
|
Definition at line 282 of file blobs.h.
◆ TBLOB() [1/2]
◆ TBLOB() [2/2]
TBLOB::TBLOB |
( |
const TBLOB & |
src | ) |
|
|
inline |
◆ ~TBLOB()
◆ BBArea()
int TBLOB::BBArea |
( |
| ) |
const |
|
inline |
Definition at line 370 of file blobs.h.
374 total_area += outline->BBArea();
◆ bounding_box()
TBOX TBLOB::bounding_box |
( |
| ) |
const |
Definition at line 466 of file blobs.cpp.
471 for (outline = outline->
next; outline !=
nullptr; outline = outline->
next) {
◆ ClassifyNormalizeIfNeeded()
TBLOB * TBLOB::ClassifyNormalizeIfNeeded |
( |
| ) |
const |
Definition at line 345 of file blobs.cpp.
346 TBLOB* rotated_blob =
nullptr;
349 if (denorm_.
block() !=
nullptr &&
352 int x_middle = (box.
left() + box.
right()) / 2;
353 int y_middle = (box.
top() + box.
bottom()) / 2;
354 rotated_blob =
new TBLOB(*
this);
360 (rotation.
y() > 0 ? x_middle - box.
left() : box.
right() - x_middle);
361 rotated_blob->
Normalize(
nullptr, &rotation, &denorm_, x_middle, y_middle,
362 1.0f, 1.0f, 0.0f, target_y, denorm_.
inverse(),
◆ Clear()
◆ ComputeBoundingBoxes()
void TBLOB::ComputeBoundingBoxes |
( |
| ) |
|
Definition at line 445 of file blobs.cpp.
447 outline = outline->
next) {
448 outline->ComputeBoundingBox();
◆ ComputeMoments()
int TBLOB::ComputeMoments |
( |
FCOORD * |
center, |
|
|
FCOORD * |
second_moments |
|
) |
| const |
Definition at line 520 of file blobs.cpp.
526 CollectEdges(box,
nullptr, &accumulator,
nullptr,
nullptr);
531 if (x2nd < 1.0) x2nd = 1.0;
532 if (y2nd < 1.0) y2nd = 1.0;
533 second_moments->
set_x(x2nd);
534 second_moments->
set_y(y2nd);
535 return accumulator.
count();
◆ Contains()
bool TBLOB::Contains |
( |
const TPOINT & |
pt | ) |
const |
|
inline |
Definition at line 345 of file blobs.h.
348 outline = outline->
next) {
349 if (outline->Contains(pt))
return true;
◆ CopyFrom()
void TBLOB::CopyFrom |
( |
const TBLOB & |
src | ) |
|
Definition at line 369 of file blobs.cpp.
373 srcline = srcline->
next) {
374 auto* new_outline =
new TESSLINE(*srcline);
378 prev_outline->
next = new_outline;
379 prev_outline = new_outline;
381 denorm_ = src.denorm_;
◆ CorrectBlobOrder()
void TBLOB::CorrectBlobOrder |
( |
TBLOB * |
next | ) |
|
◆ denorm()
const DENORM& TBLOB::denorm |
( |
| ) |
const |
|
inline |
◆ EliminateDuplicateOutlines()
void TBLOB::EliminateDuplicateOutlines |
( |
| ) |
|
Definition at line 478 of file blobs.cpp.
481 outline = outline->
next) {
483 for (
TESSLINE* other_outline = outline->
next; other_outline !=
nullptr;
484 last_outline = other_outline, other_outline = other_outline->
next) {
485 if (outline->SameBox(*other_outline)) {
486 last_outline->
next = other_outline->
next;
488 other_outline->
loop =
nullptr;
489 delete other_outline;
490 other_outline = last_outline;
◆ GetEdgeCoords()
Definition at line 555 of file blobs.cpp.
562 CollectEdges(box,
nullptr,
nullptr, x_coords, y_coords);
564 for (
int i = 0; i < x_coords->
size(); ++i) (*x_coords)[i].sort();
565 for (
int i = 0; i < y_coords->
size(); ++i) (*y_coords)[i].sort();
◆ GetPreciseBoundingBox()
void TBLOB::GetPreciseBoundingBox |
( |
TBOX * |
precise_box | ) |
const |
Definition at line 539 of file blobs.cpp.
542 *precise_box =
TBOX();
543 CollectEdges(box, precise_box,
nullptr,
nullptr,
nullptr);
◆ Move()
void TBLOB::Move |
( |
const ICOORD |
vec | ) |
|
◆ Normalize()
void TBLOB::Normalize |
( |
const BLOCK * |
block, |
|
|
const FCOORD * |
rotation, |
|
|
const DENORM * |
predecessor, |
|
|
float |
x_origin, |
|
|
float |
y_origin, |
|
|
float |
x_scale, |
|
|
float |
y_scale, |
|
|
float |
final_xshift, |
|
|
float |
final_yshift, |
|
|
bool |
inverse, |
|
|
Pix * |
pix |
|
) |
| |
Definition at line 396 of file blobs.cpp.
401 x_scale, y_scale, final_xshift, final_yshift);
413 outline->Normalize(denorm_);
◆ NumOutlines()
int TBLOB::NumOutlines |
( |
| ) |
const |
◆ operator=()
◆ plot()
Definition at line 508 of file blobs.cpp.
512 outline = outline->
next)
513 outline->plot(window, color, child_color);
◆ PolygonalCopy()
TBLOB * TBLOB::PolygonalCopy |
( |
bool |
allow_detailed_fx, |
|
|
C_BLOB * |
src |
|
) |
| |
|
static |
Definition at line 326 of file blobs.cpp.
327 auto* tblob =
new TBLOB;
328 ApproximateOutlineList(allow_detailed_fx, src->
out_list(),
false,
◆ Rotate()
void TBLOB::Rotate |
( |
const FCOORD |
rotation | ) |
|
Definition at line 421 of file blobs.cpp.
423 outline = outline->
next) {
424 outline->Rotate(rotation);
◆ Scale()
void TBLOB::Scale |
( |
float |
factor | ) |
|
Definition at line 437 of file blobs.cpp.
439 outline = outline->
next) {
440 outline->Scale(factor);
◆ SegmentCrossesOutline()
bool TBLOB::SegmentCrossesOutline |
( |
const TPOINT & |
pt1, |
|
|
const TPOINT & |
pt2 |
|
) |
| const |
|
inline |
Definition at line 337 of file blobs.h.
340 outline = outline->
next) {
341 if (outline->SegmentCrosses(pt1, pt2))
return true;
◆ ShallowCopy()
Definition at line 334 of file blobs.cpp.
335 auto* blob =
new TBLOB;
336 blob->denorm_ = src.denorm_;
◆ outlines
The documentation for this struct was generated from the following files: