Commit Graph

8 Commits

Author SHA1 Message Date
Berke Kocaoğlu
95bc9b463b 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>
2022-12-22 11:21:40 +00:00
NRK
9cb9a54944 [ci]: make it easy to run analysis locally (#395)
allows for developers to more easily run the analysis locally before
opening a pull request if they wish.

also disables a noisy warning (bugprone-assignment-in-if-condition)
producing too many false positives.

Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/395
Reviewed-by: Berke Kocaoğlu <kberke@metu.edu.tr>
Co-authored-by: NRK <nrk@disroot.org>
Co-committed-by: NRK <nrk@disroot.org>
2022-12-02 10:50:15 +00:00
NRK
aa56aa2303 [ci]: try building all combination with tcc (#338)
this will hopefully catch issues like [337] in the future.

not using gcc and/or clang since we have 5 build options right now,
which means 2^5 = 32 different combination. using gcc/clang would take
too much resources and time; meanwhile tcc is lightning fast.

[337]: https://codeberg.org/nsxiv/nsxiv/pulls/337

Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/338
Reviewed-by: eylles <eylles@noreply.codeberg.org>
2022-10-07 15:37:44 +02:00
NRK
88a480c938 allow disabling anti-aliasing via cli flag
simply running nsxiv with `--anti-alias` will enable anti-aliasing, and
running it with `--anti-alias=no` will disable it.

the cli flag will overwrite the config.h default.

Closes: https://codeberg.org/nsxiv/nsxiv/issues/349
2022-09-10 19:43:07 +06:00
NRK
ba39006574 [ci]: disable noisy checks (#365)
* disable `cert-err33-c` and `readability-identifier-length` check
  which causes warnings on clang-tidy v14.
* disable all "readability" checks by default, instead just opt-into the
  useful ones (such as duplicate include).

Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/365
Reviewed-by: Berke Kocaoğlu <berke.kocaoglu@metu.edu.tr>
2022-09-05 03:47:32 +02:00
NRK
32bfe58915 Misc docs cleanup (#362)
* link to online man-page
* rename: "N-R-K" -> "NRK"
* separate multiple links with a comma.
  otherwise the links get messed up due to `[] []` being valid syntax for
  reference style links with the 2nd `[]` serving as `id`.
* prefer codeberg links over github ones

Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/362
Reviewed-by: explosion-mental <explosion-mental@noreply.codeberg.org>
2022-08-19 08:36:53 +02:00
NRK
216f312578 add support for long-opts (#332)
Uses [optparse] to add support for long-opts. optparse is posix
compliant with getopt(3) and thus would be backwards compatible.
It does not have any dependency (not even the c standard library!) and
is C89 compatible and thus fits our current code-style.

[optparse]: https://github.com/skeeto/optparse

Note that we're using a couple `pragma`-s to silence some harmless
warnings. This should be portable because these pragma-s don't change the
behavior of the program. Furthermore, C standard mandates that unknown
pragma's should be ignored by the compiler and thus would not result in
build failure on compilers which do not recognize them.

Closes: https://codeberg.org/nsxiv/nsxiv/issues/328
Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/332
Reviewed-by: eylles <eylles@noreply.codeberg.org>
2022-08-16 10:43:50 +02:00
NRK
fb9686c650 Move uncritical files into etc/ (#350)
This is mainly just to reduce the amount of files in the project root.
The criteria of what gets into `etc/` are the following:

* The file should not be necessary for building nsxiv. This excludes the
  `icon/*` stuff since that's needed by `window.c`.
* The file shouldn't have any valid reason to stay in the project root.
  This excludes things like `README.md`, `.gitignore` etc.

Reviewed-on: https://codeberg.org/nsxiv/nsxiv/pulls/350
Reviewed-by: explosion-mental <explosion-mental@noreply.codeberg.org>
2022-08-09 16:21:52 +02:00