Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Wraps an OpenGL texture object representing and managing all the supported texture types. More...
#include <Texture.hpp>
Classes | |
class | SetupParams |
SetupParams wraps all the parameters needed to crate a Texture. More... | |
Public Member Functions | |
Texture (const String &image_path, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false) | |
Constructs a 1D, 2D, 3D or Cubemap texture from the specified file. More... | |
Texture (const Image *image, ETextureFormat format=TF_RGBA, bool mipmaps=true, bool border=false) | |
Constructs a 1D, 2D, 3D or Cubemap texture from the specified image. More... | |
Texture (int width, ETextureFormat format=TF_RGBA, bool border=false) | |
Constructs an empty 1D texture. More... | |
Texture (int width, int height, ETextureFormat format=TF_RGBA, bool border=false) | |
Constructs an empty 2D texture. More... | |
Texture (int width, int height, int depth, ETextureFormat format=TF_RGBA, bool border=false) | |
Constructs an empty 3D texture. More... | |
Texture () | |
Constructs an null texture that can be initialized later using one of the prepareTexture* () functions or calling createTexture(). More... | |
~Texture () | |
Destructor. More... | |
TexParameter * | getTexParameter () |
The TexParameter object associated to a Texture. More... | |
const TexParameter * | getTexParameter () const |
The TexParameter object associated to a Texture. More... | |
BufferObject * | bufferObject () |
The buffer object bound to a buffer object texture. More... | |
const BufferObject * | bufferObject () const |
The buffer object bound to a buffer object texture. More... | |
void | destroyTexture () |
Destroys the GL texture object if managed() is true (default). More... | |
bool | createTexture () |
Creates a texture using the parameters specified by the last prepareTexture* () called. More... | |
bool | createTexture (ETextureDimension tex_dimension, ETextureFormat tex_format, int w, int h, int d, bool border, BufferObject *bo, int samples, bool fixedsamplelocations) |
Creates an empty texture, with no mipmaps, of the specified type, format and dimensions. More... | |
bool | setMipLevel (int mip_level, const Image *img, bool gen_mipmaps) |
Copies the texture image to the specified mip-maping level. More... | |
void | prepareTexture1D (int width, ETextureFormat format, bool border=false) |
Prepares for creation an empty 1D texture. More... | |
bool | createTexture1D (int width, ETextureFormat format, bool border=false) |
Creates an empty 1D texture. More... | |
void | prepareTexture1D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
Prepares for creation a 1D texture from the specified file. More... | |
bool | createTexture1D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
Creates a 1D texture from the specified file. More... | |
void | prepareTexture1D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
Prepares for creation a 1D texture from the specified image. More... | |
bool | createTexture1D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
Creates a 1D texture from the specified image. More... | |
void | prepareTexture2D (int width, int height, ETextureFormat format, bool border=false) |
Prepares for creation an empty 2D texture. More... | |
bool | createTexture2D (int width, int height, ETextureFormat format, bool border=false) |
Creates an empty 2D texture. More... | |
void | prepareTexture2D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
Prepares for creation a 2D texture from the specified file. More... | |
bool | createTexture2D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
Creates a 2D texture from the specified file. More... | |
void | prepareTexture2D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
Prepares for creation a 2D texture from the specified image. More... | |
bool | createTexture2D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
Creates a 2D texture from the specified image. More... | |
void | prepareTexture3D (int width, int height, int depth, ETextureFormat format, bool border=false) |
Prepares for creation an empty 3D texture. More... | |
bool | createTexture3D (int width, int height, int depth, ETextureFormat format, bool border=false) |
Creates an empty 3D texture. More... | |
void | prepareTexture3D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
Prepares for creation a 3D texture from the specified file. More... | |
bool | createTexture3D (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
Creates a 3D texture from the specified file. More... | |
void | prepareTexture3D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
Prepares for creation a 3D texture from the specified image. More... | |
bool | createTexture3D (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
Creates a 3D texture from the specified image. More... | |
void | prepareTextureCubemap (int width, int height, ETextureFormat format, bool border=false) |
Prepares for creation an empty cubemap texture. More... | |
bool | createTextureCubemap (int width, int height, ETextureFormat format, bool border=false) |
Creates an empty cubemap texture. More... | |
void | prepareTextureCubemap (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
Prepares for creation a cubemap texture from the specified file. More... | |
bool | createTextureCubemap (const String &image_path, ETextureFormat format, bool mipmaps=true, bool border=false) |
Creates creation a cubemap texture from the specified file. More... | |
void | prepareTextureCubemap (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
Prepares for creation a cubemap texture from the specified image. More... | |
bool | createTextureCubemap (const Image *image, ETextureFormat format, bool mipmaps=true, bool border=false) |
Creates a cubemap texture from the specified image. More... | |
void | prepareTexture1DArray (int width, int count, ETextureFormat format) |
Prepares for creation an empty 1D array texture. More... | |
bool | createTexture1DArray (int width, int count, ETextureFormat format) |
Creates an empty 1D array texture. More... | |
void | prepareTexture1DArray (const String &image_path, ETextureFormat format, bool mipmaps=true) |
Prepares for creation a 1d texture array from the specified file. More... | |
bool | createTexture1DArray (const String &image_path, ETextureFormat format, bool mipmaps=true) |
Creates a 1d texture array from the specified file. More... | |
void | prepareTexture1DArray (const Image *image, ETextureFormat format, bool mipmaps=true) |
Prepares for creation a 1d texture array from the specified image. More... | |
bool | createTexture1DArray (const Image *image, ETextureFormat format, bool mipmaps=true) |
Creates a 1d texture array from the specified image. More... | |
void | prepareTexture2DArray (int width, int height, int count, ETextureFormat format) |
Prepares for creation an empty 2D array texture. More... | |
bool | createTexture2DArray (int width, int height, int count, ETextureFormat format) |
Creates an empty 2D array texture. More... | |
void | prepareTexture2DArray (const String &image_path, ETextureFormat format, bool mipmaps=true) |
Prepares for creation a 2d texture array from the specified file. More... | |
bool | createTexture2DArray (const String &image_path, ETextureFormat format, bool mipmaps=true) |
Creates a 2d texture array from the specified file. More... | |
void | prepareTexture2DArray (const Image *image, ETextureFormat format, bool mipmaps=true) |
Prepares for creation a 2d texture array from the specified image. More... | |
bool | createTexture2DArray (const Image *image, ETextureFormat format, bool mipmaps=true) |
Creates a 2d texture array from the specified image. More... | |
void | prepareTextureRectangle (int width, int height, ETextureFormat format) |
Prepares for creation an empty texture rectangle. More... | |
bool | createTextureRectangle (int width, int height, ETextureFormat format) |
Creates an empty texture rectangle. More... | |
void | prepareTextureRectangle (const String &image_path, ETextureFormat format) |
Prepares for creation a texture rectangle from the specified file. More... | |
bool | createTextureRectangle (const String &image_path, ETextureFormat format) |
Creates a texture rectangle from the specified file. More... | |
void | prepareTextureRectangle (const Image *image, ETextureFormat format) |
Prepares for creation a texture rectangle from the specified image. More... | |
bool | createTextureRectangle (const Image *image, ETextureFormat format) |
Creates a texture rectangle from the specified image. More... | |
void | prepareTextureBuffer (vl::ETextureFormat format, BufferObject *bo) |
Prepares a texture buffer texture. More... | |
bool | createTextureBuffer (vl::ETextureFormat format, BufferObject *bo) |
Creates a texture buffer texture. More... | |
void | prepareTexture2DMultisample (int width, int height, vl::ETextureFormat format, int samples, bool fixedsamplelocations) |
Prepares a 2D multisample texture. More... | |
bool | createTexture2DMultisample (int width, int height, vl::ETextureFormat format, int samples, bool fixedsamplelocations) |
Creates a 2D multisample texture. More... | |
void | prepareTexture2DMultisampleArray (int width, int height, int depth, vl::ETextureFormat format, int samples, bool fixedsamplelocations) |
Prepares a 3D multisample texture. More... | |
bool | createTexture2DMultisampleArray (int width, int height, int depth, vl::ETextureFormat format, int samples, bool fixedsamplelocations) |
Creates a 3D multisample texture. More... | |
void | setHandle (unsigned int id, bool managed=true) |
OpenGL texture handle as returned by glGenTextures(). More... | |
unsigned int | handle () const |
OpenGL texture handle as returned by glGenTextures(). More... | |
void | setManaged (bool managed) |
If managed is true the texture will be automatically destroyed when the vl::Texture is destroyed or destroyTexture() is called. More... | |
bool | managed () const |
If managed is true the texture will be automatically destroyed when the vl::Texture is destroyed or destroyTexture() is called. More... | |
void | setDimension (ETextureDimension dimension) |
The texture type (1d, 2d, cubemap etc.) as specified by the target parameter of glTexImage*(). More... | |
ETextureDimension | dimension () const |
The texture type (1d, 2d, cubemap etc.) as specified by the target parameter of glTexImage*(). More... | |
void | setInternalFormat (ETextureFormat format) |
The texture internal format as pecified by the internalFormat parameter of glTexImage*(). More... | |
ETextureFormat | internalFormat () const |
The texture internal format as pecified by the internalFormat parameter of glTexImage*(). More... | |
void | setWidth (int x) |
The horizontal dimension of the texture in texels. More... | |
int | width () const |
The horizontal dimension of the texture in texels. More... | |
void | setHeight (int y) |
The vertical dimension of the texture in texels. More... | |
int | height () const |
The vertical dimension of the texture in texels. More... | |
void | setDepth (int z) |
The z dimension of the texture in texels. More... | |
int | depth () const |
The z dimension of the texture in texels. More... | |
void | setBorder (bool border) |
Whether the texture has a 1 pixel texture border or not. More... | |
bool | border () const |
Whether the texture has a 1 pixel texture border or not. More... | |
void | setSamples (int samples) |
The number of samples of a multisample texture. More... | |
int | samples () const |
The number of samples of a multisample texture. More... | |
void | setFixedSamplesLocation (bool fixed) |
Whether the samples location is fixed for a a multisample texture. More... | |
bool | fixedSamplesLocation () const |
Whether the samples location is fixed for a a multisample texture. More... | |
void | setSetupParams (SetupParams *setup_params) |
See SetupParams. More... | |
const SetupParams * | setupParams () const |
See SetupParams. More... | |
SetupParams * | setupParams () |
See SetupParams. More... | |
bool | isValid () const |
Returns true if the current texture configuration seems valid. More... | |
bool | isDepthTexture () const |
Returns true if the texture is a depth or depth/stencil textre. More... | |
void | clone (const Texture &other) |
Copies all the texture parameters form the specified texture, including the OpenGL texture handle. More... | |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Static Public Member Functions | |
static bool | supports (ETextureDimension tex_dimension, ETextureFormat tex_format, int mip_level, EImageDimension img_dimension, int w, int h, int d, bool border, int samples, bool fixedsamplelocations, bool verbose) |
Checks whether the specified texture type, format and dimension combination is supported by the current OpenGL driver. More... | |
static bool | isCompressedFormat (int format) |
Returns true if the specified format is compressed. More... | |
Protected Attributes | |
unsigned int | mHandle |
bool | mManaged |
ref< TexParameter > | mTexParameter |
ref< SetupParams > | mSetupParams |
ref< BufferObject > | mBufferObject |
ETextureFormat | mFormat |
ETextureDimension | mDimension |
int | mWidth |
int | mHeight |
int | mDepth |
int | mSamples |
bool | mBorder |
bool | mFixedSamplesLocation |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Friends | |
class | TextureImageUnit |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Wraps an OpenGL texture object representing and managing all the supported texture types.
Use the Texture::prepareTexture*() functions when you want to defer the creation of OpenGL texture object for example in cases where you don't have yet an OpenGL context available. Use Texture::createTexture*() functions when you have an OpenGL context available and want to create immediately the GL texture objects.
References
Definition at line 178 of file Texture.hpp.
Texture::Texture | ( | const String & | image_path, |
ETextureFormat | format = TF_RGBA , |
||
bool | mipmaps = true , |
||
bool | border = false |
||
) |
Constructs a 1D, 2D, 3D or Cubemap texture from the specified file.
Definition at line 453 of file Texture.cpp.
References border(), vl::Log::bug(), createTexture(), vl::Image::dimension(), vl::Log::error(), vl::ref< T >::get(), vl::ID_1D, vl::ID_2D, vl::ID_3D, vl::ID_Cubemap, vl::Image::isValid(), vl::loadImage(), mTexParameter, prepareTexture1D(), prepareTexture2D(), prepareTexture3D(), and prepareTextureCubemap().
Texture::Texture | ( | const Image * | image, |
ETextureFormat | format = TF_RGBA , |
||
bool | mipmaps = true , |
||
bool | border = false |
||
) |
Constructs a 1D, 2D, 3D or Cubemap texture from the specified image.
Definition at line 425 of file Texture.cpp.
References vl::Log::bug(), createTexture(), vl::Image::dimension(), vl::Log::error(), vl::ID_1D, vl::ID_2D, vl::ID_3D, vl::ID_Cubemap, vl::Image::isValid(), mTexParameter, prepareTexture1D(), prepareTexture2D(), prepareTexture3D(), and prepareTextureCubemap().
Texture::Texture | ( | int | width, |
ETextureFormat | format = TF_RGBA , |
||
bool | border = false |
||
) |
Constructs an empty 1D texture.
Definition at line 392 of file Texture.cpp.
References createTexture(), vl::Log::error(), mTexParameter, NULL, and vl::TD_TEXTURE_1D.
Texture::Texture | ( | int | width, |
int | height, | ||
ETextureFormat | format = TF_RGBA , |
||
bool | border = false |
||
) |
Constructs an empty 2D texture.
Definition at line 403 of file Texture.cpp.
References createTexture(), vl::Log::error(), mTexParameter, NULL, and vl::TD_TEXTURE_2D.
Texture::Texture | ( | int | width, |
int | height, | ||
int | depth, | ||
ETextureFormat | format = TF_RGBA , |
||
bool | border = false |
||
) |
Constructs an empty 3D texture.
Definition at line 414 of file Texture.cpp.
References createTexture(), vl::Log::error(), mTexParameter, NULL, and vl::TD_TEXTURE_3D.
Texture::Texture | ( | ) |
Constructs an null texture that can be initialized later using one of the prepareTexture*
() functions or calling createTexture().
Definition at line 483 of file Texture.cpp.
References mTexParameter.
Texture::~Texture | ( | ) |
Destructor.
Definition at line 369 of file Texture.cpp.
References destroyTexture(), mBufferObject, mFixedSamplesLocation, mHandle, mManaged, mSamples, mSetupParams, mTexParameter, NULL, setBorder(), setDepth(), setDimension(), setHeight(), setInternalFormat(), setWidth(), vl::TD_TEXTURE_UNKNOWN, and vl::TF_UNKNOWN.
|
inline |
Whether the texture has a 1 pixel texture border or not.
Definition at line 747 of file Texture.hpp.
Referenced by createTexture(), setMipLevel(), and Texture().
|
inline |
The buffer object bound to a buffer object texture.
Definition at line 287 of file Texture.hpp.
Referenced by createTexture().
|
inline |
The buffer object bound to a buffer object texture.
Definition at line 290 of file Texture.hpp.
void Texture::clone | ( | const Texture & | other | ) |
Copies all the texture parameters form the specified texture, including the OpenGL texture handle.
Mainly useful when you want to use the same texture object with different texture parameters.
Definition at line 1191 of file Texture.cpp.
References mBorder, mBufferObject, mDepth, mDimension, mFixedSamplesLocation, mFormat, mHandle, mHeight, mSamples, mSetupParams, mTexParameter, mWidth, and NULL.
bool Texture::createTexture | ( | ) |
Creates a texture using the parameters specified by the last prepareTexture*
() called.
Definition at line 1083 of file Texture.cpp.
References vl::Texture::SetupParams::border(), border(), bufferObject(), vl::Texture::SetupParams::depth(), vl::Texture::SetupParams::dimension(), vl::Log::error(), vl::Texture::SetupParams::format(), vl::Texture::SetupParams::genMipmaps(), vl::Texture::SetupParams::height(), vl::Texture::SetupParams::image(), vl::loadImage(), mSetupParams, NULL, samples(), vl::Texture::SetupParams::setImage(), setMipLevel(), vl::Object::setObjectName(), setupParams(), vl::TF_UNKNOWN, VL_CHECK, VL_CHECK_OGL, and vl::Texture::SetupParams::width().
Referenced by vl::Rendering::fillRenderQueue(), and Texture().
bool Texture::createTexture | ( | ETextureDimension | tex_dimension, |
ETextureFormat | tex_format, | ||
int | w, | ||
int | h, | ||
int | d, | ||
bool | border, | ||
BufferObject * | bo, | ||
int | samples, | ||
bool | fixedsamplelocations | ||
) |
Creates an empty texture, with no mipmaps, of the specified type, format and dimensions.
Definition at line 706 of file Texture.cpp.
References vl::Log::bug(), destroyTexture(), vl::Log::error(), vl::getGLErrorString(), vl::BufferObject::handle(), vl::ID_None, mBufferObject, mFixedSamplesLocation, mHandle, mSamples, mSetupParams, NULL, samples(), setBorder(), setDepth(), setDimension(), setHeight(), setInternalFormat(), setWidth(), supports(), vl::TD_TEXTURE_1D, vl::TD_TEXTURE_1D_ARRAY, vl::TD_TEXTURE_2D, vl::TD_TEXTURE_2D_ARRAY, vl::TD_TEXTURE_2D_MULTISAMPLE, vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY, vl::TD_TEXTURE_3D, vl::TD_TEXTURE_BUFFER, vl::TD_TEXTURE_CUBE_MAP, vl::TD_TEXTURE_RECTANGLE, VL_CHECK, VL_CHECK_OGL, and VL_TRAP.
|
inline |
Creates an empty 1D texture.
Definition at line 322 of file Texture.hpp.
|
inline |
Creates a 1D texture from the specified file.
Definition at line 336 of file Texture.hpp.
|
inline |
Creates a 1D texture from the specified image.
Definition at line 354 of file Texture.hpp.
|
inline |
Creates an empty 1D array texture.
Definition at line 511 of file Texture.hpp.
|
inline |
Creates a 1d texture array from the specified file.
Definition at line 525 of file Texture.hpp.
|
inline |
Creates a 1d texture array from the specified image.
Definition at line 543 of file Texture.hpp.
|
inline |
Creates an empty 2D texture.
Definition at line 369 of file Texture.hpp.
|
inline |
Creates a 2D texture from the specified file.
Definition at line 383 of file Texture.hpp.
|
inline |
Creates a 2D texture from the specified image.
Definition at line 401 of file Texture.hpp.
|
inline |
Creates an empty 2D array texture.
Definition at line 559 of file Texture.hpp.
|
inline |
Creates a 2d texture array from the specified file.
Definition at line 573 of file Texture.hpp.
|
inline |
Creates a 2d texture array from the specified image.
Definition at line 591 of file Texture.hpp.
|
inline |
Creates a 2D multisample texture.
Definition at line 677 of file Texture.hpp.
|
inline |
Creates a 3D multisample texture.
Definition at line 699 of file Texture.hpp.
|
inline |
Creates an empty 3D texture.
Definition at line 417 of file Texture.hpp.
|
inline |
Creates a 3D texture from the specified file.
Definition at line 431 of file Texture.hpp.
|
inline |
Creates a 3D texture from the specified image.
Definition at line 449 of file Texture.hpp.
|
inline |
Creates a texture buffer texture.
The BufferObject can come from an Array* or from ImagePBO or can be a stand-alone BufferObject as well.
Definition at line 656 of file Texture.hpp.
|
inline |
Creates an empty cubemap texture.
Definition at line 464 of file Texture.hpp.
|
inline |
Creates creation a cubemap texture from the specified file.
Definition at line 478 of file Texture.hpp.
|
inline |
Creates a cubemap texture from the specified image.
Definition at line 496 of file Texture.hpp.
|
inline |
Creates an empty texture rectangle.
Definition at line 606 of file Texture.hpp.
|
inline |
Creates a texture rectangle from the specified file.
Definition at line 620 of file Texture.hpp.
|
inline |
Creates a texture rectangle from the specified image.
Definition at line 638 of file Texture.hpp.
|
inline |
The z dimension of the texture in texels.
Definition at line 742 of file Texture.hpp.
Referenced by setMipLevel(), and vl::RaycastVolume::updateUniforms().
void Texture::destroyTexture | ( | ) |
Destroys the GL texture object if managed() is true
(default).
TexParameter is not reset but is marked dirty. After calling this function the vl::Texture values are reset() including managed() which is set to true
.
Definition at line 359 of file Texture.cpp.
References mHandle, mManaged, and VL_CHECK_OGL.
Referenced by createTexture(), and ~Texture().
|
inline |
The texture type (1d, 2d, cubemap etc.) as specified by the target
parameter of glTexImage*().
Definition at line 722 of file Texture.hpp.
Referenced by setMipLevel().
|
inline |
Whether the samples location is fixed for a a multisample texture.
Definition at line 757 of file Texture.hpp.
|
inline |
The TexParameter object associated to a Texture.
Definition at line 281 of file Texture.hpp.
Referenced by vlX::VLXClassWrapper_Texture::exportTexture(), vlX::VLXClassWrapper_Texture::importTexture(), vl::Terrain::init(), vl::load3DS(), vl::ObjLoader::loadOBJ(), and vl::VectorGraphics::popScissor().
|
inline |
The TexParameter object associated to a Texture.
Definition at line 284 of file Texture.hpp.
|
inline |
OpenGL texture handle as returned by glGenTextures().
Definition at line 710 of file Texture.hpp.
Referenced by vl::Rendering::fillRenderQueue(), and isValid().
|
inline |
The vertical dimension of the texture in texels.
Definition at line 737 of file Texture.hpp.
Referenced by setMipLevel(), and vl::RaycastVolume::updateUniforms().
|
inline |
The texture internal format as pecified by the internalFormat
parameter of glTexImage*().
Definition at line 727 of file Texture.hpp.
Referenced by isDepthTexture(), and setMipLevel().
|
static |
Returns true
if the specified format is compressed.
Definition at line 1232 of file Texture.cpp.
References vl::TF_COMPRESSED_ALPHA, vl::TF_COMPRESSED_INTENSITY, vl::TF_COMPRESSED_LUMINANCE, vl::TF_COMPRESSED_LUMINANCE_ALPHA, vl::TF_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, vl::TF_COMPRESSED_LUMINANCE_LATC1_EXT, vl::TF_COMPRESSED_RED_GREEN_RGTC2_EXT, vl::TF_COMPRESSED_RED_RGTC1_EXT, vl::TF_COMPRESSED_RGB, vl::TF_COMPRESSED_RGB_FXT1_3DFX, vl::TF_COMPRESSED_RGB_S3TC_DXT1_EXT, vl::TF_COMPRESSED_RGBA, vl::TF_COMPRESSED_RGBA_FXT1_3DFX, vl::TF_COMPRESSED_RGBA_S3TC_DXT1_EXT, vl::TF_COMPRESSED_RGBA_S3TC_DXT3_EXT, vl::TF_COMPRESSED_RGBA_S3TC_DXT5_EXT, vl::TF_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT, vl::TF_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT, vl::TF_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT, and vl::TF_COMPRESSED_SIGNED_RED_RGTC1_EXT.
Referenced by setMipLevel().
bool Texture::isDepthTexture | ( | ) | const |
Returns true if the texture is a depth or depth/stencil textre.
Definition at line 1211 of file Texture.cpp.
References internalFormat(), vl::TF_DEPTH24_STENCIL8, vl::TF_DEPTH32F_STENCIL8, vl::TF_DEPTH_COMPONENT, vl::TF_DEPTH_COMPONENT16, vl::TF_DEPTH_COMPONENT24, vl::TF_DEPTH_COMPONENT32, vl::TF_DEPTH_COMPONENT32F, and vl::TF_DEPTH_STENCIL.
bool Texture::isValid | ( | ) | const |
|
inline |
If managed
is true the texture will be automatically destroyed when the vl::Texture is destroyed or destroyTexture() is called.
See also destroyTexture().
Definition at line 717 of file Texture.hpp.
|
inline |
Prepares for creation an empty 1D texture.
Definition at line 315 of file Texture.hpp.
References NULL.
Referenced by Texture().
|
inline |
Prepares for creation a 1D texture from the specified file.
Definition at line 329 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a 1D texture from the specified image.
Definition at line 343 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_1D.
|
inline |
Prepares for creation an empty 1D array texture.
Definition at line 503 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a 1d texture array from the specified file.
Definition at line 518 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a 1d texture array from the specified image.
Definition at line 532 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_1D_ARRAY.
|
inline |
Prepares for creation an empty 2D texture.
Definition at line 361 of file Texture.hpp.
References NULL.
Referenced by vl::load3DS(), vl::loadAC3D(), vl::ObjLoader::loadOBJ(), and Texture().
|
inline |
Prepares for creation a 2D texture from the specified file.
Definition at line 376 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a 2D texture from the specified image.
Definition at line 390 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_2D.
|
inline |
Prepares for creation an empty 2D array texture.
Definition at line 550 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a 2d texture array from the specified file.
Definition at line 566 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a 2d texture array from the specified image.
Definition at line 580 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_2D_ARRAY.
|
inline |
Prepares a 2D multisample texture.
Definition at line 663 of file Texture.hpp.
References vl::Texture::SetupParams::setDimension(), and vl::TD_TEXTURE_2D_MULTISAMPLE.
|
inline |
Prepares a 3D multisample texture.
Definition at line 684 of file Texture.hpp.
References vl::Texture::SetupParams::setDimension(), and vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY.
|
inline |
Prepares for creation an empty 3D texture.
Definition at line 408 of file Texture.hpp.
References NULL.
Referenced by Texture().
|
inline |
Prepares for creation a 3D texture from the specified file.
Definition at line 424 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a 3D texture from the specified image.
Definition at line 438 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_3D.
|
inline |
Prepares a texture buffer texture.
The BufferObject can come from an Array* or from ImagePBO or can be a stand-alone BufferObject as well.
Definition at line 645 of file Texture.hpp.
References vl::Texture::SetupParams::setDimension(), and vl::TD_TEXTURE_BUFFER.
|
inline |
Prepares for creation an empty cubemap texture.
Definition at line 456 of file Texture.hpp.
References NULL.
Referenced by Texture().
|
inline |
Prepares for creation a cubemap texture from the specified file.
Definition at line 471 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a cubemap texture from the specified image.
Definition at line 485 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_CUBE_MAP.
|
inline |
Prepares for creation an empty texture rectangle.
Definition at line 598 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a texture rectangle from the specified file.
Definition at line 613 of file Texture.hpp.
References NULL.
|
inline |
Prepares for creation a texture rectangle from the specified image.
Definition at line 627 of file Texture.hpp.
References vl::Texture::SetupParams::setImage(), and vl::TD_TEXTURE_RECTANGLE.
|
inline |
The number of samples of a multisample texture.
Definition at line 752 of file Texture.hpp.
Referenced by createTexture().
|
inline |
Whether the texture has a 1 pixel texture border or not.
Definition at line 745 of file Texture.hpp.
Referenced by createTexture(), and ~Texture().
|
inline |
The z dimension of the texture in texels.
Definition at line 740 of file Texture.hpp.
Referenced by createTexture(), and ~Texture().
|
inline |
The texture type (1d, 2d, cubemap etc.) as specified by the target
parameter of glTexImage*().
Definition at line 720 of file Texture.hpp.
Referenced by createTexture(), and ~Texture().
|
inline |
Whether the samples location is fixed for a a multisample texture.
Definition at line 755 of file Texture.hpp.
|
inline |
OpenGL texture handle as returned by glGenTextures().
If managed
is true the texture will be automatically destroyed when the vl::Texture is destroyed or destroyTexture() is called. See also destroyTexture().
Definition at line 708 of file Texture.hpp.
|
inline |
The vertical dimension of the texture in texels.
Definition at line 735 of file Texture.hpp.
Referenced by createTexture(), and ~Texture().
|
inline |
The texture internal format as pecified by the internalFormat
parameter of glTexImage*().
Definition at line 725 of file Texture.hpp.
Referenced by createTexture(), and ~Texture().
|
inline |
If managed
is true the texture will be automatically destroyed when the vl::Texture is destroyed or destroyTexture() is called.
See also destroyTexture().
Definition at line 714 of file Texture.hpp.
bool Texture::setMipLevel | ( | int | mip_level, |
const Image * | img, | ||
bool | gen_mipmaps | ||
) |
Copies the texture image to the specified mip-maping level.
This function can be useful to specify one by one the mipmapping images or to create texture animation effects.
mip_level | The mip-mapping level to be modified. |
img | The Image containing the pixels to be copied into the specified mip-mapping level. |
gen_mipmaps | If true automatically generates the mip-mapping images for the levels below mip_level . |
Definition at line 844 of file Texture.cpp.
References border(), vl::Log::bug(), vl::Image::byteAlignment(), vl::Image::depth(), depth(), vl::Image::dimension(), dimension(), vl::Log::error(), vl::Image::format(), vl::Has_GL_GENERATE_MIPMAP, vl::Has_glGenerateMipmaps, vl::Image::height(), height(), internalFormat(), isCompressedFormat(), mHandle, vl::Image::pixels(), vl::Image::pixelsXN(), vl::Image::pixelsXP(), vl::Image::pixelsYN(), vl::Image::pixelsYP(), vl::Image::pixelsZN(), vl::Image::pixelsZP(), vl::Image::requiredMemory(), supports(), vl::TD_TEXTURE_1D, vl::TD_TEXTURE_1D_ARRAY, vl::TD_TEXTURE_2D, vl::TD_TEXTURE_2D_ARRAY, vl::TD_TEXTURE_2D_MULTISAMPLE, vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY, vl::TD_TEXTURE_3D, vl::TD_TEXTURE_BUFFER, vl::TD_TEXTURE_CUBE_MAP, vl::TD_TEXTURE_RECTANGLE, vl::Image::type(), VL_CHECK, VL_CHECK_OGL, VL_IS_POW_2, VL_TRAP, vl::Log::warning(), vl::Image::width(), and width().
Referenced by createTexture().
|
inline |
The number of samples of a multisample texture.
Definition at line 750 of file Texture.hpp.
|
inline |
See SetupParams.
Definition at line 760 of file Texture.hpp.
Referenced by vlX::VLXClassWrapper_Texture::importTexture().
|
inline |
See SetupParams.
Definition at line 763 of file Texture.hpp.
Referenced by createTexture(), vlX::VLXClassWrapper_Texture::exportTexture(), vl::Rendering::fillRenderQueue(), and vlX::VLXClassWrapper_Texture::importTexture().
|
inline |
See SetupParams.
Definition at line 766 of file Texture.hpp.
|
inline |
The horizontal dimension of the texture in texels.
Definition at line 730 of file Texture.hpp.
Referenced by createTexture(), and ~Texture().
|
static |
Checks whether the specified texture type, format and dimension combination is supported by the current OpenGL driver.
Definition at line 498 of file Texture.cpp.
References vl::Log::error(), vl::Has_Cubemap_Textures, vl::Has_Texture_Array, vl::Has_Texture_Buffer, vl::Has_Texture_Multisample, vl::Has_Texture_Rectangle, vl::ID_2D, vl::ID_3D, NULL, vl::TD_TEXTURE_1D, vl::TD_TEXTURE_1D_ARRAY, vl::TD_TEXTURE_2D, vl::TD_TEXTURE_2D_ARRAY, vl::TD_TEXTURE_2D_MULTISAMPLE, vl::TD_TEXTURE_2D_MULTISAMPLE_ARRAY, vl::TD_TEXTURE_3D, vl::TD_TEXTURE_BUFFER, vl::TD_TEXTURE_CUBE_MAP, vl::TD_TEXTURE_RECTANGLE, VL_CHECK, VL_CHECK_OGL, and width().
Referenced by createTexture(), and setMipLevel().
|
inline |
The horizontal dimension of the texture in texels.
Definition at line 732 of file Texture.hpp.
Referenced by setMipLevel(), supports(), and vl::RaycastVolume::updateUniforms().
|
friend |
Definition at line 181 of file Texture.hpp.
|
protected |
Definition at line 802 of file Texture.hpp.
Referenced by clone().
|
protected |
Definition at line 795 of file Texture.hpp.
Referenced by clone(), createTexture(), and ~Texture().
|
protected |
Definition at line 800 of file Texture.hpp.
|
protected |
Definition at line 797 of file Texture.hpp.
Referenced by clone().
|
protected |
Definition at line 803 of file Texture.hpp.
Referenced by clone(), createTexture(), and ~Texture().
|
protected |
Definition at line 796 of file Texture.hpp.
Referenced by clone().
|
protected |
Definition at line 791 of file Texture.hpp.
Referenced by clone(), createTexture(), destroyTexture(), setMipLevel(), and ~Texture().
|
protected |
Definition at line 799 of file Texture.hpp.
|
protected |
Definition at line 792 of file Texture.hpp.
Referenced by destroyTexture(), and ~Texture().
|
protected |
Definition at line 801 of file Texture.hpp.
Referenced by clone(), createTexture(), and ~Texture().
|
protected |
Definition at line 794 of file Texture.hpp.
Referenced by clone(), createTexture(), and ~Texture().
|
protected |
Definition at line 793 of file Texture.hpp.
Referenced by clone(), Texture(), and ~Texture().
|
protected |
Definition at line 798 of file Texture.hpp.
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:55.
© Copyright Michele Bosi. All rights reserved.