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

◆ sort_regions_by_dimension()

void MayaFlux::Kakshya::sort_regions_by_dimension ( std::vector< Region > &  regions,
size_t  dimension 
)

Sort a vector of Regions by a specific dimension.

Parameters
regionsVector of Regions to sort.
dimensionDimension index to sort by.

Definition at line 114 of file RegionUtils.cpp.

115{
116 std::ranges::sort(regions,
117 [dimension](const Region& a, const Region& b) {
118 if (dimension < a.start_coordinates.size() && dimension < b.start_coordinates.size())
119 return a.start_coordinates[dimension] < b.start_coordinates[dimension];
120 return false;
121 });
122}
size_t a
size_t b
Represents a point or span in N-dimensional space.
Definition Region.hpp:67

References a, b, and sort_regions_by_dimension().

Referenced by sort_regions_by_dimension().

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