imageworks/OpenColorIO — Issue #231: XYZ to RGB matrix constructor
Author: dbr
Created: 2012-03-07 12:58:29+00:00
State: open

http://opencolorio.org/FAQ.html#can-you-convert-xyz-named-color-space-rgb-values

> But there is no convenience function to compute this matrix for you. (We do include other Matrix convenience functions though, so it already has a place to be added. See MatrixTransform in export/OpenColorTransforms.h)

Is this something people have asked for? I have the XYZ->RGB matrix calculation implemented in Python somewhere, and converting it to C++ should be easy enough

If so, my only initial question would be: how would it be used in the config? E.g the current matrix usage looks like:

- !
matrix: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
offset: [0, 0, 0, 0]

Should it be coerced into the above transform, or made into a new one? Something like this seems tidiest to me:

- !
red_primary_xy: [0.64, 0.33]
green_primary_xy: [0.3, 0.6]
blue_primary_xy: [0.15, 0.06]
whitepoint_xy: [0.3127, 0.3290]
direction: inverse # RGB to XYZ