56 if (almostEqual(start, end))
97 return value >= m_start && value <= m_end;
104 template <typename Q = T, std::enable_if_t<std::is_integral<Q>::value,
int> = 0>
105 static constexpr bool almostEqual(Q v1, Q v2)
110 template <typename Q = T, std::enable_if_t<std::is_floating_point<Q>::value,
int> = 0>
111 static constexpr Q almostEqualMaxHelper(Q v1, Q v2)
113 return std::max<Q>({ 1.0, std::fabs(v1), std::fabs(v2) });
116 template <typename Q = T, std::enable_if_t<std::is_floating_point<Q>::value,
int> = 0>
117 static constexpr bool almostEqual(Q v1, Q v2)
119 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:81
constexpr Interval(T start, T end)
Constructor for the interval.
Definition peak_ipl_interval.hpp:48
constexpr T Start() const
Get the start value (inclusive) for the interval.
Definition peak_ipl_interval.hpp:69
constexpr bool InInterval(T value) const
Check if the value is in the interval.
Definition peak_ipl_interval.hpp:95
The exception thrown when passing an invalid parameter to a function.
Definition peak_ipl_exception.hpp:84
The "peak::ipl" namespace contains the whole image processing library.
#define PEAK_IPL_NO_DISCARD
Definition peak_ipl_attribute_defines.h:25