| Flutter Impeller |

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

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

`#include <half.h>`

## Public Member Functions
constexpr | Half ()
constexpr | Half (double value)
constexpr | Half (Scalar value)
constexpr | Half (int value)
constexpr | Half (InternalHalf x)
constexpr bool | operator== (const Half &v) const
constexpr bool | operator!= (const Half &v) const

## Public Attributes
InternalHalf | x = 0

## Detailed Description

A storage only class for half precision floating point.

Definition at line 37 of file half.h.

## Constructor & Destructor Documentation

## ◆ Half() [1/5]

constexpr impeller::Half::Half | ( |  | ) |
| inline constexpr

Definition at line 40 of file half.h.

40 {}

## ◆ Half() [2/5]

constexpr impeller::Half::Half | ( | double | value | ) |
| inline constexpr

Definition at line 42 of file half.h.

42 : x(ScalarToHalf(static_cast<Scalar>(value))) {}

## ◆ Half() [3/5]

constexpr impeller::Half::Half | ( | Scalar | value | ) |
| inline constexpr

Definition at line 44 of file half.h.

44 : x(ScalarToHalf(value)) {}

## ◆ Half() [4/5]

constexpr impeller::Half::Half | ( | int | value | ) |
| inline constexpr

Definition at line 46 of file half.h.

46 : x(ScalarToHalf(static_cast<Scalar>(value))) {}

## ◆ Half() [5/5]

constexpr impeller::Half::Half | ( | InternalHalf | x | ) |
| inline constexpr

Definition at line 48 of file half.h.

48 : x(x) {}

## Member Function Documentation

## ◆ operator!=()

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

Definition at line 52 of file half.h.

52 { return v.x != x; }

References x.

## ◆ operator==()

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

Definition at line 50 of file half.h.

50 { return v.x == x; }

References x.

## Member Data Documentation

## ◆ x

InternalHalf impeller::Half::x = 0

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