Matthias Clasen
f62606105e
Fix up transfer function symmetry
...
The easiest things trigger the silliest mistakes. Add tests
for various properties we want our transfer functions to have,
such as:
- be inverse of each other
- stay within the defined ranges
- by symmetric around 0
2024-08-14 11:45:25 -04:00
Matthias Clasen
e1fbd52c29
gdk: Handle negative values in all transfer function
...
Make sure that for all eotfs/oetfs, eotf(x) == -eotf(-x)
In particular, don't pass negative values to pow() and cause
undefined behavior.
2024-08-13 15:47:17 -04:00
Matthias Clasen
50ea9450ea
cicp: Fill in some more transfer functions
...
Handle gamma 2.2 and gamma 2.8.
2024-07-28 11:56:43 -04:00
Matthias Clasen
1373a7a6f0
Change the matrix implementation
...
Go from float[3][3] to float[9]. That is easier to manage in
static initialization.
2024-07-27 19:20:14 -04:00
Matthias Clasen
c9443dd04d
Fix the hlg transfer function
...
Fix a bug in the formula, and enable hlg as a transfer function.
The tests are passing now.
2024-07-24 18:59:18 -06:00
Matthias Clasen
a46bcc2755
Move transfer functions and matrices to a header
...
This way, we can write tests against them without static linking.
2024-07-24 16:45:21 -06:00