#include "include/private/base/SkMath.h"
#include <cstdint>
#include <cstring>
Go to the source code of this file.
◆ SkScalarAs2sCompliment
◆ Sk2sComplimentAsFloat()
static float Sk2sComplimentAsFloat |
( |
int32_t |
x | ) |
|
|
inlinestatic |
Return the 2s compliment int as a float. This undos the result of SkFloatAs2sCompliment
Definition at line 66 of file SkFloatBits.h.
66 {
68}
static int32_t Sk2sComplimentToSignBit(int32_t x)
static float SkBits2Float(uint32_t bits)
◆ Sk2sComplimentToSignBit()
static int32_t Sk2sComplimentToSignBit |
( |
int32_t |
x | ) |
|
|
inlinestatic |
Convert a 2s compliment int to a sign-bit (i.e. int interpreted as float). This undoes the result of SkSignBitTo2sCompliment().
Definition at line 31 of file SkFloatBits.h.
31 {
33
35
38}
static constexpr int32_t SkLeftShift(int32_t value, int32_t shift)
static int sign(SkScalar x)
◆ SkBits2Float()
static float SkBits2Float |
( |
uint32_t |
bits | ) |
|
|
inlinestatic |
◆ SkFloat2Bits()
static uint32_t SkFloat2Bits |
( |
float |
value | ) |
|
|
inlinestatic |
◆ SkFloatAs2sCompliment()
static int32_t SkFloatAs2sCompliment |
( |
float |
x | ) |
|
|
inlinestatic |
Return the float as a 2s compliment int. Just to be used to compare floats to each other or against positive float-bit-constants (like 0). This does not return the int equivalent of the float, just something cheaper for compares-only.
Definition at line 59 of file SkFloatBits.h.
59 {
61}
static uint32_t SkFloat2Bits(float value)
static int32_t SkSignBitTo2sCompliment(int32_t x)
◆ SkSignBitTo2sCompliment()
static int32_t SkSignBitTo2sCompliment |
( |
int32_t |
x | ) |
|
|
inlinestatic |
Convert a sign-bit int (i.e. float interpreted as int) into a 2s compliement int. This also converts -0 (0x80000000) to 0. Doing this to a float allows it to be compared using normal C operators (<, <=, etc.)
Definition at line 20 of file SkFloatBits.h.