Gitweb links:
...log
http://git.netsurf-browser.org/libnsgif.git/shortlog/848debfe6c3a000ab547d185b57b47ac5560ba8e
...commit
http://git.netsurf-browser.org/libnsgif.git/commit/848debfe6c3a000ab547d185b57b47ac5560ba8e
...tree
http://git.netsurf-browser.org/libnsgif.git/tree/848debfe6c3a000ab547d185b57b47ac5560ba8e
The branch, master has been updated
via 848debfe6c3a000ab547d185b57b47ac5560ba8e (commit)
via 1fd945a79b7bd785ae4fc53c545614aca0c1bfc4 (commit)
from 5398ee4f08ffeab3778dc8f014f49f73c8e9eb43 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=848debfe6c3a000ab547d185b57b47ac5560ba8e
commit 848debfe6c3a000ab547d185b57b47ac5560ba8e
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
API: Minor code documentation improvements for public API.
diff --git a/include/nsgif.h b/include/nsgif.h
index c20c976..6bf2dd6 100644
--- a/include/nsgif.h
+++ b/include/nsgif.h
@@ -23,10 +23,13 @@
/** Representation of infinity. */
#define NSGIF_INFINITE (UINT32_MAX)
+/**
+ * Opaque type used by LibNSGIF to represent a GIF object in memory.
+ */
typedef struct nsgif nsgif_t;
/**
- * GIF rectangle structure.
+ * LibNSGIF rectangle structure.
*
* * Top left coordinate is `(x0, y0)`.
* * Width is `x1 - x0`.
@@ -45,7 +48,7 @@ typedef struct nsgif_rect {
} nsgif_rect_t;
/**
- * NSGIF return codes.
+ * LibNSGIF return codes.
*/
typedef enum {
/**
@@ -104,7 +107,7 @@ typedef enum {
* Client bitmap type.
*
* These are client-created and destroyed, via the \ref bitmap callbacks,
- * but they are owned by a \ref nsgif.
+ * but they are owned by a \ref nsgif_t.
*
* 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
@@ -179,7 +182,7 @@ const char *nsgif_strerror(nsgif_error err);
* Create the NSGIF object.
*
* \param[in] bitmap_vt Bitmap operation functions v-table.
- * \param[out] gif_out Return NSGIF object on success.
+ * \param[out] gif_out Return \ref nsgif_t object on success.
*
* \return NSGIF_OK on success, or appropriate error otherwise.
*/
@@ -205,14 +208,14 @@ void nsgif_destroy(nsgif_t *gif);
* already given to \ref nsgif_data_scan must be provided each time.
*
* For example, if you call \ref nsgif_data_scan with 25 bytes of data, and
then
- * fetch another 10 bytes, you would need to call \ref nsgif_data with a size
of
- * 35 bytes, and the whole 35 bytes must be contiguous memory. It is safe to
- * `realloc` the source buffer between calls to \ref nsgif_data_scan. (The
- * actual data pointer is allowed to be different.)
+ * fetch another 10 bytes, you would need to call \ref nsgif_data_scan with a
+ * size of 35 bytes, and the whole 35 bytes must be contiguous memory. It is
+ * safe to `realloc` the source buffer between calls to \ref nsgif_data_scan.
+ * (The actual data pointer is allowed to be different.)
*
* If an error occurs, all previously scanned frames are retained.
*
- * \param[in] gif The NSGIF object.
+ * \param[in] gif The \ref nsgif_t object.
* \param[in] size Number of bytes in data.
* \param[in] data Raw source GIF data.
*
@@ -230,7 +233,7 @@ nsgif_error nsgif_data_scan(
* returned `delay_cs` will be \ref NSGIF_INFINITE, indicating that the frame
* should be shown forever.
*
- * \param[in] gif The NSGIF object.
+ * \param[in] gif The \ref nsgif_t object.
* \param[out] area The area in pixels that must be redrawn.
* \param[out] delay_cs Time to wait after frame_new before next frame in cs.
* \param[out] frame_new The frame to decode.
@@ -246,7 +249,7 @@ nsgif_error nsgif_frame_prepare(
/**
* Decodes a GIF frame.
*
- * \param[in] gif The nsgif object.
+ * \param[in] gif The \ref nsgif_t object.
* \param[in] frame The frame number to decode.
* \param[out] bitmap On success, returns pointer to the client-allocated,
* nsgif-owned client bitmap structure.
@@ -264,9 +267,9 @@ nsgif_error nsgif_frame_decode(
* Some animations are only meant to loop N times, and then show the
* final frame forever. This function resets the loop and frame counters,
* so that the animation can be replayed without the overhead of recreating
- * the NSGIF object and rescanning the raw data.
+ * the \ref nsgif_t object and rescanning the raw data.
*
- * \param[in] gif A NSGIF object.
+ * \param[in] gif A \ref nsgif_t object.
*
* \return NSGIF_OK on success, or appropriate error otherwise.
*/
@@ -328,18 +331,18 @@ typedef struct nsgif_frame_info {
} nsgif_frame_info_t;
/**
- * Get information about a GIF from an NSGIF object.
+ * Get information about a GIF from an \ref nsgif_t object.
*
- * \param[in] gif The NSGIF object to get info for.
+ * \param[in] gif The \ref nsgif_t object to get info for.
*
* \return The gif info, or NULL on error.
*/
const nsgif_info_t *nsgif_get_info(const nsgif_t *gif);
/**
- * Get information about a GIF from an NSGIF object.
+ * Get information about a GIF from an \ref nsgif_t object.
*
- * \param[in] gif The NSGIF object to get frame info for.
+ * \param[in] gif The \ref nsgif_t object to get frame info for.
* \param[in] frame The frame number to get info for.
*
* \return The gif frame info, or NULL on error.
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=1fd945a79b7bd785ae4fc53c545614aca0c1bfc4
commit 1fd945a79b7bd785ae4fc53c545614aca0c1bfc4
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
API: Document pixel buffer format in header.
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.
-----------------------------------------------------------------------
Summary of changes:
include/nsgif.h | 42 +++++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 17 deletions(-)
diff --git a/include/nsgif.h b/include/nsgif.h
index b60747f..6bf2dd6 100644
--- a/include/nsgif.h
+++ b/include/nsgif.h
@@ -23,10 +23,13 @@
/** Representation of infinity. */
#define NSGIF_INFINITE (UINT32_MAX)
+/**
+ * Opaque type used by LibNSGIF to represent a GIF object in memory.
+ */
typedef struct nsgif nsgif_t;
/**
- * GIF rectangle structure.
+ * LibNSGIF rectangle structure.
*
* * Top left coordinate is `(x0, y0)`.
* * Width is `x1 - x0`.
@@ -45,7 +48,7 @@ typedef struct nsgif_rect {
} nsgif_rect_t;
/**
- * NSGIF return codes.
+ * LibNSGIF return codes.
*/
typedef enum {
/**
@@ -104,7 +107,11 @@ typedef enum {
* Client bitmap type.
*
* These are client-created and destroyed, via the \ref bitmap callbacks,
- * but they are owned by a \ref nsgif.
+ * but they are owned by a \ref nsgif_t.
+ *
+ * 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 +137,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.
@@ -174,7 +182,7 @@ const char *nsgif_strerror(nsgif_error err);
* Create the NSGIF object.
*
* \param[in] bitmap_vt Bitmap operation functions v-table.
- * \param[out] gif_out Return NSGIF object on success.
+ * \param[out] gif_out Return \ref nsgif_t object on success.
*
* \return NSGIF_OK on success, or appropriate error otherwise.
*/
@@ -200,14 +208,14 @@ void nsgif_destroy(nsgif_t *gif);
* already given to \ref nsgif_data_scan must be provided each time.
*
* For example, if you call \ref nsgif_data_scan with 25 bytes of data, and
then
- * fetch another 10 bytes, you would need to call \ref nsgif_data with a size
of
- * 35 bytes, and the whole 35 bytes must be contiguous memory. It is safe to
- * `realloc` the source buffer between calls to \ref nsgif_data_scan. (The
- * actual data pointer is allowed to be different.)
+ * fetch another 10 bytes, you would need to call \ref nsgif_data_scan with a
+ * size of 35 bytes, and the whole 35 bytes must be contiguous memory. It is
+ * safe to `realloc` the source buffer between calls to \ref nsgif_data_scan.
+ * (The actual data pointer is allowed to be different.)
*
* If an error occurs, all previously scanned frames are retained.
*
- * \param[in] gif The NSGIF object.
+ * \param[in] gif The \ref nsgif_t object.
* \param[in] size Number of bytes in data.
* \param[in] data Raw source GIF data.
*
@@ -225,7 +233,7 @@ nsgif_error nsgif_data_scan(
* returned `delay_cs` will be \ref NSGIF_INFINITE, indicating that the frame
* should be shown forever.
*
- * \param[in] gif The NSGIF object.
+ * \param[in] gif The \ref nsgif_t object.
* \param[out] area The area in pixels that must be redrawn.
* \param[out] delay_cs Time to wait after frame_new before next frame in cs.
* \param[out] frame_new The frame to decode.
@@ -241,7 +249,7 @@ nsgif_error nsgif_frame_prepare(
/**
* Decodes a GIF frame.
*
- * \param[in] gif The nsgif object.
+ * \param[in] gif The \ref nsgif_t object.
* \param[in] frame The frame number to decode.
* \param[out] bitmap On success, returns pointer to the client-allocated,
* nsgif-owned client bitmap structure.
@@ -259,9 +267,9 @@ nsgif_error nsgif_frame_decode(
* Some animations are only meant to loop N times, and then show the
* final frame forever. This function resets the loop and frame counters,
* so that the animation can be replayed without the overhead of recreating
- * the NSGIF object and rescanning the raw data.
+ * the \ref nsgif_t object and rescanning the raw data.
*
- * \param[in] gif A NSGIF object.
+ * \param[in] gif A \ref nsgif_t object.
*
* \return NSGIF_OK on success, or appropriate error otherwise.
*/
@@ -323,18 +331,18 @@ typedef struct nsgif_frame_info {
} nsgif_frame_info_t;
/**
- * Get information about a GIF from an NSGIF object.
+ * Get information about a GIF from an \ref nsgif_t object.
*
- * \param[in] gif The NSGIF object to get info for.
+ * \param[in] gif The \ref nsgif_t object to get info for.
*
* \return The gif info, or NULL on error.
*/
const nsgif_info_t *nsgif_get_info(const nsgif_t *gif);
/**
- * Get information about a GIF from an NSGIF object.
+ * Get information about a GIF from an \ref nsgif_t object.
*
- * \param[in] gif The NSGIF object to get frame info for.
+ * \param[in] gif The \ref nsgif_t object to get frame info for.
* \param[in] frame The frame number to get info for.
*
* \return The gif frame info, or NULL on error.
--
NetSurf GIF Decoder
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]