Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-05-19 21:31:58 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-05-23 16:34:50 +0300
commit469ee7ff1529a1b28ce0b300835ebc42d5c5362f (patch)
tree9be3874673f222ac3c3773fe726f0158287ac1e6 /intern/opencolorio/ocio_capi.h
parent2f2d13b8c664b90a7d3249d6ad71bac3d519026d (diff)
Python API: add mathutils.Color functions to convert color spaces
Between scene linear and sRGB, XYZ, linear Rec.709 and ACES2065-1. And add some clarifications about color spaces in the docs. Fixes T98267 Ref T68926 Differential Revision: https://developer.blender.org/D14989
Diffstat (limited to 'intern/opencolorio/ocio_capi.h')
-rw-r--r--intern/opencolorio/ocio_capi.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/intern/opencolorio/ocio_capi.h b/intern/opencolorio/ocio_capi.h
index 9bd4ec374e2..4be838a218d 100644
--- a/intern/opencolorio/ocio_capi.h
+++ b/intern/opencolorio/ocio_capi.h
@@ -31,10 +31,15 @@ OCIO_DECLARE_HANDLE(OCIO_ConstContextRcPtr);
OCIO_DECLARE_HANDLE(OCIO_PackedImageDesc);
OCIO_DECLARE_HANDLE(OCIO_ConstLookRcPtr);
-/* Standard XYZ to linear sRGB transform, for fallback. */
-static const float OCIO_XYZ_TO_LINEAR_SRGB[3][3] = {{3.2404542f, -0.9692660f, 0.0556434f},
- {-1.5371385f, 1.8760108f, -0.2040259f},
- {-0.4985314f, 0.0415560f, 1.0572252f}};
+/* Standard XYZ (D65) to linear Rec.709 transform. */
+static const float OCIO_XYZ_TO_REC709[3][3] = {{3.2404542f, -0.9692660f, 0.0556434f},
+ {-1.5371385f, 1.8760108f, -0.2040259f},
+ {-0.4985314f, 0.0415560f, 1.0572252f}};
+/* Standard ACES to XYZ (D65) transform.
+ * Matches OpenColorIO builtin transform: UTILITY - ACES-AP0_to_CIE-XYZ-D65_BFD. */
+static const float OCIO_ACES_TO_XYZ[3][3] = {{0.938280f, 0.337369f, 0.001174f},
+ {-0.004451f, 0.729522f, -0.003711f},
+ {0.016628f, -0.066890f, 1.091595f}};
/* This structure is used to pass curve mapping settings from
* blender's DNA structure stored in view transform settings