-
首页
-
C4D R23.110 C++ SDK
Col3< T, STRIDE > Struct Template Reference
#include <vector.h>
详细描述
template<typename T, Int STRIDE = 1>
struct maxon::Col3< T, STRIDE >
A color consisting of three components R, G and B.
公共成员函数
|
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
HashInt
|
GetHashCode
() 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)
|
Member Typedef Documentation
◆
Rebind
◆
VectorStrideType
◆
ValueType
◆
ValueTypeParam
◆
Unstrided
◆
BoolType
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.
构造函数 & 析构函数文档编制
◆
Col3()
[1/9]
Initializes all vector components with 0.0.
◆
Col3()
[2/9]
Initializes all vector components with a scalar.
◆
Col3()
[3/9]
Initializes all vector components individually.
◆
Col3()
[4/9]
constexpr
Col3
|
(
|
const
Col3
< T2, S2 > &
|
v
|
)
|
|
|
explicit
constexpr
|
Initializes components from another 3d vector.
◆
Col3()
[5/9]
constexpr
Col3
|
(
|
const
Vec3
< T2, S2 > &
|
v
|
)
|
|
|
explicit
constexpr
|
◆
Col3()
[6/9]
constexpr
Col3
|
(
|
const
Col4
< T2, S2 > &
|
v
|
)
|
|
|
explicit
constexpr
|
◆
Col3()
[7/9]
constexpr
Col3
|
(
|
const
Col3
< T, S2 > &
|
v
|
)
|
|
|
constexpr
|
◆
Col3()
[8/9]
Skips initialization of vector (for better speed)
◆
Col3()
[9/9]
成员函数文档编制
◆
operator=()
constexpr
Col3
& operator=
|
(
|
const typename std::conditional<
STRIDE
==1, DummyParamType,
Col3
< T,
STRIDE
> >::type &
|
src
|
)
|
|
|
constexpr
|
◆
operator[]()
[1/2]
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.
◆
operator[]()
[2/2]
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.
◆
operator+=()
[1/2]
constexpr
Col3
& operator+=
|
(
|
const
Col3
< T2, S2 > &
|
v
|
)
|
|
|
constexpr
|
Adds two vectors.
◆
operator+=()
[2/2]
◆
operator-=()
[1/2]
constexpr
Col3
& operator-=
|
(
|
const
Col3
< T2, S2 > &
|
v
|
)
|
|
|
constexpr
|
Subtracts two vectors.
◆
operator-=()
[2/2]
◆
operator*=()
[1/4]
constexpr
Col3
& operator*=
|
(
|
const
Col3
< T2, S2 > &
|
v
|
)
|
|
|
constexpr
|
Multiplies two vectors component-wise.
◆
operator*=()
[2/4]
◆
operator*=()
[3/4]
Multiplies each vector component by a scalar.
◆
operator/=()
Divides each vector component by a scalar. The passed argument is checked for 0.0.
◆
operator*()
[1/3]
Multiplies each vector component by a scalar.
◆
operator*()
[2/3]
Multiplies each vector component by a scalar.
◆
operator/()
Divides each vector component by a scalar. The scalar value is tested for 0.0.
◆
operator*()
[3/3]
Multiplies two vectors component-wise.
◆
operator+()
Adds two vectors.
◆
operator-()
[1/2]
Subtracts vector v2 from v1.
◆
operator-()
[2/2]
Negates vector v.
◆
operator==()
[1/2]
constexpr
BoolType
operator==
|
(
|
const
Col3
< T2, S2 > &
|
v
|
)
|
const
|
|
constexpr
|
◆
operator==()
[2/2]
◆
operator!=()
[1/2]
constexpr
BoolType
operator!=
|
(
|
const
Col3
< T2, S2 > &
|
v
|
)
|
const
|
|
constexpr
|
◆
operator!=()
[2/2]
◆
GetHashCode()
constexpr
HashInt
GetHashCode
|
(
|
|
)
|
const
|
|
constexpr
|
◆
IsEqual()
Tests component-wise if the difference is no bigger than 'epsilon'.
◆
IsZero()
Checks if each component is zero.
◆
SetZero()
constexpr void SetZero
|
(
|
|
)
|
|
|
constexpr
|
Sets all components to zero.
◆
GetAverage()
constexpr T GetAverage
|
(
|
|
)
|
const
|
|
constexpr
|
Calculates the average value of 'r', 'g' and 'b'.
◆
GetSum()
constexpr T GetSum
|
(
|
|
)
|
const
|
|
constexpr
|
Calculates the sum of 'r', 'g' and 'b'.
◆
ClampMin()
Set the minimum of each component.
◆
ClampMax()
constexpr void ClampMax
|
(
|
const
Col3
< T,
STRIDE
> &
|
other
|
)
|
|
|
constexpr
|
Set the maximum of each component.
◆
Clamp01()
Returns a vector that is clamped to the range [0.0 .. 1.0].
◆
ToString()
Returns a readable string of the content.
-
参数
-
-
返回
-
The converted result.
◆
GetVector()
[1/2]
constexpr const
Vec3
<T,
STRIDE
>& GetVector
|
(
|
|
)
|
const
|
|
constexpr
|
Reinterprets the color as vector.
◆
GetVector()
[2/2]
◆
GetMin()
constexpr T GetMin
|
(
|
|
)
|
const
|
|
constexpr
|
Returns the minimum of 'r', 'g' and 'b'.
◆
GetMax()
constexpr T GetMax
|
(
|
|
)
|
const
|
|
constexpr
|
Returns the maximum of 'r', 'g' and 'b'.
◆
GetRightRotated()
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.
|
-
返回
-
Vector with rotated components.
◆
operator*=()
[4/4]
constexpr
Col3
& operator*=
|
(
|
const
Mat3
< T2 > &
|
m
|
)
|
|
|
constexpr
|
Transforms color by a matrix.
◆
NullValue()
static constexpr const
Col3
& NullValue
|
(
|
|
)
|
|
|
static
constexpr
|
Friends And Related Function Documentation
◆
operator*
Multiplies each vector component by a scalar.
◆
Abs
returns the vector with absolute value for each entry
-
参数
-
[in]
|
v1
|
input vector to work on
|
-
返回
-
component wise absolute value vector of input vector
◆
最小
Calculates the minimum of each component.
◆
最大
Calculates the maximum of each component.
◆
SetMin
Set the minimum of each component.
◆
SetMax
Set the maximum of each component.
Member Data Documentation
◆
_xpadding
◆
@1049
◆
_ypadding
◆
@1051
◆
_zpadding
◆
@1053