Add support for changing the gamma value

This commit is contained in:
András Mohari
2013-11-13 20:54:09 +01:00
parent 450c1ed9b5
commit 0353e6eea2
9 changed files with 91 additions and 3 deletions

View File

@ -46,6 +46,12 @@ enum {
GIF_LOOP = 0 /* endless loop [0/1] */
};
/* gamma correction: the user-visible ranges [-GAMMA_RANGE, 0] and
* (0, GAMMA_RANGE] are mapped to the ranges [0, 1], and (1, GAMMA_MAX].
* */
static const double GAMMA_MAX = 10.0;
static const int GAMMA_RANGE = 32;
#endif
#ifdef _THUMBS_CONFIG
@ -141,6 +147,11 @@ static const keymap_t keys[] = {
{ false, XK_a, i_toggle_antialias, (arg_t) None },
{ false, XK_A, it_toggle_alpha, (arg_t) None },
/* decrease/increase/reset gamma */
{ false, XK_braceleft, i_change_gamma, (arg_t) -1 },
{ false, XK_braceright, i_change_gamma, (arg_t) +1 },
{ true, XK_G, i_change_gamma, (arg_t) 0 },
/* open current image with given program: */
{ true, XK_g, it_open_with, (arg_t) "gimp" },