diff options
Diffstat (limited to 'commands.c')
-rw-r--r-- | commands.c | 27 |
1 files changed, 20 insertions, 7 deletions
@@ -222,15 +222,28 @@ bool cg_navigate_marked(arg_t n) return navigate_to(new); } -bool cg_change_gamma(arg_t d) +static bool change_color_modifier(arg_t d, int *target) { - if (img_change_gamma(&img, d * (prefix > 0 ? prefix : 1))) { - if (mode == MODE_THUMB) - tns.dirty = true; - return true; - } else { + if (!img_change_color_modifier(&img, d * (prefix > 0 ? prefix : 1), target)) return false; - } + if (mode == MODE_THUMB) + tns.dirty = true; + return true; +} + +bool cg_change_gamma(arg_t d) +{ + return change_color_modifier(d, &img.gamma); +} + +bool cg_change_brightness(arg_t d) +{ + return change_color_modifier(d, &img.brightness); +} + +bool cg_change_contrast(arg_t d) +{ + return change_color_modifier(d, &img.contrast); } bool ci_navigate(arg_t n) |