summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-03-23 17:45:21 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2022-03-23 17:49:25 +0000
commite1c266df7688eced5ea7eaf1df2434dc92b4ccb2 (patch)
treed3b69995d445098b235a1673475ed5aa7065d64b
parent193234ec4e48bb6445576e0a9a1702f55234594f (diff)
downloadlibnsgif-e1c266df7688eced5ea7eaf1df2434dc92b4ccb2.tar.gz
libnsgif-e1c266df7688eced5ea7eaf1df2434dc92b4ccb2.tar.bz2
Docs: Mention colour formats in README.
-rw-r--r--README.md11
1 files changed, 7 insertions, 4 deletions
diff --git a/README.md b/README.md
index 63ccdc7..e6219aa 100644
--- a/README.md
+++ b/README.md
@@ -22,14 +22,17 @@ Using
LibNSGIF allows the client to allocate the bitmap into which the GIF is
decoded. The client can have an arbitrary bitmap structure, that is simply
a void pointer to LibNSGIF. The client must provide a callback table for
-interacting with bitmaps. This table must include as a minimum functions to
-create and destroy bitmaps, and a function to get a pointer to the bitmap's
-pixel data buffer.
+interacting with bitmaps, and the required client bitmap pixel format.
+The bitmap table must include as a minimum functions to create and destroy
+bitmaps, and a function to get a pointer to the bitmap's pixel data buffer.
+
+LibNSGIF always decodes to a 32bpp, 8 bits per channel bitmap pixel format,
+however it allows the client to control the colour component ordering.
To load a GIF, first create an nsgif object with `nsgif_create()`.
```c
- err = nsgif_create(&bitmap_callbacks, &gif);
+ err = nsgif_create(&bitmap_callbacks, NSGIF_BITMAP_FMT_R8G8B8A8, &gif);
if (err != NSGIF_OK) {
fprintf(stderr, "%s\n", nsgif_strerror(err));
// Handle error