diff options
author | András Mohari <andras.mohari@gmail.com> | 2013-11-13 20:54:09 +0100 |
---|---|---|
committer | András Mohari <andras.mohari@gmail.com> | 2013-11-13 20:54:09 +0100 |
commit | 0353e6eea265f5f6fa53eb75300529d9ffa6d4fa (patch) | |
tree | 8b1e30131ec3eb3edd4cd7df7d955db3270b0c17 /commands.c | |
parent | 450c1ed9b54de4d374bff80735c874bb6f7a4a0f (diff) | |
download | nsxiv-0353e6eea265f5f6fa53eb75300529d9ffa6d4fa.tar.zst |
Add support for changing the gamma value
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -474,6 +474,22 @@ bool i_toggle_antialias(arg_t a) } } +/* a < 0: decrease gamma + * a == 0: reset gamma + * a > 0: increase gamma + */ +bool i_change_gamma(arg_t a) +{ + if (mode == MODE_IMAGE) { + long val = (long) a; + int delta = val > 0 ? 1 : (val < 0 ? -1 : -img.gamma); + img_set_gamma(&img, img.gamma + delta); + return true; + } else { + return false; + } +} + bool it_toggle_alpha(arg_t a) { img.alpha = tns.alpha = !img.alpha; |