/** Animations are structured in AnimationData as follows: .colors contains .color_count*3 uint8_t values for R, G and B. .offsets contains the frame start offsets within .data + the length of the data. (So you can always do something like `for (int i=anim.offsets[i]; i #include "prototypes.h" #include "my_fastled.h" #include "Window.h" class Animation { protected: unsigned long currentFrameSince; uint8_t currentFrame = 0; uint8_t* animation_data; CRGB** _colors = NULL; CRGB* fgColor = NULL; CRGB* bgColor = new CRGB(0x000000); int8_t xOffset = 0; int8_t yOffset = 0; uint8_t _startFrame = 0; uint8_t _endFrame = 0; Window* _window; uint8_t _width; uint8_t _height; uint8_t _frame_count = 0; uint8_t _color_count = 0; uint16_t* _frame_times = NULL; uint16_t* _frame_data_lengths = NULL; uint8_t** _frame_data = NULL; bool _data_valid = false; virtual CRGB* getColor(uint8_t color_index); void drawPixel(int index, CRGB* color); uint16_t getFrameDelay(int frame); bool _load_from_file(const char* c); public: Animation(const char* filename, Window* win); void setFgColor(uint32_t c); void setBgColor(uint32_t c); bool invert(); void setOffsets(int8_t x, int8_t y); void setStartFrame(uint8_t sf); void setEndFrame(uint8_t ef); void setFrameRange(uint8_t sf, uint8_t ef); void setSingleFrame(uint8_t frame); virtual ~Animation(); void draw(); void drawFrame(); void drawFrame(uint8_t frame_index); virtual bool advance(); };