emote2ss

Animated webp to spritesheets converting tool
git clone git://bsandro.tech/emote2ss
Log | Files | Refs | README | LICENSE

animation.h (550B)


      1 /* webp animations utility stuff */
      2 #pragma once
      3 
      4 #include <stdbool.h>
      5 #include <stdint.h>
      6 
      7 #define NUM_CHANNELS 4
      8 
      9 typedef struct {
     10 	uint8_t *rgba;
     11 	int duration;
     12 	bool is_key;
     13 } Frame;
     14 
     15 typedef struct {
     16 	int width, height, bgcolor, loop_count;
     17 	Frame *frames;
     18 	uint32_t frame_count;
     19 	void *raw_mem;
     20 	char *path;
     21 	char *dirname;
     22 	char *filename;
     23 } Animation;
     24 
     25 Animation * ImageLoad(const char *path);
     26 void ImageUnload(Animation **img);
     27 int WebpRead(const char *filename, Animation *anim);
     28 void AnimationCreate(Animation *img, uint32_t frame_count);