LibGame  v0.4.0
The LG Game Engine - Copyright (C) 2024-2025 ETMSoftware
lg_astc_loader.h
1 /*
2  * LibGame - Copyright (C) Emmanuel Thomas-Maurin 2011-2025
3  * All rights reserved
4  */
5 
6 #ifndef LG_ASTC_LOADER_H
7 #define LG_ASTC_LOADER_H
8 
9 typedef struct __attribute__((packed)) {
10  uint8_t magic[4];
11  uint8_t block_x;
12  uint8_t block_y;
13  uint8_t block_z; /* 1 for 2D images */
14  uint8_t dim_x[3]; /* (24-bit unsigned value) decoded_dim = dim[0] + (dim[1] << 8) + (dim[2] << 16) */
15  uint8_t dim_y[3];
16  uint8_t dim_z[3]; /* 1 for 2D images */
17 } ASTC_Header;
18 
19 typedef struct __attribute__((packed)) {
20  char sig[4]; /* "PKM " */
21  char version[2]; /* "10" or "20" */
22  uint16_t data_type; /* 0 = ETC1_RGB_NO_MIPMAPS */
23  uint16_t width; /* uint16_t big-endian */
24  uint16_t height;
25  uint16_t orig_width;
26  uint16_t orig_height;
27 } PKM_Header;
28 
29 void *lg_load_astc(const char *, lg_tc_format *, size_t *, int *, int *, int *);
30 
31 void *lg_load_etc1(const char *, lg_tc_format *, size_t *, int *, int *, int *);
32 
33 #endif /* LG_ASTC_LOADER_H */
lg_load_etc1
void * lg_load_etc1(const char *path, lg_tc_format *tc_format, size_t *size, int *w, int *h, int *n_mipmaps)
Definition: lg_astc_loader.c:174
PKM_Header
Definition: lg_astc_loader.h:19
ASTC_Header
Definition: lg_astc_loader.h:9
lg_load_astc
void * lg_load_astc(const char *path, lg_tc_format *tc_format, size_t *size, int *w, int *h, int *n_mipmaps)
Definition: lg_astc_loader.c:53