MayaFlux 0.1.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 365 of file RegionUtils.hpp.

370{
371 size_t channel_dim_idx = 0;
372 for (size_t i = 0; i < dimensions.size(); ++i) {
373 if (dimensions[i].role == DataDimension::Role::CHANNEL) {
374 channel_dim_idx = i;
375 break;
376 }
377 }
378
379 size_t start_channel = region.start_coordinates[channel_dim_idx];
380 size_t end_channel = region.end_coordinates[channel_dim_idx];
381
382 for (size_t ch = start_channel; ch <= end_channel && ch < dest_spans.size(); ++ch) {
383 size_t source_channel_idx = ch - start_channel;
384 if (source_channel_idx >= source_data.size())
385 continue;
386
387 Region channel_region = remove_channel_dimension(region, dimensions);
388 auto non_channel_dims = get_non_channel_dimensions(dimensions);
389
390 set_or_update_region_data(
391 dest_spans[ch],
392 source_data[source_channel_idx],
393 channel_region,
394 non_channel_dims);
395 }
396}
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: