GLIP-Lib
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Glip::CoreGL::HdlAbstractTextureFormat Class Reference

Object handle for OpenGL texture formats (Read Only). More...

#include <HdlTexture.hpp>

Inheritance diagram for Glip::CoreGL::HdlAbstractTextureFormat:
Inheritance graph

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 HdlTextureFormatDescriptorgetFormatDescriptor (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 &copy)
 HdlAbstractTextureFormat Construtor. More...
 
void setAlignment (int _alignment)
 Set the alignment for this format. More...
 

Detailed Description

Object handle for OpenGL texture formats (Read Only).

Constructor & Destructor Documentation

HdlAbstractTextureFormat::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 
)
protected

HdlAbstractTextureFormat Construtor.

Parameters
_widthWidth of the texture.
_heightHeight of the texture.
_modeMode for the texture (e.g. GL_RGB, GL_RGBA, GL_BGRA, etc.).
_depthDepth for the texture (e.g. GL_FLOAT, GL_UNSIGNED_BYTE, GL_INT, etc.).
_minFilterMinification filter (e.g. GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, GL_LINEAR_MIPMAP_NEAREST or GL_LINEAR_MIPMAP_LINEAR).
_magFilterMagnification filter (e.g. GL_NEAREST or GL_LINEAR, only these two options are accepted).
_wrapsWrapping S parameter (GL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_MIRRORED_REPEAT).
_wraptWrapping T parameter (GL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_MIRRORED_REPEAT).
_baseLevelBase for the mipmaps (default is 0).
_maxLevelHighest level for the mipmaps (default is 0, no other mipmaps than the original image).
HdlAbstractTextureFormat::HdlAbstractTextureFormat ( const HdlAbstractTextureFormat copy)
protected

HdlAbstractTextureFormat Construtor.

Parameters
copyCopy this format.

Member Function Documentation

int HdlAbstractTextureFormat::getAlignment ( void  ) const
Returns
The alignment parameter in bytes.
int HdlAbstractTextureFormat::getBaseLevel ( void  ) const
Returns
The texture's base level for mipmaps.
int HdlAbstractTextureFormat::getChannelDepth ( void  ) const
Returns
The channel size in bytes.
HdlAbstractTextureFormat HdlAbstractTextureFormat::getCompressedFormat ( void  ) const

Get the equivalent, but compressed, format.

Returns
A HdlAbstractTextureFormat object instance identical to this, but mode is set to the corresponding compressed format.
const HdlTextureFormatDescriptor & HdlAbstractTextureFormat::getFormatDescriptor ( void  ) const
Returns
A constatnt reference to the descriptor of the current mode.
GLenum HdlAbstractTextureFormat::getGLDepth ( void  ) const
Returns
The texture's pixel depth.
GLenum HdlAbstractTextureFormat::getGLMode ( void  ) const
Returns
The texture's mode.
int HdlAbstractTextureFormat::getHeight ( void  ) const
Returns
The texture's height.
GLenum HdlAbstractTextureFormat::getMagFilter ( void  ) const
Returns
The texture's magnification parameter.
int HdlAbstractTextureFormat::getMaxLevel ( void  ) const
Returns
The texture's highest level for mipmaps.
int HdlAbstractTextureFormat::getMaxSize ( void  )
static

Returns the maximum size for a texture.

Returns
The size, in pixels.
GLenum HdlAbstractTextureFormat::getMinFilter ( void  ) const
Returns
The texture's minification parameter.
int HdlAbstractTextureFormat::getNumChannels ( void  ) const
Returns
The texture's channel count.
int HdlAbstractTextureFormat::getNumElements ( void  ) const
Returns
The texture's number of elements (width x height x channels).
int HdlAbstractTextureFormat::getNumPixels ( void  ) const
Returns
The texture's number of pixels (width x height).
int HdlAbstractTextureFormat::getPixelSize ( void  ) const
Returns
The pixel size in bytes.
size_t HdlAbstractTextureFormat::getRowSize ( void  ) const
virtual
Returns
The row size in bytes.
unsigned int HdlAbstractTextureFormat::getSetting ( GLenum  param) const
virtual

Obtain a setting value based on its GL name.

Parameters
paramThe GL name of the setting to be retreived.
Returns
The value of the corresponding setting or raise an Exception if any error occur.

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).
size_t HdlAbstractTextureFormat::getSize ( void  ) const
virtual
Returns
The texture's size in bytes.
GLenum HdlAbstractTextureFormat::getSWrapping ( void  ) const
Returns
The texture's S wrapping parameter.
GLenum HdlAbstractTextureFormat::getTWrapping ( void  ) const
Returns
The texture's T wrapping parameter.
HdlAbstractTextureFormat HdlAbstractTextureFormat::getUncompressedFormat ( void  ) const

Get the equivalent, but uncompressed, format.

Returns
A HdlAbstractTextureFormat object instance identical to this, but mode is set to the corresponding uncompressed format.
int HdlAbstractTextureFormat::getWidth ( void  ) const
Returns
The texture's width.
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).

Parameters
fFormat to be compared with this.
Returns
True if the two formats share the same memory characteristics (sizes, number of channels, byte per pixel, internal GL mode, same mipmap levels).
bool HdlAbstractTextureFormat::isCompressed ( void  ) const
Returns
True if the texture is compressed.
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.

Parameters
fFormat to be compared with this.
Returns
True if this and f share the same memory parameters except that the mode for f is the corresponding compressed mode of this.
bool HdlAbstractTextureFormat::isFloatingPoint ( void  ) const
Returns
True if the texture is of floatting point type.
bool HdlAbstractTextureFormat::operator!= ( const HdlAbstractTextureFormat f) const
Parameters
fFormat to be compared with this.
Returns
True if the two format have at least one different parameter.
bool HdlAbstractTextureFormat::operator== ( const HdlAbstractTextureFormat f) const
Parameters
fFormat to be compared with this.
Returns
True if the two format have the same parameters.
void HdlAbstractTextureFormat::setAlignment ( int  _alignment)
protected

Set the alignment for this format.

Parameters
_alignmentThe new alignment value. It must be either 1, 4 or 8 bytes. Any other values will result in an exception.

The documentation for this class was generated from the following files: