From 95bc9b463b87236d30d86626e1052e6979d6510f Mon Sep 17 00:00:00 2001 From: Berke Kocaoğlu Date: Thu, 22 Dec 2022 11:21:40 +0000 Subject: add brightness and contrast (#396) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Imlib2 supports modifying gamma, brightness and contrast directly while sxiv only supports gamma. Makes sense to extend it to brightness and contrast as well. * Since color corrections need to be aware of each other, they have been refactored into one centralized function. * This also makes the code more hackable as it makes it easier to add more color correction functions without them interfering with each other. Co-authored-by: 0ion9 Co-authored-by: NRK Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/396 Reviewed-by: NRK Reviewed-by: TAAPArthur Co-authored-by: Berke Kocaoğlu Co-committed-by: Berke Kocaoğlu --- commands.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'commands.h') diff --git a/commands.h b/commands.h index c4c3973..76b1330 100644 --- a/commands.h +++ b/commands.h @@ -4,6 +4,8 @@ /* global */ bool cg_change_gamma(arg_t); +bool cg_change_brightness(arg_t); +bool cg_change_contrast(arg_t); bool cg_first(arg_t); bool cg_mark_range(arg_t); bool cg_n_or_last(arg_t); @@ -47,6 +49,8 @@ bool ct_select(arg_t); #ifdef INCLUDE_MAPPINGS_CONFIG /* global */ #define g_change_gamma { cg_change_gamma, MODE_ALL } +#define g_change_brightness { cg_change_brightness, MODE_ALL } +#define g_change_contrast { cg_change_contrast, MODE_ALL } #define g_first { cg_first, MODE_ALL } #define g_mark_range { cg_mark_range, MODE_ALL } #define g_n_or_last { cg_n_or_last, MODE_ALL } -- cgit v1.2.3-54-g00ecf