This is the first pass to repair the legacy luminance conversions happening via the various hard coded math routines.
Problems with current mechanisms in math_color_inline.c:
- Many of the functions break colormanagement. That is, they are ignorant of the reference space primaries and the results are therefore broken.
- In particular, the luminance weights are all over the map. This stems from what appears to be a mixture of malformed color knowledge and, in some cases, an attempt to hack linearization and luminance into singular values. Both approaches are incorrect.
This was loosely started when @Kévin Dietrich (kevindietrich) began work on D517. This work attempts to properly glean correct luminance values from the OCIO configuration.