Flutter Engine
The Flutter Engine
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 ( )
inlineconstexpr

Definition at line 44 of file half.h.

44{}

◆ Half() [2/5]

constexpr impeller::Half::Half ( double  value)
inlineconstexpr

Definition at line 46 of file half.h.

46: x(ScalarToHalf(static_cast<Scalar>(value))) {}
uint8_t value
float Scalar
Definition: scalar.h:18
constexpr InternalHalf ScalarToHalf(Scalar f)
Convert a scalar to a half precision float.
Definition: half.h:32
InternalHalf x
Definition: half.h:42

◆ Half() [3/5]

constexpr impeller::Half::Half ( Scalar  value)
inlineconstexpr

Definition at line 48 of file half.h.

48: x(ScalarToHalf(value)) {}

◆ Half() [4/5]

constexpr impeller::Half::Half ( int  value)
inlineconstexpr

Definition at line 50 of file half.h.

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

◆ Half() [5/5]

constexpr impeller::Half::Half ( InternalHalf  x)
inlineconstexpr

Definition at line 52 of file half.h.

52: x(x) {}

Member Function Documentation

◆ operator!=()

constexpr bool impeller::Half::operator!= ( const Half v) const
inlineconstexpr

Definition at line 56 of file half.h.

56{ return v.x != x; }

◆ operator==()

constexpr bool impeller::Half::operator== ( const Half v) const
inlineconstexpr

Definition at line 54 of file half.h.

54{ return v.x == x; }

Member Data Documentation

◆ x

InternalHalf impeller::Half::x = 0

Definition at line 42 of file half.h.


The documentation for this struct was generated from the following file: