Object handle describing an OpenGL Texture mode.
More...
#include <HdlTextureTools.hpp>
|
static int | getTypeSizeInBits (GLenum depth) |
| Return the size of the type associated with depth. More...
|
|
static int | getTypeSize (GLenum depth) |
| Return the size of the type associated with depth. More...
|
|
static void | getShuffle (const HdlTextureFormatDescriptor &dst, const HdlTextureFormatDescriptor &src, char *shuffleIndex, const int length) |
| Construct the shuffling pattern between two format. More...
|
|
static int | getBitShuffle (const HdlTextureFormatDescriptor &dst, const GLenum &dstDepth, const HdlTextureFormatDescriptor &src, const GLenum &srcDepth, char *shuffleBitIndex, const int length, bool *isBlack=NULL) |
| Construct the byte shuffling pattern between two format. More...
|
|
static void | applyBitShuffle (char *dst, const char *src, const char *shuffleBitIndex, const int length) |
| Apply the bit shuffling pattern from the source to the destination. More...
|
|
|
const GLenum | mode |
| Name of the mode (GL_RGB, GL_RGBA, etc.).
|
|
const GLenum | aliasMode |
| Name of the alias mode (simplified mode, GL_RGB, GL_RGBA, etc.).
|
|
const GLenum | uncompressedMode |
| Name of the corresponding uncompressed mode (the same as mode if not a compressed format).
|
|
const GLenum | compressedMode |
| Name of the corresponding compressed mode (the same as mode if already a compressed format).
|
|
const int | numChannels |
| Number of channels.
|
|
const GLenum | channels [HdlTextureFormatDescriptor_MaxNumChannels] |
| Channels content (GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA, GL_LUMINANCE, etc.) or GL_NONE if empty.
|
|
const int | channelsSizeInBits [HdlTextureFormatDescriptor_MaxNumChannels] |
| Size of the channels in bits or 0 if empty.
|
|
const GLenum | channelsDepth [HdlTextureFormatDescriptor_MaxNumChannels] |
| Depth associated with the channel or GL_NONE if no type is enforced or if channel is empty.
|
|
const bool | isFloatingPoint |
| If the format is in floating point.
|
|
const bool | isCompressed |
| If the format is compressed.
|
|
const bool | isSupported |
| If the format is supported.
|
|
Object handle describing an OpenGL Texture mode.
void HdlTextureFormatDescriptor::applyBitShuffle |
( |
char * |
dst, |
|
|
const char * |
src, |
|
|
const char * |
shuffleBitIndex, |
|
|
const int |
length |
|
) |
| |
|
static |
Apply the bit shuffling pattern from the source to the destination.
- Parameters
-
Construct the byte shuffling pattern between two format.
- Parameters
-
dst | The destination format. |
dstDepth | The depth associated with the destination format. |
src | The source format. |
srcDepth | The depth associated with the source format. |
shuffleBitIndex | Pointer to a buffer which will contain the bit shuffling pattern. |
length | Length of the given buffer (dst.getPixelSize() is sufficient). |
isBlack | If not null, will contain a boolean asserting that there is not correspondence between the source and the destination. |
- Returns
- The length of the pattern actually written.
This function constructs an array containing the bit index of the channels in the source from the point of view of the destination (or -1 if a channel does not exist in the source). To be used with HdlTextureFormatDescriptor::applyBitShuffle. It will raise an exception if either or both the source and the destination are floating point formats.
int HdlTextureFormatDescriptor::getChannelIndex |
( |
GLenum |
channel | ) |
const |
Get the index of a particular channel.
- Parameters
-
channel | The channel name (GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA or GL_LUMINANCE). |
- Returns
- The channel index or -1 if not found.
int HdlTextureFormatDescriptor::getChannelOffset |
( |
int |
channelIndex, |
|
|
GLenum |
depth |
|
) |
| const |
Get the channel offset/position.
- Parameters
-
channelIndex | The index of the channel |
depth | The depth associated with the current format. |
- Returns
- The channel offset in bytes or -1 if the channel does not exist.
int HdlTextureFormatDescriptor::getChannelOffsetInBits |
( |
int |
channelIndex, |
|
|
GLenum |
depth |
|
) |
| const |
Get the channel offset/position.
- Parameters
-
channelIndex | The index of the channel |
depth | The depth associated with the current format. |
- Returns
- The channel offset in bits or -1 if the channel does not exist.
int HdlTextureFormatDescriptor::getChannelSize |
( |
int |
channelIndex, |
|
|
GLenum |
depth |
|
) |
| const |
Get the size of a channel.
- Parameters
-
channelIndex | The index of the channel |
depth | The depth associated with the current format. |
- Returns
- The channel size in bytes or 0 if the channel does not exist.
int HdlTextureFormatDescriptor::getChannelSizeInBits |
( |
int |
channelIndex, |
|
|
GLenum |
depth |
|
) |
| const |
Get the size of a channel.
- Parameters
-
channelIndex | The index of the channel |
depth | The depth associated with the current format. |
- Returns
- The channel size in bits or 0 if the channel does not exist.
int HdlTextureFormatDescriptor::getPixelSize |
( |
GLenum |
depth | ) |
const |
Get the pixel size.
- Parameters
-
depth | The depth associated with the current format. |
- Returns
- The pixel size in bytes.
int HdlTextureFormatDescriptor::getPixelSizeInBits |
( |
GLenum |
depth | ) |
const |
Get the pixel size.
- Parameters
-
depth | The depth associated with the current format. |
- Returns
- The pixel size in bits.
Construct the shuffling pattern between two format.
- Parameters
-
dst | The destination format. |
src | The source format. |
shuffleIndex | Pointer to a buffer which will contain the shuffling pattern. |
length | Length of the given buffer (dst.numChannels is sufficient). |
This function constructs an array containing the index of the channels in the source from the point of view of the destination (or -1 if a channel does not exist in the source).
int HdlTextureFormatDescriptor::getTypeSize |
( |
GLenum |
depth | ) |
|
|
static |
Return the size of the type associated with depth.
- Parameters
-
depth | The depth, described as its enumerator value (e.g. GL_BYTE for GLbyte). |
- Returns
- Size of the type, in bytes.
int HdlTextureFormatDescriptor::getTypeSizeInBits |
( |
GLenum |
depth | ) |
|
|
static |
Return the size of the type associated with depth.
- Parameters
-
depth | The depth, described as its enumerator value (e.g. GL_BYTE for GLbyte). |
- Returns
- Size of the type, in bits.
bool HdlTextureFormatDescriptor::hasChannel |
( |
GLenum |
channel | ) |
const |
Returns true if the format has the required channel, false otherwise or raise an exception if the channel is unknown.
- Parameters
-
channel | The channel name (GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA or GL_LUMINANCE). |
- Returns
- True if the format has the channel.
bool HdlTextureFormatDescriptor::isDepthValid |
( |
GLenum |
depth | ) |
const |
Test if a depth is valid for the current format.
- Parameters
-
depth | The depth to be tested. |
- Returns
- True if the depth can be associated to this format.
The documentation for this class was generated from the following files: