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.

DynamicPropertyValue

namespace OpenColorIO_v2_2dev::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.

DynamicPropertyDouble

class OpenColorIO_v2_2dev::DynamicPropertyDouble

Interface used to access dynamic property double value.

Public Functions

virtual double getValue() const = 0
virtual void setValue(double value) = 0
DynamicPropertyDouble(const DynamicPropertyDouble&) = delete
DynamicPropertyDouble &operator=(const DynamicPropertyDouble&) = delete
virtual ~DynamicPropertyDouble() = default

Do not use (needed only for pybind11).

typedef std::shared_ptr<const DynamicPropertyDouble> OpenColorIO_v2_2dev::ConstDynamicPropertyDoubleRcPtr
typedef std::shared_ptr<DynamicPropertyDouble> OpenColorIO_v2_2dev::DynamicPropertyDoubleRcPtr

DynamicPropertyGradingPrimary

class OpenColorIO_v2_2dev::DynamicPropertyGradingPrimary

Interface used to access dynamic property GradingPrimary value.

Public Functions

virtual const GradingPrimary &getValue() const = 0
virtual void setValue(const GradingPrimary &value) = 0

Will throw if value is not valid.

DynamicPropertyGradingPrimary(const DynamicPropertyGradingPrimary&) = delete
DynamicPropertyGradingPrimary &operator=(const DynamicPropertyGradingPrimary&) = delete
virtual ~DynamicPropertyGradingPrimary() = default

Do not use (needed only for pybind11).

typedef std::shared_ptr<const DynamicPropertyGradingPrimary> OpenColorIO_v2_2dev::ConstDynamicPropertyGradingPrimaryRcPtr
typedef std::shared_ptr<DynamicPropertyGradingPrimary> OpenColorIO_v2_2dev::DynamicPropertyGradingPrimaryRcPtr

DynamicPropertyGradingRGBCurve

class OpenColorIO_v2_2dev::DynamicPropertyGradingRGBCurve

Interface used to access dynamic property ConstGradingRGBCurveRcPtr value.

Public Functions

virtual const ConstGradingRGBCurveRcPtr &getValue() const = 0
virtual void setValue(const ConstGradingRGBCurveRcPtr &value) = 0

Will throw if value is not valid.

DynamicPropertyGradingRGBCurve(const DynamicPropertyGradingRGBCurve&) = delete
DynamicPropertyGradingRGBCurve &operator=(const DynamicPropertyGradingRGBCurve&) = delete
virtual ~DynamicPropertyGradingRGBCurve() = default

Do not use (needed only for pybind11).

typedef std::shared_ptr<const DynamicPropertyGradingRGBCurve> OpenColorIO_v2_2dev::ConstDynamicPropertyGradingRGBCurveRcPtr
typedef std::shared_ptr<DynamicPropertyGradingRGBCurve> OpenColorIO_v2_2dev::DynamicPropertyGradingRGBCurveRcPtr

DynamicPropertyGradingTone

class OpenColorIO_v2_2dev::DynamicPropertyGradingTone

Interface used to access dynamic property GradingTone value.

Public Functions

virtual const GradingTone &getValue() const = 0
virtual void setValue(const GradingTone &value) = 0

Will throw if value is not valid.

DynamicPropertyGradingTone(const DynamicPropertyGradingTone&) = delete
DynamicPropertyGradingTone &operator=(const DynamicPropertyGradingTone&) = delete
virtual ~DynamicPropertyGradingTone() = default

Do not use (needed only for pybind11).

typedef std::shared_ptr<const DynamicPropertyGradingTone> OpenColorIO_v2_2dev::ConstDynamicPropertyGradingToneRcPtr
typedef std::shared_ptr<DynamicPropertyGradingTone> OpenColorIO_v2_2dev::DynamicPropertyGradingToneRcPtr