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

◆ set_or_update_region_data() [2/3]

template<typename T >
void MayaFlux::Kakshya::set_or_update_region_data ( std::vector< std::span< T > > &  dest_spans,
const std::vector< std::span< const T > > &  source_data,
const Region region,
const std::vector< DataDimension > &  dimensions 
)

Write or update a region of data in planar storage.

Template Parameters
TData type.
Parameters
dest_spansVector of destination data spans (one per channel).
source_dataVector of source data spans (one per channel).
regionRegion to update (includes channel dimension).
dimensionsDimension descriptors (includes channel dimension).

Definition at line 374 of file RegionUtils.hpp.

379{
380 size_t channel_dim_idx = 0;
381 for (size_t i = 0; i < dimensions.size(); ++i) {
382 if (dimensions[i].role == DataDimension::Role::CHANNEL) {
383 channel_dim_idx = i;
384 break;
385 }
386 }
387
388 size_t start_channel = region.start_coordinates[channel_dim_idx];
389 size_t end_channel = region.end_coordinates[channel_dim_idx];
390
391 for (size_t ch = start_channel; ch <= end_channel && ch < dest_spans.size(); ++ch) {
392 size_t source_channel_idx = ch - start_channel;
393 if (source_channel_idx >= source_data.size())
394 continue;
395
396 Region channel_region = remove_channel_dimension(region, dimensions);
397 auto non_channel_dims = get_non_channel_dimensions(dimensions);
398
399 set_or_update_region_data(
400 dest_spans[ch],
401 source_data[source_channel_idx],
402 channel_region,
403 non_channel_dims);
404 }
405}
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

References MayaFlux::Kakshya::DataDimension::CHANNEL, MayaFlux::Kakshya::Region::end_coordinates, get_non_channel_dimensions(), remove_channel_dimension(), set_or_update_region_data(), and MayaFlux::Kakshya::Region::start_coordinates.

+ Here is the call graph for this function: