From 9069ea20fa168a4610f9036c52ea885df6aa4ddf Mon Sep 17 00:00:00 2001 From: Alexandr Arutjunov Date: Wed, 28 Sep 2016 17:50:17 +0300 Subject: [PATCH] [*] Format hint for embedded textures improvement. --- include/assimp/texture.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/include/assimp/texture.h b/include/assimp/texture.h index d37aaa1e6..fe53cef93 100644 --- a/include/assimp/texture.h +++ b/include/assimp/texture.h @@ -147,10 +147,17 @@ struct aiTexture unsigned int mHeight; /** A hint from the loader to make it easier for applications - * to determine the type of embedded compressed textures. + * to determine the type of embedded textures. * - * If mHeight != 0 this member is undefined. Otherwise it - * is set set to '\\0\\0\\0\\0' if the loader has no additional + * 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: + * 1. Image contain RGBA and 8 bit per channel, achFormatHint == "rgba8888"; + * 2. Image contain ARGB and 8 bit per channel, achFormatHint == "argb8888"; + * 2. Image contain RGB and 5 bit for R and B channels and 6 bit for G channel, achFormatHint == "rgba5650"; + * 3. One color image with B channel and 1 bit for it, achFormatHint == "rgba0010"; + * If mHeight == 0 then achFormatHint 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 @@ -158,7 +165,7 @@ struct aiTexture * E.g. 'dds\\0', 'pcx\\0', 'jpg\\0'. All characters are lower-case. * The fourth character will always be '\\0'. */ - char achFormatHint[4]; + char achFormatHint[9];// 8 for string + 1 for terminator. /** Data of the texture. *