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

◆ transform_clamp() [2/2]

template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_clamp ( DataType &  input,
double  min_val,
double  max_val,
std::vector< std::vector< double > > &  working_buffer 
)

Clamp transformation using C++20 ranges (OUT-OF-PLACE)

Template Parameters
DataTypeOperationReadyData type
Parameters
inputInput data - will NOT be modified
min_valMinimum value
max_valMaximum value
working_bufferBuffer for operations (will be resized if needed)
Returns
Clamped data

Definition at line 465 of file MathematicalHelper.hpp.

466{
467 auto [target_data, structure_info] = OperationHelper::setup_operation_buffer(input, working_buffer);
468
469 for (auto& span : target_data) {
470 std::ranges::transform(span, span.begin(),
471 [min_val, max_val](double x) { return std::clamp(x, min_val, max_val); });
472 }
473
474 return OperationHelper::reconstruct_from_double<DataType>(working_buffer, structure_info);
475}

References transform_clamp().

+ Here is the call graph for this function: