MayaFlux 0.4.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 392 of file RegionUtils.hpp.

397{
398 size_t channel_dim_idx = 0;
399 for (size_t i = 0; i < dimensions.size(); ++i) {
400 if (dimensions[i].role == DataDimension::Role::CHANNEL) {
401 channel_dim_idx = i;
402 break;
403 }
404 }
405
406 size_t start_channel = region.start_coordinates[channel_dim_idx];
407 size_t end_channel = region.end_coordinates[channel_dim_idx];
408
409 for (size_t ch = start_channel; ch <= end_channel && ch < dest_spans.size(); ++ch) {
410 size_t source_channel_idx = ch - start_channel;
411 if (source_channel_idx >= source_data.size())
412 continue;
413
414 Region channel_region = remove_channel_dimension(region, dimensions);
415 auto non_channel_dims = get_non_channel_dimensions(dimensions);
416
417 set_or_update_region_data(
418 dest_spans[ch],
419 source_data[source_channel_idx],
420 channel_region,
421 non_channel_dims);
422 }
423}
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: