Support Forum G3D Web Page |
Represents numbers on [-1, 1] in 8 bits as a signed normalized 0.8 fixed-point value using the same encoding scheme as OpenGL. More...
Public Member Functions | |
snorm8 () | |
snorm8 (const snorm8 &other) | |
snorm8 (float f) | |
Maps f to round(f * 127). More... | |
uint8 | 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 snorm8 other) const |
snorm8 | operator* (const int i) const |
snorm8 & | operator*= (const int i) |
snorm8 | operator+ (const snorm8 other) const |
snorm8 & | operator+= (const snorm8 other) |
snorm8 | operator- (const snorm8 other) const |
snorm8 & | operator-= (const snorm8 other) |
snorm8 | operator/ (const int i) const |
snorm8 & | operator/= (const int i) |
bool | operator< (const snorm8 other) const |
snorm8 | operator<< (const int i) const |
snorm8 & | operator<<= (const int i) |
bool | operator<= (const snorm8 other) const |
bool | operator== (const snorm8 other) const |
bool | operator> (const snorm8 other) const |
bool | operator>= (const snorm8 other) const |
snorm8 | operator>> (const int i) const |
snorm8 & | operator>>= (const int i) |
int8 | reinterpretAsInt8 () const |
Returns the underlying bits in this representation. More... | |
Static Public Member Functions | |
static snorm8 | fromBits (int8 b) |
Equivalent to: More... | |
static snorm8 | one () |
static snorm8 | reinterpretFrom (int8 b) |
Equivalent to: More... | |
static snorm8 | zero () |
Represents numbers on [-1, 1] in 8 bits as a signed normalized 0.8 fixed-point value using the same encoding scheme as OpenGL.
Note that arithmetic operations may over and under-flow, just like int8 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 * 127).
|
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 |