#include <stepblob.h>
Definition at line 30 of file stepblob.h.
◆ C_BLOB() [1/3]
◆ C_BLOB() [2/3]
C_BLOB::C_BLOB |
( |
C_OUTLINE_LIST * |
outline_list | ) |
|
|
explicit |
Definition at line 160 of file stepblob.cpp.
161 for (C_OUTLINE_IT ol_it(outline_list); !ol_it.empty(); ol_it.forward()) {
164 position_outline(outline, &outlines);
void CheckInverseFlagAndDirection()
◆ C_BLOB() [3/3]
Definition at line 171 of file stepblob.cpp.
172 C_OUTLINE_IT it(&outlines);
173 it.add_to_end(outline);
◆ area()
Definition at line 270 of file stepblob.cpp.
272 C_OUTLINE_IT it = &outlines;
276 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
277 outline = it.data ();
278 total += outline->
area ();
◆ bounding_box()
TBOX C_BLOB::bounding_box |
( |
| ) |
const |
Definition at line 250 of file stepblob.cpp.
253 C_OUTLINE_IT it =
const_cast<C_OUTLINE_LIST*
>(&outlines);
256 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
257 outline = it.data ();
const TBOX & bounding_box() const
◆ CheckInverseFlagAndDirection()
void C_BLOB::CheckInverseFlagAndDirection |
( |
| ) |
|
Definition at line 221 of file stepblob.cpp.
222 C_OUTLINE_IT ol_it(&outlines);
223 for (ol_it.mark_cycle_pt(); !ol_it.cycled_list(); ol_it.forward()) {
227 reverse_outline_list(outline->
child());
inT16 turn_direction() const
void set_flag(C_OUTLINE_FLAGS mask, BOOL8 value)
◆ ComputeEdgeOffsets()
void C_BLOB::ComputeEdgeOffsets |
( |
int |
threshold, |
|
|
Pix * |
pix |
|
) |
| |
Definition at line 409 of file stepblob.cpp.
410 ComputeEdgeOffsetsOutlineList(threshold, pix, &outlines);
◆ ConstructBlobsFromOutlines()
void C_BLOB::ConstructBlobsFromOutlines |
( |
bool |
good_blob, |
|
|
C_OUTLINE_LIST * |
outline_list, |
|
|
C_BLOB_IT * |
good_blobs_it, |
|
|
C_BLOB_IT * |
bad_blobs_it |
|
) |
| |
|
static |
Definition at line 186 of file stepblob.cpp.
191 C_OUTLINE_LIST nested_outlines;
192 for (C_OUTLINE_IT ol_it(outline_list); !ol_it.empty(); ol_it.forward()) {
195 position_outline(outline, &nested_outlines);
198 for (C_OUTLINE_IT ol_it(&nested_outlines); !ol_it.empty(); ol_it.forward()) {
200 bool blob_is_good = good_blob;
204 blob_is_good =
false;
205 ol_it.add_list_after(outline->
child());
211 if (!blob_is_good && bad_blobs_it != NULL)
212 bad_blobs_it->add_after_then_move(blob);
214 good_blobs_it->add_after_then_move(blob);
bool IsLegallyNested() const
void CheckInverseFlagAndDirection()
◆ count_transitions()
inT32 C_BLOB::count_transitions |
( |
inT32 |
threshold | ) |
|
Definition at line 330 of file stepblob.cpp.
334 C_OUTLINE_IT it = &outlines;
338 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
339 outline = it.data ();
inT32 count_transitions(inT32 threshold)
◆ deep_copy()
◆ EstimateBaselinePosition()
inT16 C_BLOB::EstimateBaselinePosition |
( |
| ) |
|
Definition at line 427 of file stepblob.cpp.
429 int left = box.
left();
430 int width = box.
width();
431 int bottom = box.
bottom();
437 C_OUTLINE_IT it(&outlines);
438 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
441 for (
int s = 0; s < outline->
pathlength(); ++s) {
442 if (pos.
y() < y_mins[pos.
x() - left])
443 y_mins[pos.
x() - left] = pos.
y();
444 pos += outline->
step(s);
448 int bottom_extent = 0;
449 for (
int x = 0; x <= width; ++x) {
450 if (y_mins[x] == bottom || y_mins[x] == bottom + 1)
454 int best_min = box.
top();
456 int prev_y = box.
top();
457 int prev_prev_y = box.
top();
458 for (
int x = 0; x < width; x += prev_run) {
460 int y_at_x = y_mins[x];
462 while (x + run <= width && y_mins[x + run] == y_at_x) ++run;
463 if (y_at_x > bottom + 1) {
467 while (x + total_run <= width &&
468 (y_mins[x + total_run] == y_at_x ||
469 y_mins[x + total_run] == y_at_x + 1)) ++total_run;
471 if (prev_prev_y > y_at_x + 1 || x + total_run > width ||
472 y_mins[x + total_run] > y_at_x + 1) {
475 if (prev_run > 0 && prev_y == y_at_x + 1) total_run += prev_run;
476 if (total_run > bottom_extent && y_at_x < best_min) {
482 prev_prev_y = prev_y;
485 return best_min == box.
top() ? bottom : best_min;
TBOX bounding_box() const
ICOORD step(int index) const
inT16 x() const
access function
const ICOORD & start_pos() const
const double kMaxPerimeterWidthRatio
void init_to_size(int size, T t)
inT16 y() const
access_function
◆ FakeBlob()
Definition at line 238 of file stepblob.cpp.
239 C_OUTLINE_LIST outlines;
241 return new C_BLOB(&outlines);
static void FakeOutline(const TBOX &box, C_OUTLINE_LIST *outlines)
◆ move()
void C_BLOB::move |
( |
const ICOORD |
vec | ) |
|
Definition at line 352 of file stepblob.cpp.
355 C_OUTLINE_IT it(&outlines);
357 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ())
358 it.data ()->move (vec);
◆ operator=()
Definition at line 106 of file stepblob.h.
107 if (!outlines.empty ())
static C_OUTLINE * deep_copy(const C_OUTLINE *src)
◆ out_list()
C_OUTLINE_LIST* C_BLOB::out_list |
( |
| ) |
|
|
inline |
◆ outer_area()
inT32 C_BLOB::outer_area |
( |
| ) |
|
Definition at line 309 of file stepblob.cpp.
311 C_OUTLINE_IT it = &outlines;
315 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
316 outline = it.data ();
◆ perimeter()
inT32 C_BLOB::perimeter |
( |
| ) |
|
Definition at line 289 of file stepblob.cpp.
291 C_OUTLINE_IT it = &outlines;
295 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
◆ plot()
Definition at line 532 of file stepblob.cpp.
535 plot_outline_list(&outlines, window, blob_colour, child_colour);
◆ plot_normed()
Definition at line 540 of file stepblob.cpp.
544 plot_normed_outline_list(denorm, &outlines, blob_colour, child_colour,
◆ render()
Definition at line 509 of file stepblob.cpp.
511 Pix* pix = pixCreate(box.
width(), box.
height(), 1);
512 render_outline_list(&outlines, box.
left(), box.
top(), pix);
TBOX bounding_box() const
◆ render_outline()
Pix * C_BLOB::render_outline |
( |
| ) |
|
Definition at line 518 of file stepblob.cpp.
520 Pix* pix = pixCreate(box.
width(), box.
height(), 1);
521 render_outline_list_outline(&outlines, box.
left(), box.
top(), pix);
TBOX bounding_box() const
◆ rotate()
void C_BLOB::rotate |
( |
const FCOORD & |
rotation | ) |
|
Definition at line 387 of file stepblob.cpp.
void RotateOutlineList(const FCOORD &rotation, C_OUTLINE_LIST *outlines)
◆ SortByXMiddle()
static int C_BLOB::SortByXMiddle |
( |
const void * |
v1, |
|
|
const void * |
v2 |
|
) |
| |
|
inlinestatic |
Definition at line 119 of file stepblob.h.
120 const C_BLOB* blob1 = *
reinterpret_cast<const C_BLOB*
const *
>(v1);
121 const C_BLOB* blob2 = *
reinterpret_cast<const C_BLOB*
const *
>(v2);
TBOX bounding_box() const
The documentation for this class was generated from the following files: