52 lines
994 B
C
52 lines
994 B
C
#ifndef APP_GIFDEC_H
|
|
#define APP_GIFDEC_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct gd_Palette {
|
|
int size;
|
|
uint8_t colors[0x100 * 3];
|
|
} gd_Palette;
|
|
|
|
typedef struct gd_GCE {
|
|
uint16_t delay;
|
|
uint8_t tindex;
|
|
uint8_t disposal;
|
|
int input;
|
|
int transparency;
|
|
} gd_GCE;
|
|
|
|
typedef struct gd_GIF {
|
|
const uint8_t *data;
|
|
size_t data_size;
|
|
size_t pos;
|
|
size_t anim_start;
|
|
uint16_t width, height;
|
|
uint16_t depth;
|
|
uint16_t loop_count;
|
|
gd_GCE gce;
|
|
gd_Palette *palette;
|
|
gd_Palette lct, gct;
|
|
uint16_t fx, fy, fw, fh;
|
|
uint8_t bgindex;
|
|
uint8_t *canvas, *frame;
|
|
} gd_GIF;
|
|
|
|
gd_GIF *gd_open_gif_mem(const uint8_t *data, size_t size);
|
|
int gd_get_frame(gd_GIF *gif);
|
|
void gd_render_frame(gd_GIF *gif, uint8_t *buffer);
|
|
int gd_is_bgcolor(gd_GIF *gif, uint8_t color[3]);
|
|
void gd_rewind(gd_GIF *gif);
|
|
void gd_close_gif(gd_GIF *gif);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* APP_GIFDEC_H */
|