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

## Constructor & Destructor Documentation

## ◆ HalfVector2() [1/3]

constexpr impeller::HalfVector2::HalfVector2 | ( |  | ) |
| inlineconstexpr

Definition at line 138 of file half.h.

138 {}

## ◆ HalfVector2() [2/3]

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

Definition at line 140 of file half.h.

141 : 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:132
impeller::HalfVector2::y
InternalHalf y
Definition: half.h:133

## ◆ HalfVector2() [3/3]

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

Definition at line 143 of file half.h.

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

## Member Function Documentation

## ◆ operator!=()

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

Definition at line 149 of file half.h.

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

References x, and y.

## ◆ operator==()

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

Definition at line 145 of file half.h.

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

References x, and y.

## Member Data Documentation

## ◆

union { ... }

## ◆ e

InternalHalf impeller::HalfVector2::e[2]

Definition at line 135 of file half.h.

## ◆ x

InternalHalf impeller::HalfVector2::x = 0

Definition at line 132 of file half.h.

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

## ◆ y

InternalHalf impeller::HalfVector2::y = 0

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