Merge "vwebp: make 'd' key toggle the debugging of fragments"
diff --git a/README b/README
index ba4e8c5..908e559 100644
--- a/README
+++ b/README
@@ -384,6 +384,7 @@
Keyboard shortcuts:
'c' ................ toggle use of color profile
'i' ................ overlay file information
+ 'd' ................ disable blending & disposal (debug)
'q' / 'Q' / ESC .... quit
Building:
diff --git a/examples/vwebp.c b/examples/vwebp.c
index 0fddf72..17887f7 100644
--- a/examples/vwebp.c
+++ b/examples/vwebp.c
@@ -54,6 +54,7 @@
int done;
int decoding_error;
int print_info;
+ int only_deltas;
int use_color_profile;
int canvas_width, canvas_height;
@@ -252,6 +253,9 @@
// more involved though (need to save the previous frame).
if (!kParams.has_animation) ClearPreviousFrame();
glutPostRedisplay();
+ } else if (key == 'd') {
+ kParams.only_deltas = 1 - kParams.only_deltas;
+ glutPostRedisplay();
}
}
@@ -314,7 +318,9 @@
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ROW_LENGTH, pic->u.RGBA.stride / 4);
- if (prev->dispose_method == WEBP_MUX_DISPOSE_BACKGROUND ||
+ if (kParams.only_deltas) {
+ DrawCheckerBoard();
+ } else if (prev->dispose_method == WEBP_MUX_DISPOSE_BACKGROUND ||
curr->blend_method == WEBP_MUX_NO_BLEND) {
// glScissor() takes window coordinates (0,0 at bottom left).
int window_x, window_y;
@@ -414,6 +420,7 @@
"Keyboard shortcuts:\n"
" 'c' ................ toggle use of color profile\n"
" 'i' ................ overlay file information\n"
+ " 'd' ................ disable blending & disposal (debug)\n"
" 'q' / 'Q' / ESC .... quit\n"
);
}
diff --git a/man/vwebp.1 b/man/vwebp.1
index a7d5181..4ec346a 100644
--- a/man/vwebp.1
+++ b/man/vwebp.1
@@ -1,5 +1,5 @@
.\" Hey, EMACS: -*- nroff -*-
-.TH VWEBP 1 "June 23, 2016"
+.TH VWEBP 1 "November 25, 2016"
.SH NAME
vwebp \- decompress a WebP file and display it in a window
.SH SYNOPSIS
@@ -59,6 +59,9 @@
.B 'i'
Overlay file information.
.TP
+.B 'd'
+Disable blending and disposal process, for debugging purposes.
+.TP
.B 'q' / 'Q' / ESC
Quit.