Support Forum G3D Web Page |
Represents numbers on [0, 1] in 16 bits as an unsigned normalized 0.8 fixed-point value using the same encoding scheme as OpenGL. More...
Public Member Functions | |
unorm16 () | |
unorm16 (const unorm16 &other) | |
unorm16 (const class Any &a) | |
unorm16 (float f) | |
Maps f to round(f * 65535). More... | |
unorm16 (double f) | |
uint16 | bits () const |
Returns the underlying bits in this representation. More... | |
operator double () const | |
operator float () const | |
Returns a number on [0.0f, 1.0f]. More... | |
bool | operator!= (const unorm16 other) const |
unorm16 | operator* (const int i) const |
unorm16 & | operator*= (const int i) |
unorm16 | operator+ (const unorm16 other) const |
unorm16 & | operator+= (const unorm16 other) |
unorm16 | operator- (const unorm16 other) const |
unorm16 & | operator-= (const unorm16 other) |
unorm16 | operator/ (const int i) const |
unorm16 & | operator/= (const int i) |
bool | operator< (const unorm16 other) const |
unorm16 | operator<< (const int i) const |
unorm16 & | operator<<= (const int i) |
bool | operator<= (const unorm16 other) const |
bool | operator== (const unorm16 other) const |
bool | operator> (const unorm16 other) const |
bool | operator>= (const unorm16 other) const |
unorm16 | operator>> (const int i) const |
unorm16 & | operator>>= (const int i) |
uint16 | reinterpretAsUInt16 () const |
Returns the underlying bits in this representation. More... | |
class Any | toAny () const |
Static Public Member Functions | |
static unorm16 | fromBits (uint16 b) |
Equivalent to: More... | |
static unorm16 | one () |
static unorm16 | reinterpretFrom (uint16 b) |
Equivalent to: More... | |
static unorm16 | zero () |
Represents numbers on [0, 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 uint16 arithmetic.
OpenGL specifications can be found here: http://www.opengl.org/registry/specs/ARB/shading_language_packing.txt
|
inline |
|
inline |
|
explicit |
|
inlineexplicit |
Maps f to round(f * 65535).
|
inlineexplicit |
|
inline |
Returns the underlying bits in this representation.
Equivalent to:
Referenced by G3D::Vector2unorm16::hashCode().
|
inlinestatic |
|
inline |
|
inline |
Returns a number on [0.0f, 1.0f].
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
class Any G3D::unorm16::toAny | ( | ) | const |
|
inlinestatic |