diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2022-05-07 20:23:51 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2022-05-07 20:25:53 +0100 |
commit | 76cc3a8ae804d398816ab9454731948f0ecb4c70 (patch) | |
tree | e585f9655c12fc97447ece939836430920bdc03c /include | |
parent | 2b93687087490cb5e760405709961a9abf8e205b (diff) | |
download | libnsgif-76cc3a8ae804d398816ab9454731948f0ecb4c70.tar.gz |
API: Add function to get global colour table.
Diffstat (limited to 'include')
-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 bd0fd58..9eec0f8 100644 --- a/include/nsgif.h +++ b/include/nsgif.h @@ -23,6 +23,9 @@ /** Representation of infinity. */ #define NSGIF_INFINITE (UINT32_MAX) +/** Maximum colour table size */ +#define NSGIF_MAX_COLOURS 256 + /** * Opaque type used by LibNSGIF to represent a GIF object in memory. */ @@ -428,6 +431,23 @@ const nsgif_frame_info_t *nsgif_get_frame_info( uint32_t frame); /** + * Get the global colour palette. + * + * If the GIF has no global colour table, this will return the default + * colour palette. + * + * Colours in same pixel format as \ref nsgif_bitmap_t. + * + * \param[in] gif The \ref nsgif_t object. + * \param[out] table Client buffer to hold the colour table. + * \param[out] entries The number of used entries in the colour table. + */ +void nsgif_global_palette( + const nsgif_t *gif, + 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 |