Grading Transforms¶
GradingPrimaryTransform¶
- class PyOpenColorIO.GradingPrimaryTransform¶
Primary color correction controls.
This transform is for making basic color correction adjustments to an image such as brightness, contrast, or saturation.
The controls are customized for linear, logarithmic, and video color encodings. - Linear controls: Exposure, Contrast, Pivot, Offset, Saturation, Black Clip, White Clip. - Log controls: Brightness, Contrast, Pivot, Log Gamma, Saturation, Black Clip, White Clip, Black Pivot White Pivot. - Video controls : Lift, Gamma, Gain, Offset, Saturation, Black Clip, White Clip, Black Pivot White Pivot.
The controls are dynamic, so they may be adjusted even after the Transform has been included in a Processor.
- GradingPrimaryTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingPrimaryTransform, values: PyOpenColorIO.PyOpenColorIO.GradingPrimary, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Creates an instance of GradingPrimaryTransform.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingPrimaryTransform, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Creates an instance of GradingPrimaryTransform.
- getDirection() PyOpenColorIO.PyOpenColorIO.TransformDirection¶
- getFormatMetadata() PyOpenColorIO.PyOpenColorIO.FormatMetadata¶
- getStyle() PyOpenColorIO.PyOpenColorIO.GradingStyle¶
Adjusts the behavior of the transform for log, linear, or video color space encodings.
- getTransformType() PyOpenColorIO.PyOpenColorIO.TransformType¶
- getValue() PyOpenColorIO.PyOpenColorIO.GradingPrimary¶
- isDynamic() bool¶
Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingPrimaryTransform only one can have dynamic parameters.
- makeDynamic() None¶
- makeNonDynamic() None¶
- setDirection(direction: PyOpenColorIO.PyOpenColorIO.TransformDirection) None¶
Note that this only affects the evaluation and not the values stored in the object.
- setStyle(style: PyOpenColorIO.PyOpenColorIO.GradingStyle) None¶
Will reset value to style’s defaults if style is not the current style.
- setValue(values: PyOpenColorIO.PyOpenColorIO.GradingPrimary) None¶
Throws if value is not valid.
- validate() None¶
Will throw if data is not valid.
-
class GradingPrimaryTransform : public Transform¶
Primary color correction controls.
This transform is for making basic color correction adjustments to an image such as brightness, contrast, or saturation.
The controls are customized for linear, logarithmic, and video color encodings.
Linear controls: Exposure, Contrast, Pivot, Offset, Saturation, Black Clip, White Clip.
Log controls: Brightness, Contrast, Pivot, Log Gamma, Saturation, Black Clip, White Clip, Black Pivot White Pivot.
Video controls : Lift, Gamma, Gain, Offset, Saturation, Black Clip, White Clip, Black Pivot White Pivot.
The controls are dynamic, so they may be adjusted even after the Transform has been included in a Processor.
Public Functions
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
virtual FormatMetadata &getFormatMetadata() noexcept = 0¶
-
virtual bool equals(const GradingPrimaryTransform &other) const noexcept = 0¶
Checks if this equals other.
-
virtual GradingStyle getStyle() const noexcept = 0¶
Adjusts the behavior of the transform for log, linear, or video color space encodings.
-
virtual void setStyle(GradingStyle style) noexcept = 0¶
Will reset value to style’s defaults if style is not the current style.
-
virtual const GradingPrimary &getValue() const = 0¶
-
virtual void setValue(const GradingPrimary &values) = 0¶
Throws if value is not valid.
-
virtual bool isDynamic() const noexcept = 0¶
Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingPrimaryTransform only one can have dynamic parameters.
-
virtual void makeDynamic() noexcept = 0¶
-
virtual void makeNonDynamic() noexcept = 0¶
-
GradingPrimaryTransform(const GradingPrimaryTransform&) = delete¶
-
GradingPrimaryTransform &operator=(const GradingPrimaryTransform&) = delete¶
-
virtual ~GradingPrimaryTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static GradingPrimaryTransformRcPtr Create(GradingStyle style)¶
Creates an instance of GradingPrimaryTransform.
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingPrimaryTransform&) noexcept¶
-
typedef std::shared_ptr<const GradingPrimaryTransform> OpenColorIO_v2_5::ConstGradingPrimaryTransformRcPtr¶
-
typedef std::shared_ptr<GradingPrimaryTransform> OpenColorIO_v2_5::GradingPrimaryTransformRcPtr¶
GradingPrimary¶
- class PyOpenColorIO.GradingPrimary¶
Grading primary values.
- NoClampBlack = -1.7976931348623157e+308¶
- NoClampWhite = 1.7976931348623157e+308¶
- GradingPrimary(arg0: PyOpenColorIO.PyOpenColorIO.GradingStyle) None¶
- property brightness¶
- property clampBlack¶
- property clampWhite¶
- property contrast¶
- property exposure¶
- property gain¶
- property gamma¶
- property lift¶
- property offset¶
- property pivot¶
- property pivotBlack¶
- property pivotWhite¶
- property saturation¶
- validate(arg0: PyOpenColorIO.PyOpenColorIO.GradingStyle) None¶
The valid range for each parameter varies.
-
struct GradingPrimary¶
Grading primary values.
Public Functions
-
GradingPrimary() = delete¶
-
inline explicit GradingPrimary(GradingStyle style)¶
-
void validate(GradingStyle style) const¶
The valid range for each parameter varies.
Public Members
-
GradingRGBM m_brightness = {0.0, 0.0, 0.0, 0.0}¶
-
GradingRGBM m_contrast = {1.0, 1.0, 1.0, 1.0}¶
-
GradingRGBM m_gamma = {1.0, 1.0, 1.0, 1.0}¶
-
GradingRGBM m_offset = {0.0, 0.0, 0.0, 0.0}¶
-
GradingRGBM m_exposure = {0.0, 0.0, 0.0, 0.0}¶
-
GradingRGBM m_lift = {0.0, 0.0, 0.0, 0.0}¶
-
GradingRGBM m_gain = {1.0, 1.0, 1.0, 1.0}¶
-
double m_saturation = {1.0}¶
-
double m_pivot¶
-
double m_pivotBlack = {0.0}¶
-
double m_pivotWhite = {1.0}¶
-
double m_clampBlack¶
-
double m_clampWhite¶
-
GradingPrimary() = delete¶
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingPrimary&)¶
GradingRGBM¶
- class PyOpenColorIO.GradingRGBM¶
Used by the grading transforms to hold the red, green, blue, and master components of a single parameter. The master component affects all three channels (RGB).
- GradingRGBM(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBM) -> None
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBM, red: typing.SupportsFloat | typing.SupportsIndex, green: typing.SupportsFloat | typing.SupportsIndex, blue: typing.SupportsFloat | typing.SupportsIndex, master: typing.SupportsFloat | typing.SupportsIndex) -> None
- property blue¶
- property green¶
- property master¶
- property red¶
-
struct GradingRGBM¶
Used by the grading transforms to hold the red, green, blue, and master components of a single parameter. The master component affects all three channels (RGB).
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingRGBM&)¶
GradingRGBCurveTransform¶
- class PyOpenColorIO.GradingRGBCurveTransform¶
RGB curve color correction controls.
This transform allows for modifying tone reproduction via B-spline curves.
There is an R, G, and B curve followed by 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 Transform is included in a Processor.
- GradingRGBCurveTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBCurveTransform, values: PyOpenColorIO.PyOpenColorIO.GradingRGBCurve, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Creates an instance of GradingPrimaryTransform.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBCurveTransform, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Creates an instance of GradingPrimaryTransform.
- getBypassLinToLog() bool¶
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.
- getDirection() PyOpenColorIO.PyOpenColorIO.TransformDirection¶
- getFormatMetadata() PyOpenColorIO.PyOpenColorIO.FormatMetadata¶
- getSlope(channel: PyOpenColorIO.PyOpenColorIO.RGBCurveType, index: SupportsInt | SupportsIndex) float¶
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.
- getStyle() PyOpenColorIO.PyOpenColorIO.GradingStyle¶
Adjusts the behavior of the transform for log, linear, or video color space encodings.
- getTransformType() PyOpenColorIO.PyOpenColorIO.TransformType¶
- getValue() PyOpenColorIO.PyOpenColorIO.GradingRGBCurve¶
- isDynamic() bool¶
Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingRGBCurveTransform only one can have dynamic parameters.
- makeDynamic() None¶
- makeNonDynamic() None¶
- setBypassLinToLog(bypass: bool) None¶
- setDirection(direction: PyOpenColorIO.PyOpenColorIO.TransformDirection) None¶
Note that this only affects the evaluation and not the values stored in the object.
- setSlope(channel: PyOpenColorIO.PyOpenColorIO.RGBCurveType, index: SupportsInt | SupportsIndex, slope: SupportsFloat | SupportsIndex) None¶
- setStyle(style: PyOpenColorIO.PyOpenColorIO.GradingStyle) None¶
Will reset value to style’s defaults if style is not the current style.
- setValue(values: PyOpenColorIO.PyOpenColorIO.GradingRGBCurve) None¶
Throws if value is not valid.
- slopesAreDefault(channel: PyOpenColorIO.PyOpenColorIO.RGBCurveType) bool¶
- validate() None¶
Will throw if data is not valid.
-
class GradingRGBCurveTransform : public Transform¶
RGB curve color correction controls.
This transform allows for modifying tone reproduction via B-spline curves.
There is an R, G, and B curve followed by 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 Transform is included in a Processor.
Public Functions
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
virtual FormatMetadata &getFormatMetadata() noexcept = 0¶
-
virtual bool equals(const GradingRGBCurveTransform &other) const noexcept = 0¶
Checks if this equals other.
-
virtual GradingStyle getStyle() const noexcept = 0¶
Adjusts the behavior of the transform for log, linear, or video color space encodings.
-
virtual void setStyle(GradingStyle style) noexcept = 0¶
Will reset value to style’s defaults if style is not the current style.
-
virtual const ConstGradingRGBCurveRcPtr getValue() const = 0¶
-
virtual void setValue(const ConstGradingRGBCurveRcPtr &values) = 0¶
Throws if value is not valid.
-
virtual float getSlope(RGBCurveType c, size_t index) const = 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 void setSlope(RGBCurveType c, size_t index, float slope) = 0¶
-
virtual bool slopesAreDefault(RGBCurveType c) const = 0¶
-
virtual bool getBypassLinToLog() 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) it may be useful to bypass the lin-to-log. Default value is false.
-
virtual void setBypassLinToLog(bool bypass) = 0¶
-
virtual bool isDynamic() const noexcept = 0¶
Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingRGBCurveTransform only one can have dynamic parameters.
-
virtual void makeDynamic() noexcept = 0¶
-
virtual void makeNonDynamic() noexcept = 0¶
-
GradingRGBCurveTransform(const GradingRGBCurveTransform&) = delete¶
-
GradingRGBCurveTransform &operator=(const GradingRGBCurveTransform&) = delete¶
-
virtual ~GradingRGBCurveTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static GradingRGBCurveTransformRcPtr Create(GradingStyle style)¶
Creates an instance of GradingPrimaryTransform.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingRGBCurveTransform&) noexcept¶
-
typedef std::shared_ptr<const GradingRGBCurveTransform> OpenColorIO_v2_5::ConstGradingRGBCurveTransformRcPtr¶
-
typedef std::shared_ptr<GradingRGBCurveTransform> OpenColorIO_v2_5::GradingRGBCurveTransformRcPtr¶
GradingRGBCurve¶
- class PyOpenColorIO.GradingRGBCurve¶
A set of red, green, blue and master curves. It is used by RGBCurveTransform and can be used as a dynamic property (see DynamicPropertyGradingRGBCurve).
- GradingRGBCurve(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBCurve, style: PyOpenColorIO.PyOpenColorIO.GradingStyle) -> None
Do not use (needed only for pybind11).
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBCurve, red: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve = <control_points=[<x=0, y=0><x=0.5, y=0.5><x=1, y=1>]>, green: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve = <control_points=[<x=0, y=0><x=0.5, y=0.5><x=1, y=1>]>, blue: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve = <control_points=[<x=0, y=0><x=0.5, y=0.5><x=1, y=1>]>, master: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve = <control_points=[<x=0, y=0><x=0.5, y=0.5><x=1, y=1>]>) -> None
- property blue¶
- property green¶
- isIdentity() bool¶
- property master¶
- property red¶
- validate() None¶
-
class GradingRGBCurve¶
A set of red, green, blue and master curves. It is used by RGBCurveTransform and can be used as a dynamic property (see DynamicPropertyGradingRGBCurve).
Public Functions
-
virtual GradingRGBCurveRcPtr createEditableCopy() const = 0¶
-
virtual void validate() const = 0¶
-
virtual bool isIdentity() const = 0¶
-
virtual ConstGradingBSplineCurveRcPtr getCurve(RGBCurveType c) const = 0¶
-
virtual GradingBSplineCurveRcPtr getCurve(RGBCurveType c) = 0¶
-
virtual ~GradingRGBCurve() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static GradingRGBCurveRcPtr Create(GradingStyle style)¶
Create a GradingRGBCurve. (The style argument is not part of the object, it is simply used to initialize the proper default curves.)
-
static GradingRGBCurveRcPtr Create(const ConstGradingRGBCurveRcPtr &rhs)¶
-
static GradingRGBCurveRcPtr Create(const ConstGradingBSplineCurveRcPtr &red, const ConstGradingBSplineCurveRcPtr &green, const ConstGradingBSplineCurveRcPtr &blue, const ConstGradingBSplineCurveRcPtr &master)¶
-
virtual GradingRGBCurveRcPtr createEditableCopy() const = 0¶
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingRGBCurve&)¶
-
typedef std::shared_ptr<const GradingRGBCurve> OpenColorIO_v2_5::ConstGradingRGBCurveRcPtr¶
-
typedef std::shared_ptr<GradingRGBCurve> OpenColorIO_v2_5::GradingRGBCurveRcPtr¶
GradingHueCurveTransform¶
- class PyOpenColorIO.GradingHueCurveTransform¶
Hue curve color correction controls.
This transform provides eight spline curves to make the following adjustments:
Hue-Hue: Map input hue to output hue (where a diagonal line is the identity).
Hue-Sat: Adjust saturation as a function of hue (a value of 1.0 is the identity).
Hue-Lum: Adjust luma as a function of hue (a value of 1.0 is the identity).
Lum-Sat: Adjust saturation as a function of luma (a value of 1.0 is the identity).
Sat-Sat: Adjust saturation as a function of saturation (a diagonal is the identity).
Lum-Lum: Adjust luma as a function of luma, maintaining hue & sat (diagonal is identity).
Sat-Lum: Adjust luma as a function of saturation (a value of 1.0 is the identity).
Hue-FX : Map input hue to delta output hue (a value of 0.0 is the identity).
The algorithm is different for scene-linear, logarithmic, and video color spaces, so initialize the style argument appropriately before setting the curves.
An RGB-to-HSY FixedFunction is used to convert RGB into a hue, saturation, luma color space. However, there is an option to bypass that conversion to use an outboard transform.
Like the GradingRGBCurveTransform, the curves are defined by the x and y coordinates of a set of control points. A spline will be fit to the control points. Monotonicity is preserved for curves where the diagonal is the identity. For curves that take luma as input, if the style is scene-linear, the units are in photographic stops relative to 0.18. For log and video, the luma is scaled the same as the input RGB.
The hue variable is [0,1] and is periodic. For example, -0.2, 0.8, and 1.8 are equivalent. The domain of the curves is [0,1] and control points outside that domain are mapped into it. A hue of 0 or 1 corresponds to a magenta hue.
The control points are dynamic, so they may be adjusted even after the Transform is included in a Processor. However, creating a curve or setting the parameters will call the GradingBSplineCurveImpl::validate function, which will throw an exception if the control points do not meet certain requirements, for example that the X-coordinates are non-decreasing Please review that function for details on the validation. Applications that provide a UI to edit curves must ensure that they prevent users from creating control points that are not valid.
The transform is invertible as long as the curves allow it. For example, if saturation is mapped to zero, obviously that cannot be resaturated. Care should be taken with the Hue-FX curve because it is possible to fold hues over on themselves, which also cannot be inverted. In most cases the Hue-FX curve is not necessary since the Hue-Hue curve provides similar functionality with the added benefit of being strictly invertible.
- GradingHueCurveTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingHueCurveTransform, values: PyOpenColorIO.PyOpenColorIO.GradingHueCurve, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Creates an instance of GradingHueCurveTransform.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingHueCurveTransform, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Creates an instance of GradingHueCurveTransform.
- getDirection() PyOpenColorIO.PyOpenColorIO.TransformDirection¶
- getFormatMetadata() PyOpenColorIO.PyOpenColorIO.FormatMetadata¶
- getRGBToHSY() PyOpenColorIO.PyOpenColorIO.HSYTransformStyle¶
By default, the input is transformed into HSY space to apply the hue curves and then the result is transformed back to RGB. However, this may be set to HSY_TRANSFORM_NONE to bypass this in order to use other hue/sat/luma type transforms applied separately before and after this transform.
- getSlope(curve: PyOpenColorIO.PyOpenColorIO.HueCurveType, index: SupportsInt | SupportsIndex) float¶
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.
- getStyle() PyOpenColorIO.PyOpenColorIO.GradingStyle¶
Adjusts the behavior of the transform for log, linear, or video color space encodings.
- getTransformType() PyOpenColorIO.PyOpenColorIO.TransformType¶
- getValue() PyOpenColorIO.PyOpenColorIO.GradingHueCurve¶
- isDynamic() bool¶
Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingHueCurveTransform only one can have dynamic parameters.
- makeDynamic() None¶
- makeNonDynamic() None¶
- setDirection(direction: PyOpenColorIO.PyOpenColorIO.TransformDirection) None¶
Note that this only affects the evaluation and not the values stored in the object.
- setRGBToHSY(style: PyOpenColorIO.PyOpenColorIO.HSYTransformStyle) None¶
- setSlope(curve: PyOpenColorIO.PyOpenColorIO.HueCurveType, index: SupportsInt | SupportsIndex, slope: SupportsFloat | SupportsIndex) None¶
- setStyle(style: PyOpenColorIO.PyOpenColorIO.GradingStyle) None¶
Will reset value to style’s defaults if style is not the current style.
- setValue(values: PyOpenColorIO.PyOpenColorIO.GradingHueCurve) None¶
Throws if value is not valid.
- slopesAreDefault(curve: PyOpenColorIO.PyOpenColorIO.HueCurveType) bool¶
- validate() None¶
Will throw if data is not valid.
-
class GradingHueCurveTransform : public Transform¶
Hue curve color correction controls.
This transform provides eight spline curves to make the following adjustments:
Hue-Hue: Map input hue to output hue (where a diagonal line is the identity).
Hue-Sat: Adjust saturation as a function of hue (a value of 1.0 is the identity).
Hue-Lum: Adjust luma as a function of hue (a value of 1.0 is the identity).
Lum-Sat: Adjust saturation as a function of luma (a value of 1.0 is the identity).
Sat-Sat: Adjust saturation as a function of saturation (a diagonal is the identity).
Lum-Lum: Adjust luma as a function of luma, maintaining hue & sat (diagonal is identity).
Sat-Lum: Adjust luma as a function of saturation (a value of 1.0 is the identity).
Hue-FX : Map input hue to delta output hue (a value of 0.0 is the identity).
The algorithm is different for scene-linear, logarithmic, and video color spaces, so initialize the style argument appropriately before setting the curves.
An RGB-to-HSY FixedFunction is used to convert RGB into a hue, saturation, luma color space. However, there is an option to bypass that conversion to use an outboard transform.
Like the GradingRGBCurveTransform, the curves are defined by the x and y coordinates of a set of control points. A spline will be fit to the control points. Monotonicity is preserved for curves where the diagonal is the identity. For curves that take luma as input, if the style is scene-linear, the units are in photographic stops relative to 0.18. For log and video, the luma is scaled the same as the input RGB.
The hue variable is [0,1] and is periodic. For example, -0.2, 0.8, and 1.8 are equivalent. The domain of the curves is [0,1] and control points outside that domain are mapped into it. A hue of 0 or 1 corresponds to a magenta hue.
The control points are dynamic, so they may be adjusted even after the Transform is included in a Processor. However, creating a curve or setting the parameters will call the GradingBSplineCurveImpl::validate function, which will throw an exception if the control points do not meet certain requirements, for example that the X-coordinates are non-decreasing Please review that function for details on the validation. Applications that provide a UI to edit curves must ensure that they prevent users from creating control points that are not valid.
The transform is invertible as long as the curves allow it. For example, if saturation is mapped to zero, obviously that cannot be resaturated. Care should be taken with the Hue-FX curve because it is possible to fold hues over on themselves, which also cannot be inverted. In most cases the Hue-FX curve is not necessary since the Hue-Hue curve provides similar functionality with the added benefit of being strictly invertible.
Public Functions
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
virtual FormatMetadata &getFormatMetadata() noexcept = 0¶
-
virtual bool equals(const GradingHueCurveTransform &other) const noexcept = 0¶
Checks if this equals other.
-
virtual GradingStyle getStyle() const noexcept = 0¶
Adjusts the behavior of the transform for log, linear, or video color space encodings.
-
virtual void setStyle(GradingStyle style) noexcept = 0¶
Will reset value to style’s defaults if style is not the current style.
-
virtual const ConstGradingHueCurveRcPtr getValue() const = 0¶
-
virtual void setValue(const ConstGradingHueCurveRcPtr &value) = 0¶
Throws if value is not valid.
-
virtual float getSlope(HueCurveType c, size_t index) const = 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 void setSlope(HueCurveType c, size_t index, float slope) = 0¶
-
virtual bool slopesAreDefault(HueCurveType c) const = 0¶
-
virtual HSYTransformStyle getRGBToHSY() const = 0¶
By default, the input is transformed into HSY space to apply the hue curves and then the result is transformed back to RGB. However, this may be set to HSY_TRANSFORM_NONE to bypass this in order to use other hue/sat/luma type transforms applied separately before and after this transform.
-
virtual void setRGBToHSY(HSYTransformStyle style) = 0¶
-
virtual bool isDynamic() const noexcept = 0¶
Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingHueCurveTransform only one can have dynamic parameters.
-
virtual void makeDynamic() noexcept = 0¶
-
virtual void makeNonDynamic() noexcept = 0¶
-
GradingHueCurveTransform(const GradingHueCurveTransform&) = delete¶
-
GradingHueCurveTransform &operator=(const GradingHueCurveTransform&) = delete¶
-
virtual ~GradingHueCurveTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static GradingHueCurveTransformRcPtr Create(GradingStyle style)¶
Creates an instance of GradingHueCurveTransform.
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingHueCurveTransform&) noexcept¶
-
typedef std::shared_ptr<const GradingHueCurveTransform> OpenColorIO_v2_5::ConstGradingHueCurveTransformRcPtr¶
-
typedef std::shared_ptr<GradingHueCurveTransform> OpenColorIO_v2_5::GradingHueCurveTransformRcPtr¶
GradingHueCurve¶
- class PyOpenColorIO.GradingHueCurve¶
A set of HUE/SAT/LUM curves. It is used by GradingHueCurveTransform and can be used as a dynamic property (see DynamicPropertyGradingHueCurve).
- GradingHueCurve(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingHueCurve, style: PyOpenColorIO.PyOpenColorIO.GradingStyle) -> None
Do not use (needed only for pybind11).
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingHueCurve, arg0: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg1: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg2: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg3: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg4: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg5: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg6: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg7: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve) -> None
- getDrawCurveOnly() bool¶
Enable drawCurveOnly mode to return the output value of a spline curve without any of the other associated processing of the RGB values. This is useful when the curves need to be graphed independently in a user interface. To use this, set the curve parameters on the Hue-Sat curve. The R, G, and B values will be sent through that curve with the interpretation that they are the input axis to the curve (which would be hue, sat, or luma) rather than RGB. This mode does not apply the RGB-to-HSY or Lin-to-Log, so for scene-linear curves the luma values are interpreted as already being in the logarithmic (f-stop) space. The forward curve evaluation is done regardless of the transform direction.
- property hue_fx¶
- property hue_hue¶
- property hue_lum¶
- property hue_sat¶
- isIdentity() bool¶
- property lum_lum¶
- property lum_sat¶
- property sat_lum¶
- property sat_sat¶
- setDrawCurveOnly(drawcurveonly: bool) None¶
- validate() None¶
-
class GradingHueCurve¶
A set of HUE/SAT/LUM curves. It is used by GradingHueCurveTransform and can be used as a dynamic property (see DynamicPropertyGradingHueCurve).
Public Functions
-
virtual GradingHueCurveRcPtr createEditableCopy() const = 0¶
-
virtual void validate() const = 0¶
-
virtual bool isIdentity() const = 0¶
-
virtual bool getDrawCurveOnly() const = 0¶
Enable drawCurveOnly mode to return the output value of a spline curve without any of the other associated processing of the RGB values. This is useful when the curves need to be graphed independently in a user interface. To use this, set the curve parameters on the Hue-Sat curve. The R, G, and B values will be sent through that curve with the interpretation that they are the input axis to the curve (which would be hue, sat, or luma) rather than RGB. This mode does not apply the RGB-to-HSY or Lin-to-Log, so for scene-linear curves the luma values are interpreted as already being in the logarithmic (f-stop) space. The forward curve evaluation is done regardless of the transform direction.
-
virtual void setDrawCurveOnly(bool drawCurveOnly) = 0¶
-
virtual ConstGradingBSplineCurveRcPtr getCurve(HueCurveType c) const = 0¶
-
virtual GradingBSplineCurveRcPtr getCurve(HueCurveType c) = 0¶
-
virtual ~GradingHueCurve() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static GradingHueCurveRcPtr Create(GradingStyle style)¶
Create a GradingHueCurve. (The style argument is not part of the object, it is simply used to initialize the proper default curves.)
-
static GradingHueCurveRcPtr Create(const ConstGradingHueCurveRcPtr &rhs)¶
-
static GradingHueCurveRcPtr Create(ConstGradingBSplineCurveRcPtr hueHue, ConstGradingBSplineCurveRcPtr hueSat, ConstGradingBSplineCurveRcPtr hueLum, ConstGradingBSplineCurveRcPtr lumSat, ConstGradingBSplineCurveRcPtr satSat, ConstGradingBSplineCurveRcPtr lumLum, ConstGradingBSplineCurveRcPtr satLum, ConstGradingBSplineCurveRcPtr hueFx)¶
-
static BSplineType GetBSplineTypeForHueCurveType(HueCurveType curveType)¶
-
virtual GradingHueCurveRcPtr createEditableCopy() const = 0¶
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingHueCurve&)¶
-
typedef std::shared_ptr<const GradingHueCurve> OpenColorIO_v2_5::ConstGradingHueCurveRcPtr¶
-
typedef std::shared_ptr<GradingHueCurve> OpenColorIO_v2_5::GradingHueCurveRcPtr¶
GradingControlPoint¶
- class PyOpenColorIO.GradingControlPoint¶
2D control point used by GradingBSplineCurve.
- GradingControlPoint(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingControlPoint) -> None
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingControlPoint, x: typing.SupportsFloat | typing.SupportsIndex = 0.0, y: typing.SupportsFloat | typing.SupportsIndex = 0.0) -> None
- property x¶
- property y¶
-
struct GradingControlPoint¶
2D control point used by GradingBSplineCurve.
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingControlPoint&)¶
GradingBSplineCurve¶
- class PyOpenColorIO.GradingBSplineCurve¶
A BSpline curve defined with GradingControlPoint.
- GradingBSplineCurve(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, size: typing.SupportsInt | typing.SupportsIndex) -> None
Create a BSpline curve with a specified number of control points.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, size: typing.SupportsInt | typing.SupportsIndex, huecurvetype: PyOpenColorIO.PyOpenColorIO.HueCurveType) -> None
Create a BSpline curve with a specified number of control points.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, size: typing.SupportsInt | typing.SupportsIndex, splinetype: PyOpenColorIO.PyOpenColorIO.BSplineType) -> None
Create a BSpline curve with a specified number of control points.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg0: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex]) -> None
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve, arg0: collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], arg1: PyOpenColorIO.PyOpenColorIO.HueCurveType) -> None
- getControlPoints() PyOpenColorIO.PyOpenColorIO.GradingBSplineCurve.GradingControlPointIterator¶
- getSlopes() list[float]¶
- getSplineType() PyOpenColorIO.PyOpenColorIO.BSplineType¶
- setNumControlPoints(size: SupportsInt | SupportsIndex) None¶
- setSlopes(arg0: collections.abc.Sequence[SupportsFloat | SupportsIndex]) None¶
- setSplineType(splinetype: PyOpenColorIO.PyOpenColorIO.BSplineType) None¶
- slopesAreDefault() bool¶
- validate() None¶
- class PyOpenColorIO.GradingBSplineCurve.GradingControlPointIterator¶
- self[arg0: SupportsInt | SupportsIndex] PyOpenColorIO.PyOpenColorIO.GradingControlPoint¶
- len(self) int¶
- self[arg0: SupportsInt | SupportsIndex] = arg1: PyOpenColorIO.PyOpenColorIO.GradingControlPoint None¶
-
class GradingBSplineCurve¶
A BSpline curve defined with GradingControlPoint.
Public Functions
-
virtual GradingBSplineCurveRcPtr createEditableCopy() const = 0¶
-
virtual size_t getNumControlPoints() const noexcept = 0¶
Get the number of ControlPoint objects (and the number of slopes).
-
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¶
-
virtual BSplineType getSplineType() const = 0¶
-
virtual void setSplineType(BSplineType splineType) = 0¶
-
GradingBSplineCurve(const GradingBSplineCurve&) = delete¶
-
GradingBSplineCurve &operator=(const GradingBSplineCurve&) = delete¶
-
virtual ~GradingBSplineCurve() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static GradingBSplineCurveRcPtr Create(size_t size)¶
Create a BSpline curve with a specified number of control points.
-
static GradingBSplineCurveRcPtr Create(size_t size, BSplineType splineType)¶
-
static GradingBSplineCurveRcPtr Create(size_t size, HueCurveType curveType)¶
-
static GradingBSplineCurveRcPtr Create(std::initializer_list<GradingControlPoint> values)¶
Create a BSpline curve with a list of control points.
-
static GradingBSplineCurveRcPtr Create(std::initializer_list<GradingControlPoint> values, BSplineType splineType)¶
-
static GradingBSplineCurveRcPtr Create(std::initializer_list<GradingControlPoint> values, HueCurveType curveType)¶
-
virtual GradingBSplineCurveRcPtr createEditableCopy() const = 0¶
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingBSplineCurve&)¶
-
typedef std::shared_ptr<const GradingBSplineCurve> OpenColorIO_v2_5::ConstGradingBSplineCurveRcPtr¶
-
typedef std::shared_ptr<GradingBSplineCurve> OpenColorIO_v2_5::GradingBSplineCurveRcPtr¶
GradingToneTransform¶
- class PyOpenColorIO.GradingToneTransform¶
Tonal color correction controls.
This transform is for making fine adjustments to tone reproduction in specific tonal ranges.
There are five tonal controls and each one has two parameters to control its range: - Blacks (start, width) - Shadows(start, pivot) - Midtones(center, width) - Highlights(start, pivot) - Whites(start, width)
The transform has three styles that adjust the response and default ranges for linear, logarithimic, and video color encodings. The defaults vary based on the style. When the style is linear, the units for start/width/etc. are photographic stops relative to 0.18.
Each control allows R, G, B adjustments and a Master adjustment.
There is also an S-contrast control for imparting an S-shape curve.
The controls are dynamic, so they may be adjusted even after the Transform has been included in a Processor.
- GradingToneTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingToneTransform, values: PyOpenColorIO.PyOpenColorIO.GradingTone, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Creates an instance of GradingToneTransform.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingToneTransform, style: PyOpenColorIO.PyOpenColorIO.GradingStyle = <GradingStyle.GRADING_LOG: 0>, dynamic: bool = False, dir: PyOpenColorIO.PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Creates an instance of GradingToneTransform.
- getDirection() PyOpenColorIO.PyOpenColorIO.TransformDirection¶
- getFormatMetadata() PyOpenColorIO.PyOpenColorIO.FormatMetadata¶
- getStyle() PyOpenColorIO.PyOpenColorIO.GradingStyle¶
Adjusts the behavior of the transform for log, linear, or video color space encodings.
- getTransformType() PyOpenColorIO.PyOpenColorIO.TransformType¶
- getValue() PyOpenColorIO.PyOpenColorIO.GradingTone¶
- isDynamic() bool¶
Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingToneTransform only one can have dynamic parameters.
- makeDynamic() None¶
- makeNonDynamic() None¶
- setDirection(direction: PyOpenColorIO.PyOpenColorIO.TransformDirection) None¶
Note that this only affects the evaluation and not the values stored in the object.
- setStyle(style: PyOpenColorIO.PyOpenColorIO.GradingStyle) None¶
Will reset value to style’s defaults if style is not the current style.
- setValue(values: PyOpenColorIO.PyOpenColorIO.GradingTone) None¶
- validate() None¶
Will throw if data is not valid.
-
class GradingToneTransform : public Transform¶
Tonal color correction controls.
This transform is for making fine adjustments to tone reproduction in specific tonal ranges.
There are five tonal controls and each one has two parameters to control its range:
Blacks (start, width)
Shadows(start, pivot)
Midtones(center, width)
Highlights(start, pivot)
Whites(start, width)
The transform has three styles that adjust the response and default ranges for linear, logarithimic, and video color encodings. The defaults vary based on the style. When the style is linear, the units for start/width/etc. are photographic stops relative to 0.18.
Each control allows R, G, B adjustments and a Master adjustment.
There is also an S-contrast control for imparting an S-shape curve.
The controls are dynamic, so they may be adjusted even after the Transform has been included in a Processor.
Public Functions
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
virtual FormatMetadata &getFormatMetadata() noexcept = 0¶
-
virtual bool equals(const GradingToneTransform &other) const noexcept = 0¶
-
virtual GradingStyle getStyle() const noexcept = 0¶
Adjusts the behavior of the transform for log, linear, or video color space encodings.
-
virtual void setStyle(GradingStyle style) noexcept = 0¶
Will reset value to style’s defaults if style is not the current style.
-
virtual const GradingTone &getValue() const = 0¶
-
virtual void setValue(const GradingTone &values) = 0¶
-
virtual bool isDynamic() const noexcept = 0¶
Parameters can be made dynamic so the values can be changed through the CPU or GPU processor, but if there are several GradingToneTransform only one can have dynamic parameters.
-
virtual void makeDynamic() noexcept = 0¶
-
virtual void makeNonDynamic() noexcept = 0¶
-
GradingToneTransform(const GradingToneTransform&) = delete¶
-
GradingToneTransform &operator=(const GradingToneTransform&) = delete¶
-
virtual ~GradingToneTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static GradingToneTransformRcPtr Create(GradingStyle style)¶
Creates an instance of GradingToneTransform.
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingToneTransform&) noexcept¶
-
typedef std::shared_ptr<const GradingToneTransform> OpenColorIO_v2_5::ConstGradingToneTransformRcPtr¶
-
typedef std::shared_ptr<GradingToneTransform> OpenColorIO_v2_5::GradingToneTransformRcPtr¶
GradingTone¶
- class PyOpenColorIO.GradingTone¶
Grading tone values.
- GradingTone(arg0: PyOpenColorIO.PyOpenColorIO.GradingStyle) None¶
- property blacks¶
- property highlights¶
- property midtones¶
- property scontrast¶
- property shadows¶
- validate() None¶
The valid range for each parameter varies. The client is expected to enforce these bounds in the UI.
- property whites¶
-
struct GradingTone¶
Grading tone values.
Public Functions
-
GradingTone() = delete¶
-
inline explicit GradingTone(GradingStyle style)¶
-
void validate() const¶
The valid range for each parameter varies. The client is expected to enforce these bounds in the UI.
Public Members
-
GradingRGBMSW m_blacks¶
-
GradingRGBMSW m_shadows¶
-
GradingRGBMSW m_midtones¶
-
GradingRGBMSW m_highlights¶
-
GradingRGBMSW m_whites¶
-
double m_scontrast = {1.0}¶
-
GradingTone() = delete¶
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingTone&)¶
GradingRGBMSW¶
- class PyOpenColorIO.GradingRGBMSW¶
Used by the grading tone transforms to hold the red, green, blue, master, start, and width components of a single parameter. The master component affects all three channels (RGB). The start and width components control the range of tones affected. Although this struct simply uses “start” and “width” for all the range values, the actual user-facing name changes based on the parameter.
- GradingRGBMSW(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBMSW) -> None
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBMSW, red: typing.SupportsFloat | typing.SupportsIndex, green: typing.SupportsFloat | typing.SupportsIndex, blue: typing.SupportsFloat | typing.SupportsIndex, master: typing.SupportsFloat | typing.SupportsIndex, start: typing.SupportsFloat | typing.SupportsIndex, width: typing.SupportsFloat | typing.SupportsIndex) -> None
__init__(self: PyOpenColorIO.PyOpenColorIO.GradingRGBMSW, start: typing.SupportsFloat | typing.SupportsIndex, width: typing.SupportsFloat | typing.SupportsIndex) -> None
- property blue¶
- property green¶
- property master¶
- property red¶
- property start¶
- property width¶
-
struct GradingRGBMSW¶
Used by the grading tone transforms to hold the red, green, blue, master, start, and width components of a single parameter. The master component affects all three channels (RGB). The start and width components control the range of tones affected. Although this struct simply uses “start” and “width” for all the range values, the actual user-facing name changes based on the parameter.
-
std::ostream &OpenColorIO_v2_5::operator<<(std::ostream&, const GradingRGBMSW&)¶