Cinder  0.9.1
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
cinder::gl::TextureBase::Format Struct Reference

#include <Texture.h>

Inherited by cinder::gl::Texture1d::Format, cinder::gl::Texture2d::Format, cinder::gl::Texture3d::Format, and cinder::gl::TextureCubeMap::Format.

Public Member Functions

void setTarget (GLenum target)
 
void setTargetRect ()
 
void enableMipmapping (bool enableMipmapping=true)
 
void setBaseMipmapLevel (GLuint level)
 
void setMaxMipmapLevel (GLint level)
 
GLuint getBaseMipmapLevel () const
 
GLuint getMaxMipmapLevel () const
 
void setImmutableStorage (bool immutable=true)
 
bool isImmutableStorage () const
 
void setInternalFormat (GLint internalFormat)
 
void setAutoInternalFormat ()
 
void setDataType (GLint dataType)
 
void setAutoDataType ()
 
void setCompareMode (GLenum compareMode)
 
void setCompareFunc (GLenum compareFunc)
 
GLenum getCompareMode () const
 
GLenum getCompareFunc () const
 
void setWrap (GLenum wrapS, GLenum wrapT)
 
void setWrap (GLenum wrapS, GLenum wrapT, GLenum wrapR)
 
void setWrapS (GLenum wrapS)
 
void setWrapT (GLenum wrapT)
 
void setWrapR (GLenum wrapR)
 
void setMinFilter (GLenum minFilter)
 
void setMagFilter (GLenum magFilter)
 
void setMaxAnisotropy (GLfloat maxAnisotropy)
 
GLenum getTarget () const
 
bool hasMipmapping () const
 
GLint getInternalFormat () const
 
bool isAutoInternalFormat () const
 
GLint getDataType () const
 
bool isAutoDataType () const
 
GLenum getWrapS () const
 
GLenum getWrapT () const
 
GLenum getWrapR () const
 
GLenum getMinFilter () const
 
GLenum getMagFilter () const
 
GLfloat getMaxAnisotropy () const
 
void setIntermediatePbo (const PboRef &intermediatePbo)
 
const PboRefgetIntermediatePbo () const
 
void setBorderColor (const std::array< GLfloat, 4 > &border)
 
void setBorderColor (const ColorA &color)
 
void setSwizzleMask (const std::array< GLint, 4 > &swizzleMask)
 
void setSwizzleMask (GLint r, GLint g, GLint b, GLint a)
 
const std::array< GLint, 4 > & getSwizzleMask () const
 
const std::string & getLabel () const
 
void setLabel (const std::string &label)
 
Formatlabel (const std::string &label)
 

Protected Member Functions

 Format ()
 

Protected Attributes

GLenum mTarget
 
GLenum mWrapS
 
GLenum mWrapT
 
GLenum mWrapR
 
GLenum mMinFilter
 
GLenum mMagFilter
 
GLint mCompareMode
 
GLint mCompareFunc
 
bool mMipmapping
 
bool mMipmappingSpecified
 
bool mMinFilterSpecified
 
GLuint mBaseMipmapLevel
 
GLint mMaxMipmapLevel
 
bool mImmutableStorage
 
GLfloat mMaxAnisotropy
 
GLint mInternalFormat
 
GLint mDataType
 
bool mSwizzleSpecified
 
std::array< GLint, 4 > mSwizzleMask
 
bool mBorderSpecified
 
std::array< GLfloat, 4 > mBorderColor
 
std::string mLabel
 
PboRef mIntermediatePbo
 

Friends

class TextureBase
 

Constructor & Destructor Documentation

cinder::gl::TextureBase::Format::Format ( )
protected

Member Function Documentation

void cinder::gl::TextureBase::Format::setTarget ( GLenum  target)

Specifies the texture's target. The default is GL_TEXTURE_2D.

void cinder::gl::TextureBase::Format::setTargetRect ( )

Sets the texture's target to be GL_TEXTURE_RECTANGLE. Not available in OpenGL ES.

void cinder::gl::TextureBase::Format::enableMipmapping ( bool  enableMipmapping = true)

Enables or disables mipmapping. Default is disabled.

void cinder::gl::TextureBase::Format::setBaseMipmapLevel ( GLuint  level)

Specifies the index of the lowest defined mipmap level. Default is 0. Ignored on ES 2.

void cinder::gl::TextureBase::Format::setMaxMipmapLevel ( GLint  level)

Sets the max mipmap level. Default (expressed as -1) is derived from the size of the texture. Ignored on ES 2.

GLuint cinder::gl::TextureBase::Format::getBaseMipmapLevel ( ) const

Returns the index of the lowest defined mipmap level.

GLuint cinder::gl::TextureBase::Format::getMaxMipmapLevel ( ) const

Returns the max mipmap level.

void cinder::gl::TextureBase::Format::setImmutableStorage ( bool  immutable = true)

Sets whether the storage for the cannot be changed in the future (making glTexImage*D() calls illegal). More efficient when possible. Default is false.

bool cinder::gl::TextureBase::Format::isImmutableStorage ( ) const

Returns whether the storage for the cannot be changed in the future (making glTexImage*D() calls illegal). Default is false.

void cinder::gl::TextureBase::Format::setInternalFormat ( GLint  internalFormat)

Sets the Texture's internal format. A value of -1 implies selecting the best format for the context.

void cinder::gl::TextureBase::Format::setAutoInternalFormat ( )

Sets the Texture's internal format to be automatically selected based on the context.

void cinder::gl::TextureBase::Format::setDataType ( GLint  dataType)

Sets the data type parameter used by glTexImage2D when glTexStorage2D is unavailable. Defaults to -1 which implies automatic determination. Primary use is to pass GL_FLOAT or GL_HALF_FLOAT to create 32F or 16F textures on ES 2 when OES_texture_float is available.

void cinder::gl::TextureBase::Format::setAutoDataType ( )

Sets the Texture's data type format to be automatically selected based on the context.

void cinder::gl::TextureBase::Format::setCompareMode ( GLenum  compareMode)
void cinder::gl::TextureBase::Format::setCompareFunc ( GLenum  compareFunc)
GLenum cinder::gl::TextureBase::Format::getCompareMode ( ) const

Returns the texture comparison mode for currently bound depth texture.

GLenum cinder::gl::TextureBase::Format::getCompareFunc ( ) const

Returns the comparison operator used when GL_TEXTURE_COMPARE_MODE is set to GL_COMPARE_R_TO_TEXTURE.

void cinder::gl::TextureBase::Format::setWrap ( GLenum  wrapS,
GLenum  wrapT 
)

Sets the wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are GL_REPEAT, GL_CLAMP_TO_EDGE, etc. Default is GL_CLAMP_TO_EDGE.

void cinder::gl::TextureBase::Format::setWrap ( GLenum  wrapS,
GLenum  wrapT,
GLenum  wrapR 
)

Sets the wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are GL_REPEAT, GL_CLAMP_TO_EDGE, etc. Default is GL_CLAMP_TO_EDGE.

void cinder::gl::TextureBase::Format::setWrapS ( GLenum  wrapS)

Sets the horizontal wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are GL_REPEAT, GL_CLAMP_TO_EDGE, etc. Default is GL_CLAMP_TO_EDGE.

void cinder::gl::TextureBase::Format::setWrapT ( GLenum  wrapT)

Sets the vertical wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are GL_REPEAT, GL_CLAMP_TO_EDGE, etc. Default is GL_CLAMP_TO_EDGE.

void cinder::gl::TextureBase::Format::setWrapR ( GLenum  wrapR)

Sets the depth wrapping behavior when a texture coordinate falls outside the range of [0,1]. Possible values are GL_REPEAT, GL_CLAMP_TO_EDGE, etc. Default is GL_CLAMP_TO_EDGE.

void cinder::gl::TextureBase::Format::setMinFilter ( GLenum  minFilter)

Sets the filtering behavior when a texture is displayed at a lower resolution than its native resolution. Default is GL_LINEAR unless mipmapping is enabled, in which case GL_LINEAR_MIPMAP_LINEAR.

void cinder::gl::TextureBase::Format::setMagFilter ( GLenum  magFilter)

Sets the filtering behavior when a texture is displayed at a higher resolution than its native resolution. Default is GL_LINEAR.

void cinder::gl::TextureBase::Format::setMaxAnisotropy ( GLfloat  maxAnisotropy)

Sets the anisotropic filter amount. A value greater than 1.0 "enables" anisotropic filtering. Maximum of getMaxAnisotropyMax();.

GLenum cinder::gl::TextureBase::Format::getTarget ( ) const

Returns the texture's target.

bool cinder::gl::TextureBase::Format::hasMipmapping ( ) const

Returns whether the texture has mipmapping enabled.

GLint cinder::gl::TextureBase::Format::getInternalFormat ( ) const

Returns the Texture's internal format. A value of -1 implies automatic selection of the internal format based on the context.

bool cinder::gl::TextureBase::Format::isAutoInternalFormat ( ) const

Returns whether the Texture's internal format will be automatically selected based on the context.

GLint cinder::gl::TextureBase::Format::getDataType ( ) const

Returns the data type parameter used by glTexImage2D when glTexStorage2D is unavailable. Defaults to -1 which implies automatic determination.

bool cinder::gl::TextureBase::Format::isAutoDataType ( ) const

Returns whether the Texture's data type will be automatically selected based on the context.

GLenum cinder::gl::TextureBase::Format::getWrapS ( ) const

Returns the horizontal wrapping behavior for the texture coordinates.

GLenum cinder::gl::TextureBase::Format::getWrapT ( ) const

Returns the vertical wrapping behavior for the texture coordinates.

GLenum cinder::gl::TextureBase::Format::getWrapR ( ) const

Returns the depth wrapping behavior for the texture coordinates.

GLenum cinder::gl::TextureBase::Format::getMinFilter ( ) const

Returns the texture minifying function, which is used whenever the pixel being textured maps to an area greater than one texture element.

GLenum cinder::gl::TextureBase::Format::getMagFilter ( ) const

Returns the texture magnifying function, which is used whenever the pixel being textured maps to an area less than or equal to one texture element.

GLfloat cinder::gl::TextureBase::Format::getMaxAnisotropy ( ) const

Returns the texture anisotropic filtering amount.

void cinder::gl::TextureBase::Format::setIntermediatePbo ( const PboRef intermediatePbo)

Supplies an intermediate PBO that Texture constructors optionally make use of. A PBO of an inadequate size may result in an exception.

const PboRef& cinder::gl::TextureBase::Format::getIntermediatePbo ( ) const

Returns the optional intermediate PBO that Texture constructors may make use of.

void cinder::gl::TextureBase::Format::setBorderColor ( const std::array< GLfloat, 4 > &  border)

Sets the texture's border color. Ignored in OpenGL ES.

void cinder::gl::TextureBase::Format::setBorderColor ( const ColorA color)

Sets the texture's border color. Ignored in OpenGL ES.

void cinder::gl::TextureBase::Format::setSwizzleMask ( const std::array< GLint, 4 > &  swizzleMask)

Sets the swizzle mask corresponding to GL_TEXTURE_SWIZZLE_RGBA. Expects GL_RED through GL_ALPHA, or GL_ONE or GL_ZERO.

void cinder::gl::TextureBase::Format::setSwizzleMask ( GLint  r,
GLint  g,
GLint  b,
GLint  a 
)

Sets the swizzle mask corresponding to GL_TEXTURE_SWIZZLE_RGBA. Expects GL_RED through GL_ALPHA, or GL_ONE or GL_ZERO.

const std::array<GLint,4>& cinder::gl::TextureBase::Format::getSwizzleMask ( ) const

Returns the swizzle mask corresponding to GL_TEXTURE_SWIZZLE_RGBA.

const std::string& cinder::gl::TextureBase::Format::getLabel ( ) const

Returns the debugging label associated with the Texture.

void cinder::gl::TextureBase::Format::setLabel ( const std::string &  label)

Sets the debugging label associated with the Texture. Calls glObjectLabel() when available.

Format& cinder::gl::TextureBase::Format::label ( const std::string &  label)

Sets the debugging label associated with the Texture. Calls glObjectLabel() when available.

Friends And Related Function Documentation

friend class TextureBase
friend

Member Data Documentation

GLenum cinder::gl::TextureBase::Format::mTarget
protected
GLenum cinder::gl::TextureBase::Format::mWrapS
protected
GLenum cinder::gl::TextureBase::Format::mWrapT
protected
GLenum cinder::gl::TextureBase::Format::mWrapR
protected
GLenum cinder::gl::TextureBase::Format::mMinFilter
protected
GLenum cinder::gl::TextureBase::Format::mMagFilter
protected
GLint cinder::gl::TextureBase::Format::mCompareMode
protected
GLint cinder::gl::TextureBase::Format::mCompareFunc
protected
bool cinder::gl::TextureBase::Format::mMipmapping
protected
bool cinder::gl::TextureBase::Format::mMipmappingSpecified
protected
bool cinder::gl::TextureBase::Format::mMinFilterSpecified
protected
GLuint cinder::gl::TextureBase::Format::mBaseMipmapLevel
protected
GLint cinder::gl::TextureBase::Format::mMaxMipmapLevel
protected
bool cinder::gl::TextureBase::Format::mImmutableStorage
protected
GLfloat cinder::gl::TextureBase::Format::mMaxAnisotropy
protected
GLint cinder::gl::TextureBase::Format::mInternalFormat
protected
GLint cinder::gl::TextureBase::Format::mDataType
protected
bool cinder::gl::TextureBase::Format::mSwizzleSpecified
protected
std::array<GLint,4> cinder::gl::TextureBase::Format::mSwizzleMask
protected
bool cinder::gl::TextureBase::Format::mBorderSpecified
protected
std::array<GLfloat,4> cinder::gl::TextureBase::Format::mBorderColor
protected
std::string cinder::gl::TextureBase::Format::mLabel
protected
PboRef cinder::gl::TextureBase::Format::mIntermediatePbo
protected

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