Go to the source code of this file.
Functions | |
| forcedinline uint32 | swapByteOrder (uint32 n) throw () |
| Swaps the byte-order in an integer from little to big-endianness or vice-versa. | |
| uint16 | swapByteOrder (const uint16 n) throw () |
| Swaps the byte-order of a 16-bit short. | |
| uint64 | swapByteOrder (const uint64 value) throw () |
| uint16 | swapIfBigEndian (const uint16 v) throw () |
| Swaps the byte order of a 16-bit int if the CPU is big-endian. | |
| uint32 | swapIfBigEndian (const uint32 v) throw () |
| Swaps the byte order of a 32-bit int if the CPU is big-endian. | |
| uint64 | swapIfBigEndian (const uint64 v) throw () |
| Swaps the byte order of a 64-bit int if the CPU is big-endian. | |
| uint16 | swapIfLittleEndian (const uint16 v) throw () |
| Swaps the byte order of a 16-bit int if the CPU is little-endian. | |
| uint32 | swapIfLittleEndian (const uint32 v) throw () |
| Swaps the byte order of a 32-bit int if the CPU is little-endian. | |
| uint64 | swapIfLittleEndian (const uint64 v) throw () |
| Swaps the byte order of a 64-bit int if the CPU is little-endian. | |
| uint32 | littleEndianInt (const char *const bytes) throw () |
| Turns 4 bytes into a little-endian integer. | |
| uint16 | littleEndianShort (const char *const bytes) throw () |
| Turns 2 bytes into a little-endian integer. | |
| uint32 | bigEndianInt (const char *const bytes) throw () |
| Turns 4 bytes into a big-endian integer. | |
| uint16 | bigEndianShort (const char *const bytes) throw () |
| Turns 2 bytes into a big-endian integer. | |
| int | littleEndian24Bit (const char *const bytes) throw () |
| Converts 3 little-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits). | |
| int | bigEndian24Bit (const char *const bytes) throw () |
| Converts 3 big-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits). | |
| void | littleEndian24BitToChars (const int value, char *const destBytes) throw () |
| Copies a 24-bit number to 3 little-endian bytes. | |
| void | bigEndian24BitToChars (const int value, char *const destBytes) throw () |
| Copies a 24-bit number to 3 big-endian bytes. | |
| int | roundDoubleToInt (const double value) throw () |
| Fast floating-point-to-integer conversion. | |
| int | roundDoubleToIntAccurate (const double value) throw () |
| Fast floating-point-to-integer conversion. | |
| int | roundFloatToInt (const float value) throw () |
| Fast floating-point-to-integer conversion. | |
|
|
Swaps the byte-order in an integer from little to big-endianness or vice-versa.
|
|
|
Swaps the byte-order of a 16-bit short.
|
|
|
|
|
|
Swaps the byte order of a 16-bit int if the CPU is big-endian.
|
|
|
Swaps the byte order of a 32-bit int if the CPU is big-endian.
|
|
|
Swaps the byte order of a 64-bit int if the CPU is big-endian.
|
|
|
Swaps the byte order of a 16-bit int if the CPU is little-endian.
|
|
|
Swaps the byte order of a 32-bit int if the CPU is little-endian.
|
|
|
Swaps the byte order of a 64-bit int if the CPU is little-endian.
|
|
|
Turns 4 bytes into a little-endian integer.
|
|
|
Turns 2 bytes into a little-endian integer.
|
|
|
Turns 4 bytes into a big-endian integer.
|
|
|
Turns 2 bytes into a big-endian integer.
|
|
|
Converts 3 little-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits).
|
|
|
Converts 3 big-endian bytes into a signed 24-bit value (which is sign-extended to 32 bits).
|
|
||||||||||||
|
Copies a 24-bit number to 3 little-endian bytes.
|
|
||||||||||||
|
Copies a 24-bit number to 3 big-endian bytes.
|
|
|
Fast floating-point-to-integer conversion. This is faster than using the normal c++ cast to convert a double to an int, and it will round the value to the nearest integer, rather than rounding it down like the normal cast does. Note that this routine gets its speed at the expense of some accuracy, and when rounding values whose floating point component is exactly 0.5, odd numbers and even numbers will be rounded up or down differently. For a more accurate conversion, see roundDoubleToIntAccurate(). |
|
|
Fast floating-point-to-integer conversion. This is a slightly slower and slightly more accurate version of roundDoubleToInt(). It works fine for values above zero, but negative numbers are rounded the wrong way. |
|
|
Fast floating-point-to-integer conversion. This is faster than using the normal c++ cast to convert a float to an int, and it will round the value to the nearest integer, rather than rounding it down like the normal cast does. Note that this routine gets its speed at the expense of some accuracy, and when rounding values whose floating point component is exactly 0.5, odd numbers and even numbers will be rounded up or down differently. |