6 #ifndef SUPPORT_SOFTWARE_ETC_UNPACK
15 #define KTX_IDENTIFIER_REF { 0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A }
16 #define KTX_ENDIAN_REF (0x04030201)
17 #define KTX_ENDIAN_REF_REV (0x01020304)
18 #define KTX_HEADER_SIZE (64)
28 khronos_uint8_t identifier[12];
29 khronos_uint32_t endianness;
30 khronos_uint32_t glType;
31 khronos_uint32_t glTypeSize;
32 khronos_uint32_t glFormat;
33 khronos_uint32_t glInternalFormat;
34 khronos_uint32_t glBaseInternalFormat;
35 khronos_uint32_t pixelWidth;
36 khronos_uint32_t pixelHeight;
37 khronos_uint32_t pixelDepth;
38 khronos_uint32_t numberOfArrayElements;
39 khronos_uint32_t numberOfFaces;
40 khronos_uint32_t numberOfMipmapLevels;
41 khronos_uint32_t bytesOfKeyValueData;
45 typedef int KTX_header_SIZE_ASSERT [
sizeof(
KTX_header) == KTX_HEADER_SIZE];
55 khronos_uint32_t textureDimensions;
56 khronos_uint32_t glTarget;
57 khronos_uint32_t compressed;
58 khronos_uint32_t generateMipmaps;
62 #define GL_TEXTURE_1D 0x0DE0
65 #define GL_TEXTURE_3D 0x806F
67 #ifndef GL_TEXTURE_CUBE_MAP
68 #define GL_TEXTURE_CUBE_MAP 0x8513
69 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
72 #ifndef GL_TEXTURE_1D_ARRAY_EXT
73 #define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
74 #define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
76 #ifndef GL_GENERATE_MIPMAP
77 #define GL_GENERATE_MIPMAP 0x8191
80 #ifndef GL_UNSIGNED_SHORT_5_6_5
81 #define GL_UNSIGNED_SHORT_5_6_5 0x8363
83 #ifndef GL_UNSIGNED_SHORT_4_4_4_4
84 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
86 #ifndef GL_UNSIGNED_SHORT_5_5_5_1
87 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
90 #ifndef GL_ETC1_RGB8_OES
91 #define GL_ETC1_RGB8_OES 0x8D64
96 #define MAX(x, y) (((x) > (y)) ? (x) : (y))
108 void _ktxSwapEndian16(khronos_uint16_t* pData16,
int count);
113 void _ktxSwapEndian32(khronos_uint32_t* pData32,
int count);
118 KTX_error_code _ktxUnpackETC(
const GLubyte *srcETC, GLubyte **dstImage,
119 khronos_uint32_t active_width,
120 khronos_uint32_t active_height);