|
mmcfilters
Public API documentation
|
Incremental foreground A4 contours on the image domain. More...
#include <ContourComputation.hpp>
Classes | |
| class | iterator |
| Single-pass iterator yielding (node, borrowed pixel span). More... | |
Public Member Functions | |
| ContourComputation (const MorphologicalTree &tree) | |
| Builds the compact indexes for a stable tree with a 2D domain. | |
| template<AltitudeValue T> | |
| ContourComputation (const ValuedMorphologicalTreeView< T > &view) | |
| Builds contours from the topology of a current valued view. | |
| std::vector< PixelId > | contour (NodeId node) const |
| Returns an owned contour of one live node, without caching it. | |
| iterator | begin () const |
| Starts an independent incremental post-order traversal. | |
| std::default_sentinel_t | end () const noexcept |
| Returns the exhaustion sentinel. | |
| template<typename Consumer > | |
| void | forEachContour (Consumer &&consumer) const |
| Calls consumer(node, pixels) once for every live node. | |
Incremental foreground A4 contours on the image domain.
Stores compact support and boundary-lifetime indexes, without a contour cache. Iteration emits every live node in post-order, reusing child storage. A query for one node scans only the requested support and returns an owned pixel vector. The tree must outlive this object and its iterators, and remain unchanged. Index construction and each traversal use O(P + N) auxiliary storage, where P counts pixels and N internal node slots. The tree resolves comparable pairs of smallest nodes from DFS intervals, then selects the lower estimated storage between RMQ and offline Tarjan for the remaining batch. This bound excludes caller-retained output and pre-existing tree-owned LCA caches. Pixel order is unspecified.
Definition at line 29 of file ContourComputation.hpp.
|
inlineexplicit |
Builds the compact indexes for a stable tree with a 2D domain.
| tree | Source topology, which must outlive the computation. |
Definition at line 139 of file ContourComputation.hpp.
|
inlineexplicit |
Builds contours from the topology of a current valued view.
| view | Current valued view whose topology must outlive the computation. |
Definition at line 146 of file ContourComputation.hpp.
|
inline |
Starts an independent incremental post-order traversal.
Definition at line 168 of file ContourComputation.hpp.
Returns an owned contour of one live node, without caching it.
| node | Live internal node identifier. |
Definition at line 153 of file ContourComputation.hpp.
|
inlinenoexcept |
Returns the exhaustion sentinel.
Definition at line 177 of file ContourComputation.hpp.
Calls consumer(node, pixels) once for every live node.
Uses the same iterator. The borrowed span expires after the callback; exceptions propagate and release the traversal's temporary storage.
| consumer | Callback accepting a node identifier and borrowed contour span. |
Definition at line 186 of file ContourComputation.hpp.