public |
Description
Public Static Functions
template< typename float_t , typename signed_t , typename > | |
float_t | fromSignedTo(signed_t c) |
template< typename float_t , typename unsigned_t , typename > | |
float_t | fromUnsignedTo(unsigned_t c) |
template< typename signed_t , typename float_t , typename > | |
signed_t | toSigned(float_t f) |
template< typename unsigned_t , typename float_t , typename > | |
unsigned_t | toUnsigned(float_t f) |
template< typename _T > | |
_T | degToRad(_T f) |
template< typename _T > | |
_T | radToDeg(_T f) |
uint16_t | floatToHalf(float value) |
float | halfToFloat(uint16_t value) |
Documentation
function
Geometry::Convert::fromSignedTo
public | static | inline |
template< typename float_t , typename signed_t , typename = typename std::enable_if<std::is_integral |
||
float_t fromSignedTo( | signed_t | c ) |
Convert a signed normalized fixed-point value to a floating-point value.
Parameters
- float_t
- Floating-point type (e.g. double)
- signed_t
- Signed normalized fixed-point type (e.g. char)
Returns
Floating-point value in the range [-1, 1].
See also: Equation 2.2 in OpenGL 4.3 Core Profile Specification (updated February 14, 2013)http://www.opengl.org/registry/doc/glspec43.core.20130214.pdf
Defined in Geometry/Convert.h:35
function
Geometry::Convert::fromUnsignedTo
public | static | inline |
template< typename float_t , typename unsigned_t , typename = typename std::enable_if<std::is_integral |
||
float_t fromUnsignedTo( | unsigned_t | c ) |
Convert an unsigned normalized fixed-point value to a floating-point value.
Parameters
- float_t
- Floating-point type (e.g. double)
- unsigned_t
- Unsigned normalized fixed-point type (e.g. unsigned char)
Returns
Floating-point value in the range [0, 1].
See also: Equation 2.1 in OpenGL 4.3 Core Profile Specification (updated February 14, 2013)http://www.opengl.org/registry/doc/glspec43.core.20130214.pdf
Defined in Geometry/Convert.h:57
function
Geometry::Convert::toSigned
public | static | inline |
template< typename signed_t , typename float_t , typename = typename std::enable_if<std::is_integral |
||
signed_t toSigned( | float_t | f ) |
Convert a floating-point value to a signed normalized fixed-point value.
Parameters
- signed_t
- Signed normalized fixed-point type (e.g. char)
- float_t
- Floating-point type (e.g. double)
Parameters
- f
- Floating-point value that is clamped to the range [-1, 1].
See also: Equation 2.4 in OpenGL 4.3 Core Profile Specification (updated February 14, 2013)http://www.opengl.org/registry/doc/glspec43.core.20130214.pdf
Defined in Geometry/Convert.h:76
function
Geometry::Convert::toUnsigned
public | static | inline |
template< typename unsigned_t , typename float_t , typename = typename std::enable_if<std::is_integral |
||
unsigned_t toUnsigned( | float_t | f ) |
Convert a floating-point value to an unsigned normalized fixed-point value.
Parameters
- unsigned_t
- Unsigned normalized fixed-point type (e.g. unsigned char)
- float_t
- Floating-point type (e.g. double)
Parameters
- f
- Floating-point value that is clamped to the range [0, 1].
See also: Equation 2.3 in OpenGL 4.3 Core Profile Specification (updated February 14, 2013)http://www.opengl.org/registry/doc/glspec43.core.20130214.pdf
Defined in Geometry/Convert.h:98
function
Geometry::Convert::degToRad
public | static | inline |
template< typename _T > | ||
_T degToRad( | _T | f ) |
Defined in Geometry/Convert.h:105
function
Geometry::Convert::radToDeg
public | static | inline |
template< typename _T > | ||
_T radToDeg( | _T | f ) |
Defined in Geometry/Convert.h:112
function
Geometry::Convert::floatToHalf
public | static | inline |
uint16_t floatToHalf( | float | value ) |
Convert a 32-bit floating-point value to 16-bit floating-point value encoded in a 16-bit unsigned integer.
Parameters
- value
- Floating-point value
Returns
Floating-point value as uint16_t. based on ‘https://stackoverflow.com/questions/1659440/32-bit-to-16-bit-floating-point-conversion’
Defined in Geometry/Convert.h:125
function
Geometry::Convert::halfToFloat
public | static | inline |
float halfToFloat( | uint16_t | value ) |
Convert a 16-bit floating-point value encoded in a 16-bit unsigned integer to a 32-bit floating-point value.
Parameters
- value
- Floating-point value as uint16_t
Returns
Floating-point value. based on ‘https://stackoverflow.com/questions/1659440/32-bit-to-16-bit-floating-point-conversion’
Defined in Geometry/Convert.h:157