Releases: bitbank2/AnimatedGIF
GIFDraw callback gains user defined pointer
This release adds a new feature to allow private data to be passed to the GIFDraw callback function. This allows you to pass any dynamic info you want into the callback.There is also a new example sketch which uses this feature to pass centering information to a multi-digit animated counter.
1.3.2
regression bug
I merged a PR in the last release without retesting the code. This fixes a bug discovered by another user with that previous PR.
Interlaced support and bug fixes
Interlaced GIF images have a scheme which (unlike PNG) only modifies the line number ordering and not the horizontal pixel ordering. This made it pretty easy to implement in the AnimatedGIF library. Interlaced GIF images can be used in the "low memory" and "high memory" mode. This release also fixes a problem with memcpy() in the GIFGetMoreData() function that should have been using memmove() because the source and destination overlap. It also improves the error handling of playFrame() to be less ambiguous when reaching the end of the file.
Big Memory Features
The need for additional speed inspired me to add more options for MCUs which have a little more RAM. The draw callback in previous releases had to manage frame disposal options and transparent pixels. If your MCU/system has enough RAM, I've added new functions to simplify pixel handling and speed up drawing images with transparent pixels on SPI displays. See the 'big_mem_demo' for an example of how to use the new functions.
Minor fixes and new TFT_eSPI example
@Bodmer was kind enough to add an example sketch which uses his TFT library. This release also includes a minor fix for end-of-sequence status when working with files which have non-image data after the last frame.
Linux and C support
This release is mainly to add a pure C and Linux implementation. The C++ class now includes the C code as if it's an H file so that the same code can easily be built in either environment. I also added 2 new functions: getLastError() and getInfo(). The getInfo() function returns details about an animated sequence including the total number of frames, total duration, minimum frame delay and maximum frame delay. If using this on a large file stored on slow media (e.g. SDCard), it can take a long time to process due to file I/O latency.
This release also updates the Adafruit GFX examples with some improvements.
Adafruit example fixes
The example sketches for the Adafruit GFX library had an error in the GIFDraw() callback. The startWrite() function (sets CS low) needs to be called before calling setAddrWindow(). On my setup, I had tied CS to ground, so I didn't notice the bug.
Changed license model
Changed the license model to Apache 2.0 for easier use in other projects.
Fixed gif.open() to return valid status
The previous build returned true (success) from gif.open() even if there was an error. This update fixes it to return false when there is an error opening or parsing the given file.