Gitweb links:
...log
http://git.netsurf-browser.org/libnsgif.git/shortlog/be93a588b0e1d362b9587c2bdb1841b7743ef2e6
...commit
http://git.netsurf-browser.org/libnsgif.git/commit/be93a588b0e1d362b9587c2bdb1841b7743ef2e6
...tree
http://git.netsurf-browser.org/libnsgif.git/tree/be93a588b0e1d362b9587c2bdb1841b7743ef2e6
The branch, tlsa/expose-interlace has been created
at be93a588b0e1d362b9587c2bdb1841b7743ef2e6 (commit)
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=be93a588b0e1d362b9587c2bdb1841b7743ef2e6
commit be93a588b0e1d362b9587c2bdb1841b7743ef2e6
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
test: nsgif: Print whether frames are interlaced
diff --git a/test/nsgif.c b/test/nsgif.c
index 16a4bc9..29341e7 100644
--- a/test/nsgif.c
+++ b/test/nsgif.c
@@ -187,6 +187,7 @@ static void print_gif_frame_info(const nsgif_frame_info_t
*info, uint32_t i)
fprintf(stdout, " local palette: %s\n", info->local_palette ? "yes"
: "no");
fprintf(stdout, " disposal-method: %s\n", disposal);
fprintf(stdout, " transparency: %s\n", info->transparency ? "yes" :
"no");
+ fprintf(stdout, " interlaced: %s\n", info->interlaced ? "yes" :
"no");
fprintf(stdout, " display: %s\n", info->display ? "yes" : "no");
fprintf(stdout, " delay: %"PRIu32"\n", info->delay);
fprintf(stdout, " rect:\n");
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=aae138c2cf28e2220198bfaaabb4f5a646102837
commit aae138c2cf28e2220198bfaaabb4f5a646102837
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
gif: Set interlaced bool in frame info
diff --git a/src/gif.c b/src/gif.c
index 44c60a9..dafee1a 100644
--- a/src/gif.c
+++ b/src/gif.c
@@ -600,20 +600,15 @@ static inline nsgif_error nsgif__decode(
const uint8_t *data,
uint32_t *restrict frame_data)
{
- enum {
- GIF_MASK_INTERLACE = 0x40,
- };
-
nsgif_error ret;
uint32_t width = frame->info.rect.x1 - frame->info.rect.x0;
uint32_t height = frame->info.rect.y1 - frame->info.rect.y0;
uint32_t offset_x = frame->info.rect.x0;
uint32_t offset_y = frame->info.rect.y0;
- uint32_t interlace = frame->flags & GIF_MASK_INTERLACE;
uint32_t transparency_index = frame->transparency_index;
uint32_t *restrict colour_table = gif->colour_table;
- if (interlace == false && offset_x == 0 &&
+ if (frame->info.interlaced == false && offset_x == 0 &&
width == gif->info.width &&
width == gif->rowspan) {
ret = nsgif__decode_simple(gif, height, offset_y,
@@ -621,7 +616,7 @@ static inline nsgif_error nsgif__decode(
frame_data, colour_table);
} else {
ret = nsgif__decode_complex(gif, width, height,
- offset_x, offset_y, interlace,
+ offset_x, offset_y, frame->info.interlaced,
data, transparency_index,
frame_data, colour_table);
}
@@ -1020,6 +1015,7 @@ static nsgif_error nsgif__parse_image_descriptor(
enum {
NSGIF_IMAGE_DESCRIPTOR_LEN = 10u,
NSGIF_IMAGE_SEPARATOR = 0x2Cu,
+ NSGIF_MASK_INTERLACE = 0x40u,
};
assert(gif != NULL);
@@ -1047,6 +1043,8 @@ static nsgif_error nsgif__parse_image_descriptor(
frame->info.rect.x1 = x + w;
frame->info.rect.y1 = y + h;
+ frame->info.interlaced = frame->flags & NSGIF_MASK_INTERLACE;
+
/* Allow first frame to grow image dimensions. */
if (gif->info.frame_count == 0) {
if (x + w > gif->info.width) {
commitdiff
http://git.netsurf-browser.org/libnsgif.git/commit/?id=721319de4dbe15a772b11fff62fe0436373ab7fc
commit 721319de4dbe15a772b11fff62fe0436373ab7fc
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
api: Add interlaced bool to frame info
diff --git a/include/nsgif.h b/include/nsgif.h
index 7df8981..26897df 100644
--- a/include/nsgif.h
+++ b/include/nsgif.h
@@ -429,7 +429,8 @@ typedef struct nsgif_frame_info {
bool transparency;
/** whether the frame has a local colour table */
bool local_palette;
-
+ /** whether the frame is interlaced */
+ bool interlaced;
/** Disposal method for previous frame; affects plotting */
uint8_t disposal;
/** delay (in cs) before animating the frame */
-----------------------------------------------------------------------
--
NetSurf GIF Decoder
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]