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

## Constructor & Destructor Documentation

## ◆ Half() [1/5]

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

Definition at line 44 of file half.h.

44 {}

## ◆ Half() [2/5]

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

Definition at line 46 of file half.h.

46 : x(ScalarToHalf(static_cast<Scalar>(value))) {}
value
int32_t value
Definition: dl_golden_unittests.cc:444
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:32
impeller::Half::x
InternalHalf x
Definition: half.h:42

## ◆ Half() [3/5]

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

Definition at line 48 of file half.h.

48 : x(ScalarToHalf(value)) {}

## ◆ Half() [4/5]

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

Definition at line 50 of file half.h.

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

## ◆ Half() [5/5]

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

Definition at line 52 of file half.h.

52 : x(x) {}

## Member Function Documentation

## ◆ operator!=()

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

Definition at line 56 of file half.h.

56 { return v.x != x; }

References x.

## ◆ operator==()

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

Definition at line 54 of file half.h.

54 { return v.x == x; }

References x.

## Member Data Documentation

## ◆ x

InternalHalf impeller::Half::x = 0

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