#include <col.h>
A color consisting of three components R, G and B.
Public Types | |
| template<typename U > | |
| using | Rebind = Col3< U, STRIDE > |
| using | VectorStrideType = std::integral_constant< Int, STRIDE > |
| using | ValueType = T |
| using | ValueTypeParam = typename ByValueParam< T >::type |
| using | Unstrided = Col3< T, 1 > |
| using | BoolType = decltype(T()==T()) |
Public Member Functions | |
| constexpr | Col3 () |
| constexpr | Col3 (ValueTypeParam in) |
| constexpr | Col3 (ValueTypeParam ix, ValueTypeParam iy, ValueTypeParam iz) |
| template<typename T2 , Int S2> | |
| constexpr | Col3 (const Col3< T2, S2 > &v) |
| template<typename T2 , Int S2> | |
| constexpr | Col3 (const Vec3< T2, S2 > &v) |
| template<typename T2 , Int S2> | |
| constexpr | Col3 (const Col4< T2, S2 > &v) |
| template<Int S2> | |
| constexpr | Col3 (const Col3< T, S2 > &v) |
| constexpr | Col3 (ENUM_DONT_INITIALIZE v) |
| constexpr MAXON_IMPLICIT | Col3 (const typename std::conditional< STRIDE==1, DummyParamType, Col3 >::type &src) |
| constexpr Col3 & | operator= (const typename std::conditional< STRIDE==1, DummyParamType, Col3 >::type &src) |
| T & | operator[] (Int l) |
| ValueTypeParam | operator[] (Int l) const |
| template<typename T2 , Int S2> | |
| constexpr Col3 & | operator+= (const Col3< T2, S2 > &v) |
| constexpr Col3 & | operator+= (const Col3 &v) |
| template<typename T2 , Int S2> | |
| constexpr Col3 & | operator-= (const Col3< T2, S2 > &v) |
| constexpr Col3 & | operator-= (const Col3 &v) |
| template<typename T2 , Int S2> | |
| constexpr Col3 & | operator*= (const Col3< T2, S2 > &v) |
| constexpr Col3 & | operator*= (const Col3 &v) |
| constexpr Col3 & | operator*= (ValueTypeParam s) |
| constexpr Col3 & | operator/= (ValueTypeParam s) |
| constexpr Unstrided | operator* (ValueTypeParam s) const |
| template<typename S > | |
| constexpr Col3< typename MultiplicativePromotion< T, S, STD_IS_REPLACEMENT(scalar, S)>::type, 1 > | operator* (S s) const |
| constexpr Unstrided | operator/ (ValueTypeParam s) const |
| constexpr Unstrided | operator* (const Col3 &v) const |
| constexpr Unstrided | operator+ (const Col3 &v) const |
| constexpr Unstrided | operator- (const Col3 &v) const |
| constexpr Unstrided | operator- () const |
| template<typename T2 , Int S2> | |
| constexpr BoolType | operator== (const Col3< T2, S2 > &v) const |
| constexpr BoolType | operator== (const Col3 &v) const |
| template<typename T2 , Int S2> | |
| constexpr BoolType | operator!= (const Col3< T2, S2 > &v) const |
| constexpr BoolType | operator!= (const Col3 &v) const |
| constexpr BoolType | operator<= (const Col3 &v) const |
| constexpr BoolType | operator>= (const Col3 &v) const |
| constexpr BoolType | operator< (const Col3 &v) const |
| constexpr BoolType | operator> (const Col3 &v) const |
| constexpr HashInt | GetHashCode () const |
| UniqueHash | GetUniqueHashCode () const |
| constexpr BoolType | IsEqual (const Col3 &other, ValueTypeParam epsilon) const |
| constexpr BoolType | IsZero () const |
| constexpr void | SetZero () |
| constexpr T | GetAverage () const |
| constexpr T | GetSum () const |
| constexpr void | ClampMin (const Col3 &other=Col3()) |
| constexpr void | ClampMax (const Col3 &other) |
| constexpr Unstrided | Clamp01 () const |
| String | ToString (const FormatStatement *formatStatement=nullptr) const |
| constexpr const Vec3< T, STRIDE > & | GetVector () const |
| constexpr Vec3< T, STRIDE > & | GetVector () |
| constexpr T | GetMin () const |
| constexpr T | GetMax () const |
| constexpr Unstrided | GetRightRotated (Int rots) const |
| template<typename T2 > | |
| constexpr Col3 & | operator*= (const Mat3< T2 > &m) |
Static Public Member Functions | |
| static constexpr MAXON_ATTRIBUTE_FORCE_INLINE const Col3 & | DefaultValue () |
Public Attributes | |
| union { | |
| T r | |
| T _xpadding [STRIDE] | |
| }; | |
| union { | |
| T g | |
| T _ypadding [STRIDE] | |
| }; | |
| union { | |
| T b | |
| T _zpadding [STRIDE] | |
| }; | |
Friends | |
| constexpr friend Unstrided | operator* (ValueTypeParam s, const Col3 &v) |
| constexpr friend Unstrided | Abs (const Col3 &v1) |
| constexpr friend Unstrided | Min (const Col3 &a, const Col3 &other) |
| constexpr friend Unstrided | Max (const Col3 &a, const Col3 &other) |
| constexpr friend void | SetMin (Col3 &a, const Col3 &other) |
| constexpr friend void | SetMax (Col3 &a, const Col3 &other) |
| using VectorStrideType = std::integral_constant<Int, STRIDE> |
| using ValueType = T |
| using ValueTypeParam = typename ByValueParam<T>::type |
| using BoolType = decltype(T() == T()) |
The type returned by comparisons. If the template argument for T is a SIMD type, this will be a SIMD type, too, which contains the per-element results.
|
constexpr |
Initializes all vector components with 0.0.
|
explicitconstexpr |
Initializes all vector components with a scalar.
|
explicitconstexpr |
Initializes all vector components individually.
Initializes components from another 3d vector.
|
explicitconstexpr |
Skips initialization of vector (for better speed)
|
constexpr |
|
constexpr |
| T& operator[] | ( | Int | l | ) |
Accesses vector component: index 0 is 'r', index 1 is 'g', index 2 is 'b'. All other values must not be used and will crash.
| ValueTypeParam operator[] | ( | Int | l | ) | const |
Accesses vector component: index 0 is 'r', index 1 is 'g', index 2 is 'b'. All other values must not be used and will crash.
Multiplies two vectors component-wise.
|
constexpr |
Multiplies each vector component by a scalar.
|
constexpr |
Divides each vector component by a scalar. The passed argument is checked for 0.0.
|
constexpr |
Multiplies each vector component by a scalar.
|
constexpr |
Multiplies each vector component by a scalar.
|
constexpr |
Divides each vector component by a scalar. The scalar value is tested for 0.0.
Multiplies two vectors component-wise.
Subtracts vector v2 from v1.
|
constexpr |
Negates vector v.
Compares this color with v. Note that this doesn't define a total order but just a partial order, so for a pair of colors it can happen that neither {v <= w} nor {v >= w}.
| [in] | v | Comparison color. |
Compares this color with v. Note that this doesn't define a total order but just a partial order, so for a pair of colors it can happen that neither {v <= w} nor {v >= w}.
| [in] | v | Comparison color. |
Compares this color with v. Note that this doesn't define a total order but just a partial order, so for a pair of colors it can happen that neither {v < w} nor {v > w} nor {v == w}. Also note that {v < w} is not the same as {v <= w && v != w}.
| [in] | v | Comparison color. |
Compares this color with v. Note that this doesn't define a total order but just a partial order, so for a pair of colors it can happen that neither {v < w} nor {v > w} nor {v == w}. Also note that {v > w} is not the same as {v >= w && v != w}.
| [in] | v | Comparison color. |
|
constexpr |
| UniqueHash GetUniqueHashCode | ( | ) | const |
|
constexpr |
Tests component-wise if the difference is no bigger than 'epsilon'.
|
constexpr |
Checks if each component is zero.
|
constexpr |
Sets all components to zero.
|
constexpr |
Calculates the average value of 'r', 'g' and 'b'.
|
constexpr |
Calculates the sum of 'r', 'g' and 'b'.
Set the minimum of each component.
Set the maximum of each component.
|
constexpr |
Returns a vector that is clamped to the range [0.0 .. 1.0].
| String ToString | ( | const FormatStatement * | formatStatement = nullptr | ) | const |
Returns a readable string of the content.
| [in] | formatStatement | Nullptr or additional formatting instruction. See also Formatting Floating point values. |
|
constexpr |
Returns the minimum of 'r', 'g' and 'b'.
|
constexpr |
Returns the maximum of 'r', 'g' and 'b'.
Returns a vector where the components have been rotated to the right (in the usual (r, g, b)-representation). E.g., with a value of 1 for rots, the result will be (b, r, g).
| [in] | rots | Number of rotations, may be negative. The result depends only on the number modulo 3. |
|
staticconstexpr |
|
friend |
Multiplies each vector component by a scalar.
Returns the vector with absolute value for each entry.
| [in] | v1 | Input vector to work on. |
|
friend |
Calculates the minimum of each component.
|
friend |
Calculates the maximum of each component.
Set the minimum of each component.
Set the maximum of each component.
| T r |
| T _xpadding[STRIDE] |
| union { ... } |
| T g |
| T _ypadding[STRIDE] |
| union { ... } |
| T b |
| T _zpadding[STRIDE] |
| union { ... } |