Support Forum G3D Web Page |
Represents numbers on [-1, 1] in 16 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL. More...
Public Member Functions | |
snorm16 () | |
snorm16 (const snorm16 &other) | |
snorm16 (float f) | |
Maps f to round(f * 32767). More... | |
int16 | bits () const |
Returns the underlying bits in this representation. More... | |
operator float () const | |
Returns a number on [-1.0f, 1.0f]. More... | |
bool | operator!= (const snorm16 other) const |
snorm16 | operator* (const int i) const |
snorm16 & | operator*= (const int i) |
snorm16 | operator+ (const snorm16 other) const |
snorm16 & | operator+= (const snorm16 other) |
snorm16 | operator- (const snorm16 other) const |
snorm16 & | operator-= (const snorm16 other) |
snorm16 | operator/ (const int i) const |
snorm16 & | operator/= (const int i) |
bool | operator< (const snorm16 other) const |
snorm16 | operator<< (const int i) const |
snorm16 & | operator<<= (const int i) |
bool | operator<= (const snorm16 other) const |
bool | operator== (const snorm16 other) const |
bool | operator> (const snorm16 other) const |
bool | operator>= (const snorm16 other) const |
snorm16 | operator>> (const int i) const |
snorm16 & | operator>>= (const int i) |
int16 | reinterpretAsInt16 () const |
Returns the underlying bits in this representation. More... | |
Static Public Member Functions | |
static snorm16 | fromBits (int16 b) |
Equivalent to: More... | |
static snorm16 | one () |
static snorm16 | reinterpretFrom (int16 b) |
Equivalent to: More... | |
static snorm16 | zero () |
Represents numbers on [-1, 1] in 16 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL.
Note that arithmetic operations may over and under-flow, just like int16 arithmetic.
OpenGL specifications can be found here: <www.opengl.org/registry/specs/ARB/shading_language_packing.txt>
|
inline |
|
inline |
|
inlineexplicit |
Maps f to round(f * 32767).
|
inline |
|
inlinestatic |
|
inline |
Returns a number on [-1.0f, 1.0f].
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |