#ifndef APP_GIFDEC_H #define APP_GIFDEC_H #include #include #ifdef __cplusplus extern "C" { #endif typedef struct app_gd_Palette { int size; uint8_t colors[0x100 * 3]; } app_gd_Palette; typedef struct app_gd_GCE { uint16_t delay; uint8_t tindex; uint8_t disposal; int input; int transparency; } app_gd_GCE; typedef struct app_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; app_gd_GCE gce; app_gd_Palette *palette; app_gd_Palette lct, gct; uint16_t fx, fy, fw, fh; uint8_t bgindex; uint8_t *canvas, *frame; } app_gd_GIF; app_gd_GIF *app_gd_open_gif_mem(const uint8_t *data, size_t size); int app_gd_get_frame(app_gd_GIF *gif); void app_gd_render_frame(app_gd_GIF *gif, uint8_t *buffer); void app_gd_render_frame_to_argb(app_gd_GIF *gif, uint8_t *buffer); int app_gd_is_bgcolor(app_gd_GIF *gif, uint8_t color[3]); void app_gd_rewind(app_gd_GIF *gif); void app_gd_close_gif(app_gd_GIF *gif); #ifdef __cplusplus } #endif #endif /* APP_GIFDEC_H */