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

Layout object for buffers that store several (attribute, delta) combinations per node. More...

#include <AttributeNames.hpp>

Public Member Functions

 AttributeNamesWithDelta (std::unordered_map< AttributeKey, int > &&map)
 Constructs a layout from an already validated offset map.
 
int getIndex (Attribute attr, int delta) const
 Returns the per-node offset associated with (attr, delta).
 
int getIndex (AttributeKey attrKey) const
 Returns the per-node offset associated with a composite delta key.
 
int linearIndex (int nodeIndex, Attribute attr, int delta) const
 Returns the linear index in the flat buffer for a given node and delta-augmented attribute.
 
int linearIndex (int nodeIndex, AttributeKey attrKey) const
 Convenience overload taking an AttributeKey.
 

Static Public Member Functions

static AttributeNamesWithDelta create (int delta, const std::vector< Attribute > &attributes)
 Builds the canonical dense layout for all deltas in [-delta, delta].
 
static std::string toString (AttributeKey attrKey)
 Returns a human-readable label for a composite key.
 
static std::string toString (Attribute attr, int delta)
 Returns a human-readable label for an attribute at a given delta.
 

Public Attributes

std::unordered_map< AttributeKey, intindexMap
 Maps each (attribute, delta) key to its per-node offset.
 
const int NUM_ATTRIBUTES
 Number of delta-augmented entries stored for each node.
 

Detailed Description

Layout object for buffers that store several (attribute, delta) combinations per node.

The layout is node-major: for a given node, all requested delta variants are stored contiguously. NUM_ATTRIBUTES therefore counts the number of (attribute, delta) entries associated with each node, not the number of live nodes.

The class is primarily used by delta-based APIs such as MSER-like stability descriptors, where each node needs access to values sampled at ancestor and descendant offsets around the current position.

Definition at line 39 of file AttributeNames.hpp.

Constructor & Destructor Documentation

◆ AttributeNamesWithDelta()

mmcfilters::AttributeNamesWithDelta::AttributeNamesWithDelta ( std::unordered_map< AttributeKey, int > &&  map)
inline

Constructs a layout from an already validated offset map.

The constructor takes ownership of map and derives the per-node stride from its final size.

Definition at line 53 of file AttributeNames.hpp.

Member Function Documentation

◆ create()

static AttributeNamesWithDelta mmcfilters::AttributeNamesWithDelta::create ( int  delta,
const std::vector< Attribute > &  attributes 
)
inlinestatic

Builds the canonical dense layout for all deltas in [-delta, delta].

Definition at line 59 of file AttributeNames.hpp.

◆ getIndex() [1/2]

int mmcfilters::AttributeNamesWithDelta::getIndex ( Attribute  attr,
int  delta 
) const
inline

Returns the per-node offset associated with (attr, delta).

Definition at line 79 of file AttributeNames.hpp.

◆ getIndex() [2/2]

int mmcfilters::AttributeNamesWithDelta::getIndex ( AttributeKey  attrKey) const
inline

Returns the per-node offset associated with a composite delta key.

Definition at line 86 of file AttributeNames.hpp.

◆ linearIndex() [1/2]

int mmcfilters::AttributeNamesWithDelta::linearIndex ( int  nodeIndex,
Attribute  attr,
int  delta 
) const
inline

Returns the linear index in the flat buffer for a given node and delta-augmented attribute.

Definition at line 94 of file AttributeNames.hpp.

◆ linearIndex() [2/2]

int mmcfilters::AttributeNamesWithDelta::linearIndex ( int  nodeIndex,
AttributeKey  attrKey 
) const
inline

Convenience overload taking an AttributeKey.

Definition at line 101 of file AttributeNames.hpp.

◆ toString() [1/2]

static std::string mmcfilters::AttributeNamesWithDelta::toString ( Attribute  attr,
int  delta 
)
inlinestatic

Returns a human-readable label for an attribute at a given delta.

Definition at line 115 of file AttributeNames.hpp.

◆ toString() [2/2]

static std::string mmcfilters::AttributeNamesWithDelta::toString ( AttributeKey  attrKey)
inlinestatic

Returns a human-readable label for a composite key.

Definition at line 108 of file AttributeNames.hpp.

Member Data Documentation

◆ indexMap

std::unordered_map<AttributeKey, int> mmcfilters::AttributeNamesWithDelta::indexMap

Maps each (attribute, delta) key to its per-node offset.

Definition at line 42 of file AttributeNames.hpp.

◆ NUM_ATTRIBUTES

const int mmcfilters::AttributeNamesWithDelta::NUM_ATTRIBUTES

Number of delta-augmented entries stored for each node.

Definition at line 45 of file AttributeNames.hpp.


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