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

◆ remove_channel_dimension()

Region MayaFlux::Kakshya::remove_channel_dimension ( const Region region,
const std::vector< DataDimension > &  dimensions 
)

Remove the channel dimension from a Region.

Parameters
regionThe original Region.
dimensionsDimension descriptors to identify the channel dimension.
Returns
New Region without the channel dimension.

This function identifies the channel dimension based on the provided dimension descriptors and removes it from the region's start and end coordinates.

This is useful for operations that need to ignore the channel dimension, such as spatial-only processing or planar data handling.

Definition at line 374 of file RegionUtils.cpp.

375{
376 Region result = region;
377
378 for (long i = 0; i < dimensions.size(); ++i) {
379 if (dimensions[i].role == DataDimension::Role::CHANNEL) {
380 result.start_coordinates.erase(result.start_coordinates.begin() + i);
381 result.end_coordinates.erase(result.end_coordinates.begin() + i);
382 break;
383 }
384 }
385
386 return result;
387}
std::vector< uint64_t > end_coordinates
Ending frame index (inclusive)
Definition Region.hpp:72
std::vector< uint64_t > start_coordinates
Starting frame index (inclusive)
Definition Region.hpp:69
Represents a point or span in N-dimensional space.
Definition Region.hpp:67

References MayaFlux::Kakshya::Region::end_coordinates, remove_channel_dimension(), and MayaFlux::Kakshya::Region::start_coordinates.

Referenced by extract_region_data(), remove_channel_dimension(), and set_or_update_region_data().

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