45# if defined(_WIN32) || defined(_WINDOWS) || defined(_MSC_VER)
48# define PTEXAPI __declspec(dllexport)
50# define PTEXAPI __declspec(dllimport)
100 union { uint32_t i;
float f; } u;
107 if (val==0)
return 0;
108 union { uint32_t i;
float f; } u;
111 if (e)
return (uint16_t)(e + (((u.i&0x7fffff) + 0x1000) >> 13));
Portable fixed-width integer types.
#define PTEX_NAMESPACE_END
Half-precision (16-bit) floating-point type.
PtexHalf & operator=(float val)
PtexHalf()
Default constructor, value is undefined.
static uint16_t fromFloat(float val)
static uint32_t h2fTable[65536]
static uint16_t fromFloat_except(uint32_t val)
Handle exceptional cases for half-to-float conversion.
static uint16_t f2hTable[512]
static float toFloat(uint16_t h)