DynamicProperty¶
-
class
PyOpenColorIO.
DynamicProperty
¶ Allows transform parameter values to be set on-the-fly (after finalization). For example, to modify the exposure in a viewport. Dynamic properties can be accessed from the
:ref:`CPUProcessor`
or:ref:`GpuShaderCreator`
to change values between processing.OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig(); OCIO::ConstProcessorRcPtr processor = config->getProcessor(colorSpace1, colorSpace2); OCIO::ConstCPUProcessorRcPtr cpuProcessor = processor->getDefaultCPUProcessor();
if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_EXPOSURE)) { // Get the in-memory implementation of the dynamic property. OCIO::DynamicPropertyRcPtr dynProp = cpuProcessor->getDynamicProperty(OCIO::DYNAMIC_PROPERTY_EXPOSURE); // Get the interface used to change the double value. OCIO::DynamicPropertyDoubleRcPtr exposure = OCIO::DynamicPropertyValue::AsDouble(dynProp); // Update of the dynamic property instance with the new value. exposure->setValue(1.1f); } if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_PRIMARY)) { OCIO::DynamicPropertyRcPtr dynProp = cpuProcessor->getDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_PRIMARY); OCIO::DynamicPropertyGradingPrimaryRcPtr primaryProp = OCIO::DynamicPropertyValue::AsGradingPrimary(dynProp); OCIO::GradingPrimary primary = primaryProp->getValue(); primary.m_saturation += 0.1f; rgbCurveProp->setValue(primary); } if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_RGBCURVE)) { OCIO::DynamicPropertyRcPtr dynProp = cpuProcessor->getDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_RGBCURVE); OCIO::DynamicPropertyGradingRGBCurveRcPtr rgbCurveProp = OCIO::DynamicPropertyValue::AsGradingRGBCurve(dynProp); OCIO::ConstGradingRGBCurveRcPtr rgbCurve = rgbCurveProp->getValue()->createEditableCopy(); OCIO::GradingBSplineCurveRcPtr rCurve = rgbCurve->getCurve(OCIO::RGB_RED); rCurve->getControlPoint(1).m_y += 0.1f; rgbCurveProp->setValue(rgbCurve); }
-
DynamicProperty
(*args, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
getDouble
() → float¶ Get the property as DynamicPropertyDoubleRcPtr to access the double value. Will throw if property type is not a type that holds a double such as DYNAMIC_PROPERTY_EXPOSURE.
-
getGradingPrimary
() → PyOpenColorIO.GradingPrimary¶ Get the property as DynamicPropertyGradingPrimaryRcPtr to access the GradingPrimary value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_PRIMARY.
-
getGradingRGBCurve
() → PyOpenColorIO.GradingRGBCurve¶ Get the property as DynamicPropertyGradingRGBCurveRcPtr to access the GradingRGBCurveRcPtr value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_RGBCURVE.
-
getGradingTone
() → PyOpenColorIO.GradingTone¶ Get the property as DynamicPropertyGradingToneRcPtr to access the GradingTone value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_TONE.
-
getType
() → PyOpenColorIO.DynamicPropertyType¶
-
setDouble
(val: float) → None¶ Get the property as DynamicPropertyDoubleRcPtr to access the double value. Will throw if property type is not a type that holds a double such as DYNAMIC_PROPERTY_EXPOSURE.
-
setGradingPrimary
(val: PyOpenColorIO.GradingPrimary) → None¶ Get the property as DynamicPropertyGradingPrimaryRcPtr to access the GradingPrimary value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_PRIMARY.
-
setGradingRGBCurve
(val: PyOpenColorIO.GradingRGBCurve) → None¶ Get the property as DynamicPropertyGradingRGBCurveRcPtr to access the GradingRGBCurveRcPtr value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_RGBCURVE.
-
setGradingTone
(val: PyOpenColorIO.GradingTone) → None¶ Get the property as DynamicPropertyGradingToneRcPtr to access the GradingTone value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_TONE.
-
-
class
OpenColorIO_v2_0
::
DynamicProperty
¶ Allows transform parameter values to be set on-the-fly (after finalization). For example, to modify the exposure in a viewport. Dynamic properties can be accessed from the :cpp:class:
CPUProcessor
or :cpp:class:GpuShaderCreator
to change values between processing... code-block:: cpp
OCIO::ConstConfigRcPtr config = OCIO::GetCurrentConfig(); OCIO::ConstProcessorRcPtr processor = config->getProcessor(colorSpace1, colorSpace2); OCIO::ConstCPUProcessorRcPtr cpuProcessor = processor->getDefaultCPUProcessor();
if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_EXPOSURE)) { // Get the in-memory implementation of the dynamic property. OCIO::DynamicPropertyRcPtr dynProp = cpuProcessor->getDynamicProperty(OCIO::DYNAMIC_PROPERTY_EXPOSURE); // Get the interface used to change the double value. OCIO::DynamicPropertyDoubleRcPtr exposure = OCIO::DynamicPropertyValue::AsDouble(dynProp); // Update of the dynamic property instance with the new value. exposure->setValue(1.1f); } if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_PRIMARY)) { OCIO::DynamicPropertyRcPtr dynProp = cpuProcessor->getDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_PRIMARY); OCIO::DynamicPropertyGradingPrimaryRcPtr primaryProp = OCIO::DynamicPropertyValue::AsGradingPrimary(dynProp); OCIO::GradingPrimary primary = primaryProp->getValue(); primary.m_saturation += 0.1f; rgbCurveProp->setValue(primary); } if (cpuProcessor->hasDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_RGBCURVE)) { OCIO::DynamicPropertyRcPtr dynProp = cpuProcessor->getDynamicProperty(OCIO::DYNAMIC_PROPERTY_GRADING_RGBCURVE); OCIO::DynamicPropertyGradingRGBCurveRcPtr rgbCurveProp = OCIO::DynamicPropertyValue::AsGradingRGBCurve(dynProp); OCIO::ConstGradingRGBCurveRcPtr rgbCurve = rgbCurveProp->getValue()->createEditableCopy(); OCIO::GradingBSplineCurveRcPtr rCurve = rgbCurve->getCurve(OCIO::RGB_RED); rCurve->getControlPoint(1).m_y += 0.1f; rgbCurveProp->setValue(rgbCurve); }
Public Functions
-
DynamicPropertyType
getType
() const noexcept = 0¶
-
DynamicProperty &
operator=
(const DynamicProperty&) = delete¶
-
DynamicProperty
(const DynamicProperty&) = delete¶
-
~DynamicProperty
() = default¶ Do not use (needed only for pybind11).
-
DynamicPropertyType
-
typedef std::shared_ptr<const DynamicProperty>
OpenColorIO_v2_0
::
ConstDynamicPropertyRcPtr
¶
-
typedef std::shared_ptr<DynamicProperty>
OpenColorIO_v2_0
::
DynamicPropertyRcPtr
¶
DynamicPropertyValue¶
-
namespace
OpenColorIO_v2_0
::
DynamicPropertyValue
¶ Functions
-
DynamicPropertyDoubleRcPtr
AsDouble
(DynamicPropertyRcPtr &prop)¶ Get the property as DynamicPropertyDoubleRcPtr to access the double value. Will throw if property type is not a type that holds a double such as DYNAMIC_PROPERTY_EXPOSURE.
-
DynamicPropertyGradingPrimaryRcPtr
AsGradingPrimary
(DynamicPropertyRcPtr &prop)¶ Get the property as DynamicPropertyGradingPrimaryRcPtr to access the GradingPrimary value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_PRIMARY.
-
DynamicPropertyGradingRGBCurveRcPtr
AsGradingRGBCurve
(DynamicPropertyRcPtr &prop)¶ Get the property as DynamicPropertyGradingRGBCurveRcPtr to access the GradingRGBCurveRcPtr value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_RGBCURVE.
-
DynamicPropertyGradingToneRcPtr
AsGradingTone
(DynamicPropertyRcPtr &prop)¶ Get the property as DynamicPropertyGradingToneRcPtr to access the GradingTone value. Will throw if property type is not DYNAMIC_PROPERTY_GRADING_TONE.
-
DynamicPropertyDoubleRcPtr
DynamicPropertyDouble¶
-
class
OpenColorIO_v2_0
::
DynamicPropertyDouble
¶ Interface used to access dynamic property double value.
Public Functions
-
double
getValue
() const = 0¶
-
void
setValue
(double value) = 0¶
-
DynamicPropertyDouble
(const DynamicPropertyDouble&) = delete¶
-
DynamicPropertyDouble &
operator=
(const DynamicPropertyDouble&) = delete¶
-
~DynamicPropertyDouble
() = default¶ Do not use (needed only for pybind11).
-
double
-
typedef std::shared_ptr<const DynamicPropertyDouble>
OpenColorIO_v2_0
::
ConstDynamicPropertyDoubleRcPtr
¶
-
typedef std::shared_ptr<DynamicPropertyDouble>
OpenColorIO_v2_0
::
DynamicPropertyDoubleRcPtr
¶
DynamicPropertyGradingPrimary¶
-
class
OpenColorIO_v2_0
::
DynamicPropertyGradingPrimary
¶ Interface used to access dynamic property GradingPrimary value.
Public Functions
-
const GradingPrimary &
getValue
() const = 0¶
-
void
setValue
(const GradingPrimary &value) = 0¶ Will throw if value is not valid.
-
DynamicPropertyGradingPrimary
(const DynamicPropertyGradingPrimary&) = delete¶
-
DynamicPropertyGradingPrimary &
operator=
(const DynamicPropertyGradingPrimary&) = delete¶
-
~DynamicPropertyGradingPrimary
() = default¶ Do not use (needed only for pybind11).
-
const GradingPrimary &
-
typedef std::shared_ptr<const DynamicPropertyGradingPrimary>
OpenColorIO_v2_0
::
ConstDynamicPropertyGradingPrimaryRcPtr
¶
-
typedef std::shared_ptr<DynamicPropertyGradingPrimary>
OpenColorIO_v2_0
::
DynamicPropertyGradingPrimaryRcPtr
¶
DynamicPropertyGradingRGBCurve¶
-
class
OpenColorIO_v2_0
::
DynamicPropertyGradingRGBCurve
¶ Interface used to access dynamic property ConstGradingRGBCurveRcPtr value.
Public Functions
-
const ConstGradingRGBCurveRcPtr &
getValue
() const = 0¶
-
void
setValue
(const ConstGradingRGBCurveRcPtr &value) = 0¶ Will throw if value is not valid.
-
DynamicPropertyGradingRGBCurve
(const DynamicPropertyGradingRGBCurve&) = delete¶
-
DynamicPropertyGradingRGBCurve &
operator=
(const DynamicPropertyGradingRGBCurve&) = delete¶
-
~DynamicPropertyGradingRGBCurve
() = default¶ Do not use (needed only for pybind11).
-
const ConstGradingRGBCurveRcPtr &
-
typedef std::shared_ptr<const DynamicPropertyGradingRGBCurve>
OpenColorIO_v2_0
::
ConstDynamicPropertyGradingRGBCurveRcPtr
¶
-
typedef std::shared_ptr<DynamicPropertyGradingRGBCurve>
OpenColorIO_v2_0
::
DynamicPropertyGradingRGBCurveRcPtr
¶
DynamicPropertyGradingTone¶
-
class
OpenColorIO_v2_0
::
DynamicPropertyGradingTone
¶ Interface used to access dynamic property GradingTone value.
Public Functions
-
const GradingTone &
getValue
() const = 0¶
-
void
setValue
(const GradingTone &value) = 0¶ Will throw if value is not valid.
-
DynamicPropertyGradingTone
(const DynamicPropertyGradingTone&) = delete¶
-
DynamicPropertyGradingTone &
operator=
(const DynamicPropertyGradingTone&) = delete¶
-
~DynamicPropertyGradingTone
() = default¶ Do not use (needed only for pybind11).
-
const GradingTone &
-
typedef std::shared_ptr<const DynamicPropertyGradingTone>
OpenColorIO_v2_0
::
ConstDynamicPropertyGradingToneRcPtr
¶
-
typedef std::shared_ptr<DynamicPropertyGradingTone>
OpenColorIO_v2_0
::
DynamicPropertyGradingToneRcPtr
¶