diff options
Diffstat (limited to 'intern/opencolorio/ocio_impl.cc')
-rw-r--r-- | intern/opencolorio/ocio_impl.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/intern/opencolorio/ocio_impl.cc b/intern/opencolorio/ocio_impl.cc index 8d9c5dd2d49..7cf7fbefcd6 100644 --- a/intern/opencolorio/ocio_impl.cc +++ b/intern/opencolorio/ocio_impl.cc @@ -311,13 +311,14 @@ static bool to_scene_linear_matrix(ConstConfigRcPtr &config, return true; } -void OCIOImpl::configGetXYZtoRGB(OCIO_ConstConfigRcPtr *config_, float xyz_to_rgb[3][3]) +void OCIOImpl::configGetXYZtoSceneLinear(OCIO_ConstConfigRcPtr *config_, + float xyz_to_scene_linear[3][3]) { ConstConfigRcPtr config = (*(ConstConfigRcPtr *)config_); /* Default to ITU-BT.709 in case no appropriate transform found. * Note XYZ is defined here as having a D65 white point. */ - memcpy(xyz_to_rgb, OCIO_XYZ_TO_LINEAR_SRGB, sizeof(OCIO_XYZ_TO_LINEAR_SRGB)); + memcpy(xyz_to_scene_linear, OCIO_XYZ_TO_REC709, sizeof(OCIO_XYZ_TO_REC709)); /* Get from OpenColorO config if it has the required roles. */ if (!config->hasRole(ROLE_SCENE_LINEAR)) { @@ -326,22 +327,17 @@ void OCIOImpl::configGetXYZtoRGB(OCIO_ConstConfigRcPtr *config_, float xyz_to_rg if (config->hasRole("aces_interchange")) { /* Standard OpenColorIO role, defined as ACES AP0 (ACES2065-1). */ - float aces_to_rgb[3][3]; - if (to_scene_linear_matrix(config, "aces_interchange", aces_to_rgb)) { - /* This is the OpenColorIO builtin transform: - * UTILITY - ACES-AP0_to_CIE-XYZ-D65_BFD. */ - const float ACES_AP0_to_xyz_D65[3][3] = {{0.938280f, 0.337369f, 0.001174f}, - {-0.004451f, 0.729522f, -0.003711f}, - {0.016628f, -0.066890f, 1.091595f}}; + float aces_to_scene_linear[3][3]; + if (to_scene_linear_matrix(config, "aces_interchange", aces_to_scene_linear)) { float xyz_to_aces[3][3]; - invert_m3_m3(xyz_to_aces, ACES_AP0_to_xyz_D65); + invert_m3_m3(xyz_to_aces, OCIO_ACES_TO_XYZ); - mul_m3_m3m3(xyz_to_rgb, aces_to_rgb, xyz_to_aces); + mul_m3_m3m3(xyz_to_scene_linear, aces_to_scene_linear, xyz_to_aces); } } else if (config->hasRole("XYZ")) { /* Custom role used before the standard existed. */ - to_scene_linear_matrix(config, "XYZ", xyz_to_rgb); + to_scene_linear_matrix(config, "XYZ", xyz_to_scene_linear); } } |