mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
vwebp: make 'd' key toggle the debugging of fragments
it actually disables the disposal / blending method and just displays the raw delta values. Useful for debugging. TODO: Outline the refreshed area with a drawn rectangle? Change-Id: I6f8cddd0aad8b953cff78a693ae7e8c31def010c
This commit is contained in:
parent
bc18ebad2e
commit
c85adb33d2
1
README
1
README
@ -384,6 +384,7 @@ Options are:
|
|||||||
Keyboard shortcuts:
|
Keyboard shortcuts:
|
||||||
'c' ................ toggle use of color profile
|
'c' ................ toggle use of color profile
|
||||||
'i' ................ overlay file information
|
'i' ................ overlay file information
|
||||||
|
'd' ................ disable blending & disposal (debug)
|
||||||
'q' / 'Q' / ESC .... quit
|
'q' / 'Q' / ESC .... quit
|
||||||
|
|
||||||
Building:
|
Building:
|
||||||
|
@ -54,6 +54,7 @@ static struct {
|
|||||||
int done;
|
int done;
|
||||||
int decoding_error;
|
int decoding_error;
|
||||||
int print_info;
|
int print_info;
|
||||||
|
int only_deltas;
|
||||||
int use_color_profile;
|
int use_color_profile;
|
||||||
|
|
||||||
int canvas_width, canvas_height;
|
int canvas_width, canvas_height;
|
||||||
@ -252,6 +253,9 @@ static void HandleKey(unsigned char key, int pos_x, int pos_y) {
|
|||||||
// more involved though (need to save the previous frame).
|
// more involved though (need to save the previous frame).
|
||||||
if (!kParams.has_animation) ClearPreviousFrame();
|
if (!kParams.has_animation) ClearPreviousFrame();
|
||||||
glutPostRedisplay();
|
glutPostRedisplay();
|
||||||
|
} else if (key == 'd') {
|
||||||
|
kParams.only_deltas = 1 - kParams.only_deltas;
|
||||||
|
glutPostRedisplay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +318,9 @@ static void HandleDisplay(void) {
|
|||||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, pic->u.RGBA.stride / 4);
|
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) {
|
curr->blend_method == WEBP_MUX_NO_BLEND) {
|
||||||
// glScissor() takes window coordinates (0,0 at bottom left).
|
// glScissor() takes window coordinates (0,0 at bottom left).
|
||||||
int window_x, window_y;
|
int window_x, window_y;
|
||||||
@ -414,6 +420,7 @@ static void Help(void) {
|
|||||||
"Keyboard shortcuts:\n"
|
"Keyboard shortcuts:\n"
|
||||||
" 'c' ................ toggle use of color profile\n"
|
" 'c' ................ toggle use of color profile\n"
|
||||||
" 'i' ................ overlay file information\n"
|
" 'i' ................ overlay file information\n"
|
||||||
|
" 'd' ................ disable blending & disposal (debug)\n"
|
||||||
" 'q' / 'Q' / ESC .... quit\n"
|
" 'q' / 'Q' / ESC .... quit\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\" Hey, EMACS: -*- nroff -*-
|
.\" Hey, EMACS: -*- nroff -*-
|
||||||
.TH VWEBP 1 "June 23, 2016"
|
.TH VWEBP 1 "November 25, 2016"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
vwebp \- decompress a WebP file and display it in a window
|
vwebp \- decompress a WebP file and display it in a window
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -59,6 +59,9 @@ Toggle use of color profile.
|
|||||||
.B 'i'
|
.B 'i'
|
||||||
Overlay file information.
|
Overlay file information.
|
||||||
.TP
|
.TP
|
||||||
|
.B 'd'
|
||||||
|
Disable blending and disposal process, for debugging purposes.
|
||||||
|
.TP
|
||||||
.B 'q' / 'Q' / ESC
|
.B 'q' / 'Q' / ESC
|
||||||
Quit.
|
Quit.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user