#include <stepblob.h>
Definition at line 37 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 163 of file stepblob.cpp.
164 for (C_OUTLINE_IT ol_it(outline_list); !ol_it.empty(); ol_it.forward()) {
167 position_outline(outline, &outlines);
◆ C_BLOB() [3/3]
Definition at line 174 of file stepblob.cpp.
175 C_OUTLINE_IT it(&outlines);
176 it.add_to_end(outline);
◆ area()
Definition at line 273 of file stepblob.cpp.
275 C_OUTLINE_IT it = &outlines;
279 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
280 outline = it.data ();
281 total += outline->
area ();
◆ bounding_box()
TBOX C_BLOB::bounding_box |
( |
| ) |
const |
Definition at line 253 of file stepblob.cpp.
256 C_OUTLINE_IT it =
const_cast<C_OUTLINE_LIST*
>(&outlines);
259 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
260 outline = it.data ();
◆ CheckInverseFlagAndDirection()
void C_BLOB::CheckInverseFlagAndDirection |
( |
| ) |
|
Definition at line 224 of file stepblob.cpp.
225 C_OUTLINE_IT ol_it(&outlines);
226 for (ol_it.mark_cycle_pt(); !ol_it.cycled_list(); ol_it.forward()) {
230 reverse_outline_list(outline->
child());
◆ ComputeEdgeOffsets()
void C_BLOB::ComputeEdgeOffsets |
( |
int |
threshold, |
|
|
Pix * |
pix |
|
) |
| |
Definition at line 413 of file stepblob.cpp.
414 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 189 of file stepblob.cpp.
194 C_OUTLINE_LIST nested_outlines;
195 for (C_OUTLINE_IT ol_it(outline_list); !ol_it.empty(); ol_it.forward()) {
198 position_outline(outline, &nested_outlines);
201 for (C_OUTLINE_IT ol_it(&nested_outlines); !ol_it.empty(); ol_it.forward()) {
203 bool blob_is_good = good_blob;
207 blob_is_good =
false;
208 ol_it.add_list_after(outline->
child());
210 auto* blob =
new C_BLOB(outline);
212 blob->CheckInverseFlagAndDirection();
214 if (!blob_is_good && bad_blobs_it !=
nullptr)
215 bad_blobs_it->add_after_then_move(blob);
217 good_blobs_it->add_after_then_move(blob);
◆ count_transitions()
int32_t C_BLOB::count_transitions |
( |
int32_t |
threshold | ) |
|
Definition at line 333 of file stepblob.cpp.
337 C_OUTLINE_IT it = &outlines;
341 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
342 outline = it.data ();
◆ deep_copy()
◆ EstimateBaselinePosition()
int16_t C_BLOB::EstimateBaselinePosition |
( |
| ) |
|
Definition at line 431 of file stepblob.cpp.
433 int left = box.
left();
434 int width = box.
width();
435 int bottom = box.
bottom();
441 C_OUTLINE_IT it(&outlines);
442 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
445 for (
int s = 0; s < outline->
pathlength(); ++s) {
446 if (pos.
y() < y_mins[pos.
x() - left])
447 y_mins[pos.
x() - left] = pos.
y();
448 pos += outline->
step(s);
452 int bottom_extent = 0;
453 for (
int x = 0; x <= width; ++x) {
454 if (y_mins[x] == bottom || y_mins[x] == bottom + 1)
458 int best_min = box.
top();
460 int prev_y = box.
top();
461 int prev_prev_y = box.
top();
462 for (
int x = 0; x < width; x += prev_run) {
464 int y_at_x = y_mins[x];
466 while (x + run <= width && y_mins[x + run] == y_at_x) ++run;
467 if (y_at_x > bottom + 1) {
471 while (x + total_run <= width &&
472 (y_mins[x + total_run] == y_at_x ||
473 y_mins[x + total_run] == y_at_x + 1)) ++total_run;
475 if (prev_prev_y > y_at_x + 1 || x + total_run > width ||
476 y_mins[x + total_run] > y_at_x + 1) {
479 if (prev_run > 0 && prev_y == y_at_x + 1) total_run += prev_run;
480 if (total_run > bottom_extent && y_at_x < best_min) {
486 prev_prev_y = prev_y;
489 return best_min == box.
top() ? bottom : best_min;
◆ FakeBlob()
Definition at line 241 of file stepblob.cpp.
242 C_OUTLINE_LIST outlines;
244 return new C_BLOB(&outlines);
◆ move()
void C_BLOB::move |
( |
const ICOORD |
vec | ) |
|
Definition at line 355 of file stepblob.cpp.
358 C_OUTLINE_IT it(&outlines);
360 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ())
361 it.data ()->move (vec);
◆ operator=()
Definition at line 112 of file stepblob.h.
113 if (!outlines.empty ())
◆ out_list()
C_OUTLINE_LIST* C_BLOB::out_list |
( |
| ) |
|
|
inline |
◆ outer_area()
int32_t C_BLOB::outer_area |
( |
| ) |
|
Definition at line 312 of file stepblob.cpp.
314 C_OUTLINE_IT it = &outlines;
318 for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) {
319 outline = it.data ();
◆ perimeter()
int32_t C_BLOB::perimeter |
( |
| ) |
|
Definition at line 292 of file stepblob.cpp.
294 C_OUTLINE_IT it = &outlines;
298 for (it.mark_cycle_pt(); !it.cycled_list(); it.forward()) {
◆ plot()
Definition at line 536 of file stepblob.cpp.
539 plot_outline_list(&outlines, window, blob_colour, child_colour);
◆ plot_normed()
Definition at line 544 of file stepblob.cpp.
548 plot_normed_outline_list(denorm, &outlines, blob_colour, child_colour,
◆ render()
◆ render_outline()
Pix * C_BLOB::render_outline |
( |
| ) |
|
Definition at line 522 of file stepblob.cpp.
524 Pix* pix = pixCreate(box.
width(), box.
height(), 1);
525 render_outline_list_outline(&outlines, box.
left(), box.
top(), pix);
◆ rotate()
void C_BLOB::rotate |
( |
const FCOORD & |
rotation | ) |
|
Definition at line 391 of file stepblob.cpp.
392 RotateOutlineList(rotation, &outlines);
◆ SortByXMiddle()
static int C_BLOB::SortByXMiddle |
( |
const void * |
v1, |
|
|
const void * |
v2 |
|
) |
| |
|
inlinestatic |
The documentation for this class was generated from the following files: