10 #ifndef INCLUDED_IMATHINTERVAL_H
11 #define INCLUDED_IMATHINTERVAL_H
18 IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
59 operator== (const
Interval<
T>&
src) const IMATH_NOEXCEPT;
62 operator!= (const
Interval<
T>&
src) const IMATH_NOEXCEPT;
120 std::ostream& operator<< (std::ostream&
s, const
Interval<
T>&
v);
176 max = std::numeric_limits<T>::lowest ();
183 min = std::numeric_limits<T>::lowest ();
191 if (point <
min)
min = point;
193 if (point >
max)
max = point;
200 if (interval.min <
min)
min = interval.min;
202 if (interval.max >
max)
max = interval.max;
209 return point >=
min && point <=
max;
216 return interval.max >=
min && interval.min <=
max;
223 if (isEmpty ())
return T (0);
253 if (
min != std::numeric_limits<T>::lowest () ||
263 operator<< (std::ostream& s, const Interval<T>&
v)
265 return s <<
'(' <<
v.min <<
' ' <<
v.max <<
')';
268 IMATH_INTERNAL_NAMESPACE_HEADER_EXIT
270 #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