Assimp
v3.1.1 (June 2014)
|
Helper structure to describe an embedded texture. More...
Public Member Functions | |
aiTexture () | |
bool | CheckFormat (const char *s) const |
For compressed textures (mHeight == 0): compare the format hint against a given string. More... | |
~aiTexture () | |
Public Attributes | |
char | achFormatHint [4] |
A hint from the loader to make it easier for applications to determine the type of embedded compressed textures. More... | |
unsigned int | mHeight |
Height of the texture, in pixels. More... | |
unsigned int | mWidth |
Width of the texture, in pixels. More... | |
aiTexel * | pcData |
Data of the texture. More... | |
Detailed Description
Helper structure to describe an embedded texture.
Normally textures are contained in external files but some file formats embed them directly in the model file. There are two types of embedded textures:
- Uncompressed textures. The color data is given in an uncompressed format.
- Compressed textures stored in a file format like png or jpg. The raw file bytes are given so the application must utilize an image decoder (e.g. DevIL) to get access to the actual color data.
Embedded textures are referenced from materials using strings like "*0", "*1", etc. as the texture paths (a single asterisk character followed by the zero-based index of the texture in the aiScene::mTextures array).
Constructor & Destructor Documentation
|
inline |
|
inline |
Member Function Documentation
|
inline |
For compressed textures (mHeight == 0): compare the format hint against a given string.
- Parameters
-
s Input string. 3 characters are maximally processed. Example values: "jpg", "png"
- Returns
- true if the given string matches the format hint
Member Data Documentation
char aiTexture::achFormatHint[4] |
A hint from the loader to make it easier for applications to determine the type of embedded compressed textures.
If mHeight != 0 this member is undefined. Otherwise it is set set to '\0\0\0\0' if the loader has no additional information about the texture file format used OR the file extension of the format without a trailing dot. If there are multiple file extensions for a format, the shortest extension is chosen (JPEG maps to 'jpg', not to 'jpeg'). E.g. 'dds\0', 'pcx\0', 'jpg\0'. All characters are lower-case. The fourth character will always be '\0'.
unsigned int aiTexture::mHeight |
Height of the texture, in pixels.
If this value is zero, pcData points to an compressed texture in any format (e.g. JPEG).
unsigned int aiTexture::mWidth |
Width of the texture, in pixels.
If mHeight is zero the texture is compressed in a format like JPEG. In this case mWidth specifies the size of the memory area pcData is pointing to, in bytes.
aiTexel* aiTexture::pcData |
Data of the texture.
Points to an array of mWidth * mHeight aiTexel's. The format of the texture data is always ARGB8888 to make the implementation for user of the library as easy as possible. If mHeight = 0 this is a pointer to a memory buffer of size mWidth containing the compressed texture data. Good luck, have fun!
The documentation for this struct was generated from the following file:
Generated on Sun Feb 21 2016 19:42:29 for Assimp by 1.8.11