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

◆ transform_linear() [2/2]

template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_linear ( DataType &  input,
double  a,
double  b,
std::vector< std::vector< double > > &  working_buffer 
)

Linear transformation y = ax + b using C++20 ranges (OUT-OF-PLACE)

Template Parameters
DataTypeOperationReadyData type
Parameters
inputInput data - will NOT be modified
aScale factor
bOffset factor
working_bufferBuffer for operations (will be resized if needed)
Returns
Transformed data

Definition at line 60 of file MathematicalHelper.hpp.

61{
62 auto [target_data, structure_info] = OperationHelper::setup_operation_buffer(input, working_buffer);
63
64 for (auto& span : target_data) {
65 std::ranges::transform(span, span.begin(),
66 [a, b](double x) { return a * x + b; });
67 }
68
69 return OperationHelper::reconstruct_from_double<DataType>(working_buffer, structure_info);
70}

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

+ Here is the call graph for this function: