diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-05-08 16:18:35 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-05-08 16:18:35 +0100 |
commit | 4f588e9400eb82efac9c8c9fa6844419c2caa101 (patch) | |
tree | 9f937fe000f6aac3798654e50bbe7fc96b9cc4de /include/nsgif.h | |
parent | 5a1c0ed3ba4534957965839fda659482603117e2 (diff) | |
download | libnsgif-4f588e9400eb82efac9c8c9fa6844419c2caa101.tar.gz |
API: Add function to get a frame's local palette.
Diffstat (limited to 'include/nsgif.h')
-rw-r--r-- | include/nsgif.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/nsgif.h b/include/nsgif.h index 9eec0f8..2251060 100644 --- a/include/nsgif.h +++ b/include/nsgif.h @@ -448,6 +448,26 @@ void nsgif_global_palette( size_t *entries); /** + * Get the local colour palette for a frame. + * + * Frames may have no local palette. In this case they use the global palette. + * This function returns false if the frame has no local palette. + * + * Colours in same pixel format as \ref nsgif_bitmap_t. + * + * \param[in] gif The \ref nsgif_t object. + * \param[in] frame The \ref frame to get the palette for. + * \param[out] table Client buffer to hold the colour table. + * \param[out] entries The number of used entries in the colour table. + * \return true if a palette is returned, false otherwise. + */ +bool nsgif_local_palette( + const nsgif_t *gif, + uint32_t frame, + uint32_t table[NSGIF_MAX_COLOURS], + size_t *entries); + +/** * Configure handling of small frame delays. * * Historically people created GIFs with a tiny frame delay, however the slow |