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 --- main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 44f8eb9..8ee5b9d 100644 --- a/main.c +++ b/main.c @@ -444,6 +444,10 @@ static void update_info(void) } if (img.gamma) bar_put(r, "G%+d" BAR_SEP, img.gamma); + if (img.brightness) + bar_put(r, "B%+d" BAR_SEP, img.brightness); + if (img.contrast) + bar_put(r, "C%+d" BAR_SEP, img.contrast); bar_put(r, "%3d%%" BAR_SEP, (int) (img.zoom * 100.0)); if (img.multi.cnt > 0) { for (fn = 0, i = img.multi.cnt; i > 0; fn++, i /= 10); -- cgit v1.2.3-70-g09d2