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 --- nsxiv.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nsxiv.h') diff --git a/nsxiv.h b/nsxiv.h index 7bf7e25..33a2bde 100644 --- a/nsxiv.h +++ b/nsxiv.h @@ -181,6 +181,8 @@ struct img { Imlib_Color_Modifier cmod; int gamma; + int brightness; + int contrast; scalemode_t scalemode; float zoom; @@ -212,7 +214,8 @@ bool img_pan_edge(img_t*, direction_t); void img_rotate(img_t*, degree_t); void img_flip(img_t*, flipdir_t); void img_toggle_antialias(img_t*); -bool img_change_gamma(img_t*, int); +void img_update_color_modifiers(img_t*); +bool img_change_color_modifier(img_t*, int, int*); bool img_frame_navigate(img_t*, int); bool img_frame_animate(img_t*); Imlib_Image img_open(const fileinfo_t*); -- cgit v1.2.3-54-g00ecf