C3D Toolkit
Kernel - 117982, Vision - 2.9.2.2
|
Texture2D class is for processing 2D textures. The class is used to create textures on the fly or to change the existing texture resources. More...
#include <vsn_texture2d.h>
Public Member Functions | |
Texture2D () | |
Default constructor. | |
Texture2D (const Texture2D &other) | |
Copy constructor. | |
Texture2D (const Image &image) | |
Constructor for loading texture from Image. | |
~Texture2D () | |
Destructor. | |
void | OGLBindTexture () |
Activates texture. | |
void | Init (const Image &image) |
Initializes using Image. | |
void | Init (TextureFormat format, SizeI size, const unsigned char *pBits) |
Initializes using bit map. | |
uint | GetWidth () const |
Returns texture width. | |
uint | GetHeight () const |
Returns texture height. | |
uint | GetUniqueKey () const |
Returns texture identifier. | |
bool | HasAlphaChannel () const |
Checks if alpha channel exists. | |
bool | IsLoaded () const |
Checks texture state. | |
Image | ToImage () const |
Converts to Image. | |
void | SetFilters (TextureFilter min, TextureFilter max) |
Sets rasterization filters. | |
void | SetAnisotropic (float value) |
Sets value of anisotropic filter. | |
void | SetWrap (TextureWrap s, TextureWrap t) |
Sets parameters of texture repeat. | |
Texture2D & | operator= (const Texture2D &other) |
Copy operator. | |
bool | operator== (const Texture2D &other) const |
Assignment operator. | |
Static Public Member Functions | |
static float | GetMaxAnisotropic () |
Returns maximum value of anisotropic filter. | |
static SizeI | GetMaxTextureSize () |
Returns maximum texture size. | |
Texture2D class is for processing 2D textures. The class is used to create textures on the fly or to change the existing texture resources.
The ordinary surface mesh of object geometry gives a rough approximation of a form, while most of minutiae is presented as a texture. Texture2D is a standard bitmap image that is applied to a surface mesh. You can think of a texture image, as if it would be printed on "rubber sheet" able to stretch and be fixed to this mesh in corresponding positions. Positioning a texture is performed with the software of math kernel that is used to create a surface mesh. Texture2D can import textures from most common file formats of images, i.e. those formats supported by, for example, Vision::Image. Texture2D has a set of useful functions. Texture2D can be initialized in two ways: using image or bit map, besides, there is a capability to convert a texture to Vision::Image.