| 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 60 of file half.h.

## Constructor & Destructor Documentation

## ◆ HalfVector4() [1/4]

constexpr impeller::HalfVector4::HalfVector4 | ( |  | ) |
| inline constexpr

Definition at line 71 of file half.h.

71 {}

## ◆ HalfVector4() [2/4]

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

Definition at line 73 of file half.h.

74 : x(ScalarToHalf(a.red)),
75 y(ScalarToHalf(a.green)),
76 z(ScalarToHalf(a.blue)),
77 w(ScalarToHalf(a.alpha)) {}

## ◆ HalfVector4() [3/4]

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

Definition at line 79 of file half.h.

80 : x(ScalarToHalf(a.x)),
81 y(ScalarToHalf(a.y)),
82 z(ScalarToHalf(a.z)),
83 w(ScalarToHalf(a.w)) {}

## ◆ HalfVector4() [4/4]

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

Definition at line 85 of file half.h.

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

## Member Function Documentation

## ◆ operator!=()

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

Definition at line 95 of file half.h.

95 {
96 return v.x != x || v.y != y || v.z != z || v.w != w;
97 }

References w, x, y, and z.

## ◆ operator==()

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

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.

## Member Data Documentation

## ◆ @1

union { ... }

## ◆ e

InternalHalf impeller::HalfVector4::e[4]

Definition at line 68 of file half.h.

## ◆ w

InternalHalf impeller::HalfVector4::w = 0

Definition at line 66 of file half.h.

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

## ◆ x

InternalHalf impeller::HalfVector4::x = 0

Definition at line 63 of file half.h.

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

## ◆ y

InternalHalf impeller::HalfVector4::y = 0

Definition at line 64 of file half.h.

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

## ◆ z

InternalHalf impeller::HalfVector4::z = 0

Definition at line 65 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

impeller::HalfVector4::x
InternalHalf x
Definition: half.h:63
impeller::ScalarToHalf
constexpr InternalHalf ScalarToHalf(Scalar f)
Convert a scalar to a half precision float.
Definition: half.h:32
impeller::HalfVector4::y
InternalHalf y
Definition: half.h:64
impeller::HalfVector4::z
InternalHalf z
Definition: half.h:65
impeller::HalfVector4::w
InternalHalf w
Definition: half.h:66