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

#include <Texture.h>

Inherits cinder::gl::TextureBase::Format.

Public Member Functions

 Format ()
 
Formattarget (GLenum target)
 
Formatmipmap (bool enableMipmapping=true)
 
FormatmaxAnisotropy (float maxAnisotropy)
 
FormatinternalFormat (GLint internalFormat)
 
FormatdataType (GLint dataType)
 
Formatwrap (GLenum wrap)
 
FormatwrapS (GLenum wrapS)
 
FormatwrapT (GLenum wrapT)
 
FormatwrapR (GLenum wrapR)
 
FormatminFilter (GLenum minFilter)
 
FormatmagFilter (GLenum magFilter)
 
FormatcompareMode (GLenum compareMode)
 
FormatcompareFunc (GLenum compareFunc)
 
FormatswizzleMask (const std::array< GLint, 4 > &swizzleMask)
 
FormatswizzleMask (GLint r, GLint g, GLint b, GLint a)
 
FormatloadTopDown (bool loadTopDown=true)
 
FormatimmutableStorage (bool immutable=true)
 
FormatintermediatePbo (const PboRef &intermediatePbo)
 
Formatlabel (const std::string &label)
 
Formatdeleter (const std::function< void(Texture2d *)> &sharedPtrDeleter)
 
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)
 

Protected Attributes

bool mLoadTopDown
 
std::function< void(Texture2d *)> mDeleter
 
friend Texture2d
 
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
 

Constructor & Destructor Documentation

cinder::gl::Texture2d::Format::Format ( )

Default constructor, sets the target to GL_TEXTURE_2D, wrap to GL_CLAMP, disables mipmapping, the internal format to "automatic".

Member Function Documentation

Format& cinder::gl::Texture2d::Format::target ( GLenum  target)

Chaining functions for Format class.

Format& cinder::gl::Texture2d::Format::mipmap ( bool  enableMipmapping = true)
Format& cinder::gl::Texture2d::Format::maxAnisotropy ( float  maxAnisotropy)

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

Format& cinder::gl::Texture2d::Format::internalFormat ( GLint  internalFormat)

Specifies the internal format for the Texture, used by glTexImage2D or glTexStorage2D when available. Defaults to -1 which implies automatic determination.

Format& cinder::gl::Texture2d::Format::dataType ( GLint  dataType)

Specifies 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.

Format& cinder::gl::Texture2d::Format::wrap ( GLenum  wrap)
Format& cinder::gl::Texture2d::Format::wrapS ( GLenum  wrapS)
Format& cinder::gl::Texture2d::Format::wrapT ( GLenum  wrapT)
Format& cinder::gl::Texture2d::Format::wrapR ( GLenum  wrapR)
Format& cinder::gl::Texture2d::Format::minFilter ( GLenum  minFilter)
Format& cinder::gl::Texture2d::Format::magFilter ( GLenum  magFilter)
Format& cinder::gl::Texture2d::Format::compareMode ( GLenum  compareMode)
Format& cinder::gl::Texture2d::Format::compareFunc ( GLenum  compareFunc)

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

Format& cinder::gl::Texture2d::Format::swizzleMask ( const std::array< GLint, 4 > &  swizzleMask)
Format& cinder::gl::Texture2d::Format::swizzleMask ( GLint  r,
GLint  g,
GLint  b,
GLint  a 
)
Format& cinder::gl::Texture2d::Format::loadTopDown ( bool  loadTopDown = true)

Specifies whether the Texture should store scanlines top-down in memory. Default is false. Also marks Texture as top-down when true.

Format& cinder::gl::Texture2d::Format::immutableStorage ( bool  immutable = true)

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

Format& cinder::gl::Texture2d::Format::intermediatePbo ( const PboRef intermediatePbo)
Format& cinder::gl::Texture2d::Format::label ( const std::string &  label)

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

Format& cinder::gl::Texture2d::Format::deleter ( const std::function< void(Texture2d *)> &  sharedPtrDeleter)

Sets a custom deleter for destruction of the shared_ptr<Texture2d>

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

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

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

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

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

Enables or disables mipmapping. Default is disabled.

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

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

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

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
inherited

Returns the index of the lowest defined mipmap level.

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

Returns the max mipmap level.

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

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
inherited

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)
inherited

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

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

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

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

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 ( )
inherited

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

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

Returns the texture comparison mode for currently bound depth texture.

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

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 
)
inherited

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 
)
inherited

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)
inherited

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)
inherited

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)
inherited

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)
inherited

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)
inherited

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)
inherited

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

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

Returns the texture's target.

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

Returns whether the texture has mipmapping enabled.

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

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
inherited

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

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

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
inherited

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

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

Returns the horizontal wrapping behavior for the texture coordinates.

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

Returns the vertical wrapping behavior for the texture coordinates.

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

Returns the depth wrapping behavior for the texture coordinates.

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

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
inherited

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
inherited

Returns the texture anisotropic filtering amount.

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

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
inherited

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

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

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

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

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

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

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 
)
inherited

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
inherited

Returns the swizzle mask corresponding to GL_TEXTURE_SWIZZLE_RGBA.

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

Returns the debugging label associated with the Texture.

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

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

Member Data Documentation

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

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