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

◆ transform_polynomial() [2/2]

template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_polynomial ( DataType &  input,
const std::vector< double > &  coefficients,
std::vector< std::vector< double > > &  working_buffer 
)

Polynomial transformation using existing Generator::Polynomial (OUT-OF-PLACE)

Template Parameters
DataTypeOperationReadyData type
Parameters
inputInput data - will NOT be modified
coefficientsPolynomial coefficients [a0, a1, a2, ...]
working_bufferBuffer for operations (will be resized if needed)
Returns
Transformed data

Definition at line 158 of file MathematicalHelper.hpp.

159{
160 auto [target_data, structure_info] = OperationHelper::setup_operation_buffer(input, working_buffer);
161
162 auto polynomial_gen = std::make_shared<Nodes::Generator::Polynomial>(coefficients);
163
164 for (auto& span : target_data) {
165 std::ranges::transform(span, span.begin(),
166 [&polynomial_gen](double x) {
167 return polynomial_gen->process_sample(x);
168 });
169 }
170
171 return OperationHelper::reconstruct_from_double<DataType>(working_buffer, structure_info);
172}

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

+ Here is the call graph for this function: