Flutter Engine
The Flutter Engine
Typedefs | Functions | Variables
SkHalf.h File Reference
#include <cstdint>

Go to the source code of this file.

Typedefs

using SkHalf = uint16_t
 

Functions

float SkHalfToFloat (SkHalf h)
 
SkHalf SkFloatToHalf (float f)
 

Variables

static constexpr uint16_t SK_HalfNaN = 0x7c01
 
static constexpr uint16_t SK_HalfInfinity = 0x7c00
 
static constexpr uint16_t SK_HalfMin = 0x0400
 
static constexpr uint16_t SK_HalfMax = 0x7bff
 
static constexpr uint16_t SK_HalfEpsilon = 0x1400
 
static constexpr uint16_t SK_Half1 = 0x3C00
 

Typedef Documentation

◆ SkHalf

using SkHalf = uint16_t

Definition at line 16 of file SkHalf.h.

Function Documentation

◆ SkFloatToHalf()

SkHalf SkFloatToHalf ( float  f)

Definition at line 16 of file SkHalf.cpp.

16 {
17 if (std::isnan(f)) {
18 return SK_HalfNaN;
19 } else {
20 return to_half(skvx::Vec<1,float>(f))[0];
21 }
22}
static constexpr uint16_t SK_HalfNaN
Definition: SkHalf.h:18
SIN Vec< N, uint16_t > to_half(const Vec< N, float > &x)
Definition: SkVx.h:750
Definition: SkVx.h:83

◆ SkHalfToFloat()

float SkHalfToFloat ( SkHalf  h)

Definition at line 24 of file SkHalf.cpp.

24 {
26}
SIN Vec< N, float > from_half(const Vec< N, uint16_t > &x)
Definition: SkVx.h:790
SkScalar h

Variable Documentation

◆ SK_Half1

constexpr uint16_t SK_Half1 = 0x3C00
staticconstexpr

Definition at line 23 of file SkHalf.h.

◆ SK_HalfEpsilon

constexpr uint16_t SK_HalfEpsilon = 0x1400
staticconstexpr

Definition at line 22 of file SkHalf.h.

◆ SK_HalfInfinity

constexpr uint16_t SK_HalfInfinity = 0x7c00
staticconstexpr

Definition at line 19 of file SkHalf.h.

◆ SK_HalfMax

constexpr uint16_t SK_HalfMax = 0x7bff
staticconstexpr

Definition at line 21 of file SkHalf.h.

◆ SK_HalfMin

constexpr uint16_t SK_HalfMin = 0x0400
staticconstexpr

Definition at line 20 of file SkHalf.h.

◆ SK_HalfNaN

constexpr uint16_t SK_HalfNaN = 0x7c01
staticconstexpr

Definition at line 18 of file SkHalf.h.