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

## Constructor & Destructor Documentation

## ◆ HalfVector2() [1/3]

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

Definition at line 136 of file half.h.

136 {}

## ◆ HalfVector2() [2/3]

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

Definition at line 138 of file half.h.

139 : x(ScalarToHalf(a.x)), y(ScalarToHalf(a.y)) {}
impeller::ScalarToHalf
constexpr InternalHalf ScalarToHalf(Scalar f)
Convert a scalar to a half precision float.
Definition: half.h:32
impeller::HalfVector2::x
InternalHalf x
Definition: half.h:130
impeller::HalfVector2::y
InternalHalf y
Definition: half.h:131

## ◆ HalfVector2() [3/3]

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

Definition at line 141 of file half.h.

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

## Member Function Documentation

## ◆ operator!=()

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

Definition at line 147 of file half.h.

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

References x, and y.

## ◆ operator==()

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

Definition at line 143 of file half.h.

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

References x, and y.

## Member Data Documentation

## ◆

union { ... }

## ◆ e

InternalHalf impeller::HalfVector2::e[2]

Definition at line 133 of file half.h.

## ◆ x

InternalHalf impeller::HalfVector2::x = 0

Definition at line 130 of file half.h.

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

## ◆ y

InternalHalf impeller::HalfVector2::y = 0

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