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

## Constructor & Destructor Documentation

## ◆ HalfVector2() [1/3]

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

Definition at line 137 of file half.h.

137 {}

## ◆ HalfVector2() [2/3]

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

Definition at line 139 of file half.h.

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

## ◆ HalfVector2() [3/3]

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

Definition at line 142 of file half.h.

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

## Member Function Documentation

## ◆ operator!=()

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

Definition at line 148 of file half.h.

148 {
149 return v.x != x || v.y != y;
150 }

References x, and y.

## ◆ operator==()

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

Definition at line 144 of file half.h.

144 {
145 return v.x == x && v.y == y;
146 }

References x, and y.

## Member Data Documentation

## ◆ @9

union { ... }

## ◆ e

InternalHalf impeller::HalfVector2::e[2]

Definition at line 134 of file half.h.

## ◆ x

InternalHalf impeller::HalfVector2::x = 0

Definition at line 131 of file half.h.

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

## ◆ y

InternalHalf impeller::HalfVector2::y = 0

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