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

Object handle for OpenGL texture formats. More...

#include <HdlTexture.hpp>

Inheritance diagram for Glip::CoreGL::HdlTextureFormat:
Inheritance graph

Public Member Functions

 HdlTextureFormat (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)
 HdlTextureFormat Construtor. More...
 
 HdlTextureFormat (const HdlAbstractTextureFormat &fmt)
 HdlTextureFormat Construtor. More...
 
void setWidth (int w)
 Sets the texture's width. More...
 
void setHeight (int h)
 Sets the texture's height. More...
 
void setSize (int w, int h)
 Sets the format size. More...
 
void setGLMode (GLenum md)
 Sets the texture's mode. More...
 
void setGLDepth (GLenum dp)
 Sets the texture's pixel depth. More...
 
void setMinFilter (GLenum mf)
 Sets the texture's minification parameter. More...
 
void setMagFilter (GLenum mf)
 Sets the texture's magnification parameter. More...
 
void setBaseLevel (int l)
 Sets the texture's base level for mipmaps. More...
 
void setMaxLevel (int l)
 Sets the texture's highest level for mipmaps. More...
 
void setSWrapping (GLenum m)
 Sets the texture's S wrapping parameter. More...
 
void setTWrapping (GLenum m)
 Sets the texture's T wrapping parameter. More...
 
const HdlAbstractTextureFormatoperator= (const HdlAbstractTextureFormat &)
 Copy operator. More...
 
void setSetting (GLenum param, unsigned int value)
 Set parameter, this function will raise an Exception if any errors occur. More...
 
- Public Member Functions inherited from Glip::CoreGL::HdlAbstractTextureFormat
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 HdlTextureFormat getTextureFormat (GLuint texID)
 Obtain the format from another texture. More...
 
- Static Public Member Functions inherited from Glip::CoreGL::HdlAbstractTextureFormat
static int getMaxSize (void)
 Returns the maximum size for a texture. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Glip::CoreGL::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)
 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.

Constructor & Destructor Documentation

HdlTextureFormat::HdlTextureFormat ( 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 
)

HdlTextureFormat 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).
HdlTextureFormat::HdlTextureFormat ( const HdlAbstractTextureFormat fmt)

HdlTextureFormat Construtor.

Parameters
fmtSource format.

Member Function Documentation

HdlTextureFormat HdlTextureFormat::getTextureFormat ( GLuint  texID)
static

Obtain the format from another texture.

Parameters
texIDThe ID of the texture targeted (must compatible with GL_TEXTURE_2D).
Returns
A HdlTextureFormat describing the internal format of the texture.
const HdlAbstractTextureFormat & HdlTextureFormat::operator= ( const HdlAbstractTextureFormat copy)

Copy operator.

Parameters
copyThe format to copy.
Returns
This object.
void HdlTextureFormat::setBaseLevel ( int  l)

Sets the texture's base level for mipmaps.

Parameters
lThe new base level (must be greater than 0).
void HdlTextureFormat::setGLDepth ( GLenum  dp)

Sets the texture's pixel depth.

Parameters
dpThe new depth for the texture (e.g. GL_FLOAT, GL_UNSIGNED_BYTE, GL_INT, etc.).
void HdlTextureFormat::setGLMode ( GLenum  md)

Sets the texture's mode.

Parameters
mdThe new mode for the texture (e.g. GL_RGB, GL_RGBA, GL_BGRA, etc.).
void HdlTextureFormat::setHeight ( int  h)

Sets the texture's height.

Parameters
hThe new height.
void HdlTextureFormat::setMagFilter ( GLenum  mf)

Sets the texture's magnification parameter.

Parameters
mfThe new magnification filter (e.g. GL_NEAREST or GL_LINEAR, only these two options are accepted).
void HdlTextureFormat::setMaxLevel ( int  l)

Sets the texture's highest level for mipmaps.

Parameters
lThe new highest level (must be greater than 0).
void HdlTextureFormat::setMinFilter ( GLenum  mf)

Sets the texture's minification parameter.

Parameters
mfThe new 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).
void HdlTextureFormat::setSetting ( GLenum  param,
unsigned int  value 
)

Set parameter, this function will raise an Exception if any errors occur.

Parameters
paramThe GL name of the paramater to set.
valueThe value to assign to the parameter.

Available paramaters :

Parameter Description
GL_TEXTURE_WIDTH Set the width (same as HdlTextureFormat::setWidth()).
GL_TEXTURE_HEIGHT Set the height (same as HdlTextureFormat::setHeight()).
GL_TEXTURE_MIN_FILTER Set the minification parameter (same as HdlTextureFormat::setMinFilter()).
GL_TEXTURE_MAG_FILTER Set the magnification parameter (same as HdlTextureFormat::setMagFilter()).
GL_TEXTURE_WRAP_S Set the S wrapping parameter (same as HdlTextureFormat::setSWrapping()).
GL_TEXTURE_WRAP_T Set the T wrapping parameter (same as HdlTextureFormat::setTWrapping()).
GL_TEXTURE_BASE_LEVEL Set the base mipmap level (same as HdlTextureFormat::setBaseLevel()).
GL_TEXTURE_MAX_LEVEL Set the base mipmap level (same as HdlTextureFormat::setMaxLevel()).
GL_TEXTURE_INTERNAL_FORMAT Set the mode (same as HdlTextureFormat::setGLMode()).
GL_TEXTURE_DEPTH Set the depth (same as HdlTextureFormat::setGLDepth()).
void HdlTextureFormat::setSize ( int  w,
int  h 
)

Sets the format size.

Parameters
wThe new width.
hThe new height.
void HdlTextureFormat::setSWrapping ( GLenum  m)

Sets the texture's S wrapping parameter.

Parameters
mThe new S wrapping parameter (e.g. GL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_MIRRORED_REPEAT)
void HdlTextureFormat::setTWrapping ( GLenum  m)

Sets the texture's T wrapping parameter.

Parameters
mThe new T wrapping parameter (e.g. GL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_REPEAT, GL_MIRRORED_REPEAT)
void HdlTextureFormat::setWidth ( int  w)

Sets the texture's width.

Parameters
wThe new width.

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