OGRE
1.9.0
|
Class for manipulating bit patterns. More...
#include <OgreBitwise.h>
Static Public Member Functions | |
static FORCEINLINE uint16 | bswap16 (uint16 arg) |
Returns value with reversed bytes order. | |
static FORCEINLINE uint32 | bswap32 (uint32 arg) |
Returns value with reversed bytes order. | |
static FORCEINLINE uint64 | bswap64 (uint64 arg) |
Returns value with reversed bytes order. | |
static void | bswapBuffer (void *pData, size_t size) |
Reverses byte order of buffer. | |
static void | bswapChunks (void *pData, size_t size, size_t count) |
Reverses byte order of chunks in buffer, where 'size' is size of one chunk. | |
template<typename SrcT , typename DestT > | |
static DestT | convertBitPattern (SrcT srcValue, SrcT srcBitMask, DestT destBitMask) |
Takes a value with a given src bit mask, and produces another value with a desired bit mask. | |
static FORCEINLINE uint32 | firstPO2From (uint32 n) |
Returns the closest power-of-two number greater or equal to value. | |
static unsigned int | fixedToFixed (uint32 value, unsigned int n, unsigned int p) |
Convert N bit colour channel value to P bits. | |
static float | fixedToFloat (unsigned value, unsigned int bits) |
Fixed point to float. | |
static unsigned int | floatToFixed (const float value, const unsigned int bits) |
Convert floating point colour channel value between 0.0 and 1.0 (otherwise clamped) to integer of a certain number of bits. | |
static uint16 | floatToHalf (float i) |
Convert a float32 to a float16 (NV_half_float) Courtesy of OpenEXR. | |
static uint16 | floatToHalfI (uint32 i) |
Converts float in uint32 format to a a half in uint16 format. | |
template<typename T > | |
static FORCEINLINE unsigned int | getBitShift (T mask) |
Returns the number of bits a pattern must be shifted right by to remove right-hand zeros. | |
static float | halfToFloat (uint16 y) |
Convert a float16 (NV_half_float) to a float32 Courtesy of OpenEXR. | |
static uint32 | halfToFloatI (uint16 y) |
Converts a half in uint16 format to a float in uint32 format. | |
static unsigned int | intRead (const void *src, int n) |
Read a n*8 bits integer value to memory in native endian. | |
static void | intWrite (void *dest, const int n, const unsigned int value) |
Write a n*8 bits integer value to memory in native endian. | |
template<typename T > | |
static FORCEINLINE bool | isPO2 (T n) |
Determines whether the number is power-of-two or not. | |
static FORCEINLINE unsigned int | mostSignificantBitSet (unsigned int value) |
Returns the most significant bit set in a value. | |
Class for manipulating bit patterns.
Definition at line 48 of file OgreBitwise.h.
|
static |
Returns value with reversed bytes order.
Definition at line 52 of file OgreBitwise.h.
|
static |
Returns value with reversed bytes order.
Definition at line 64 of file OgreBitwise.h.
Referenced by bswap64().
|
static |
Returns value with reversed bytes order.
Definition at line 76 of file OgreBitwise.h.
References bswap32().
Reverses byte order of buffer.
Use bswap16/32/64 instead if possible.
Definition at line 96 of file OgreBitwise.h.
Reverses byte order of chunks in buffer, where 'size' is size of one chunk.
Definition at line 108 of file OgreBitwise.h.
|
static |
Takes a value with a given src bit mask, and produces another value with a desired bit mask.
Definition at line 179 of file OgreBitwise.h.
References getBitShift().
|
static |
Returns the closest power-of-two number greater or equal to value.
Definition at line 137 of file OgreBitwise.h.
|
static |
Convert N bit colour channel value to P bits.
It fills P bits with the bit pattern repeated. (this is /((1<<n)-1) in fixed point)
Definition at line 204 of file OgreBitwise.h.
Fixed point to float.
Definition at line 238 of file OgreBitwise.h.
|
static |
Convert floating point colour channel value between 0.0 and 1.0 (otherwise clamped) to integer of a certain number of bits.
Works for any value of bits between 0 and 31.
Definition at line 228 of file OgreBitwise.h.
Convert a float32 to a float16 (NV_half_float) Courtesy of OpenEXR.
Definition at line 299 of file OgreBitwise.h.
References floatToHalfI().
Converts float in uint32 format to a a half in uint16 format.
Definition at line 307 of file OgreBitwise.h.
Referenced by floatToHalf().
Returns the number of bits a pattern must be shifted right by to remove right-hand zeros.
Definition at line 160 of file OgreBitwise.h.
Referenced by convertBitPattern().
Convert a float16 (NV_half_float) to a float32 Courtesy of OpenEXR.
Definition at line 350 of file OgreBitwise.h.
References halfToFloatI().
Converts a half in uint16 format to a float in uint32 format.
Definition at line 359 of file OgreBitwise.h.
Referenced by halfToFloat().
Read a n*8 bits integer value to memory in native endian.
Definition at line 274 of file OgreBitwise.h.
Write a n*8 bits integer value to memory in native endian.
Definition at line 246 of file OgreBitwise.h.
Determines whether the number is power-of-two or not.
Definition at line 152 of file OgreBitwise.h.
Returns the most significant bit set in a value.
Definition at line 124 of file OgreBitwise.h.