Vector4f32 Class Reference

#include <sse_vector_4f32.h>

详细描述

The class and the default constructor are always defined. The functions of this class are only defined when C4D_HAS_SSE2_CAPABILITY is set. Instances of this class must be aligned to 16 bytes. The layout in the memory is as follows: address + 0 + 1 + 2 + 3 R0 R1 R2 R3

Public Types

using  ValueType = Float32

公共成员函数

  Vector4f32 ()=default
MAXON_ATTRIBUTE_FORCE_INLINE   Vector4f32 ( Float32 f, Bool setAll=true)
MAXON_ATTRIBUTE_FORCE_INLINE   Vector4f32 ( Float32 f0, Float32 f1, Float32 f2, Float32 f3)
MAXON_ATTRIBUTE_FORCE_INLINE   Vector4f32 (const Float32 *p, Bool aligned)
MAXON_ATTRIBUTE_FORCE_INLINE void  LoadUnaligned (const Float32 *p)
MAXON_ATTRIBUTE_FORCE_INLINE void  LoadUnaligned (const Float64 *p)
MAXON_ATTRIBUTE_FORCE_INLINE void  LoadAligned (const Float32 *p)
MAXON_ATTRIBUTE_FORCE_INLINE void  LoadAligned (const Float64 *p)
MAXON_ATTRIBUTE_FORCE_INLINE void  StoreUnaligned ( Float32 *p) const
MAXON_ATTRIBUTE_FORCE_INLINE void  StoreAligned ( Float32 *p) const
MAXON_ATTRIBUTE_FORCE_INLINE Float32 operator[] ( UInt i)
MAXON_ATTRIBUTE_FORCE_INLINE Float32   operator[] ( UInt i) const
MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 operator+= (const Vector4f32 &a)
MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32   Blend (const Vector4f32 &b, const Vector4f32 &mask) const

静态公共成员函数

template<Int32 ma4, Int32 ma3, Int32 ma2, Int32 ma1>
static MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32   Shuffle (const Vector4f32 &a)
template<Int32 mb2, Int32 mb1, Int32 ma2, Int32 ma1>
static MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32   Shuffle (const Vector4f32 &a, const Vector4f32 &b)

Public Attributes

union {
    Float32     v [4]
}; 

Friends

Vector4f32   CastToVector4f32 (const Vector4i32 &a)
Vector4f32   ConvertToVector4f32 (const Vector4i32 &a)
Vector4i32   CastToVector4i32 (const Vector4f32 &a)
Vector4i32   ConvertToVector4i32 (const Vector4f32 &a)
Vector4f32   ConvertToVector4f32 (const Vector2f64 &a, const Vector2f64 &b)
Vector4f32   ConvertToVector4f32 (const Vector2f64 &a)
void  ConvertToVectors2f64 (const Vector4f32 &a, Vector2f64 &result1, Vector2f64 &result2)
MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32   operator+ (const Vector4f32 &a, const Vector4f32 &b)
MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32   operator- (const Vector4f32 &a, const Vector4f32 &b)
MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32   operator* (const Vector4f32 &a, const Vector4f32 &b)
MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32   operator* (const Vector4f32 &a, const Float32 b)
MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32   operator/ (const Vector4f32 &a, const Vector4f32 &b)
MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32   最小 (const Vector4f32 &a, const Vector4f32 &b)
MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32   最大 (const Vector4f32 &a, const Vector4f32 &b)
MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32   Clamp (const Vector4f32 &x, const Vector4f32 &a, const Vector4f32 &b)
MAXON_ATTRIBUTE_FORCE_INLINE friend void  Transpose ( Vector4f32 &a, Vector4f32 &b, Vector4f32 &c, Vector4f32 &d)

Member Typedef Documentation

◆  ValueType

using ValueType = Float32

构造函数 & 析构函数文档编制

◆  Vector4f32() [1/4]

Vector4f32 ( )
default

Constructs the object. It does not set a default value.

◆  Vector4f32() [2/4]

MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 ( Float32   f ,
Bool   setAll = true  
)
explicit

Constructs the object and sets all values to f.

参数
[in] f The value that is assigned to all vector elements.

◆  Vector4f32() [3/4]

MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 ( Float32   f0 ,
Float32   f1 ,
Float32   f2 ,
Float32   f3  
)
explicit

Constructs the object and sets all values to f0...f3.

参数
[in] f0 The value that is assigned to vector element 0.
[in] f1 The value that is assigned to vector element 1.
[in] f2 The value that is assigned to vector element 2.
[in] f3 The value that is assigned to vector element 3.

◆  Vector4f32() [4/4]

MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 ( const Float32 p ,
Bool   aligned  
)
explicit

Constructs a vector from an address in the memory.

参数
[in] p The address where the vector is loaded from.
[in] aligned Should be set to true, if #p is known to be 16-byte aligned.

成员函数文档编制

◆  LoadUnaligned() [1/2]

MAXON_ATTRIBUTE_FORCE_INLINE void LoadUnaligned ( const Float32 p )

Loads a vector from an address in the memory.

参数
[in] p The address where the vector is loaded from.

◆  LoadUnaligned() [2/2]

MAXON_ATTRIBUTE_FORCE_INLINE void LoadUnaligned ( const Float64 p )

Loads a vector from an address in the memory.

参数
[in] p The address where the vector is loaded from.

◆  LoadAligned() [1/2]

MAXON_ATTRIBUTE_FORCE_INLINE void LoadAligned ( const Float32 p )

Loads a vector from an address in the memory.

参数
[in] p The address where the vector is loaded from, must be 16-byte aligned.

◆  LoadAligned() [2/2]

MAXON_ATTRIBUTE_FORCE_INLINE void LoadAligned ( const Float64 p )

Loads a vector from an address in the memory.

参数
[in] p The address where the vector is loaded from, must be 16-byte aligned.

◆  StoreUnaligned()

MAXON_ATTRIBUTE_FORCE_INLINE void StoreUnaligned ( Float32 p ) const

Stores the contents of this vector to an address in the memory.

参数
[in] p The address where the vector is to be stored, must be 16-byte aligned.

◆  StoreAligned()

MAXON_ATTRIBUTE_FORCE_INLINE void StoreAligned ( Float32 p ) const

Stores the contents of this vector to an address in the memory.

参数
[in] p The address where the vector is to be stored, must be 16-byte aligned.

◆  operator[]() [1/2]

MAXON_ATTRIBUTE_FORCE_INLINE Float32 & operator[] ( UInt   i )

Gets component i from the vector.

参数
[in] i The index.
返回
Vector element.

◆  operator[]() [2/2]

MAXON_ATTRIBUTE_FORCE_INLINE Float32 operator[] ( UInt   i ) const

Gets component i from the vector.

参数
[in] i The index.
返回
Vector element.

◆  operator+=()

MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 & operator+= ( const Vector4f32 a )

Adds a vector to this.

参数
[in] a The vector to add.
返回
A reference to this vector.

◆  Blend()

MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 Blend ( const Vector4f32 b ,
const Vector4f32 mask  
) const

Blends this vector with another one using a mask. For each vector element, the element of this vector is chosen if the mask element is zero, and the element of the B vector is chosen if the mask element has all bits set. If only some of the mask bits are set, the result is undefined.

参数
[in] b Input vector B.
[in] mask Mask vector.
返回
Vector with elements from this or b, depending on mask.

◆  Shuffle() [1/2]

static MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 Shuffle ( const Vector4f32 a )
static

Shuffles the components of the input vector. Note that the template arguments must be numeric constants.

参数
[in] a Input vector.
Template Parameters
ma1 Decides which element of vector A becomes the new R0.
ma2 Decides which element of vector A becomes the new R1.
ma3 Decides which element of vector A becomes the new R2.
ma4 Decides which element of vector A becomes the new R3.
返回
A vector consisting of R0=A[ma1], R1=A[ma2], R2=A[ma2], R3=A[ma3]

◆  Shuffle() [2/2]

static MAXON_ATTRIBUTE_FORCE_INLINE Vector4f32 Shuffle ( const Vector4f32 a ,
const Vector4f32 b  
)
static

Shuffles the components of the input vectors. Note that the template arguments must be numeric constants and be 0 to 3.

参数
[in] a Input vector A.
[in] b Input vector B.
Template Parameters
ma1 Decides which element of vector A becomes the new R0.
ma2 Decides which element of vector A becomes the new R1.
mb1 Decides which element of vector B becomes the new R2.
mb2 Decides which element of vector B becomes the new R3.
返回
A vector consisting of R0=A[ma1], R1=A[ma2], R2=B[mb1], R3=B[mb2]

Friends And Related Function Documentation

◆  CastToVector4f32

Vector4f32 CastToVector4f32 ( const Vector4i32 a )
friend

Casts a Vector4i32 Vector4f32 vector.

返回
A Vector4f32 vector.

◆  ConvertToVector4f32 [1/3]

Vector4f32 ConvertToVector4f32 ( const Vector4i32 a )
friend

Converts a Vector4i32 Vector4f32 vector.

返回
A Vector4f32 vector.

◆  CastToVector4i32

Vector4i32 CastToVector4i32 ( const Vector4f32 a )
friend

Casts a Vector4f32 Vector4i32 vector.

返回
A Vector4i32 vector.

◆  ConvertToVector4i32

Vector4i32 ConvertToVector4i32 ( const Vector4f32 a )
friend

Converts a Vector4f32 Vector4i32 vector.

返回
A Vector4i32 vector.

◆  ConvertToVector4f32 [2/3]

Vector4f32 ConvertToVector4f32 ( const Vector2f64 a ,
const Vector2f64 b  
)
friend

Converts two Vector2f64 Vector4f32 vector.

返回
A Vector4f32 vector.

◆  ConvertToVector4f32 [3/3]

Vector4f32 ConvertToVector4f32 ( const Vector2f64 a )
friend

Converts one Vector2f64 Vector4f32 vector.

返回
A Vector4f32 vector. The two lower values are the converted members from the source vector, the two upper values are zero.

◆  ConvertToVectors2f64

void ConvertToVectors2f64 ( const Vector4f32 a ,
Vector2f64 result1 ,
Vector2f64 result2  
)
friend

◆  operator+

MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32 operator+ ( const Vector4f32 a ,
const Vector4f32 b  
)
friend

Adds two vectors.

参数
[in] a The first operand.
[in] b The second operand.
返回
The sum of a and b.

◆  operator-

MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32 operator- ( const Vector4f32 a ,
const Vector4f32 b  
)
friend

Subtracts two vectors.

参数
[in] a The first operand.
[in] b The second operand.
返回
The component-by-component result of a - b.

◆  operator* [1/2]

MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32 operator* ( const Vector4f32 a ,
const Vector4f32 b  
)
friend

Multiplies two vectors.

参数
[in] a The first operand.
[in] b The second operand.
返回
The product of a and b.

◆  operator* [2/2]

MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32 operator* ( const Vector4f32 a ,
const Float32   b  
)
friend

Multiplies a Float32 with each vector component.

参数
[in] a The first operand.
[in] b The second operand.
返回
The product of a and b.

◆  operator/

MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32 operator/ ( const Vector4f32 a ,
const Vector4f32 b  
)
friend

Divides two vectors.

参数
[in] a The first operand.
[in] b The second operand.
返回
The component-by-component result of a / b.

◆  最小

MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32 最小 ( const Vector4f32 a ,
const Vector4f32 b  
)
friend

Calculates the minimum of two vectors.

参数
[in] a Input vector A.
[in] b Input vector B.
返回
The component-by-component minimum of a and b.

◆  最大

MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32 最大 ( const Vector4f32 a ,
const Vector4f32 b  
)
friend

Calculates the maximum of two vectors.

参数
[in] a Input vector A.
[in] b Input vector B.
返回
The component-by-component maximum of a and b.

◆  Clamp

MAXON_ATTRIBUTE_FORCE_INLINE friend Vector4f32 Clamp ( const Vector4f32 x ,
const Vector4f32 a ,
const Vector4f32 b  
)
friend

Clamps all components of the input vector x to a and b.

参数
[in] x Input vector.
[in] a Minimum value.
[in] b Maximum value.
返回
The component-by-component result.

◆  Transpose

MAXON_ATTRIBUTE_FORCE_INLINE friend void Transpose ( Vector4f32 a ,
Vector4f32 b ,
Vector4f32 c ,
Vector4f32 d  
)
friend

Transposes the input vectors.

参数
[in,out] a Input / Output vector a.
[in,out] b Input / Output vector b.
[in,out] c Input / Output vector c.
[in,out] d Input / Output vector d.

Member Data Documentation

◆  v

Float32 v[4]

◆  @1089

union { ... }

The internal SSE vector.