#include <Texture.h>
Inheritance diagram for nvsg::Texture:
Public Types | |
enum | eTexFileType { TFT_UNKNOWN = -1, TFT_DDS, TFT_JPG, TFT_TGA, TFT_BMP, TFT_TIF, TFT_RGB, TFT_GIF, TFT_PNG, TFT_HDR } |
Enumeration of the supported texture file formats. More... | |
Public Member Functions | |
NVSG_API int | getComponents (unsigned int image=0, unsigned int mipmap=0) const |
Get the components of the mipmap level of an image of the texture. | |
NVSG_API int | getType (unsigned int image=0, unsigned int mipmap=0) const |
Get the type of the mipmap level of an image of the texture. | |
NVSG_API int | getDepth (unsigned int image=0, unsigned int mipmap=0) const |
Get the depth of the mipmap level of an image of the texture. | |
NVSG_API int | getFormat (unsigned int image=0, unsigned int mipmap=0) const |
Get the format of the mipmap level of an image of the texture. | |
std::string | getFileName (void) const |
Get the filename of the texture. | |
unsigned int | getHandle (void) const |
Get the handle of the texture. | |
NVSG_API int | getHeight (unsigned int image=0, unsigned int mipmap=0) const |
Get the height of the mipmap level of an image of the texture. | |
unsigned int | getNumberOfImages (void) const |
Get the number of image in this texture. | |
NVSG_API unsigned int | getNumberOfMipmaps (unsigned int image=0) const |
Get the number of mipmaps of an image of the texture. | |
NVSG_API const void * | getPixels (unsigned int image=0, unsigned int mipmap=0) const |
Get pointer to pixels of the mipmap level of an image of the texture. | |
NVSG_API int | getSize (unsigned int image=0, unsigned int mipmap=0) const |
Get the size of the mipmap level of an image of the texture. | |
NVSG_API unsigned long | getTarget (void) const |
Get the target of the texture. | |
NVSG_API int | getWidth (unsigned int image=0, unsigned int mipmap=0) const |
Get the width of the mipmap-level of an image of the texture. | |
NVSG_API bool | isCubeMap (void) const |
Ask if this texture is a cubemap. | |
NVSG_API bool | isFloatingPoint (void) const |
Ask if this texture is a floating point texture (4 bpp per color channel). | |
NVSG_API bool | isTexFileType (eTexFileType tft) const |
Ask if this texture is of a specific file type. | |
NVSG_API bool | load (void) const |
Load the texture. | |
NVSG_API void | scale (unsigned int image=0, unsigned int width=128, unsigned int height=128, unsigned int depth=1) const |
Scale an image of the texture to the specified size. | |
NVSG_API void | setHandle (unsigned int handle) const |
Set the handle of the texture. | |
NVSG_API void | setTarget (unsigned long target) const |
Set the target of the texture. | |
NVSG_API void | unload (void) const |
Unload the texture. | |
Static Public Member Functions | |
static NVSG_API const Texture * | create (const std::string &fileName, bool flipImage=true) |
Create a Texture out of a file. | |
Protected Member Functions | |
NVSG_API | Texture (const std::string &fileName, bool flipImage=true) |
Constructor. | |
virtual NVSG_API | ~Texture (void) |
Prohibit explicit creation on stack by making the destructor protected. | |
Protected Attributes | |
bool | m_cube |
true for cube maps | |
std::string | m_fileName |
file name of the texture | |
bool | m_flipImage |
true for horizontally flipped images | |
unsigned int | m_handle |
opaque handle of the texture | |
unsigned int | m_imageID |
image id of the texture | |
unsigned int | m_numImages |
number of images in the texture | |
unsigned long | m_target |
target type of the texture (GL_TEXTURE_1D,...) | |
eTexFileType | m_texFileType |
texture file type, like TFT_DDS, TFT_JPG (see eTexFileType) |
This class is used to represent a texture of any format in the scenegraph. It is defined by the filename and hides all the format specific information behind this common interface.
|
Enumeration of the supported texture file formats.
|
|
Constructor. Creates a texture out of the file fileName. If requested, it flips the image horizontally. |
|
Prohibit explicit creation on stack by making the destructor protected.
|
|
Create a Texture out of a file.
|
|
Get the components of the mipmap level of an image of the texture.
|
|
Get the type of the mipmap level of an image of the texture.
|
|
Get the depth of the mipmap level of an image of the texture.
|
|
Get the format of the mipmap level of an image of the texture.
|
|
Get the filename of the texture.
|
|
Get the handle of the texture. Each texture can have an associated handle that can be queried here.
|
|
Get the height of the mipmap level of an image of the texture.
|
|
Get the number of image in this texture.
|
|
Get the number of mipmaps of an image of the texture.
|
|
Get pointer to pixels of the mipmap level of an image of the texture.
|
|
Get the size of the mipmap level of an image of the texture.
|
|
Get the target of the texture. The target is an arbitrary ID that can be used to classify this texture.
|
|
Get the width of the mipmap-level of an image of the texture.
|
|
Ask if this texture is a cubemap.
|
|
Ask if this texture is a floating point texture (4 bpp per color channel).
|
|
Ask if this texture is of a specific file type.
|
|
Load the texture.
|
|
Scale an image of the texture to the specified size.
|
|
Set the handle of the texture.
|
|
Set the target of the texture. The target is an arbitrary ID that can be used to classify this texture.
|
|
Unload the texture.
|
|
true for cube maps
|
|
file name of the texture
|
|
true for horizontally flipped images
|
|
opaque handle of the texture
|
|
image id of the texture
|
|
number of images in the texture
|
|
target type of the texture (GL_TEXTURE_1D,...)
|
|
texture file type, like TFT_DDS, TFT_JPG (see eTexFileType)
|