Flutter Impeller
impeller::HalfVector4 Struct Reference

A storage only class for half precision floating point vector 4. More...

#include <half.h>

Public Member Functions

constexpr HalfVector4 ()
 
constexpr HalfVector4 (const Color &a)
 
constexpr HalfVector4 (const Vector4 &a)
 
constexpr HalfVector4 (InternalHalf x, InternalHalf y, InternalHalf z, InternalHalf w)
 
constexpr bool operator== (const HalfVector4 &v) const
 
constexpr bool operator!= (const HalfVector4 &v) const
 

Public Attributes

union {
   struct {
      InternalHalf   x = 0
 
      InternalHalf   y = 0
 
      InternalHalf   z = 0
 
      InternalHalf   w = 0
 
   } 
 
   InternalHalf   e [4]
 
}; 
 

Detailed Description

A storage only class for half precision floating point vector 4.

Definition at line 56 of file half.h.

Constructor & Destructor Documentation

◆ HalfVector4() [1/4]

constexpr impeller::HalfVector4::HalfVector4 ( )
inlineconstexpr

Definition at line 67 of file half.h.

67 {}

◆ HalfVector4() [2/4]

constexpr impeller::HalfVector4::HalfVector4 ( const Color a)
inlineconstexpr

Definition at line 69 of file half.h.

70  : x(ScalarToHalf(a.red)),
71  y(ScalarToHalf(a.green)),
72  z(ScalarToHalf(a.blue)),
73  w(ScalarToHalf(a.alpha)) {}

◆ HalfVector4() [3/4]

constexpr impeller::HalfVector4::HalfVector4 ( const Vector4 a)
inlineconstexpr

Definition at line 75 of file half.h.

76  : x(ScalarToHalf(a.x)),
77  y(ScalarToHalf(a.y)),
78  z(ScalarToHalf(a.z)),
79  w(ScalarToHalf(a.w)) {}

◆ HalfVector4() [4/4]

constexpr impeller::HalfVector4::HalfVector4 ( InternalHalf  x,
InternalHalf  y,
InternalHalf  z,
InternalHalf  w 
)
inlineconstexpr

Definition at line 81 of file half.h.

85  : x(x), y(y), z(z), w(w) {}

Member Function Documentation

◆ operator!=()

constexpr bool impeller::HalfVector4::operator!= ( const HalfVector4 v) const
inlineconstexpr

Definition at line 91 of file half.h.

91  {
92  return v.x != x || v.y != y || v.z != z || v.w != w;
93  }

References w, x, y, and z.

◆ operator==()

constexpr bool impeller::HalfVector4::operator== ( const HalfVector4 v) const
inlineconstexpr

Definition at line 87 of file half.h.

87  {
88  return v.x == x && v.y == y && v.z == z && v.w == w;
89  }

References w, x, y, and z.

Member Data Documentation

◆ @1

union { ... }

◆ e

InternalHalf impeller::HalfVector4::e[4]

Definition at line 64 of file half.h.

◆ w

InternalHalf impeller::HalfVector4::w = 0

Definition at line 62 of file half.h.

Referenced by operator!=(), std::operator<<(), and operator==().

◆ x

InternalHalf impeller::HalfVector4::x = 0

Definition at line 59 of file half.h.

Referenced by operator!=(), std::operator<<(), and operator==().

◆ y

InternalHalf impeller::HalfVector4::y = 0

Definition at line 60 of file half.h.

Referenced by operator!=(), std::operator<<(), and operator==().

◆ z

InternalHalf impeller::HalfVector4::z = 0

Definition at line 61 of file half.h.

Referenced by operator!=(), std::operator<<(), and operator==().


The documentation for this struct was generated from the following file:
impeller::HalfVector4::x
InternalHalf x
Definition: half.h:59
impeller::ScalarToHalf
constexpr InternalHalf ScalarToHalf(Scalar f)
Convert a scalar to a half precision float.
Definition: half.h:28
impeller::HalfVector4::y
InternalHalf y
Definition: half.h:60
impeller::HalfVector4::z
InternalHalf z
Definition: half.h:61
impeller::HalfVector4::w
InternalHalf w
Definition: half.h:62