add brightness and contrast (#396)

* 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 <finticemo@gmail.com>
Co-authored-by: NRK <nrk@disroot.org>
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/396
Reviewed-by: NRK <nrk@disroot.org>
Reviewed-by: TAAPArthur <taaparthur@noreply.codeberg.org>
Co-authored-by: Berke Kocaoğlu <kberke@metu.edu.tr>
Co-committed-by: Berke Kocaoğlu <kberke@metu.edu.tr>
This commit is contained in:
Berke Kocaoğlu
2022-12-22 11:21:40 +00:00
committed by NRK
parent 9cb9a54944
commit 95bc9b463b
7 changed files with 92 additions and 35 deletions

View File

@ -209,6 +209,26 @@ steps.
.TP
.B Ctrl-g
Reset gamma correction.
.TP
.B [
Decrease brightness correction by
.I count
steps.
.TP
.B ]
Increase brightness correction by
.I count
steps.
.TP
.B (
Decrease contrast by
.I count
steps.
.TP
.B )
Increase contrast by
.I count
steps.
.SS Thumbnail mode
The following keyboard commands are only available in thumbnail mode:
.TP