MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ sort_regions_by_attribute()

void MayaFlux::Kakshya::sort_regions_by_attribute ( std::vector< Region > &  regions,
const std::string &  attr_name 
)

Sort a vector of Regions by a specific attribute (numeric).

Parameters
regionsVector of Regions to sort.
attr_nameAttribute name to sort by.

Definition at line 124 of file RegionUtils.cpp.

125{
126 std::ranges::sort(regions,
127 [&attr_name](const Region& a, const Region& b) {
128 auto aval = get_region_attribute<std::string>(a, attr_name);
129 auto bval = get_region_attribute<std::string>(b, attr_name);
130 return aval.value_or("") < bval.value_or("");
131 });
132}
Represents a point or span in N-dimensional space.
Definition Region.hpp:67

References sort_regions_by_attribute().

Referenced by sort_regions_by_attribute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: