MayaFlux 0.1.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 564 of file MatrixHelper.hpp.

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

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

+ Here is the call graph for this function: