Flutter Engine
The Flutter Engine
Functions
SkHalf.cpp File Reference
#include "src/base/SkHalf.h"
#include "include/private/base/SkFloatingPoint.h"
#include "src/base/SkVx.h"

Go to the source code of this file.

Functions

SkHalf SkFloatToHalf (float f)
 
float SkHalfToFloat (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