55 if (almostEqual(start, end))
96 return value >= m_start && value <= m_end;
103 template <typename Q = T, std::enable_if_t<std::is_integral<Q>::value,
int> = 0>
104 static constexpr bool almostEqual(Q v1, Q v2)
109 template <typename Q = T, std::enable_if_t<std::is_floating_point<Q>::value,
int> = 0>
110 static constexpr Q almostEqualMaxHelper(Q v1, Q v2)
112 return std::max<Q>({ 1.0, std::fabs(v1), std::fabs(v2) });
115 template <typename Q = T, std::enable_if_t<std::is_floating_point<Q>::value,
int> = 0>
116 static constexpr bool almostEqual(Q v1, Q v2)
118 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:80
constexpr Interval(T start, T end)
Constructor for the interval.
Definition peak_ipl_interval.hpp:47
constexpr T Start() const
Get the start value (inclusive) for the interval.
Definition peak_ipl_interval.hpp:68
constexpr bool InInterval(T value) const
Check if the value is in the interval.
Definition peak_ipl_interval.hpp:94
The exception thrown when passing an invalid parameter to a function.
Definition peak_ipl_exception.hpp:80
The "peak::ipl" namespace contains the whole image processing library.
#define PEAK_IPL_NO_DISCARD
Definition peak_ipl_attribute_defines.h:25