Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
|
Helper structure to describe an embedded texture. More...
#include <texture.h>
Public Member Functions | |
aiTexture () AI_NO_EXCEPT | |
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 [HINTMAXTEXTURELEN] |
A hint from the loader to make it easier for applications to determine the type of embedded textures. More... | |
C_STRUCT aiString | mFilename |
Texture original filename. More... | |
unsigned int | mHeight |
Height of the texture, in pixels. More... | |
unsigned int | mWidth |
Width of the texture, in pixels. More... | |
C_STRUCT aiTexel * | pcData |
Data of the texture. More... | |
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:
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).
|
inline |
|
inline |
|
inline |
For compressed textures (mHeight == 0): compare the format hint against a given string.
s | Input string. 3 characters are maximally processed. Example values: "jpg", "png" |
char aiTexture::achFormatHint[HINTMAXTEXTURELEN] |
A hint from the loader to make it easier for applications to determine the type of embedded textures.
If mHeight != 0 this member is show how data is packed. Hint will consist of two parts: channel order and channel bitness (count of the bits for every color channel). For simple parsing by the viewer it's better to not omit absent color channel and just use 0 for bitness. For example:
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.
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!