Writes an animated GIF a frame at a time, so a long recording is never held in memory.
More...
Writes an animated GIF a frame at a time, so a long recording is never held in memory.
A GIF frame can use at most 256 colours. Each frame gets its own colour table, chosen from what is in that frame, so a frame with 256 colours or fewer is stored exactly.
Definition at line 15 of file gif.h.
| size_t esphome::snapshot::GifWriter::build_palette_ |
( |
uint8_t * | palette | ) |
|
|
protected |
Choose up to 256 colours for the frame in bins_, storing them as red, green, blue triples in palette and which one each colour is nearest in palette_index_.
Returns how many were chosen.
Definition at line 149 of file gif.cpp.
| bool esphome::snapshot::GifWriter::write_frame |
( |
const uint8_t * | bgr, |
|
|
size_t | row_stride, |
|
|
unsigned | delay_centiseconds ) |
Add a frame from three bytes per pixel in blue, green, red order, topmost row first, with row_stride bytes from the start of one row to the start of the next.
The frame is shown for delay_centiseconds hundredths of a second.
Definition at line 224 of file gif.cpp.