51 if (almostEqual(start, end))
92 return value >= m_start && value <= m_end;
99 template <typename Q = T, std::enable_if_t<std::is_integral<Q>::value,
int> = 0>
100 static constexpr bool almostEqual(Q v1, Q v2)
105 template <typename Q = T, std::enable_if_t<std::is_floating_point<Q>::value,
int> = 0>
106 static constexpr Q almostEqualMaxHelper(Q v1, Q v2)
108 return std::max<Q>({ 1.0, std::fabs(v1), std::fabs(v2) });
111 template <typename Q = T, std::enable_if_t<std::is_floating_point<Q>::value,
int> = 0>
112 static constexpr bool almostEqual(Q v1, Q v2)
114 return std::fabs(v1 - v2) <= std::numeric_limits<Q>::epsilon() * almostEqualMaxHelper(v1, v2);
constexpr T End() const
Get the end value (inclusive) for the interval.
Definition peak_ipl_interval.hpp:76
constexpr Interval(T start, T end)
Constructor for the interval.
Definition peak_ipl_interval.hpp:43
constexpr T Start() const
Get the start value (inclusive) for the interval.
Definition peak_ipl_interval.hpp:64
constexpr bool InInterval(T value) const
Check if the value is in the interval.
Definition peak_ipl_interval.hpp:90
The exception thrown when passing an invalid parameter to a function.
Definition peak_ipl_exception.hpp:79
The "peak::ipl" namespace contains the whole image processing library.
#define PEAK_IPL_NO_DISCARD
Definition peak_ipl_attribute_defines.h:20