| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#ifndef _BASIS_SGD_H_ |
| 20 |
#define _BASIS_SGD_H_ |
| 21 |
|
| 22 |
#include <stdint.h> |
| 23 |
|
| 24 |
#ifdef __cplusplus |
| 25 |
extern "C" { |
| 26 |
#endif |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
enum bu_image_flags__bits_e { ETC1S_P_FRAME = 0x02 }; |
| 32 |
|
| 33 |
typedef uint32_t buFlags; |
| 34 |
|
| 35 |
typedef struct ktxBasisLzGlobalHeader { |
| 36 |
uint16_t endpointCount; |
| 37 |
uint16_t selectorCount; |
| 38 |
uint32_t endpointsByteLength; |
| 39 |
uint32_t selectorsByteLength; |
| 40 |
uint32_t tablesByteLength; |
| 41 |
uint32_t extendedByteLength; |
| 42 |
} ktxBasisLzGlobalHeader; |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
typedef struct ktxBasisLzEtc1sImageDesc { |
| 50 |
buFlags imageFlags; |
| 51 |
uint32_t rgbSliceByteOffset; |
| 52 |
uint32_t rgbSliceByteLength; |
| 53 |
uint32_t alphaSliceByteOffset; |
| 54 |
uint32_t alphaSliceByteLength; |
| 55 |
} ktxBasisLzEtc1sImageDesc; |
| 56 |
|
| 57 |
#define BGD_ETC1S_IMAGE_DESCS(bgd) \ |
| 58 |
reinterpret_cast<ktxBasisLzEtc1sImageDesc*>(bgd + sizeof(ktxBasisLzGlobalHeader)) |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
#define BGD_ENDPOINTS_ADDR(bgd, imageCount) \ |
| 66 |
(bgd + sizeof(ktxBasisLzGlobalHeader) + sizeof(ktxBasisLzEtc1sImageDesc) * imageCount) |
| 67 |
|
| 68 |
#define BGD_SELECTORS_ADDR(bgd, bgdh, imageCount) (BGD_ENDPOINTS_ADDR(bgd, imageCount) + bgdh.endpointsByteLength) |
| 69 |
|
| 70 |
#define BGD_TABLES_ADDR(bgd, bgdh, imageCount) (BGD_SELECTORS_ADDR(bgd, bgdh, imageCount) + bgdh.selectorsByteLength) |
| 71 |
|
| 72 |
#define BGD_EXTENDED_ADDR(bgd, bgdh, imageCount) (BGD_TABLES_ADDR(bgd, bgdh, imageCount) + bgdh.tablesByteLength) |
| 73 |
|
| 74 |
|
| 75 |
enum alpha_content_e { |
| 76 |
eNone, |
| 77 |
eAlpha, |
| 78 |
eGreen |
| 79 |
}; |
| 80 |
|
| 81 |
#ifdef __cplusplus |
| 82 |
} |
| 83 |
#endif |
| 84 |
|
| 85 |
#endif |