17 GifWriter(FILE *file,
int width,
int height);
24 bool write_frame(
const uint8_t *bgr,
size_t row_stride,
unsigned delay_centiseconds);
Writes an animated GIF a frame at a time, so a long recording is never held in memory.
std::vector< ColorBin > bins_
std::vector< uint8_t > palette_index_
std::vector< uint16_t > used_colors_
std::vector< uint8_t > output_
GifWriter(FILE *file, int width, int height)
bool write_header()
Write the start of the file. This must come first. The animation repeats forever.
bool 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,...
std::vector< uint8_t > indices_
bool write_trailer()
Write the end of the file. This must come last.
size_t build_palette_(uint8_t *palette)
Choose up to 256 colours for the frame in bins_, storing them as red, green, blue triples in palette ...
How many pixels of one colour there are in the frame, and the sum of their red, green and blue.