| Flutter Impeller |

Public Member Functions | Public Attributes | List of all members
impeller::HalfVector2 Struct Reference

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

`#include <half.h>`

## Public Member Functions
constexpr | HalfVector2 ()
constexpr | HalfVector2 (const Vector2 &a)
constexpr | HalfVector2 (InternalHalf x, InternalHalf y)
constexpr bool | operator== (const HalfVector2 &v) const
constexpr bool | operator!= (const HalfVector2 &v) const

## Public Attributes
union {
struct {
InternalHalf x = 0
InternalHalf y = 0
} |
InternalHalf e [2]
}; |

## Detailed Description

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

Definition at line 125 of file half.h.

## Constructor & Destructor Documentation

## ◆ HalfVector2() [1/3]

constexpr impeller::HalfVector2::HalfVector2 | ( |  | ) |
| inline constexpr

Definition at line 134 of file half.h.

134 {}

## ◆ HalfVector2() [2/3]

constexpr impeller::HalfVector2::HalfVector2 | ( | const Vector2 & | a | ) |
| inline constexpr

Definition at line 136 of file half.h.

137 : x(ScalarToHalf(a.x)), y(ScalarToHalf(a.y)) {}

## ◆ HalfVector2() [3/3]

constexpr impeller::HalfVector2::HalfVector2 | ( | InternalHalf | x,
|  | InternalHalf | y
| ) |  |
| inline constexpr

Definition at line 139 of file half.h.

139 : x(x), y(y){};

## Member Function Documentation

## ◆ operator!=()

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

Definition at line 145 of file half.h.

145 {
146 return v.x != x || v.y != y;
147 }

References x, and y.

## ◆ operator==()

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

Definition at line 141 of file half.h.

141 {
142 return v.x == x && v.y == y;
143 }

References x, and y.

## Member Data Documentation

## ◆ @9

union { ... }

## ◆ e

InternalHalf impeller::HalfVector2::e[2]

Definition at line 131 of file half.h.

## ◆ x

InternalHalf impeller::HalfVector2::x = 0

Definition at line 128 of file half.h.

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

## ◆ y

InternalHalf impeller::HalfVector2::y = 0

Definition at line 129 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::HalfVector2::x
InternalHalf x
Definition: half.h:128
impeller::ScalarToHalf
constexpr InternalHalf ScalarToHalf(Scalar f)
Convert a scalar to a half precision float.
Definition: half.h:28
impeller::HalfVector2::y
InternalHalf y
Definition: half.h:129