10 #ifndef INCLUDED_IMATHINTERVAL_H
11 #define INCLUDED_IMATHINTERVAL_H
18 IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
115 template <
class T> std::ostream& operator<< (std::ostream&
s, const
Interval<
T>&
v);
168 max = std::numeric_limits<T>::lowest();
175 min = std::numeric_limits<T>::lowest();
195 if (interval.min <
min)
198 if (interval.max >
max)
206 return point >=
min && point <=
max;
213 return interval.max >=
min && interval.min <=
max;
260 operator<< (std::ostream& s, const Interval<T>&
v)
262 return s <<
'(' <<
v.min <<
' ' <<
v.max <<
')';
265 IMATH_INTERNAL_NAMESPACE_HEADER_EXIT
267 #endif // INCLUDED_IMATHINTERVAL_H
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T size() const IMATH_NOEXCEPT
Return the size of the interval. The size is (max-min). An empty box has a size of 0...
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 Interval() IMATH_NOEXCEPT
Initialize to the empty interval.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects(const T &point) const IMATH_NOEXCEPT
Return true if the given point is inside the interval, false otherwise.
T min
The minimum value of the interval.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool hasVolume() const IMATH_NOEXCEPT
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
IMATH_HOSTDEVICE void makeInfinite() IMATH_NOEXCEPT
Make the interval include the entire range of the base type.
T max
The minimum value of the interval.
bool isInfinite(const float x)
Return true if x is an infinity value (either positive infinity or negative infinity).
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 T center() const IMATH_NOEXCEPT
IMATH_HOSTDEVICE constexpr bool operator!=(const Interval< T > &src) const IMATH_NOEXCEPT
Inequality.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isEmpty() const IMATH_NOEXCEPT
IMATH_HOSTDEVICE constexpr bool operator==(const Interval< T > &src) const IMATH_NOEXCEPT
Equality.
#define IMATH_EXPORT_TEMPLATE_TYPE
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects(const Box< Vec3< T >> &b, const Line3< T > &r, Vec3< T > &ip) IMATH_NOEXCEPT
IMATH_HOSTDEVICE void extendBy(const T &point) IMATH_NOEXCEPT
Extend the interval to include the given point.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool isInfinite() const IMATH_NOEXCEPT
IMATH_HOSTDEVICE void makeEmpty() IMATH_NOEXCEPT