23 #ifndef EDSP_CLIPPER_HPP 24 #define EDSP_CLIPPER_HPP 27 #include <edsp/meta/iterator.hpp> 29 namespace edsp {
inline namespace algorithm {
41 template <
typename InputItr,
typename OutputIt,
typename Numeric>
42 constexpr
void clipper(InputItr first, InputItr last, OutputIt d_first, Numeric
min, Numeric
max) {
43 std::transform(first, last, d_first,
44 [=](
const meta::value_type_t<InputItr> val) -> meta::value_type_t<OutputIt> {
45 return (val < min) ? min : (val > max) ? max : val;
51 #endif // EDSP_CLIPPER_HPP constexpr meta::value_type_t< ForwardIt > max(ForwardIt first, ForwardIt last)
Computes the maximum value of the range [first, last)
Definition: max.hpp:38
constexpr void clipper(InputItr first, InputItr last, OutputIt d_first, Numeric min, Numeric max)
Limits the values of the elements in the range [first, last) once it exceeds a threshold [min...
Definition: clipper.hpp:42
constexpr meta::value_type_t< ForwardIt > min(ForwardIt first, ForwardIt last)
Computes the minimum value of the range [first, last)
Definition: min.hpp:38
Definition: amplifier.hpp:29