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

◆ transform_channel_operation() [1/2]

template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_channel_operation ( DataType &  input,
uint32_t  num_channels,
bool  interleave 
)

Channel operations using C++20 ranges (IN-PLACE)

Template Parameters
DataTypeOperationReadyData type
Parameters
inputInput data - WILL BE MODIFIED
num_channelsNumber of channels
interleaveWhether to interleave or deinterleave
Returns
Transformed data

Definition at line 566 of file MatrixHelper.hpp.

569{
570 auto [target_data, structure_info] = OperationHelper::extract_structured_double(input);
571
572 if (target_data.size() != num_channels) {
573 throw std::invalid_argument("Data channel count must match specified number of channels");
574 }
575
576 auto reconstructed_data = target_data
577 | std::views::transform([](const auto& span) {
578 return std::vector<double>(span.begin(), span.end());
579 })
580 | std::ranges::to<std::vector>();
581
582 return OperationHelper::reconstruct_from_double<DataType>(reconstructed_data, structure_info);
583}

References MayaFlux::Yantra::OperationHelper::extract_structured_double().

+ Here is the call graph for this function: