10 #ifndef INCLUDED_IMATHCOLOR_H
11 #define INCLUDED_IMATHCOLOR_H
19 IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
163 operator= (const
Color4&
v) IMATH_NOEXCEPT;
179 operator== (const
Color4<
S>&
v) const IMATH_NOEXCEPT;
184 operator!= (const
Color4<
S>&
v) const IMATH_NOEXCEPT;
188 operator+= (const
Color4&
v) IMATH_NOEXCEPT;
192 operator+ (const
Color4&
v) const IMATH_NOEXCEPT;
196 operator-= (const
Color4&
v) IMATH_NOEXCEPT;
200 operator- (const
Color4&
v) const IMATH_NOEXCEPT;
210 operator*= (const
Color4&
v) IMATH_NOEXCEPT;
214 operator*= (
T a) IMATH_NOEXCEPT;
218 operator* (const
Color4&
v) const IMATH_NOEXCEPT;
225 operator/= (const
Color4&
v) IMATH_NOEXCEPT;
229 operator/= (
T a) IMATH_NOEXCEPT;
233 operator/ (const
Color4&
v) const IMATH_NOEXCEPT;
252 return std::numeric_limits<T>::lowest ();
270 return std::numeric_limits<T>::epsilon ();
310 std::ostream& operator<< (std::ostream&
s, const
Color4<
T>&
v);
315 operator* (S
a, const
Color4<
T>& v) IMATH_NOEXCEPT;
516 return reinterpret_cast<T *
> (
this)[i];
523 return reinterpret_cast<const T *
> (
this)[i];
627 return reinterpret_cast<T*
> (
this);
634 return reinterpret_cast<const T*
> (
this);
642 return r ==
v.r &&
g ==
v.g &&
b ==
v.b &&
a ==
v.a;
650 return r !=
v.r ||
g !=
v.g ||
b !=
v.b ||
a !=
v.a;
781 operator<< (std::ostream& s, const Color4<T>&
v)
783 return s <<
'(' <<
v.r <<
' ' <<
v.g <<
' ' <<
v.b <<
' ' <<
v.a <<
')';
790 template <
class S,
class T>
797 IMATH_INTERNAL_NAMESPACE_HEADER_EXIT
799 #endif // INCLUDED_IMATHCOLOR_H
Color3 operator+() const
Unary plus of a vector. Returns the unaltered vector.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator*=(const Color4 &v) IMATH_NOEXCEPT
Component-wise multiplication.
IMATH_HOSTDEVICE void setValue(S a, S b, S c, S d) IMATH_NOEXCEPT
Set the value.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator=(const Color4 &v) IMATH_NOEXCEPT
Assignment.
IMATH_HOSTDEVICE static constexpr T baseTypeSmallest() IMATH_NOEXCEPT
Smallest possible positive value.
IMATH_HOSTDEVICE static constexpr T baseTypeLowest() IMATH_NOEXCEPT
Largest possible negative value.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator=(const Color3 &c) IMATH_NOEXCEPT
Component-wise assignment.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator+=(const Color3 &c) IMATH_NOEXCEPT
Component-wise addition.
*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_half_bits_t half
if we're in a C-only context, alias the half bits type to half
IMATH_HOSTDEVICE T * getValue() IMATH_NOEXCEPT
Return raw pointer to the value.
GLdouble GLdouble GLdouble z
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator*=(const Vec3 &v) IMATH_NOEXCEPT
Component-wise multiplication.
GLboolean GLboolean GLboolean GLboolean a
unsigned int PackedColor
Packed 32-bit integer.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & negate() IMATH_NOEXCEPT
Component-wise multiplication by -1.
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator+=(const Vec3 &v) IMATH_NOEXCEPT
Component-wise addition.
IMATH_HOSTDEVICE static constexpr T baseTypeMax() IMATH_NOEXCEPT
Largest possible positive value.
__hostdev__ float getValue(uint32_t i) const
IMATH_HOSTDEVICE constexpr bool operator==(const Color4< S > &v) const IMATH_NOEXCEPT
Equality.
IMATH_HOSTDEVICE constexpr Vec3 operator-() const IMATH_NOEXCEPT
Component-wise multiplication by -1.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator*=(const Color3 &c) IMATH_NOEXCEPT
Component-wise multiplication.
IMATH_HOSTDEVICE Color3() IMATH_NOEXCEPT
No initialization by default.
IMATH_HOSTDEVICE constexpr bool operator!=(const Color4< S > &v) const IMATH_NOEXCEPT
Inequality.
IMATH_HOSTDEVICE constexpr Color3 operator-() const IMATH_NOEXCEPT
Component-wise multiplication by -1.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator+=(const Color4 &v) IMATH_NOEXCEPT
Component-wise addition.
IMATH_HOSTDEVICE constexpr Color3 operator*(const Color3 &c) const IMATH_NOEXCEPT
Component-wise multiplication.
IMATH_HOSTDEVICE T & operator[](int i) IMATH_NOEXCEPT
Component-wise value.
IMATH_HOSTDEVICE constexpr Vec3 operator+(const Vec3 &v) const IMATH_NOEXCEPT
Component-wise addition.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator-=(const Color4 &v) IMATH_NOEXCEPT
Component-wise subtraction.
IMATH_HOSTDEVICE constexpr Color4< T > operator*(S a, const Color4< T > &v) IMATH_NOEXCEPT
Reverse multiplication: S * Color4.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & negate() IMATH_NOEXCEPT
Component-wise multiplication by -1.
GLboolean GLboolean GLboolean b
IMATH_HOSTDEVICE static constexpr T baseTypeEpsilon() IMATH_NOEXCEPT
Smallest possible e for which 1+e != 1.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator/=(const Color3 &c) IMATH_NOEXCEPT
Component-wise division.
IMATH_HOSTDEVICE constexpr Color4 operator*(const Color4 &v) const IMATH_NOEXCEPT
Component-wise multiplication.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & negate() IMATH_NOEXCEPT
Component-wise multiplication by -1.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator-=(const Vec3 &v) IMATH_NOEXCEPT
Component-wise subtraction.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color4 & operator/=(const Color4 &v) IMATH_NOEXCEPT
Component-wise division.
#define IMATH_EXPORT_TEMPLATE_TYPE
IMATH_HOSTDEVICE constexpr Color3 operator/(const Color3 &c) const IMATH_NOEXCEPT
Component-wise division.
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLubyte GLubyte GLubyte GLubyte w
IMATH_HOSTDEVICE Color4() IMATH_NOEXCEPT
No initialization by default.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator=(const Vec3 &v) IMATH_NOEXCEPT
Assignment.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Color3 & operator-=(const Color3 &c) IMATH_NOEXCEPT
Component-wise subtraction.
IMATH_HOSTDEVICE constexpr Color4 operator-() const IMATH_NOEXCEPT
Component-wise multiplication by -1.
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 const Vec3 & operator/=(const Vec3 &v) IMATH_NOEXCEPT
Component-wise division.
IMATH_HOSTDEVICE constexpr Vec3 operator*(const Vec3 &v) const IMATH_NOEXCEPT
Component-wise multiplication.
IMATH_HOSTDEVICE constexpr Vec3 operator/(const Vec3 &v) const IMATH_NOEXCEPT
Component-wise division.
IMATH_HOSTDEVICE constexpr Color4 operator/(const Color4 &v) const IMATH_NOEXCEPT
Component-wise division.