Object handle for OpenGL texture formats (Read Only). More...
#include <HdlTexture.hpp>
Public Member Functions | |
int | getWidth (void) const |
int | getHeight (void) const |
int | getNumPixels (void) const |
int | getNumChannels (void) const |
int | getNumElements (void) const |
int | getAlignment (void) const |
int | getPixelSize (void) const |
virtual size_t | getRowSize (void) const |
virtual size_t | getSize (void) const |
int | getChannelDepth (void) const |
GLenum | getGLMode (void) const |
GLenum | getGLDepth (void) const |
GLenum | getMinFilter (void) const |
GLenum | getMagFilter (void) const |
int | getBaseLevel (void) const |
int | getMaxLevel (void) const |
GLenum | getSWrapping (void) const |
GLenum | getTWrapping (void) const |
bool | isCompressed (void) const |
bool | isFloatingPoint (void) const |
const HdlTextureFormatDescriptor & | getFormatDescriptor (void) const |
bool | operator== (const HdlAbstractTextureFormat &) const |
bool | operator!= (const HdlAbstractTextureFormat &) const |
bool | isCompatibleWith (const HdlAbstractTextureFormat &) const |
Check if the two formats share the same memory characteristics (sizes, number of channels, byte per pixel, internal GL mode, same mipmap levels). More... | |
HdlAbstractTextureFormat | getCompressedFormat (void) const |
Get the equivalent, but compressed, format. More... | |
HdlAbstractTextureFormat | getUncompressedFormat (void) const |
Get the equivalent, but uncompressed, format. More... | |
bool | isCorrespondingCompressedFormat (const HdlAbstractTextureFormat &) const |
Check if this and f share the same memory parameters except that the mode for f is the corresponding compressed mode of this. More... | |
virtual unsigned int | getSetting (GLenum param) const |
Obtain a setting value based on its GL name. More... | |
Static Public Member Functions | |
static int | getMaxSize (void) |
Returns the maximum size for a texture. More... | |
Protected Member Functions | |
HdlAbstractTextureFormat (int _width, int _height, GLenum _mode, GLenum _depth, GLenum _minFilter=GL_NEAREST, GLenum _magFilter=GL_NEAREST, GLenum _wraps=GL_CLAMP, GLenum _wrapt=GL_CLAMP, int _baseLevel=0, int _maxLevel=0) | |
HdlAbstractTextureFormat Construtor. More... | |
HdlAbstractTextureFormat (const HdlAbstractTextureFormat ©) | |
HdlAbstractTextureFormat Construtor. More... | |
void | setAlignment (int _alignment) |
Set the alignment for this format. More... | |
Object handle for OpenGL texture formats (Read Only).
|
protected |
HdlAbstractTextureFormat Construtor.
_width | Width of the texture. |
_height | Height of the texture. |
_mode | Mode for the texture (e.g. GL_RGB, GL_RGBA, GL_BGRA, etc.). |
_depth | Depth for the texture (e.g. GL_FLOAT, GL_UNSIGNED_BYTE, GL_INT, etc.). |
_minFilter | Minification filter (e.g. GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, GL_LINEAR_MIPMAP_NEAREST or GL_LINEAR_MIPMAP_LINEAR). |
_magFilter | Magnification filter (e.g. GL_NEAREST or GL_LINEAR, only these two options are accepted). |
_wraps | Wrapping S parameter (GL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_MIRRORED_REPEAT). |
_wrapt | Wrapping T parameter (GL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_MIRRORED_REPEAT). |
_baseLevel | Base for the mipmaps (default is 0). |
_maxLevel | Highest level for the mipmaps (default is 0, no other mipmaps than the original image). |
|
protected |
HdlAbstractTextureFormat Construtor.
copy | Copy this format. |
int HdlAbstractTextureFormat::getAlignment | ( | void | ) | const |
int HdlAbstractTextureFormat::getBaseLevel | ( | void | ) | const |
int HdlAbstractTextureFormat::getChannelDepth | ( | void | ) | const |
HdlAbstractTextureFormat HdlAbstractTextureFormat::getCompressedFormat | ( | void | ) | const |
Get the equivalent, but compressed, format.
const HdlTextureFormatDescriptor & HdlAbstractTextureFormat::getFormatDescriptor | ( | void | ) | const |
GLenum HdlAbstractTextureFormat::getGLDepth | ( | void | ) | const |
GLenum HdlAbstractTextureFormat::getGLMode | ( | void | ) | const |
int HdlAbstractTextureFormat::getHeight | ( | void | ) | const |
GLenum HdlAbstractTextureFormat::getMagFilter | ( | void | ) | const |
int HdlAbstractTextureFormat::getMaxLevel | ( | void | ) | const |
|
static |
Returns the maximum size for a texture.
GLenum HdlAbstractTextureFormat::getMinFilter | ( | void | ) | const |
int HdlAbstractTextureFormat::getNumChannels | ( | void | ) | const |
int HdlAbstractTextureFormat::getNumElements | ( | void | ) | const |
int HdlAbstractTextureFormat::getNumPixels | ( | void | ) | const |
int HdlAbstractTextureFormat::getPixelSize | ( | void | ) | const |
|
virtual |
|
virtual |
Obtain a setting value based on its GL name.
param | The GL name of the setting to be retreived. |
Available paramaters :
Parameter | Description |
---|---|
GL_TEXTURE_WIDTH | Get the width (same as HdlAbstractTextureFormat::getWidth()). |
GL_TEXTURE_HEIGHT | Get the height (same as HdlAbstractTextureFormat::getHeight()). |
GL_TEXTURE_RED_SIZE | Get the depth of the red channel in bits (same as HdlAbstractTextureFormat::getFormatDescriptor().redDepthInBits). |
GL_TEXTURE_GREEN_SIZE | Get the depth of the green channel in bits (same as HdlAbstractTextureFormat::getFormatDescriptor().greenDepthInBits). |
GL_TEXTURE_BLUE_SIZE | Get the depth of the blue channel in bits (same as HdlAbstractTextureFormat::getFormatDescriptor().blueDepthInBits). |
GL_TEXTURE_ALPHA_SIZE | Get the depth of the alpha channel in bits (same as HdlAbstractTextureFormat::getFormatDescriptor().alphaDepthInBits). |
GL_TEXTURE_LUMINANCE_SIZE | Get the depth of the luminance channel in bits (same as HdlAbstractTextureFormat::getFormatDescriptor().luminanceDepthInBits). |
GL_TEXTURE_MIN_FILTER | Get the minification parameter (same as HdlAbstractTextureFormat::getMinFilter()). |
GL_TEXTURE_MAG_FILTER | Get the magnification parameter (same as HdlAbstractTextureFormat::getMagFilter()). |
GL_TEXTURE_WRAP_S | Get the S wrapping parameter (same as HdlAbstractTextureFormat::getSWrapping()). |
GL_TEXTURE_WRAP_T | Get the T wrapping parameter (same as HdlAbstractTextureFormat::getTWrapping()). |
GL_TEXTURE_BASE_LEVEL | Get the base mipmap level (same as HdlAbstractTextureFormat::getBaseLevel()). |
GL_TEXTURE_MAX_LEVEL | Get the base mipmap level (same as HdlAbstractTextureFormat::getMaxLevel()). |
GL_GENERATE_MIPMAP | Return 1 if the mipmap will be generated. |
GL_TEXTURE_INTERNAL_FORMAT | Get the mode (same as HdlAbstractTextureFormat::getGLMode()). |
GL_TEXTURE_COMPRESSED | Return 1 if the texture is compressed, 0 otherwise (same as HdlAbstractTextureFormat::isCompressed()). |
GL_TEXTURE_COMPRESSED_IMAGE_SIZE | Will raise an exception as the format cannot communicate with the display driver. |
GL_TEXTURE_DEPTH | Get the depth (same as HdlAbstractTextureFormat::getGLDepth()). |
GL_TEXTURE_RED_TYPE | Get the red type (same as HdlAbstractTextureFormat::getFormatDescriptor().redType). |
GL_TEXTURE_GREEN_TYPE | Get the green type (same as HdlAbstractTextureFormat::getFormatDescriptor().greenType). |
GL_TEXTURE_BLUE_TYPE | Get the blue type (same as HdlAbstractTextureFormat::getFormatDescriptor().blueType). |
GL_TEXTURE_ALPHA_TYPE | Get the alpha type (same as HdlAbstractTextureFormat::getFormatDescriptor().alphaType). |
|
virtual |
GLenum HdlAbstractTextureFormat::getSWrapping | ( | void | ) | const |
GLenum HdlAbstractTextureFormat::getTWrapping | ( | void | ) | const |
HdlAbstractTextureFormat HdlAbstractTextureFormat::getUncompressedFormat | ( | void | ) | const |
Get the equivalent, but uncompressed, format.
int HdlAbstractTextureFormat::getWidth | ( | void | ) | const |
bool HdlAbstractTextureFormat::isCompatibleWith | ( | const HdlAbstractTextureFormat & | f | ) | const |
Check if the two formats share the same memory characteristics (sizes, number of channels, byte per pixel, internal GL mode, same mipmap levels).
f | Format to be compared with this. |
bool HdlAbstractTextureFormat::isCompressed | ( | void | ) | const |
bool HdlAbstractTextureFormat::isCorrespondingCompressedFormat | ( | const HdlAbstractTextureFormat & | f | ) | const |
Check if this and f share the same memory parameters except that the mode for f is the corresponding compressed mode of this.
f | Format to be compared with this. |
bool HdlAbstractTextureFormat::isFloatingPoint | ( | void | ) | const |
bool HdlAbstractTextureFormat::operator!= | ( | const HdlAbstractTextureFormat & | f | ) | const |
f | Format to be compared with this. |
bool HdlAbstractTextureFormat::operator== | ( | const HdlAbstractTextureFormat & | f | ) | const |
f | Format to be compared with this. |
|
protected |
Set the alignment for this format.
_alignment | The new alignment value. It must be either 1, 4 or 8 bytes. Any other values will result in an exception. |