mmcfilters
Public API documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | List of all members
mmcfilters::ContourTraceComputation Class Reference

Incremental ordered contour traces on the image domain. More...

#include <ContourTraceComputation.hpp>

Classes

class  iterator
 Single-pass iterator yielding a node and borrowed ordered trace. More...
 

Public Member Functions

 ContourTraceComputation (const MorphologicalTree &tree)
 Prepares compact edge changes for a stable tree with a 2D domain.
 
template<AltitudeValue T>
 ContourTraceComputation (const ValuedMorphologicalTreeView< T > &view)
 Prepares traces using the current valued view's shape connectivity.
 
ContourTrace trace (NodeId node) const
 Computes an independently owned ordered trace for one live node.
 
iterator begin () const
 Starts an independent incremental post-order traversal.
 
std::default_sentinel_t end () const noexcept
 Returns the exhaustion sentinel shared by all traversals.
 
template<typename Consumer >
void forEachTrace (Consumer &&consumer) const
 Calls consumer(node, trace) once for every live node.
 

Static Public Member Functions

static int packEdge (PixelId pixel, ContourSide side)
 Packs one pixel-side edge into a compact integer identifier.
 
static ContourEdge unpackEdge (int packedEdge)
 Unpacks one compact contour edge identifier.
 

Detailed Description

Incremental ordered contour traces on the image domain.

Construction stores compact edge changes shared by independent traversals. Iteration emits every live node in post-order and retains only the edge sets needed to build an unvisited parent. A query for one node scans that node's support and returns an independently owned trace. The tree must outlive this object and its iterators and remain unchanged.

Definition at line 35 of file ContourTraceComputation.hpp.

Constructor & Destructor Documentation

◆ ContourTraceComputation() [1/2]

mmcfilters::ContourTraceComputation::ContourTraceComputation ( const MorphologicalTree tree)
inlineexplicit

Prepares compact edge changes for a stable tree with a 2D domain.

Parameters
treeSource topology, which must outlive the computation.

Definition at line 161 of file ContourTraceComputation.hpp.

◆ ContourTraceComputation() [2/2]

template<AltitudeValue T>
mmcfilters::ContourTraceComputation::ContourTraceComputation ( const ValuedMorphologicalTreeView< T > &  view)
inlineexplicit

Prepares traces using the current valued view's shape connectivity.

Parameters
viewCurrent valued view whose topology must outlive the computation.

Definition at line 169 of file ContourTraceComputation.hpp.

Member Function Documentation

◆ begin()

iterator mmcfilters::ContourTraceComputation::begin ( ) const
inline

Starts an independent incremental post-order traversal.

Returns
Iterator positioned at the first trace, or exhausted.

Definition at line 209 of file ContourTraceComputation.hpp.

◆ end()

std::default_sentinel_t mmcfilters::ContourTraceComputation::end ( ) const
inlinenoexcept

Returns the exhaustion sentinel shared by all traversals.

Returns
Traversal sentinel.

Definition at line 215 of file ContourTraceComputation.hpp.

◆ forEachTrace()

template<typename Consumer >
void mmcfilters::ContourTraceComputation::forEachTrace ( Consumer &&  consumer) const
inline

Calls consumer(node, trace) once for every live node.

The borrowed trace view expires after the callback. Exceptions propagate and release traversal storage.

Parameters
consumerCallback accepting a node identifier and trace view.

Definition at line 225 of file ContourTraceComputation.hpp.

◆ packEdge()

static int mmcfilters::ContourTraceComputation::packEdge ( PixelId  pixel,
ContourSide  side 
)
inlinestatic

Packs one pixel-side edge into a compact integer identifier.

Parameters
pixelSupport pixel identifier.
sideSide occupied by the contour edge.
Returns
Packed contour edge identifier.

Definition at line 144 of file ContourTraceComputation.hpp.

◆ trace()

ContourTrace mmcfilters::ContourTraceComputation::trace ( NodeId  node) const
inline

Computes an independently owned ordered trace for one live node.

The support is scanned directly. The result can outlive this computation.

Parameters
nodeLive internal node identifier.
Returns
Owned ordered contour trace.

Definition at line 180 of file ContourTraceComputation.hpp.

◆ unpackEdge()

static ContourEdge mmcfilters::ContourTraceComputation::unpackEdge ( int  packedEdge)
inlinestatic

Unpacks one compact contour edge identifier.

Parameters
packedEdgePacked contour edge identifier.
Returns
Support pixel and side represented by the identifier.

Definition at line 153 of file ContourTraceComputation.hpp.


The documentation for this class was generated from the following file: