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

◆ transform_wrap() [1/2]

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

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

Template Parameters
DataTypeOperationReadyData type
Parameters
inputInput data - WILL BE MODIFIED
wrap_rangeWrap range [0, wrap_range)
Returns
Wrapped data

Definition at line 485 of file MathematicalHelper.hpp.

486{
487 auto [target_data, structure_info] = OperationHelper::extract_structured_double(input);
488
489 for (auto& span : target_data) {
490 std::ranges::transform(span, span.begin(),
491 [wrap_range](double x) {
492 return x - wrap_range * std::floor(x / wrap_range);
493 });
494 }
495
496 auto reconstructed_data = target_data
497 | std::views::transform([](const auto& span) {
498 return std::vector<double>(span.begin(), span.end());
499 })
500 | std::ranges::to<std::vector>();
501
502 return OperationHelper::reconstruct_from_double<DataType>(reconstructed_data, structure_info);
503}

References transform_wrap().

Referenced by transform_wrap(), and transform_wrap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: