| Flutter Impeller |

Public Member Functions | Public Attributes | List of all members
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 58 of file half.h.

## Constructor & Destructor Documentation

## ◆ HalfVector4() [1/4]

constexpr impeller::HalfVector4::HalfVector4 | ( |  | ) |
| inlineconstexpr

Definition at line 69 of file half.h.

69 {}

## ◆ HalfVector4() [2/4]

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

Definition at line 71 of file half.h.

72 : x(ScalarToHalf(a.red)),
73 y(ScalarToHalf(a.green)),
74 z(ScalarToHalf(a.blue)),
75 w(ScalarToHalf(a.alpha)) {}
impeller::ScalarToHalf
constexpr InternalHalf ScalarToHalf(Scalar f)
Convert a scalar to a half precision float.
Definition: half.h:32
impeller::HalfVector4::x
InternalHalf x
Definition: half.h:61
impeller::HalfVector4::w
InternalHalf w
Definition: half.h:64
impeller::HalfVector4::y
InternalHalf y
Definition: half.h:62
impeller::HalfVector4::z
InternalHalf z
Definition: half.h:63

## ◆ HalfVector4() [3/4]

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

Definition at line 77 of file half.h.

78 : x(ScalarToHalf(a.x)),
79 y(ScalarToHalf(a.y)),
80 z(ScalarToHalf(a.z)),
81 w(ScalarToHalf(a.w)) {}

## ◆ HalfVector4() [4/4]

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

Definition at line 83 of file half.h.

87 : 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 93 of file half.h.

93 {
94 return v.x != x || v.y != y || v.z != z || v.w != w;
95 }

References w, x, y, and z.

## ◆ operator==()

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

Definition at line 89 of file half.h.

89 {
90 return v.x == x && v.y == y && v.z == z && v.w == w;
91 }

References w, x, y, and z.

## Member Data Documentation

## ◆

union { ... }

## ◆ e

InternalHalf impeller::HalfVector4::e[4]

Definition at line 66 of file half.h.

## ◆ w

InternalHalf impeller::HalfVector4::w = 0

Definition at line 64 of file half.h.

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

## ◆ x

InternalHalf impeller::HalfVector4::x = 0

Definition at line 61 of file half.h.

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

## ◆ y

InternalHalf impeller::HalfVector4::y = 0

Definition at line 62 of file half.h.

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

## ◆ z

InternalHalf impeller::HalfVector4::z = 0

Definition at line 63 of file half.h.

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

The documentation for this struct was generated from the following file:

- impeller/geometry/half.h