summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-03-01 11:23:26 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2022-03-01 11:23:26 +0000
commit1fd945a79b7bd785ae4fc53c545614aca0c1bfc4 (patch)
tree66187344f53aa10f2b5686efac0334a7be893c32
parent5398ee4f08ffeab3778dc8f014f49f73c8e9eb43 (diff)
downloadlibnsgif-1fd945a79b7bd785ae4fc53c545614aca0c1bfc4.tar.gz
libnsgif-1fd945a79b7bd785ae4fc53c545614aca0c1bfc4.tar.bz2
API: Document pixel buffer format in header.
-rw-r--r--include/nsgif.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/nsgif.h b/include/nsgif.h
index b60747f..c20c976 100644
--- a/include/nsgif.h
+++ b/include/nsgif.h
@@ -105,6 +105,10 @@ typedef enum {
*
* These are client-created and destroyed, via the \ref bitmap callbacks,
* but they are owned by a \ref nsgif.
+ *
+ * The pixel buffer is is 32bpp, treated as individual bytes in the component
+ * order RR GG BB AA. For example, a 1x1 image with a single orange pixel would
+ * be encoded as the following sequence of bytes: 0xff, 0x88, 0x00, 0x00.
*/
typedef void nsgif_bitmap_t;
@@ -130,6 +134,7 @@ typedef struct nsgif_bitmap_cb_vt {
* Get pointer to pixel buffer in a bitmap.
*
* The pixel buffer must be `width * height * sizeof(uint32_t)`.
+ * Note that the returned pointer to uint8_t must be 4-byte aligned.
*
* \param[in] bitmap The bitmap.
* \return pointer to bitmap's pixel buffer.