aboutsummaryrefslogtreecommitdiff
path: root/commands.c
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2013-11-14 14:47:36 +0100
committerBert Münnich <ber.t@posteo.de>2013-11-14 14:47:36 +0100
commit2737fc8b81829372d454f407e19733d66d964272 (patch)
tree976ee138e2fdcaba94c3c17073720834c1b45aa6 /commands.c
parent38bc23405d619a7ba430731f141157104f2267f9 (diff)
parent0353e6eea265f5f6fa53eb75300529d9ffa6d4fa (diff)
Merge remote-tracking branch 'ariand/gamma'
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/commands.c b/commands.c
index 97b5405..0e0029c 100644
--- a/commands.c
+++ b/commands.c
@@ -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;