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:
authorAntony Riakiotakis <kalast@gmail.com>2015-03-17 16:15:05 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-03-17 16:15:05 +0300
commit42aac45d7f0e0f43725093e97ebb8175a95aa247 (patch)
tree80ce127f3443711bf2f0c8f2a12cbc82f9f8c7ad
parentbf8ea6b60e69e6dd77d94c66cbcbab2a8e0b73f8 (diff)
Part 1 of D1082 by Troy Sobotka, add API in OCIO for luminance
calculation.
-rw-r--r--intern/opencolorio/fallback_impl.cc13
-rw-r--r--intern/opencolorio/ocio_capi.cc5
-rw-r--r--intern/opencolorio/ocio_capi.h2
-rw-r--r--intern/opencolorio/ocio_impl.cc10
-rw-r--r--intern/opencolorio/ocio_impl.h6
-rw-r--r--release/datafiles/colormanagement/config.ocio2
6 files changed, 37 insertions, 1 deletions
diff --git a/intern/opencolorio/fallback_impl.cc b/intern/opencolorio/fallback_impl.cc
index d1493cb3ad5..136f427ee0e 100644
--- a/intern/opencolorio/fallback_impl.cc
+++ b/intern/opencolorio/fallback_impl.cc
@@ -162,6 +162,19 @@ const char *FallbackImpl::configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *
return "sRGB";
}
+void FallbackImpl::configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr * /*config*/, float *rgb)
+{
+ /* Here we simply use the older Blender assumed primaries of
+ * ITU-BT.709 / sRGB, or 0.2126729 0.7151522 0.0721750. Brute
+ * force stupid, but only plausible option given no color management
+ * system in place.
+ */
+
+ rgb[0] = 0.2126729f;
+ rgb[1] = 0.7151522f;
+ rgb[2] = 0.0721750f;
+}
+
int FallbackImpl::configGetNumLooks(OCIO_ConstConfigRcPtr * /*config*/)
{
return 0;
diff --git a/intern/opencolorio/ocio_capi.cc b/intern/opencolorio/ocio_capi.cc
index a4f2db456e8..7a0b9faa5fc 100644
--- a/intern/opencolorio/ocio_capi.cc
+++ b/intern/opencolorio/ocio_capi.cc
@@ -132,6 +132,11 @@ const char *OCIO_configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *config, c
return impl->configGetDisplayColorSpaceName(config, display, view);
}
+void OCIO_configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr *config, float *rgb)
+{
+ impl->configGetDefaultLumaCoefs(config, rgb);
+}
+
int OCIO_configGetNumLooks(OCIO_ConstConfigRcPtr *config)
{
return impl->configGetNumLooks(config);
diff --git a/intern/opencolorio/ocio_capi.h b/intern/opencolorio/ocio_capi.h
index d667dece62a..52a86727902 100644
--- a/intern/opencolorio/ocio_capi.h
+++ b/intern/opencolorio/ocio_capi.h
@@ -140,6 +140,8 @@ int OCIO_configGetNumViews(OCIO_ConstConfigRcPtr *config, const char *di
const char *OCIO_configGetView(OCIO_ConstConfigRcPtr *config, const char *display, int index);
const char *OCIO_configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *config, const char *display, const char *view);
+void OCIO_configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr *config, float *rgb);
+
int OCIO_configGetNumLooks(OCIO_ConstConfigRcPtr *config);
const char *OCIO_configGetLookNameByIndex(OCIO_ConstConfigRcPtr *config, int index);
OCIO_ConstLookRcPtr *OCIO_configGetLook(OCIO_ConstConfigRcPtr *config, const char *name);
diff --git a/intern/opencolorio/ocio_impl.cc b/intern/opencolorio/ocio_impl.cc
index 5015f3a5c7d..bf5590077ef 100644
--- a/intern/opencolorio/ocio_impl.cc
+++ b/intern/opencolorio/ocio_impl.cc
@@ -272,6 +272,16 @@ const char *OCIOImpl::configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *conf
return NULL;
}
+void OCIOImpl::configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr *config, float *rgb)
+{
+ try {
+ (*(ConstConfigRcPtr *) config)->getDefaultLumaCoefs(rgb);
+ }
+ catch (Exception &exception) {
+ OCIO_reportException(exception);
+ }
+}
+
int OCIOImpl::configGetNumLooks(OCIO_ConstConfigRcPtr *config)
{
try {
diff --git a/intern/opencolorio/ocio_impl.h b/intern/opencolorio/ocio_impl.h
index 47e6d829902..f086bbb1a26 100644
--- a/intern/opencolorio/ocio_impl.h
+++ b/intern/opencolorio/ocio_impl.h
@@ -58,6 +58,8 @@ public:
virtual const char *configGetView(OCIO_ConstConfigRcPtr *config, const char *display, int index) = 0;
virtual const char *configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *config, const char *display, const char *view) = 0;
+ virtual void configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr *config, float *rgb) = 0;
+
virtual int configGetNumLooks(OCIO_ConstConfigRcPtr *config) = 0;
virtual const char *configGetLookNameByIndex(OCIO_ConstConfigRcPtr *config, int index) = 0;
virtual OCIO_ConstLookRcPtr *configGetLook(OCIO_ConstConfigRcPtr *config, const char *name) = 0;
@@ -145,6 +147,8 @@ public:
const char *configGetView(OCIO_ConstConfigRcPtr *config, const char *display, int index);
const char *configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *config, const char *display, const char *view);
+ void configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr *config, float *rgb);
+
int configGetNumLooks(OCIO_ConstConfigRcPtr *config);
const char *configGetLookNameByIndex(OCIO_ConstConfigRcPtr *config, int index);
OCIO_ConstLookRcPtr *configGetLook(OCIO_ConstConfigRcPtr *config, const char *name);
@@ -233,6 +237,8 @@ public:
const char *configGetView(OCIO_ConstConfigRcPtr *config, const char *display, int index);
const char *configGetDisplayColorSpaceName(OCIO_ConstConfigRcPtr *config, const char *display, const char *view);
+ void configGetDefaultLumaCoefs(OCIO_ConstConfigRcPtr *config, float *rgb);
+
int configGetNumLooks(OCIO_ConstConfigRcPtr *config);
const char *configGetLookNameByIndex(OCIO_ConstConfigRcPtr *config, int index);
OCIO_ConstLookRcPtr *configGetLook(OCIO_ConstConfigRcPtr *config, const char *name);
diff --git a/release/datafiles/colormanagement/config.ocio b/release/datafiles/colormanagement/config.ocio
index 1cf9a3bb36e..7ecc9768d57 100644
--- a/release/datafiles/colormanagement/config.ocio
+++ b/release/datafiles/colormanagement/config.ocio
@@ -6,7 +6,7 @@ ocio_profile_version: 1
search_path: luts
strictparsing: true
-luma: [0.2126, 0.7152, 0.0722]
+luma: [0.2126729, 0.7151522, 0.0721750]
description: RRT version ut33