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

## Constructor & Destructor Documentation

## ◆ Half() [1/5]

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

Definition at line 43 of file half.h.

43 {}

## ◆ Half() [2/5]

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

Definition at line 45 of file half.h.

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

## ◆ Half() [3/5]

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

Definition at line 47 of file half.h.

47 : x(ScalarToHalf(value)) {}

## ◆ Half() [4/5]

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

Definition at line 49 of file half.h.

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

## ◆ Half() [5/5]

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

Definition at line 51 of file half.h.

51 : x(x) {}

## Member Function Documentation

## ◆ operator!=()

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

Definition at line 55 of file half.h.

55 { return v.x != x; }

References x.

## ◆ operator==()

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

Definition at line 53 of file half.h.

53 { return v.x == x; }

References x.

## Member Data Documentation

## ◆ x

InternalHalf impeller::Half::x = 0

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