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

◆ transform_wrap() [2/2]

template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_wrap ( DataType &  input,
double  wrap_range,
std::vector< std::vector< double > > &  working_buffer 
)

Wrap transformation (modulo operation) using C++20 ranges (OUT-OF-PLACE)

Template Parameters
DataTypeOperationReadyData type
Parameters
inputInput data - will NOT be modified
wrap_rangeWrap range [0, wrap_range)
working_bufferBuffer for operations (will be resized if needed)
Returns
Wrapped data

Definition at line 514 of file MathematicalHelper.hpp.

515{
516 auto [target_data, structure_info] = OperationHelper::setup_operation_buffer(input, working_buffer);
517
518 for (auto& span : target_data) {
519 std::ranges::transform(span, span.begin(),
520 [wrap_range](double x) {
521 return x - wrap_range * std::floor(x / wrap_range);
522 });
523 }
524
525 return OperationHelper::reconstruct_from_double<DataType>(working_buffer, structure_info);
526}

References transform_wrap().

+ Here is the call graph for this function: