Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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)) {}
struct MyStruct a[10]
constexpr InternalHalf ScalarToHalf(Scalar f)
Convert a scalar to a half precision float.
Definition half.h:32
InternalHalf x
Definition half.h:132
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 }

◆ 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 }

Member Data Documentation

◆ [union]

union { ... } impeller::HalfVector2

◆ 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.

◆ y

InternalHalf impeller::HalfVector2::y = 0

Definition at line 133 of file half.h.


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