Skip to content

Commit

Permalink
Merge branch 'master' into config_wg_12152020
Browse files Browse the repository at this point in the history
  • Loading branch information
michdolan authored Jan 7, 2021
2 parents d773031 + ebebc25 commit 1fce2ba
Show file tree
Hide file tree
Showing 45 changed files with 2,914 additions and 799 deletions.
222 changes: 118 additions & 104 deletions docs/api/python/frozen/pyopencolorio_gradingrgbcurvetransform.rst
Original file line number Diff line number Diff line change
@@ -1,104 +1,118 @@
..
SPDX-License-Identifier: CC-BY-4.0
Copyright Contributors to the OpenColorIO Project.
Do not edit! This file was automatically generated by share/docs/frozendoc.py.
.. py:class:: GradingRGBCurveTransform
:module: PyOpenColorIO

RGB curve color correction controls.

This transform allows for modifying tone reproduction via B-spline curves.

There is an R, G, and B curve along with a Master curve (that applies to R, G, and B). Each curve is specified via the x and y coordinates of its control points. A monotonic spline is fit to the control points. The x coordinates must be non-decreasing. When the grading style is linear, the units for the control points are photographic stops relative to 0.18.

The control points are dynamic, so they may be adjusted even after the :ref:`Transform` is included in a :ref:`Processor`.


.. py:method:: GradingRGBCurveTransform.__init__(*args, **kwargs)
:module: PyOpenColorIO

Overloaded function.

1. __init__(self: PyOpenColorIO.GradingRGBCurveTransform, style: PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, values: PyOpenColorIO.GradingRGBCurve, dynamic: bool = False, dir: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of :ref:`GradingPrimaryTransform`.

2. __init__(self: PyOpenColorIO.GradingRGBCurveTransform, style: PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of :ref:`GradingPrimaryTransform`.


.. py:method:: GradingRGBCurveTransform.__str__(self: PyOpenColorIO.Transform) -> str
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.getBypassLinToLog(self: PyOpenColorIO.GradingRGBCurveTransform) -> bool
:module: PyOpenColorIO

The scene-linear grading style applies a lin-to-log transform to the pixel values before going through the curve. However, in some cases (e.g. drawing curves in a UI) it may be useful to bypass the lin-to-log. Default value is false.


.. py:method:: GradingRGBCurveTransform.getDirection(self: PyOpenColorIO.Transform) -> PyOpenColorIO.TransformDirection
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.getFormatMetadata(self: PyOpenColorIO.GradingRGBCurveTransform) -> PyOpenColorIO.FormatMetadata
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.getStyle(self: PyOpenColorIO.GradingRGBCurveTransform) -> PyOpenColorIO.GradingStyle
:module: PyOpenColorIO

Adjusts the behavior of the transform for log, linear, or video color space encodings.


.. py:method:: GradingRGBCurveTransform.getTransformType(self: PyOpenColorIO.Transform) -> PyOpenColorIO.TransformType
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.getValue(self: PyOpenColorIO.GradingRGBCurveTransform) -> PyOpenColorIO.GradingRGBCurve
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.isDynamic(self: PyOpenColorIO.GradingRGBCurveTransform) -> bool
:module: PyOpenColorIO

Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several :ref:`GradingRGBCurveTransform` only one can have dynamic parameters.


.. py:method:: GradingRGBCurveTransform.makeDynamic(self: PyOpenColorIO.GradingRGBCurveTransform) -> None
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.makeNonDynamic(self: PyOpenColorIO.GradingRGBCurveTransform) -> None
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.setBypassLinToLog(self: PyOpenColorIO.GradingRGBCurveTransform, bypass: bool) -> None
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.setDirection(self: PyOpenColorIO.Transform, direction: PyOpenColorIO.TransformDirection) -> None
:module: PyOpenColorIO

Note that this only affects the evaluation and not the values stored in the object.


.. py:method:: GradingRGBCurveTransform.setStyle(self: PyOpenColorIO.GradingRGBCurveTransform, style: PyOpenColorIO.GradingStyle) -> None
:module: PyOpenColorIO

Will reset value to style's defaults if style is not the current style.


.. py:method:: GradingRGBCurveTransform.setValue(self: PyOpenColorIO.GradingRGBCurveTransform, values: PyOpenColorIO.GradingRGBCurve) -> None
:module: PyOpenColorIO

Throws if value is not valid.


.. py:method:: GradingRGBCurveTransform.validate(self: PyOpenColorIO.Transform) -> None
:module: PyOpenColorIO

Will throw if data is not valid.

..
SPDX-License-Identifier: CC-BY-4.0
Copyright Contributors to the OpenColorIO Project.
Do not edit! This file was automatically generated by share/docs/frozendoc.py.
.. py:class:: GradingRGBCurveTransform
:module: PyOpenColorIO

RGB curve color correction controls.

This transform allows for modifying tone reproduction via B-spline curves.

There is an R, G, and B curve along with a Master curve (that applies to R, G, and B). Each curve is specified via the x and y coordinates of its control points. A monotonic spline is fit to the control points. The x coordinates must be non-decreasing. When the grading style is linear, the units for the control points are photographic stops relative to 0.18.

The control points are dynamic, so they may be adjusted even after the :ref:`Transform` is included in a :ref:`Processor`.


.. py:method:: GradingRGBCurveTransform.__init__(*args, **kwargs)
:module: PyOpenColorIO

Overloaded function.

1. __init__(self: PyOpenColorIO.GradingRGBCurveTransform, style: PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, values: PyOpenColorIO.GradingRGBCurve, dynamic: bool = False, dir: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of :ref:`GradingPrimaryTransform`.

2. __init__(self: PyOpenColorIO.GradingRGBCurveTransform, style: PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None

Creates an instance of :ref:`GradingPrimaryTransform`.


.. py:method:: GradingRGBCurveTransform.__str__(self: PyOpenColorIO.Transform) -> str
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.getBypassLinToLog(self: PyOpenColorIO.GradingRGBCurveTransform) -> bool
:module: PyOpenColorIO

The scene-linear grading style applies a lin-to-log transform to the pixel values before going through the curve. However, in some cases (e.g. drawing curves in a UI) it may be useful to bypass the lin-to-log. Default value is false.


.. py:method:: GradingRGBCurveTransform.getDirection(self: PyOpenColorIO.Transform) -> PyOpenColorIO.TransformDirection
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.getFormatMetadata(self: PyOpenColorIO.GradingRGBCurveTransform) -> PyOpenColorIO.FormatMetadata
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.getSlope(self: PyOpenColorIO.GradingRGBCurveTransform, channel: PyOpenColorIO.RGBCurveType, index: int) -> float
:module: PyOpenColorIO

It is possible to provide a desired slope value for each control point. The number of slopes is always the same as the number of control points and so the control points must be set before setting the slopes. The slopes are primarily intended for use by config authors looking to match a specific shape with as few control points as possible, they are not intended to be exposed to a user interface for direct manipulation. When a curve is being generated for creative purposes it is better to let OCIO calculate the slopes automatically.


.. py:method:: GradingRGBCurveTransform.getStyle(self: PyOpenColorIO.GradingRGBCurveTransform) -> PyOpenColorIO.GradingStyle
:module: PyOpenColorIO

Adjusts the behavior of the transform for log, linear, or video color space encodings.


.. py:method:: GradingRGBCurveTransform.getTransformType(self: PyOpenColorIO.Transform) -> PyOpenColorIO.TransformType
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.getValue(self: PyOpenColorIO.GradingRGBCurveTransform) -> PyOpenColorIO.GradingRGBCurve
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.isDynamic(self: PyOpenColorIO.GradingRGBCurveTransform) -> bool
:module: PyOpenColorIO

Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several :ref:`GradingRGBCurveTransform` only one can have dynamic parameters.


.. py:method:: GradingRGBCurveTransform.makeDynamic(self: PyOpenColorIO.GradingRGBCurveTransform) -> None
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.makeNonDynamic(self: PyOpenColorIO.GradingRGBCurveTransform) -> None
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.setBypassLinToLog(self: PyOpenColorIO.GradingRGBCurveTransform, bypass: bool) -> None
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.setDirection(self: PyOpenColorIO.Transform, direction: PyOpenColorIO.TransformDirection) -> None
:module: PyOpenColorIO

Note that this only affects the evaluation and not the values stored in the object.


.. py:method:: GradingRGBCurveTransform.setSlope(self: PyOpenColorIO.GradingRGBCurveTransform, channel: PyOpenColorIO.RGBCurveType, index: int, slope: float) -> None
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.setStyle(self: PyOpenColorIO.GradingRGBCurveTransform, style: PyOpenColorIO.GradingStyle) -> None
:module: PyOpenColorIO

Will reset value to style's defaults if style is not the current style.


.. py:method:: GradingRGBCurveTransform.setValue(self: PyOpenColorIO.GradingRGBCurveTransform, values: PyOpenColorIO.GradingRGBCurve) -> None
:module: PyOpenColorIO

Throws if value is not valid.


.. py:method:: GradingRGBCurveTransform.slopesAreDefault(self: PyOpenColorIO.GradingRGBCurveTransform, channel: PyOpenColorIO.RGBCurveType) -> bool
:module: PyOpenColorIO


.. py:method:: GradingRGBCurveTransform.validate(self: PyOpenColorIO.Transform) -> None
:module: PyOpenColorIO

Will throw if data is not valid.

15 changes: 15 additions & 0 deletions include/OpenColorIO/OpenColorTransforms.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ class OCIOEXPORT GradingBSplineCurve
virtual void setNumControlPoints(size_t size) = 0;
virtual const GradingControlPoint & getControlPoint(size_t index) const = 0;
virtual GradingControlPoint & getControlPoint(size_t index) = 0;
virtual float getSlope(size_t index) const = 0;
virtual void setSlope(size_t index, float slope) = 0;
virtual bool slopesAreDefault() const = 0;
virtual void validate() const = 0;

GradingBSplineCurve(const GradingBSplineCurve &) = delete;
Expand Down Expand Up @@ -1211,6 +1214,18 @@ class OCIOEXPORT GradingRGBCurveTransform : public Transform
/// Throws if value is not valid.
virtual void setValue(const ConstGradingRGBCurveRcPtr & values) = 0;

/**
* It is possible to provide a desired slope value for each control point. The number of slopes is
* always the same as the number of control points and so the control points must be set before
* setting the slopes. The slopes are primarily intended for use by config authors looking to match
* a specific shape with as few control points as possible, they are not intended to be exposed to
* a user interface for direct manipulation. When a curve is being generated for creative purposes
* it is better to let OCIO calculate the slopes automatically.
*/
virtual float getSlope(RGBCurveType c, size_t index) const = 0;
virtual void setSlope(RGBCurveType c, size_t index, float slope) = 0;
virtual bool slopesAreDefault(RGBCurveType c) const = 0;

/**
* The scene-linear grading style applies a lin-to-log transform to the pixel
* values before going through the curve. However, in some cases (e.g. drawing curves in a UI)
Expand Down
12 changes: 8 additions & 4 deletions src/OpenColorIO/DynamicProperty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ bool DynamicPropertyImpl::equals(const DynamicPropertyImpl & rhs) const
}
else
{
// Both dynamic, will be same.
return true;
// Both dynamic, may not be same (this is used for processor optimization do not
// assume they will always have same values even if it is currently the case).
return false;
}
}

Expand Down Expand Up @@ -175,8 +176,11 @@ void DynamicPropertyGradingPrimaryImpl::setStyle(GradingStyle style)

void DynamicPropertyGradingPrimaryImpl::setDirection(TransformDirection dir) noexcept
{
m_direction = dir;
m_preRenderValues.update(m_style, m_direction, m_value);
if (m_direction != dir)
{
m_direction = dir;
m_preRenderValues.update(m_style, m_direction, m_value);
}
}

DynamicPropertyGradingRGBCurveImpl::DynamicPropertyGradingRGBCurveImpl(
Expand Down
1 change: 1 addition & 0 deletions src/OpenColorIO/DynamicProperty.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class DynamicPropertyGradingPrimaryImpl : public DynamicPropertyImpl,

void setStyle(GradingStyle style);
void setDirection(TransformDirection dir) noexcept;
TransformDirection getDirection() const noexcept { return m_direction; }
const GradingPrimaryPreRender & getComputedValue() const { return m_preRenderValues; }

const Float3 & getBrightness() const { return m_preRenderValues.getBrightness(); }
Expand Down
Loading

0 comments on commit 1fce2ba

Please sign in to comment.