Transforms¶
See also: Grading Transforms
Transform¶
- class PyOpenColorIO.Transform¶
Base class for all the transform classes.
- Transform(*args, **kwargs)¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- validate() None ¶
Will throw if data is not valid.
-
class Transform¶
Base class for all the transform classes.
Subclassed by AllocationTransform, BuiltinTransform, CDLTransform, ColorSpaceTransform, DisplayViewTransform, ExponentTransform, ExponentWithLinearTransform, ExposureContrastTransform, FileTransform, FixedFunctionTransform, GradingPrimaryTransform, GradingRGBCurveTransform, GradingToneTransform, GroupTransform, LogAffineTransform, LogCameraTransform, LogTransform, LookTransform, Lut1DTransform, Lut3DTransform, MatrixTransform, RangeTransform
Public Functions
-
virtual TransformRcPtr createEditableCopy() const = 0¶
-
virtual TransformDirection getDirection() const noexcept = 0¶
-
virtual void setDirection(TransformDirection dir) noexcept = 0¶
Note that this only affects the evaluation and not the values stored in the object.
-
virtual TransformType getTransformType() const noexcept = 0¶
-
virtual void validate() const¶
Will throw if data is not valid.
-
virtual ~Transform() = default¶
Do not use (needed only for pybind11).
-
virtual TransformRcPtr createEditableCopy() const = 0¶
AllocationTransform¶
- class PyOpenColorIO.AllocationTransform¶
Forward direction wraps the ‘expanded’ range into the specified, often compressed, range.
- AllocationTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.AllocationTransform) -> None
__init__(self: PyOpenColorIO.AllocationTransform, allocation: PyOpenColorIO.Allocation = <Allocation.ALLOCATION_UNIFORM: 1>, vars: List[float] = [], direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- getAllocation() PyOpenColorIO.Allocation ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- getVars() List[float] ¶
- setAllocation(allocation: PyOpenColorIO.Allocation) None ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setVars(vars: List[float]) None ¶
- validate() None ¶
Will throw if data is not valid.
-
class AllocationTransform : public Transform¶
Forward direction wraps the ‘expanded’ range into the specified, often compressed, range.
Public Functions
-
virtual TransformRcPtr createEditableCopy() const override¶
-
virtual TransformDirection getDirection() const noexcept override¶
-
virtual void setDirection(TransformDirection dir) noexcept override¶
Note that this only affects the evaluation and not the values stored in the object.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual void validate() const override¶
Will throw if data is not valid.
-
Allocation getAllocation() const¶
-
void setAllocation(Allocation allocation)¶
-
int getNumVars() const¶
-
void getVars(float *vars) const¶
-
void setVars(int numvars, const float *vars)¶
-
AllocationTransform &operator=(const AllocationTransform&) = delete¶
-
virtual ~AllocationTransform()¶
Do not use (needed only for pybind11).
Public Static Functions
-
static AllocationTransformRcPtr Create()¶
-
virtual TransformRcPtr createEditableCopy() const override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const AllocationTransform&)¶
-
typedef std::shared_ptr<const AllocationTransform> OpenColorIO_v2_2::ConstAllocationTransformRcPtr¶
-
typedef std::shared_ptr<AllocationTransform> OpenColorIO_v2_2::AllocationTransformRcPtr¶
BuiltinTransform¶
- class PyOpenColorIO.BuiltinTransform¶
A built-in transform is similar to a FileTransform, but without the file. OCIO knows how to build a set of commonly used transforms on-demand, thus avoiding the need for external files and simplifying config authoring.
- BuiltinTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.BuiltinTransform) -> None
__init__(self: PyOpenColorIO.BuiltinTransform, style: str = ‘IDENTITY’, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- getDescription() str ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getStyle() str ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setStyle(style: str) None ¶
Select an existing built-in transform style from the list accessible through
:ref:`BuiltinTransformRegistry`
. The style is the ID string that identifies which transform to apply.
- validate() None ¶
Will throw if data is not valid.
-
class BuiltinTransform : public Transform¶
A built-in transform is similar to a FileTransform, but without the file. OCIO knows how to build a set of commonly used transforms on-demand, thus avoiding the need for external files and simplifying config authoring.
Public Functions
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual const char *getStyle() const noexcept = 0¶
-
virtual void setStyle(const char *style) = 0¶
Select an existing built-in transform style from the list accessible through :cpp:class:
BuiltinTransformRegistry
. The style is the ID string that identifies which transform to apply.
-
virtual const char *getDescription() const noexcept = 0¶
-
virtual ~BuiltinTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static BuiltinTransformRcPtr Create()¶
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const BuiltinTransform&) noexcept¶
-
typedef std::shared_ptr<const BuiltinTransform> OpenColorIO_v2_2::ConstBuiltinTransformRcPtr¶
-
typedef std::shared_ptr<BuiltinTransform> OpenColorIO_v2_2::BuiltinTransformRcPtr¶
BuiltinTransformRegistry¶
- class PyOpenColorIO.BuiltinTransformRegistry¶
The built-in transform registry contains all the existing built-in transforms which can be used by a configuration (version 2 or higher only).
- BuiltinTransformRegistry() None ¶
Get the current built-in transform registry.
- getBuiltins() PyOpenColorIO.BuiltinTransformRegistry.BuiltinIterator ¶
-
class BuiltinTransformRegistry¶
The built-in transform registry contains all the existing built-in transforms which can be used by a configuration (version 2 or higher only).
Public Functions
-
BuiltinTransformRegistry(const BuiltinTransformRegistry&) = delete¶
-
BuiltinTransformRegistry &operator=(const BuiltinTransformRegistry&) = delete¶
-
virtual size_t getNumBuiltins() const noexcept = 0¶
Get the number of built-in transforms available.
-
virtual const char *getBuiltinStyle(size_t index) const = 0¶
Get the style string for the i-th built-in transform. The style is the ID string that identifies a given transform.
-
virtual const char *getBuiltinDescription(size_t index) const = 0¶
Get the description string for the i-th built-in transform.
Public Static Functions
-
static ConstBuiltinTransformRegistryRcPtr Get() noexcept¶
Get the current built-in transform registry.
-
BuiltinTransformRegistry(const BuiltinTransformRegistry&) = delete¶
-
typedef std::shared_ptr<const BuiltinTransformRegistry> OpenColorIO_v2_2::ConstBuiltinTransformRegistryRcPtr¶
-
typedef std::shared_ptr<BuiltinTransformRegistry> OpenColorIO_v2_2::BuiltinTransformRegistryRcPtr¶
CDLTransform¶
- class PyOpenColorIO.CDLTransform¶
An implementation of the ASC Color Decision List (CDL), based on the ASC v1.2 specification.
ASC_SOP
Slope, offset, power:: out = clamp( (in * slope) + offset ) ^ power
Note
If the config version is 1, negative values are clamped if the power is not 1.0. For config version 2 and higher, the negative handling is controlled by the CDL style.
- static CreateFromFile(src: str, id: str) PyOpenColorIO.CDLTransform ¶
Load the CDL from the src .cdl, .cc, or .ccc file.
Note
The cccid can be the ID of a CDL or the index of the CDL (as string). If cccid is NULL or empty the first CDL is returned. The cccid is case-sensitive. The src must be an absolute path reference, no relative directory or envvar resolution is performed. Throws if file does not contain any CDL or if the specified cccid is not found.
- static CreateGroupFromFile(src: str) PyOpenColorIO.GroupTransform ¶
Load all of the CDLs in a .cdl or .ccc file into a single GroupTransform.
Note
This may be useful as a quicker way for applications to check the contents of each of the CDLs. The src must be an absolute path reference, no relative directory or envvar resolution is performed.
- CDLTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.CDLTransform) -> None
__init__(self: PyOpenColorIO.CDLTransform, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
__init__(self: PyOpenColorIO.CDLTransform, slope: List[float[3]] = [1.0, 1.0, 1.0], offset: List[float[3]] = [0.0, 0.0, 0.0], power: List[float[3]] = [1.0, 1.0, 1.0], sat: float = 1.0, id: str = ‘’, description: str = ‘’, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- equals(other: PyOpenColorIO.CDLTransform) bool ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFirstSOPDescription() str ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getID() str ¶
The get/setID methods are now deprecated. The preferred way of interacting with the ID is now via the transform’s formatMetadata.
- getOffset() List[float[3]] ¶
- getPower() List[float[3]] ¶
- getSOP() List[float[9]] ¶
- getSat() float ¶
- getSatLumaCoefs() List[float[3]] ¶
These are hard-coded, by spec, to r709.
- getSlope() List[float[3]] ¶
- getStyle() PyOpenColorIO.CDLStyle ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setFirstSOPDescription(description: str) None ¶
- setID(id: str) None ¶
- setOffset(rgb: List[float[3]]) None ¶
- setPower(rgb: List[float[3]]) None ¶
- setSOP(vec9: List[float[9]]) None ¶
- setSat(sat: float) None ¶
- setSlope(rgb: List[float[3]]) None ¶
- setStyle(style: PyOpenColorIO.CDLStyle) None ¶
Use CDL_ASC to clamp values to [0,1] per the ASC spec. Use NO_CLAMP to never clamp values (regardless of whether power is 1.0). The NO_CLAMP option passes negatives through unchanged (like the NEGATIVE_PASS_THRU style of ExponentTransform). The default style is CDL_NO_CLAMP.
- validate() None ¶
Will throw if data is not valid.
-
class CDLTransform : public Transform¶
An implementation of the ASC Color Decision List (CDL), based on the ASC v1.2 specification.
ASC_SOP
Slope, offset, power:: out = clamp( (in * slope) + offset ) ^ power
Note
If the config version is 1, negative values are clamped if the power is not 1.0. For config version 2 and higher, the negative handling is controlled by the CDL style.
Public Functions
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual FormatMetadata &getFormatMetadata() noexcept = 0¶
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
virtual bool equals(const CDLTransform &other) const noexcept = 0¶
-
virtual void setStyle(CDLStyle style) = 0¶
Use CDL_ASC to clamp values to [0,1] per the ASC spec. Use NO_CLAMP to never clamp values (regardless of whether power is 1.0). The NO_CLAMP option passes negatives through unchanged (like the NEGATIVE_PASS_THRU style of ExponentTransform). The default style is CDL_NO_CLAMP.
-
virtual void getSlope(double *rgb) const = 0¶
-
virtual void setSlope(const double *rgb) = 0¶
-
virtual void getOffset(double *rgb) const = 0¶
-
virtual void setOffset(const double *rgb) = 0¶
-
virtual void getPower(double *rgb) const = 0¶
-
virtual void setPower(const double *rgb) = 0¶
-
virtual void getSOP(double *vec9) const = 0¶
-
virtual void setSOP(const double *vec9) = 0¶
-
virtual double getSat() const = 0¶
-
virtual void setSat(double sat) = 0¶
-
virtual void getSatLumaCoefs(double *rgb) const = 0¶
These are hard-coded, by spec, to r709.
-
virtual const char *getID() const = 0¶
The get/setID methods are now deprecated. The preferred way of interacting with the ID is now via the transform’s formatMetadata.
-
virtual void setID(const char *id) = 0¶
-
virtual const char *getFirstSOPDescription() const = 0¶
-
virtual void setFirstSOPDescription(const char *description) = 0¶
-
CDLTransform(const CDLTransform&) = delete¶
-
CDLTransform &operator=(const CDLTransform&) = delete¶
-
virtual ~CDLTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static CDLTransformRcPtr Create()¶
-
static CDLTransformRcPtr CreateFromFile(const char *src, const char *cccid)¶
Load the CDL from the src .cdl, .cc, or .ccc file.
Note
The cccid can be the ID of a CDL or the index of the CDL (as string). If cccid is NULL or empty the first CDL is returned. The cccid is case-sensitive. The src must be an absolute path reference, no relative directory or envvar resolution is performed. Throws if file does not contain any CDL or if the specified cccid is not found.
-
static GroupTransformRcPtr CreateGroupFromFile(const char *src)¶
Load all of the CDLs in a .cdl or .ccc file into a single GroupTransform.
Note
This may be useful as a quicker way for applications to check the contents of each of the CDLs. The src must be an absolute path reference, no relative directory or envvar resolution is performed.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const CDLTransform&)¶
-
typedef std::shared_ptr<const CDLTransform> OpenColorIO_v2_2::ConstCDLTransformRcPtr¶
-
typedef std::shared_ptr<CDLTransform> OpenColorIO_v2_2::CDLTransformRcPtr¶
ColorSpaceTransform¶
- class PyOpenColorIO.ColorSpaceTransform¶
- ColorSpaceTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.ColorSpaceTransform) -> None
__init__(self: PyOpenColorIO.ColorSpaceTransform, src: str = ‘’, dst: str = ‘’, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>, dataBypass: bool = True) -> None
- getDataBypass() bool ¶
Data color spaces do not get processed when true (which is the default).
- getDirection() PyOpenColorIO.TransformDirection ¶
- getDst() str ¶
- getSrc() str ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setDataBypass(dataBypass: bool) None ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setDst(dst: str) None ¶
- setSrc(src: str) None ¶
- validate() None ¶
Will throw if data is not valid.
-
class ColorSpaceTransform : public Transform¶
Public Functions
-
virtual TransformRcPtr createEditableCopy() const override¶
-
virtual TransformDirection getDirection() const noexcept override¶
-
virtual void setDirection(TransformDirection dir) noexcept override¶
Note that this only affects the evaluation and not the values stored in the object.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual void validate() const override¶
Will throw if data is not valid.
-
const char *getSrc() const¶
-
void setSrc(const char *src)¶
-
const char *getDst() const¶
-
void setDst(const char *dst)¶
-
bool getDataBypass() const noexcept¶
Data color spaces do not get processed when true (which is the default).
-
void setDataBypass(bool enabled) noexcept¶
-
ColorSpaceTransform &operator=(const ColorSpaceTransform&) = delete¶
-
virtual ~ColorSpaceTransform()¶
Do not use (needed only for pybind11).
Public Static Functions
-
static ColorSpaceTransformRcPtr Create()¶
-
virtual TransformRcPtr createEditableCopy() const override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const ColorSpaceTransform&)¶
-
typedef std::shared_ptr<const ColorSpaceTransform> OpenColorIO_v2_2::ConstColorSpaceTransformRcPtr¶
-
typedef std::shared_ptr<ColorSpaceTransform> OpenColorIO_v2_2::ColorSpaceTransformRcPtr¶
DisplayViewTransform¶
- class PyOpenColorIO.DisplayViewTransform¶
- DisplayViewTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.DisplayViewTransform) -> None
__init__(self: PyOpenColorIO.DisplayViewTransform, src: str = ‘’, display: str = ‘’, view: str = ‘’, looksBypass: bool = False, dataBypass: bool = True, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- getDataBypass() bool ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getDisplay() str ¶
- getLooksBypass() bool ¶
- getSrc() str ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- getView() str ¶
- setDataBypass(dataBypass: bool) None ¶
Data color spaces do not get processed when true (which is the default).
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setDisplay(display: str) None ¶
Specify which display to use.
- setLooksBypass(looksBypass: bool) None ¶
Looks will be bypassed when true (the default is false).
- setSrc(src: str) None ¶
Specify the incoming color space.
- setView(view: str) None ¶
Specify which view transform to use.
- validate() None ¶
Will throw if data is not valid.
-
class DisplayViewTransform : public Transform¶
Public Functions
-
virtual TransformRcPtr createEditableCopy() const override¶
-
virtual TransformDirection getDirection() const noexcept override¶
-
virtual void setDirection(TransformDirection dir) noexcept override¶
Note that this only affects the evaluation and not the values stored in the object.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual void validate() const override¶
Will throw if data is not valid.
-
const char *getSrc() const¶
-
void setSrc(const char *name)¶
Specify the incoming color space.
-
const char *getDisplay() const¶
-
void setDisplay(const char *display)¶
Specify which display to use.
-
const char *getView() const¶
-
void setView(const char *view)¶
Specify which view transform to use.
-
bool getLooksBypass() const¶
-
void setLooksBypass(bool bypass)¶
Looks will be bypassed when true (the default is false).
-
bool getDataBypass() const noexcept¶
-
void setDataBypass(bool bypass) noexcept¶
Data color spaces do not get processed when true (which is the default).
-
virtual ~DisplayViewTransform()¶
Do not use (needed only for pybind11).
Public Static Functions
-
static DisplayViewTransformRcPtr Create()¶
-
virtual TransformRcPtr createEditableCopy() const override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const DisplayViewTransform&)¶
-
typedef std::shared_ptr<const DisplayViewTransform> OpenColorIO_v2_2::ConstDisplayViewTransformRcPtr¶
-
typedef std::shared_ptr<DisplayViewTransform> OpenColorIO_v2_2::DisplayViewTransformRcPtr¶
ExponentTransform¶
- class PyOpenColorIO.ExponentTransform¶
Represents exponent transform: pow( clamp(color), value ).
Note
For configs with version == 1: Negative style is ignored and if the exponent is 1.0, this will not clamp. Otherwise, the input color will be clamped between [0.0, inf]. For configs with version > 1: Negative value handling may be specified via setNegativeStyle.
- ExponentTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.ExponentTransform) -> None
__init__(self: PyOpenColorIO.ExponentTransform, value: List[float[4]] = [1.0, 1.0, 1.0, 1.0], negativeStyle: PyOpenColorIO.NegativeStyle = <NegativeStyle.NEGATIVE_CLAMP: 0>, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- equals(other: PyOpenColorIO.ExponentTransform) bool ¶
Checks if this exactly equals other.
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getNegativeStyle() PyOpenColorIO.NegativeStyle ¶
Specifies how negative values are handled. Legal values:
NEGATIVE_CLAMP – Clamp negative values (default).
NEGATIVE_MIRROR – Positive curve is rotated 180 degrees around the origin to handle negatives.
NEGATIVE_PASS_THRU – Negative values are passed through unchanged.
- getTransformType() PyOpenColorIO.TransformType ¶
- getValue() List[float[4]] ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setNegativeStyle(style: PyOpenColorIO.NegativeStyle) None ¶
- setValue(value: List[float[4]]) None ¶
- validate() None ¶
Will throw if data is not valid.
-
class ExponentTransform : public Transform¶
Represents exponent transform: pow( clamp(color), value ).
Note
For configs with version == 1: Negative style is ignored and if the exponent is 1.0, this will not clamp. Otherwise, the input color will be clamped between [0.0, inf]. For configs with version > 1: Negative value handling may be specified via setNegativeStyle.
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 ExponentTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual void getValue(double (&vec4)[4]) const noexcept = 0¶
-
virtual void setValue(const double (&vec4)[4]) noexcept = 0¶
-
virtual NegativeStyle getNegativeStyle() const = 0¶
Specifies how negative values are handled. Legal values:
NEGATIVE_CLAMP — Clamp negative values (default).
NEGATIVE_MIRROR — Positive curve is rotated 180 degrees around the origin to handle negatives.
NEGATIVE_PASS_THRU — Negative values are passed through unchanged.
-
virtual void setNegativeStyle(NegativeStyle style) = 0¶
-
ExponentTransform(const ExponentTransform&) = delete¶
-
ExponentTransform &operator=(const ExponentTransform&) = delete¶
-
virtual ~ExponentTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static ExponentTransformRcPtr Create()¶
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const ExponentTransform&)¶
-
typedef std::shared_ptr<const ExponentTransform> OpenColorIO_v2_2::ConstExponentTransformRcPtr¶
-
typedef std::shared_ptr<ExponentTransform> OpenColorIO_v2_2::ExponentTransformRcPtr¶
ExponentWithLinearTransform¶
- class PyOpenColorIO.ExponentWithLinearTransform¶
Represents power functions with a linear section in the shadows such as sRGB and L*.
The basic formula is:
pow( (x + offset)/(1 + offset), gamma ) with the breakpoint at offset/(gamma - 1).
Negative values are never clamped.
- ExponentWithLinearTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.ExponentWithLinearTransform) -> None
__init__(self: PyOpenColorIO.ExponentWithLinearTransform, gamma: List[float[4]] = [1.0, 1.0, 1.0, 1.0], offset: List[float[4]] = [0.0, 0.0, 0.0, 0.0], negativeStyle: PyOpenColorIO.NegativeStyle = <NegativeStyle.NEGATIVE_LINEAR: 3>, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- equals(other: PyOpenColorIO.ExponentWithLinearTransform) bool ¶
Checks if this exactly equals other.
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getGamma() List[float[4]] ¶
- getNegativeStyle() PyOpenColorIO.NegativeStyle ¶
Specifies how negative values are handled. Legal values:
NEGATIVE_LINEAR – Linear segment continues into negatives (default).
NEGATIVE_MIRROR – Positive curve is rotated 180 degrees around the origin to handle negatives.
- getOffset() List[float[4]] ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setGamma(values: List[float[4]]) None ¶
Set the exponent value for the power function for R, G, B, A.
Note
The gamma values must be in the range of [1, 10]. Set the transform direction to inverse to obtain the effect of values less than 1.
- setNegativeStyle(style: PyOpenColorIO.NegativeStyle) None ¶
- setOffset(values: List[float[4]]) None ¶
Set the offset value for the power function for R, G, B, A.
Note
The offset values must be in the range [0, 0.9].
- validate() None ¶
Will throw if data is not valid.
-
class ExponentWithLinearTransform : public Transform¶
Represents power functions with a linear section in the shadows such as sRGB and L*.
The basic formula is::
pow( (x + offset)/(1 + offset), gamma ) with the breakpoint at offset/(gamma - 1).
Negative values are never clamped.
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 ExponentWithLinearTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual void getGamma(double (&values)[4]) const noexcept = 0¶
-
virtual void setGamma(const double (&values)[4]) noexcept = 0¶
Set the exponent value for the power function for R, G, B, A.
Note
The gamma values must be in the range of [1, 10]. Set the transform direction to inverse to obtain the effect of values less than 1.
-
virtual void getOffset(double (&values)[4]) const noexcept = 0¶
-
virtual void setOffset(const double (&values)[4]) noexcept = 0¶
Set the offset value for the power function for R, G, B, A.
Note
The offset values must be in the range [0, 0.9].
-
virtual NegativeStyle getNegativeStyle() const = 0¶
Specifies how negative values are handled. Legal values:
NEGATIVE_LINEAR — Linear segment continues into negatives (default).
NEGATIVE_MIRROR — Positive curve is rotated 180 degrees around the origin to handle negatives.
-
virtual void setNegativeStyle(NegativeStyle style) = 0¶
-
ExponentWithLinearTransform(const ExponentWithLinearTransform&) = delete¶
-
ExponentWithLinearTransform &operator=(const ExponentWithLinearTransform&) = delete¶
-
virtual ~ExponentWithLinearTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static ExponentWithLinearTransformRcPtr Create()¶
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const ExponentWithLinearTransform&)¶
-
typedef std::shared_ptr<const ExponentWithLinearTransform> OpenColorIO_v2_2::ConstExponentWithLinearTransformRcPtr¶
-
typedef std::shared_ptr<ExponentWithLinearTransform> OpenColorIO_v2_2::ExponentWithLinearTransformRcPtr¶
ExposureContrastTransform¶
- class PyOpenColorIO.ExposureContrastTransform¶
Applies exposure, gamma, and pivoted contrast adjustments. Adjusts the math to be appropriate for linear, logarithmic, or video color spaces.
- ExposureContrastTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.ExposureContrastTransform) -> None
__init__(self: PyOpenColorIO.ExposureContrastTransform, style: PyOpenColorIO.ExposureContrastStyle = <ExposureContrastStyle.EXPOSURE_CONTRAST_LINEAR: 0>, exposure: float = 0.0, contrast: float = 1.0, gamma: float = 1.0, pivot: float = 0.18, logExposureStep: float = 0.088, logMidGray: float = 0.435, dynamicExposure: bool = False, dynamicContrast: bool = False, dynamicGamma: bool = False, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- equals(other: PyOpenColorIO.ExposureContrastTransform) bool ¶
Checks if this exactly equals other.
- getContrast() float ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getExposure() float ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getGamma() float ¶
- getLogExposureStep() float ¶
- getLogMidGray() float ¶
- getPivot() float ¶
- getStyle() PyOpenColorIO.ExposureContrastStyle ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- isContrastDynamic() bool ¶
Contrast can be made dynamic so the value can be changed through the CPU or GPU processor, but if there are several ExposureContrastTransform only one can have a dynamic contrast.
- isExposureDynamic() bool ¶
Exposure can be made dynamic so the value can be changed through the CPU or GPU processor, but if there are several ExposureContrastTransform only one can have a dynamic exposure.
- isGammaDynamic() bool ¶
Gamma can be made dynamic so the value can be changed through the CPU or GPU processor, but if there are several ExposureContrastTransform only one can have a dynamic gamma.
- makeContrastDynamic() None ¶
- makeContrastNonDynamic() None ¶
- makeExposureDynamic() None ¶
- makeExposureNonDynamic() None ¶
- makeGammaDynamic() None ¶
- makeGammaNonDynamic() None ¶
- setContrast(contrast: float) None ¶
Applies a contrast/gamma adjustment around a pivot point. The contrast and gamma are mathematically the same, but two controls are provided to enable the use of separate dynamic parameters. Contrast is usually a scene-referred adjustment that pivots around gray whereas gamma is usually a display-referred adjustment that pivots around white.
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setExposure(exposure: float) None ¶
Applies an exposure adjustment. The value is in units of stops (regardless of style), for example, a value of -1 would be equivalent to reducing the lighting by one half.
- setGamma(gamma: float) None ¶
- setLogExposureStep(logExposureStep: float) None ¶
Set the increment needed to move one stop for the log-style algorithm. For example, ACEScct is 0.057, LogC is roughly 0.074, and Cineon is roughly 90/1023 = 0.088. The default value is 0.088.
- setLogMidGray(logMidGray: float) None ¶
Set the position of 18% gray for use by the log-style algorithm. For example, ACEScct is about 0.41, LogC is about 0.39, and ADX10 is 445/1023 = 0.435. The default value is 0.435.
- setPivot(pivot: float) None ¶
Set the pivot point around which the contrast and gamma controls will work. Regardless of whether linear/video/log-style is being used, the pivot is always expressed in linear. In other words, a pivot of 0.18 is always mid-gray.
- setStyle(style: PyOpenColorIO.ExposureContrastStyle) None ¶
Select the algorithm for linear, video or log color spaces.
- validate() None ¶
Will throw if data is not valid.
-
class ExposureContrastTransform : public Transform¶
Applies exposure, gamma, and pivoted contrast adjustments. Adjusts the math to be appropriate for linear, logarithmic, or video color spaces.
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 ExposureContrastTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual ExposureContrastStyle getStyle() const = 0¶
-
virtual void setStyle(ExposureContrastStyle style) = 0¶
Select the algorithm for linear, video or log color spaces.
-
virtual double getExposure() const = 0¶
-
virtual void setExposure(double exposure) = 0¶
Applies an exposure adjustment. The value is in units of stops (regardless of style), for example, a value of -1 would be equivalent to reducing the lighting by one half.
-
virtual bool isExposureDynamic() const = 0¶
Exposure can be made dynamic so the value can be changed through the CPU or GPU processor, but if there are several ExposureContrastTransform only one can have a dynamic exposure.
-
virtual void makeExposureDynamic() = 0¶
-
virtual void makeExposureNonDynamic() = 0¶
-
virtual double getContrast() const = 0¶
-
virtual void setContrast(double contrast) = 0¶
Applies a contrast/gamma adjustment around a pivot point. The contrast and gamma are mathematically the same, but two controls are provided to enable the use of separate dynamic parameters. Contrast is usually a scene-referred adjustment that pivots around gray whereas gamma is usually a display-referred adjustment that pivots around white.
-
virtual bool isContrastDynamic() const = 0¶
Contrast can be made dynamic so the value can be changed through the CPU or GPU processor, but if there are several ExposureContrastTransform only one can have a dynamic contrast.
-
virtual void makeContrastDynamic() = 0¶
-
virtual void makeContrastNonDynamic() = 0¶
-
virtual double getGamma() const = 0¶
-
virtual void setGamma(double gamma) = 0¶
-
virtual bool isGammaDynamic() const = 0¶
Gamma can be made dynamic so the value can be changed through the CPU or GPU processor, but if there are several ExposureContrastTransform only one can have a dynamic gamma.
-
virtual void makeGammaDynamic() = 0¶
-
virtual void makeGammaNonDynamic() = 0¶
-
virtual double getPivot() const = 0¶
-
virtual void setPivot(double pivot) = 0¶
Set the pivot point around which the contrast and gamma controls will work. Regardless of whether linear/video/log-style is being used, the pivot is always expressed in linear. In other words, a pivot of 0.18 is always mid-gray.
-
virtual double getLogExposureStep() const = 0¶
-
virtual void setLogExposureStep(double logExposureStep) = 0¶
Set the increment needed to move one stop for the log-style algorithm. For example, ACEScct is 0.057, LogC is roughly 0.074, and Cineon is roughly 90/1023 = 0.088. The default value is 0.088.
-
virtual double getLogMidGray() const = 0¶
-
virtual void setLogMidGray(double logMidGray) = 0¶
Set the position of 18% gray for use by the log-style algorithm. For example, ACEScct is about 0.41, LogC is about 0.39, and ADX10 is 445/1023 = 0.435. The default value is 0.435.
-
virtual ~ExposureContrastTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static ExposureContrastTransformRcPtr Create()¶
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const ExposureContrastTransform&)¶
-
typedef std::shared_ptr<const ExposureContrastTransform> OpenColorIO_v2_2::ConstExposureContrastTransformRcPtr¶
-
typedef std::shared_ptr<ExposureContrastTransform> OpenColorIO_v2_2::ExposureContrastTransformRcPtr¶
FileTransform¶
- class PyOpenColorIO.FileTransform¶
- FileTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.FileTransform) -> None
__init__(self: PyOpenColorIO.FileTransform, src: str = ‘’, cccId: str = ‘’, interpolation: PyOpenColorIO.Interpolation = <Interpolation.INTERP_DEFAULT: 254>, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- getCCCId() str ¶
The cccid can be the ID of a CDL or the index of the CDL (as string). If cccid is NULL or empty the first CDL is returned. The cccid is case-sensitive.
- getCDLStyle() PyOpenColorIO.CDLStyle ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- static getFormats() PyOpenColorIO.FileTransform.FormatIterator ¶
- getInterpolation() PyOpenColorIO.Interpolation ¶
The file parsers that care about interpolation (LUTs) will try to make use of the requested interpolation method when loading the file. In these cases, if the requested method could not be used, a warning is logged. If no method is provided, or a method cannot be used, INTERP_DEFAULT is used.
- getSrc() str ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setCCCId(cccId: str) None ¶
- setCDLStyle(style: PyOpenColorIO.CDLStyle) None ¶
Can be used with CDL, CC & CCC formats to specify the clamping behavior of the CDLTransform. Default is CDL_NO_CLAMP.
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setInterpolation(interpolation: PyOpenColorIO.Interpolation) None ¶
- setSrc(src: str) None ¶
- validate() None ¶
Will throw if data is not valid.
-
class FileTransform : public Transform¶
Public Functions
-
virtual TransformRcPtr createEditableCopy() const override¶
-
virtual TransformDirection getDirection() const noexcept override¶
-
virtual void setDirection(TransformDirection dir) noexcept override¶
Note that this only affects the evaluation and not the values stored in the object.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual void validate() const override¶
Will throw if data is not valid.
-
const char *getSrc() const¶
-
void setSrc(const char *src)¶
-
const char *getCCCId() const¶
The cccid can be the ID of a CDL or the index of the CDL (as string). If cccid is NULL or empty the first CDL is returned. The cccid is case-sensitive.
-
void setCCCId(const char *id)¶
-
void setCDLStyle(CDLStyle)¶
Can be used with CDL, CC & CCC formats to specify the clamping behavior of the CDLTransform. Default is CDL_NO_CLAMP.
-
Interpolation getInterpolation() const¶
The file parsers that care about interpolation (LUTs) will try to make use of the requested interpolation method when loading the file. In these cases, if the requested method could not be used, a warning is logged. If no method is provided, or a method cannot be used, INTERP_DEFAULT is used.
-
void setInterpolation(Interpolation interp)¶
-
FileTransform &operator=(const FileTransform&) = delete¶
-
virtual ~FileTransform()¶
Do not use (needed only for pybind11).
Public Static Functions
-
static FileTransformRcPtr Create()¶
-
static int GetNumFormats()¶
Get the number of LUT readers.
-
static const char *GetFormatNameByIndex(int index)¶
Get the LUT readers at index, return empty string if an invalid index is specified.
-
static const char *GetFormatExtensionByIndex(int index)¶
Get the LUT reader extension at index, return empty string if an invalid index is specified.
-
virtual TransformRcPtr createEditableCopy() const override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const FileTransform&)¶
-
typedef std::shared_ptr<const FileTransform> OpenColorIO_v2_2::ConstFileTransformRcPtr¶
-
typedef std::shared_ptr<FileTransform> OpenColorIO_v2_2::FileTransformRcPtr¶
FixedFunctionTransform¶
- class PyOpenColorIO.FixedFunctionTransform¶
Provides a set of hard-coded algorithmic building blocks that are needed to accurately implement various common color transformations.
- FixedFunctionTransform(style: PyOpenColorIO.FixedFunctionStyle, params: List[float] = [], direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) None ¶
- equals(other: PyOpenColorIO.FixedFunctionTransform) bool ¶
Checks if this exactly equals other.
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getParams() List[float] ¶
- getStyle() PyOpenColorIO.FixedFunctionStyle ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setParams(params: List[float]) None ¶
Set the parameters (for functions that require them).
- setStyle(style: PyOpenColorIO.FixedFunctionStyle) None ¶
Select which algorithm to use.
- validate() None ¶
Will throw if data is not valid.
-
class FixedFunctionTransform : public Transform¶
Provides a set of hard-coded algorithmic building blocks that are needed to accurately implement various common color transformations.
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 FixedFunctionTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual FixedFunctionStyle getStyle() const = 0¶
-
virtual void setStyle(FixedFunctionStyle style) = 0¶
Select which algorithm to use.
-
virtual size_t getNumParams() const = 0¶
-
virtual void getParams(double *params) const = 0¶
-
virtual void setParams(const double *params, size_t num) = 0¶
Set the parameters (for functions that require them).
-
FixedFunctionTransform(const FixedFunctionTransform&) = delete¶
-
FixedFunctionTransform &operator=(const FixedFunctionTransform&) = delete¶
-
virtual ~FixedFunctionTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static FixedFunctionTransformRcPtr Create(FixedFunctionStyle style)¶
-
static FixedFunctionTransformRcPtr Create(FixedFunctionStyle style, const double *params, size_t num)¶
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const FixedFunctionTransform&)¶
-
typedef std::shared_ptr<const FixedFunctionTransform> OpenColorIO_v2_2::ConstFixedFunctionTransformRcPtr¶
-
typedef std::shared_ptr<FixedFunctionTransform> OpenColorIO_v2_2::FixedFunctionTransformRcPtr¶
GroupTransform¶
- class PyOpenColorIO.GroupTransform¶
- static GetWriteFormats() PyOpenColorIO.GroupTransform.WriteFormatIterator ¶
- GroupTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.GroupTransform) -> None
__init__(self: PyOpenColorIO.GroupTransform, transforms: List[PyOpenColorIO.Transform] = [], direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- appendTransform(transform: PyOpenColorIO.Transform) None ¶
Adds a transform to the end of the group.
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- prependTransform(transform: PyOpenColorIO.Transform) None ¶
Add a transform at the beginning of the group.
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- validate() None ¶
Will throw if data is not valid.
- write(*args, **kwargs)¶
Overloaded function.
write(self: PyOpenColorIO.GroupTransform, formatName: str, fileName: str, config: PyOpenColorIO.Config = None) -> None
Write the transforms comprising the group to the stream.
Writing (as opposed to Baking) is a lossless process. An exception is thrown if the processor cannot be losslessly written to the specified file format. Transforms such as FileTransform or ColorSpaceTransform are resolved into write-able simple transforms using the config and context. Supported formats include CTF, CLF, and CDL. All available formats can be listed with the following: .. code-block:: cpp
// What are the allowed writing output formats? std::ostringstream formats; formats << “Formats to write to: “; for (int i = 0; i < :ref:`GroupTransform::GetNumWriteFormats`(); ++i) {
if (i != 0) formats << “, “; formats << :ref:`GroupTransform::GetFormatNameByIndex`(i); formats << ” (.” << GroupTransform::GetFormatExtensionByIndex(i) << “)”;
}
write(self: PyOpenColorIO.GroupTransform, formatName: str, config: PyOpenColorIO.Config = None) -> str
Write the transforms comprising the group to the stream.
Writing (as opposed to Baking) is a lossless process. An exception is thrown if the processor cannot be losslessly written to the specified file format. Transforms such as FileTransform or ColorSpaceTransform are resolved into write-able simple transforms using the config and context. Supported formats include CTF, CLF, and CDL. All available formats can be listed with the following: .. code-block:: cpp
// What are the allowed writing output formats? std::ostringstream formats; formats << “Formats to write to: “; for (int i = 0; i < :ref:`GroupTransform::GetNumWriteFormats`(); ++i) {
if (i != 0) formats << “, “; formats << :ref:`GroupTransform::GetFormatNameByIndex`(i); formats << ” (.” << GroupTransform::GetFormatExtensionByIndex(i) << “)”;
}
- class PyOpenColorIO.GroupTransform.WriteFormatIterator¶
- self[arg0: int] tuple ¶
- len(self) int ¶
- next(self) tuple ¶
- class PyOpenColorIO.GroupTransform.TransformIterator¶
- self[arg0: int] PyOpenColorIO.Transform ¶
- iter(self) PyOpenColorIO.GroupTransform.TransformIterator ¶
- len(self) int ¶
- next(self) PyOpenColorIO.Transform ¶
-
class GroupTransform : public Transform¶
Public Functions
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
virtual FormatMetadata &getFormatMetadata() noexcept = 0¶
-
virtual ConstTransformRcPtr getTransform(int index) const = 0¶
Throws if index is not allowed.
-
virtual TransformRcPtr &getTransform(int index) = 0¶
Throws if index is not allowed.
-
virtual int getNumTransforms() const noexcept = 0¶
Return number of transforms.
-
virtual void appendTransform(TransformRcPtr transform) noexcept = 0¶
Adds a transform to the end of the group.
-
virtual void prependTransform(TransformRcPtr transform) noexcept = 0¶
Add a transform at the beginning of the group.
-
virtual void write(const ConstConfigRcPtr &config, const char *formatName, std::ostream &os) const = 0¶
Write the transforms comprising the group to the stream.
Writing (as opposed to Baking) is a lossless process. An exception is thrown if the processor cannot be losslessly written to the specified file format. Transforms such as FileTransform or ColorSpaceTransform are resolved into write-able simple transforms using the config and context. Supported formats include CTF, CLF, and CDL. All available formats can be listed with the following:
// What are the allowed writing output formats? std::ostringstream formats; formats << "Formats to write to: "; for (int i = 0; i < GroupTransform::GetNumWriteFormats(); ++i) { if (i != 0) formats << ", "; formats << GroupTransform::GetFormatNameByIndex(i); formats << " (." << GroupTransform::GetFormatExtensionByIndex(i) << ")"; }
-
GroupTransform(const GroupTransform&) = delete¶
-
GroupTransform &operator=(const GroupTransform&) = delete¶
-
virtual ~GroupTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static GroupTransformRcPtr Create()¶
-
static int GetNumWriteFormats() noexcept¶
Get the number of writers.
-
static const char *GetFormatNameByIndex(int index) noexcept¶
Get the writer at index, return empty string if an invalid index is specified.
-
static const char *GetFormatExtensionByIndex(int index) noexcept¶
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const GroupTransform&)¶
-
typedef std::shared_ptr<const GroupTransform> OpenColorIO_v2_2::ConstGroupTransformRcPtr¶
-
typedef std::shared_ptr<GroupTransform> OpenColorIO_v2_2::GroupTransformRcPtr¶
LogAffineTransform¶
- class PyOpenColorIO.LogAffineTransform¶
Applies a logarithm with an affine transform before and after. Represents the Cineon lin-to-log type transforms:
logSideSlope * log( linSideSlope * color + linSideOffset, base) + logSideOffset
Default values are: 1. * log( 1. * color + 0., 2.) + 0.
The alpha channel is not affected.
- LogAffineTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.LogAffineTransform) -> None
__init__(self: PyOpenColorIO.LogAffineTransform, logSideSlope: List[float[3]] = [1.0, 1.0, 1.0], logSideOffset: List[float[3]] = [0.0, 0.0, 0.0], linSideSlope: List[float[3]] = [1.0, 1.0, 1.0], linSideOffset: List[float[3]] = [0.0, 0.0, 0.0], direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- equals(other: PyOpenColorIO.LogAffineTransform) bool ¶
Checks if this exactly equals other.
- getBase() float ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getLinSideOffsetValue() List[float[3]] ¶
- getLinSideSlopeValue() List[float[3]] ¶
- getLogSideOffsetValue() List[float[3]] ¶
- getLogSideSlopeValue() List[float[3]] ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setBase(base: float) None ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setLinSideOffsetValue(values: List[float[3]]) None ¶
- setLinSideSlopeValue(values: List[float[3]]) None ¶
- setLogSideOffsetValue(values: List[float[3]]) None ¶
- setLogSideSlopeValue(values: List[float[3]]) None ¶
- validate() None ¶
Will throw if data is not valid.
-
class LogAffineTransform : public Transform¶
Applies a logarithm with an affine transform before and after. Represents the Cineon lin-to-log type transforms::
logSideSlope * log( linSideSlope * color + linSideOffset, base) + logSideOffset
Default values are: 1. * log( 1. * color + 0., 2.) + 0.
The alpha channel is not affected.
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 LogAffineTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual double getBase() const noexcept = 0¶
-
virtual void setBase(double base) noexcept = 0¶
-
virtual void getLogSideSlopeValue(double (&values)[3]) const noexcept = 0¶
-
virtual void setLogSideSlopeValue(const double (&values)[3]) noexcept = 0¶
-
virtual void getLogSideOffsetValue(double (&values)[3]) const noexcept = 0¶
-
virtual void setLogSideOffsetValue(const double (&values)[3]) noexcept = 0¶
-
virtual void getLinSideSlopeValue(double (&values)[3]) const noexcept = 0¶
-
virtual void setLinSideSlopeValue(const double (&values)[3]) noexcept = 0¶
-
virtual void getLinSideOffsetValue(double (&values)[3]) const noexcept = 0¶
-
virtual void setLinSideOffsetValue(const double (&values)[3]) noexcept = 0¶
-
LogAffineTransform(const LogAffineTransform&) = delete¶
-
LogAffineTransform &operator=(const LogAffineTransform&) = delete¶
-
virtual ~LogAffineTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static LogAffineTransformRcPtr Create()¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const LogAffineTransform&)¶
-
typedef std::shared_ptr<const LogAffineTransform> OpenColorIO_v2_2::ConstLogAffineTransformRcPtr¶
-
typedef std::shared_ptr<LogAffineTransform> OpenColorIO_v2_2::LogAffineTransformRcPtr¶
LogCameraTransform¶
- class PyOpenColorIO.LogCameraTransform¶
Same as LogAffineTransform but with the addition of a linear segment near black. This formula is used for many camera logs (e.g., LogC) as well as ACEScct.
The linSideBreak specifies the point on the linear axis where the log and linear segments meet. It must be set (there is no default).
The linearSlope specifies the slope of the linear segment of the forward (linToLog) transform. By default it is set equal to the slope of the log curve at the break point.
- LogCameraTransform() None ¶
LinSideBreak must be set for the transform to be valid (there is no default).
- equals(other: PyOpenColorIO.LogCameraTransform) bool ¶
Checks if this exactly equals other.
- getBase() float ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getLinSideBreakValue() List[float[3]] ¶
- getLinSideOffsetValue() List[float[3]] ¶
- getLinSideSlopeValue() List[float[3]] ¶
- getLinearSlopeValue() List[float[3]] ¶
Return LinearSlope or 3 qnan values if not defined.
- getLogSideOffsetValue() List[float[3]] ¶
- getLogSideSlopeValue() List[float[3]] ¶
Get/Set values for the R, G, B components.
- getTransformType() PyOpenColorIO.TransformType ¶
- isLinearSlopeValueSet() bool ¶
- setBase(base: float) None ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setLinSideBreakValue(values: List[float[3]]) None ¶
- setLinSideOffsetValue(values: List[float[3]]) None ¶
- setLinSideSlopeValue(values: List[float[3]]) None ¶
- setLinearSlopeValue(values: List[float[3]]) None ¶
Set LinearSlope value.
Note
You must call setLinSideBreakValue before calling this.
- setLogSideOffsetValue(values: List[float[3]]) None ¶
- setLogSideSlopeValue(values: List[float[3]]) None ¶
- unsetLinearSlopeValue() None ¶
Remove LinearSlope values so that default values are used.
- validate() None ¶
Will throw if data is not valid.
-
class LogCameraTransform : public Transform¶
Same as LogAffineTransform but with the addition of a linear segment near black. This formula is used for many camera logs (e.g., LogC) as well as ACEScct.
The linSideBreak specifies the point on the linear axis where the log and linear segments meet. It must be set (there is no default).
The linearSlope specifies the slope of the linear segment of the forward (linToLog) transform. By default it is set equal to the slope of the log curve at the break point.
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 LogCameraTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual double getBase() const noexcept = 0¶
-
virtual void setBase(double base) noexcept = 0¶
-
virtual void getLogSideSlopeValue(double (&values)[3]) const noexcept = 0¶
Get/Set values for the R, G, B components.
-
virtual void setLogSideSlopeValue(const double (&values)[3]) noexcept = 0¶
-
virtual void getLogSideOffsetValue(double (&values)[3]) const noexcept = 0¶
-
virtual void setLogSideOffsetValue(const double (&values)[3]) noexcept = 0¶
-
virtual void getLinSideSlopeValue(double (&values)[3]) const noexcept = 0¶
-
virtual void setLinSideSlopeValue(const double (&values)[3]) noexcept = 0¶
-
virtual void getLinSideOffsetValue(double (&values)[3]) const noexcept = 0¶
-
virtual void setLinSideOffsetValue(const double (&values)[3]) noexcept = 0¶
-
virtual void getLinSideBreakValue(double (&values)[3]) const noexcept = 0¶
-
virtual void setLinSideBreakValue(const double (&values)[3]) noexcept = 0¶
-
virtual bool getLinearSlopeValue(double (&values)[3]) const = 0¶
Return true if LinearSlope values were set, false if they were not.
-
virtual void setLinearSlopeValue(const double (&values)[3]) = 0¶
Set LinearSlope value.
Note
You must call setLinSideBreakValue before calling this.
-
virtual void unsetLinearSlopeValue() = 0¶
Remove LinearSlope values so that default values are used.
-
LogCameraTransform(const LogCameraTransform&) = delete¶
-
LogCameraTransform &operator=(const LogCameraTransform&) = delete¶
-
virtual ~LogCameraTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static LogCameraTransformRcPtr Create(const double (&linSideBreakValues)[3])¶
LinSideBreak must be set for the transform to be valid (there is no default).
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const LogCameraTransform&)¶
-
typedef std::shared_ptr<const LogCameraTransform> OpenColorIO_v2_2::ConstLogCameraTransformRcPtr¶
-
typedef std::shared_ptr<LogCameraTransform> OpenColorIO_v2_2::LogCameraTransformRcPtr¶
LogTransform¶
- class PyOpenColorIO.LogTransform¶
Represents log transform: log(color, base)
The input will be clamped for negative numbers.
Default base is 2.0.
The alpha channel is not affected.
- LogTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.LogTransform) -> None
__init__(self: PyOpenColorIO.LogTransform, base: float = 2.0, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- equals(other: PyOpenColorIO.LogTransform) bool ¶
Checks if this exactly equals other.
- getBase() float ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setBase(base: float) None ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- validate() None ¶
Will throw if data is not valid.
-
class LogTransform : public Transform¶
Represents log transform: log(color, base)
The input will be clamped for negative numbers.
Default base is 2.0.
The alpha channel is not affected.
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 LogTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual double getBase() const noexcept = 0¶
-
virtual void setBase(double val) noexcept = 0¶
-
LogTransform(const LogTransform&) = delete¶
-
LogTransform &operator=(const LogTransform&) = delete¶
-
virtual ~LogTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static LogTransformRcPtr Create()¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const LogTransform&)¶
-
typedef std::shared_ptr<const LogTransform> OpenColorIO_v2_2::ConstLogTransformRcPtr¶
-
typedef std::shared_ptr<LogTransform> OpenColorIO_v2_2::LogTransformRcPtr¶
LookTransform¶
- class PyOpenColorIO.LookTransform¶
- LookTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.LookTransform) -> None
__init__(self: PyOpenColorIO.LookTransform, src: str, dst: str, looks: str = ‘’, skipColorSpaceConversion: bool = False, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- getDirection() PyOpenColorIO.TransformDirection ¶
- getDst() str ¶
- getLooks() str ¶
- getSkipColorSpaceConversion() bool ¶
- getSrc() str ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setDst(dst: str) None ¶
- setLooks(looks: str) None ¶
Specify looks to apply. Looks is a potentially comma (or colon) delimited list of look names, Where +/- prefixes are optionally allowed to denote forward/inverse look specification. (And forward is assumed in the absence of either)
- setSkipColorSpaceConversion(skipColorSpaceConversion: bool) None ¶
- setSrc(src: str) None ¶
- validate() None ¶
Will throw if data is not valid.
-
class LookTransform : public Transform¶
Public Functions
-
virtual TransformRcPtr createEditableCopy() const override¶
-
virtual TransformDirection getDirection() const noexcept override¶
-
virtual void setDirection(TransformDirection dir) noexcept override¶
Note that this only affects the evaluation and not the values stored in the object.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual void validate() const override¶
Will throw if data is not valid.
-
const char *getSrc() const¶
-
void setSrc(const char *src)¶
-
const char *getDst() const¶
-
void setDst(const char *dst)¶
-
const char *getLooks() const¶
-
void setLooks(const char *looks)¶
Specify looks to apply. Looks is a potentially comma (or colon) delimited list of look names, Where +/- prefixes are optionally allowed to denote forward/inverse look specification. (And forward is assumed in the absence of either)
-
bool getSkipColorSpaceConversion() const¶
-
void setSkipColorSpaceConversion(bool skip)¶
-
LookTransform &operator=(const LookTransform&) = delete¶
-
virtual ~LookTransform()¶
Do not use (needed only for pybind11).
Public Static Functions
-
static LookTransformRcPtr Create()¶
-
static const char *GetLooksResultColorSpace(const ConstConfigRcPtr &config, const ConstContextRcPtr &context, const char *looks)¶
Return the name of the color space after applying looks in the forward direction but without converting to the destination color space. This is equivalent to the process space of the last look in the look sequence (and takes into account that a look fall-back may be used).
-
virtual TransformRcPtr createEditableCopy() const override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const LookTransform&)¶
-
typedef std::shared_ptr<const LookTransform> OpenColorIO_v2_2::ConstLookTransformRcPtr¶
-
typedef std::shared_ptr<LookTransform> OpenColorIO_v2_2::LookTransformRcPtr¶
Lut1DTransform¶
- class PyOpenColorIO.Lut1DTransform¶
Represents a 1D-LUT transform.
- Lut1DTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.Lut1DTransform) -> None
Create an identity 1D-LUT of length two.
__init__(self: PyOpenColorIO.Lut1DTransform, length: int, inputHalfDomain: bool) -> None
Create an identity 1D-LUT with specific length and half-domain setting. Will throw for lengths longer than 1024x1024.
__init__(self: PyOpenColorIO.Lut1DTransform, length: int = 2, inputHalfDomain: bool = False, outputRawHalfs: bool = False, fileOutputBitDepth: PyOpenColorIO.BitDepth = <BitDepth.BIT_DEPTH_UNKNOWN: 0>, hueAdjust: PyOpenColorIO.Lut1DHueAdjust = <Lut1DHueAdjust.HUE_NONE: 0>, interpolation: PyOpenColorIO.Interpolation = <Interpolation.INTERP_DEFAULT: 254>, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Create an identity 1D-LUT with specific length and half-domain setting. Will throw for lengths longer than 1024x1024.
- equals(other: PyOpenColorIO.Lut1DTransform) bool ¶
Checks if this exactly equals other.
- getData() numpy.ndarray ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFileOutputBitDepth() PyOpenColorIO.BitDepth ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getHueAdjust() PyOpenColorIO.Lut1DHueAdjust ¶
- getInputHalfDomain() bool ¶
- getInterpolation() PyOpenColorIO.Interpolation ¶
- getLength() int ¶
- getOutputRawHalfs() bool ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- getValue(index: int) tuple ¶
- setData(data: buffer) None ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setFileOutputBitDepth(bitDepth: PyOpenColorIO.BitDepth) None ¶
Get the bit-depth associated with the LUT values read from a file or set the bit-depth of values to be written to a file (for file formats such as CLF that support multiple bit-depths). However, note that the values stored in the object are always normalized.
- setHueAdjust(hueAdjust: PyOpenColorIO.Lut1DHueAdjust) None ¶
The 1D-LUT transform optionally supports a hue adjustment feature that was used in some versions of ACES. This adjusts the hue of the result to approximately match the input.
- setInputHalfDomain(isHalfDomain: bool) None ¶
In a half-domain LUT, the contents of the LUT specify the desired value of the function for each half-float value. Therefore, the length of the LUT must be 65536 entries or else validate() will throw.
- setInterpolation(interpolation: PyOpenColorIO.Interpolation) None ¶
- setLength(length: int) None ¶
Changing the length will reset the LUT to identity. Will throw for lengths longer than 1024x1024.
- setOutputRawHalfs(isRawHalfs: bool) None ¶
Set OutputRawHalfs to true if you want to output the LUT contents as 16-bit floating point values expressed as unsigned 16-bit integers representing the equivalent bit pattern. For example, the value 1.0 would be written as the integer 15360 because it has the same bit-pattern. Note that this implies the values will be quantized to a 16-bit float. Note that this setting only controls the output formatting (where supported) and not the values for getValue/setValue. The only file formats that currently support this are CLF and CTF.
- setValue(index: int, r: float, g: float, b: float) None ¶
Set the values of a LUT1D. Will throw if the index is outside of the range from 0 to (length-1).
The LUT values are always for the “forward” LUT, regardless of how the transform direction is set.
These values are normalized relative to what may be stored in any given LUT files. For example in a CLF file using a “10i” output depth, a value of 1023 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
LUTs in various file formats may only provide values for one channel where R, G, B are the same. Even in that case, you should provide three equal values to the setter.
- validate() None ¶
Will throw if data is not valid.
-
class Lut1DTransform : public Transform¶
Represents a 1D-LUT transform.
Public Functions
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual void setFileOutputBitDepth(BitDepth bitDepth) noexcept = 0¶
Get the bit-depth associated with the LUT values read from a file or set the bit-depth of values to be written to a file (for file formats such as CLF that support multiple bit-depths). However, note that the values stored in the object are always normalized.
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
virtual FormatMetadata &getFormatMetadata() noexcept = 0¶
-
virtual bool equals(const Lut1DTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual unsigned long getLength() const = 0¶
-
virtual void setLength(unsigned long length) = 0¶
Changing the length will reset the LUT to identity. Will throw for lengths longer than 1024x1024.
-
virtual void getValue(unsigned long index, float &r, float &g, float &b) const = 0¶
-
virtual void setValue(unsigned long index, float r, float g, float b) = 0¶
Set the values of a LUT1D. Will throw if the index is outside of the range from 0 to (length-1).
The LUT values are always for the “forward” LUT, regardless of how the transform direction is set.
These values are normalized relative to what may be stored in any given LUT files. For example in a CLF file using a “10i” output depth, a value of 1023 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
LUTs in various file formats may only provide values for one channel where R, G, B are the same. Even in that case, you should provide three equal values to the setter.
-
virtual bool getInputHalfDomain() const noexcept = 0¶
-
virtual void setInputHalfDomain(bool isHalfDomain) noexcept = 0¶
In a half-domain LUT, the contents of the LUT specify the desired value of the function for each half-float value. Therefore, the length of the LUT must be 65536 entries or else validate() will throw.
-
virtual bool getOutputRawHalfs() const noexcept = 0¶
-
virtual void setOutputRawHalfs(bool isRawHalfs) noexcept = 0¶
Set OutputRawHalfs to true if you want to output the LUT contents as 16-bit floating point values expressed as unsigned 16-bit integers representing the equivalent bit pattern. For example, the value 1.0 would be written as the integer 15360 because it has the same bit-pattern. Note that this implies the values will be quantized to a 16-bit float. Note that this setting only controls the output formatting (where supported) and not the values for getValue/setValue. The only file formats that currently support this are CLF and CTF.
-
virtual Lut1DHueAdjust getHueAdjust() const noexcept = 0¶
-
virtual void setHueAdjust(Lut1DHueAdjust algo) = 0¶
The 1D-LUT transform optionally supports a hue adjustment feature that was used in some versions of ACES. This adjusts the hue of the result to approximately match the input.
-
virtual Interpolation getInterpolation() const = 0¶
-
virtual void setInterpolation(Interpolation algo) = 0¶
-
Lut1DTransform(const Lut1DTransform&) = delete¶
-
Lut1DTransform &operator=(const Lut1DTransform&) = delete¶
-
virtual ~Lut1DTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static Lut1DTransformRcPtr Create()¶
Create an identity 1D-LUT of length two.
-
static Lut1DTransformRcPtr Create(unsigned long length, bool isHalfDomain)¶
Create an identity 1D-LUT with specific length and half-domain setting. Will throw for lengths longer than 1024x1024.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const Lut1DTransform&)¶
-
typedef std::shared_ptr<const Lut1DTransform> OpenColorIO_v2_2::ConstLut1DTransformRcPtr¶
-
typedef std::shared_ptr<Lut1DTransform> OpenColorIO_v2_2::Lut1DTransformRcPtr¶
Lut3DTransform¶
- class PyOpenColorIO.Lut3DTransform¶
Represents a 3D-LUT transform.
- Lut3DTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.Lut3DTransform) -> None
Create an identity 3D-LUT of size 2x2x2.
__init__(self: PyOpenColorIO.Lut3DTransform, gridSize: int) -> None
Create an identity 3D-LUT with specific grid size. Will throw for grid size larger than 129.
__init__(self: PyOpenColorIO.Lut3DTransform, gridSize: int = 2, fileOutputBitDepth: PyOpenColorIO.BitDepth = <BitDepth.BIT_DEPTH_UNKNOWN: 0>, interpolation: PyOpenColorIO.Interpolation = <Interpolation.INTERP_DEFAULT: 254>, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Create an identity 3D-LUT with specific grid size. Will throw for grid size larger than 129.
- equals(other: PyOpenColorIO.Lut3DTransform) bool ¶
Checks if this exactly equals other.
- getData() numpy.ndarray ¶
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFileOutputBitDepth() PyOpenColorIO.BitDepth ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getGridSize() int ¶
- getInterpolation() PyOpenColorIO.Interpolation ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- getValue(indexR: int, indexG: int, indexB: int) tuple ¶
- setData(data: buffer) None ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setFileOutputBitDepth(bitDepth: PyOpenColorIO.BitDepth) None ¶
Get the bit-depth associated with the LUT values read from a file or set the bit-depth of values to be written to a file (for file formats such as CLF that support multiple bit-depths). However, note that the values stored in the object are always normalized.
- setGridSize(gridSize: int) None ¶
Changing the grid size will reset the LUT to identity. Will throw for grid sizes larger than 129.
- setInterpolation(interpolation: PyOpenColorIO.Interpolation) None ¶
- setValue(indexR: int, indexG: int, indexB: int, r: float, g: float, b: float) None ¶
Set the values of a 3D-LUT. Will throw if an index is outside of the range from 0 to (gridSize-1).
The LUT values are always for the “forward” LUT, regardless of how the transform direction is set.
These values are normalized relative to what may be stored in any given LUT files. For example in a CLF file using a “10i” output depth, a value of 1023 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
- validate() None ¶
Will throw if data is not valid.
-
class Lut3DTransform : public Transform¶
Represents a 3D-LUT transform.
Public Functions
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual void setFileOutputBitDepth(BitDepth bitDepth) noexcept = 0¶
Get the bit-depth associated with the LUT values read from a file or set the bit-depth of values to be written to a file (for file formats such as CLF that support multiple bit-depths). However, note that the values stored in the object are always normalized.
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
virtual FormatMetadata &getFormatMetadata() noexcept = 0¶
-
virtual bool equals(const Lut3DTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual unsigned long getGridSize() const = 0¶
-
virtual void setGridSize(unsigned long gridSize) = 0¶
Changing the grid size will reset the LUT to identity. Will throw for grid sizes larger than 129.
-
virtual void getValue(unsigned long indexR, unsigned long indexG, unsigned long indexB, float &r, float &g, float &b) const = 0¶
-
virtual void setValue(unsigned long indexR, unsigned long indexG, unsigned long indexB, float r, float g, float b) = 0¶
Set the values of a 3D-LUT. Will throw if an index is outside of the range from 0 to (gridSize-1).
The LUT values are always for the “forward” LUT, regardless of how the transform direction is set.
These values are normalized relative to what may be stored in any given LUT files. For example in a CLF file using a “10i” output depth, a value of 1023 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
-
virtual Interpolation getInterpolation() const = 0¶
-
virtual void setInterpolation(Interpolation algo) = 0¶
-
Lut3DTransform(const Lut3DTransform&) = delete¶
-
Lut3DTransform &operator=(const Lut3DTransform&) = delete¶
-
virtual ~Lut3DTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static Lut3DTransformRcPtr Create()¶
Create an identity 3D-LUT of size 2x2x2.
-
static Lut3DTransformRcPtr Create(unsigned long gridSize)¶
Create an identity 3D-LUT with specific grid size. Will throw for grid size larger than 129.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const Lut3DTransform&)¶
-
typedef std::shared_ptr<const Lut3DTransform> OpenColorIO_v2_2::ConstLut3DTransformRcPtr¶
-
typedef std::shared_ptr<Lut3DTransform> OpenColorIO_v2_2::Lut3DTransformRcPtr¶
MatrixTransform¶
- class PyOpenColorIO.MatrixTransform¶
Represents an MX+B Matrix transform.
Note
For singular matrices, an inverse direction will throw an exception during finalization.
- static Fit(oldMin: List[float[4]] = [0.0, 0.0, 0.0, 0.0], oldMax: List[float[4]] = [1.0, 1.0, 1.0, 1.0], newMin: List[float[4]] = [0.0, 0.0, 0.0, 0.0], newMax: List[float[4]] = [1.0, 1.0, 1.0, 1.0]) PyOpenColorIO.MatrixTransform ¶
Convenience functions
Build the matrix and offset corresponding to higher-level concepts.
Note
These can throw an exception if for any component oldmin == oldmax. (divide by 0)
- static Identity() PyOpenColorIO.MatrixTransform ¶
- static Sat(sat: float, lumaCoef: List[float[3]]) PyOpenColorIO.MatrixTransform ¶
- static Scale(scale: List[float[4]]) PyOpenColorIO.MatrixTransform ¶
- static View(channelHot: List[int[4]], lumaCoef: List[float[3]]) PyOpenColorIO.MatrixTransform ¶
- MatrixTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.MatrixTransform) -> None
__init__(self: PyOpenColorIO.MatrixTransform, matrix: List[float[16]] = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0], offset: List[float[4]] = [0.0, 0.0, 0.0, 0.0], direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
- equals(other: PyOpenColorIO.MatrixTransform) bool ¶
Checks if this exactly equals other.
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFileInputBitDepth() PyOpenColorIO.BitDepth ¶
Get the bit-depths associated with the matrix values read from a file or set the bit-depths of values to be written to a file (for file formats such as CLF that support multiple bit-depths).
In a format such as CLF, the matrix values are scaled to take pixels at the specified inBitDepth to pixels at the specified outBitDepth. This complicates the interpretation of the matrix values and so this object always holds normalized values and scaling is done on the way from or to file formats such as CLF.
- getFileOutputBitDepth() PyOpenColorIO.BitDepth ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getMatrix() List[float[16]] ¶
- getOffset() List[float[4]] ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setFileInputBitDepth(bitDepth: PyOpenColorIO.BitDepth) None ¶
- setFileOutputBitDepth(bitDepth: PyOpenColorIO.BitDepth) None ¶
- setMatrix(matrix: List[float[16]]) None ¶
Get or set the values of a Matrix. Expects 16 values, where the first four are the coefficients to generate the R output channel from R, G, B, A input channels.
The Matrix values are always for the “forward” Matrix, regardless of how the transform direction is set.
These values are normalized relative to what may be stored in file formats such as CLF. For example in a CLF file using a “32f” input depth and “10i” output depth, a value of 1023 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
- setOffset(offset: List[float[4]]) None ¶
Get or set the R, G, B, A offsets to be applied after the matrix.
These values are normalized relative to what may be stored in file formats such as CLF. For example, in a CLF file using a “10i” output depth, a value of 1023 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
- validate() None ¶
Will throw if data is not valid.
-
class MatrixTransform : public Transform¶
Represents an MX+B Matrix transform.
Note
For singular matrices, an inverse direction will throw an exception during finalization.
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 MatrixTransform &other) const noexcept = 0¶
Checks if this exactly equals other.
-
virtual void getMatrix(double *m44) const = 0¶
-
virtual void setMatrix(const double *m44) = 0¶
Get or set the values of a Matrix. Expects 16 values, where the first four are the coefficients to generate the R output channel from R, G, B, A input channels.
The Matrix values are always for the “forward” Matrix, regardless of how the transform direction is set.
These values are normalized relative to what may be stored in file formats such as CLF. For example in a CLF file using a “32f” input depth and “10i” output depth, a value of 1023 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
-
virtual void getOffset(double *offset4) const = 0¶
-
virtual void setOffset(const double *offset4) = 0¶
Get or set the R, G, B, A offsets to be applied after the matrix.
These values are normalized relative to what may be stored in file formats such as CLF. For example, in a CLF file using a “10i” output depth, a value of 1023 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
-
virtual BitDepth getFileInputBitDepth() const noexcept = 0¶
Get the bit-depths associated with the matrix values read from a file or set the bit-depths of values to be written to a file (for file formats such as CLF that support multiple bit-depths).
In a format such as CLF, the matrix values are scaled to take pixels at the specified inBitDepth to pixels at the specified outBitDepth. This complicates the interpretation of the matrix values and so this object always holds normalized values and scaling is done on the way from or to file formats such as CLF.
-
MatrixTransform(const MatrixTransform&) = delete¶
-
MatrixTransform &operator=(const MatrixTransform&) = delete¶
-
virtual ~MatrixTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static MatrixTransformRcPtr Create()¶
-
static void Fit(double *m44, double *offset4, const double *oldmin4, const double *oldmax4, const double *newmin4, const double *newmax4)¶
Convenience functions
Build the matrix and offset corresponding to higher-level concepts.
Note
These can throw an exception if for any component
oldmin == oldmax. (divide by 0)
-
static void Identity(double *m44, double *offset4)¶
-
static void Sat(double *m44, double *offset4, double sat, const double *lumaCoef3)¶
-
static void Scale(double *m44, double *offset4, const double *scale4)¶
-
static void View(double *m44, double *offset4, int *channelHot4, const double *lumaCoef3)¶
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const MatrixTransform&) noexcept¶
-
typedef std::shared_ptr<const MatrixTransform> OpenColorIO_v2_2::ConstMatrixTransformRcPtr¶
-
typedef std::shared_ptr<MatrixTransform> OpenColorIO_v2_2::MatrixTransformRcPtr¶
RangeTransform¶
- class PyOpenColorIO.RangeTransform¶
Represents a range transform
The Range is used to apply an affine transform (scale & offset) and clamps values to min/max bounds on all color components except the alpha. The scale and offset values are computed from the input and output bounds.
Refer to section 7.2.4 in specification S-2014-006 “A Common File Format for Look-Up Tables” from the Academy of Motion Picture Arts and Sciences and the American Society of Cinematographers.
Note
The “noClamp” style described in the specification S-2014-006 becomes a MatrixOp at the processor level.
Note
Changing the transform direction does not modify the in/out values – they are always specified with respect to the “forward” direction.
- RangeTransform(*args, **kwargs)¶
Overloaded function.
__init__(self: PyOpenColorIO.RangeTransform) -> None
Creates an instance of RangeTransform.
__init__(self: PyOpenColorIO.RangeTransform, minInValue: float = nan, maxInValue: float = nan, minOutValue: float = nan, maxOutValue: float = nan, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) -> None
Creates an instance of RangeTransform.
- equals(other: PyOpenColorIO.RangeTransform) bool ¶
Checks if this equals other.
- getDirection() PyOpenColorIO.TransformDirection ¶
- getFileInputBitDepth() PyOpenColorIO.BitDepth ¶
File bit-depth
In a format such as CLF, the range values are scaled to take pixels at the specified inBitDepth to pixels at the specified outBitDepth. This complicates the interpretation of the range values and so this object always holds normalized values and scaling is done on the way from or to file formats such as CLF. Get the bit-depths associated with the range values read from a file or set the bit-depths of values to be written to a file (for file formats such as CLF that support multiple bit-depths).
- getFileOutputBitDepth() PyOpenColorIO.BitDepth ¶
- getFormatMetadata() PyOpenColorIO.FormatMetadata ¶
- getMaxInValue() float ¶
Get the maximum value for the input.
- getMaxOutValue() float ¶
Get the maximum value for the output.
- getMinInValue() float ¶
Get the minimum value for the input.
Range values
These values are normalized relative to what may be stored in file formats such as CLF. For example in a CLF file using a “10i” input depth, a MaxInValue of 1023 in the file is normalized to 1.0. Likewise, for an output depth of “12i”, a MaxOutValue of 4095 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
- getMinOutValue() float ¶
Get the minimum value for the output.
- getStyle() PyOpenColorIO.RangeStyle ¶
- getTransformType() PyOpenColorIO.TransformType ¶
- hasMaxInValue() bool ¶
Is the maximum value for the input set?
- hasMaxOutValue() bool ¶
Is the maximum value for the output set?
- hasMinInValue() bool ¶
Is the minimum value for the input set?
- hasMinOutValue() bool ¶
Is the minimum value for the output set?
- setDirection(direction: PyOpenColorIO.TransformDirection) None ¶
Note that this only affects the evaluation and not the values stored in the object.
- setFileInputBitDepth(bitDepth: PyOpenColorIO.BitDepth) None ¶
- setFileOutputBitDepth(bitDepth: PyOpenColorIO.BitDepth) None ¶
- setMaxInValue(value: float) None ¶
Set the maximum value for the input.
- setMaxOutValue(value: float) None ¶
Set the maximum value for the output.
- setMinInValue(value: float) None ¶
Set the minimum value for the input.
- setMinOutValue(value: float) None ¶
Set the minimum value for the output.
- setStyle(style: PyOpenColorIO.RangeStyle) None ¶
Set the Range style to clamp or not input values.
- unsetMaxInValue() None ¶
Unset the maximum value for the input.
- unsetMaxOutValue() None ¶
Unset the maximum value for the output.
- unsetMinInValue() None ¶
Unset the minimum value for the input.
- unsetMinOutValue() None ¶
Unset the minimum value for the output.
- validate() None ¶
Will throw if data is not valid.
-
class RangeTransform : public Transform¶
Represents a range transform
The Range is used to apply an affine transform (scale & offset) and clamps values to min/max bounds on all color components except the alpha. The scale and offset values are computed from the input and output bounds.
Refer to section 7.2.4 in specification S-2014-006 “A Common File Format
for Look-Up Tables” from the Academy of Motion Picture Arts and Sciences and the American Society of Cinematographers.
Note
The “noClamp” style described in the specification S-2014-006 becomes a MatrixOp at the processor level.
Note
Changing the transform direction does not modify the in/out values — they are always specified with respect to the “forward” direction.
Public Functions
-
inline virtual TransformType getTransformType() const noexcept override¶
-
virtual RangeStyle getStyle() const noexcept = 0¶
-
virtual void setStyle(RangeStyle style) noexcept = 0¶
Set the Range style to clamp or not input values.
-
virtual const FormatMetadata &getFormatMetadata() const noexcept = 0¶
-
virtual FormatMetadata &getFormatMetadata() noexcept = 0¶
-
virtual bool equals(const RangeTransform &other) const noexcept = 0¶
Checks if this equals other.
-
virtual BitDepth getFileInputBitDepth() const noexcept = 0¶
File bit-depth
In a format such as CLF, the range values are scaled to take pixels at the specified inBitDepth to pixels at the specified outBitDepth. This complicates the interpretation of the range values and so this object always holds normalized values and scaling is done on the way from or to file formats such as CLF.Get the bit-depths associated with the range values read from a file or set the bit-depths of values to be written to a file (for file formats such as CLF that support multiple bit-depths).
-
virtual double getMinInValue() const noexcept = 0¶
Get the minimum value for the input.
Range values
These values are normalized relative to what may be stored in file formats such as CLF. For example in a CLF file using a “10i” input depth, a MaxInValue of 1023 in the file is normalized to 1.0. Likewise, for an output depth of “12i”, a MaxOutValue of 4095 in the file is normalized to 1.0. The values here are unclamped and may extend outside [0,1].
-
virtual void setMinInValue(double val) noexcept = 0¶
Set the minimum value for the input.
-
virtual bool hasMinInValue() const noexcept = 0¶
Is the minimum value for the input set?
-
virtual void unsetMinInValue() noexcept = 0¶
Unset the minimum value for the input.
-
virtual void setMaxInValue(double val) noexcept = 0¶
Set the maximum value for the input.
-
virtual double getMaxInValue() const noexcept = 0¶
Get the maximum value for the input.
-
virtual bool hasMaxInValue() const noexcept = 0¶
Is the maximum value for the input set?
-
virtual void unsetMaxInValue() noexcept = 0¶
Unset the maximum value for the input.
-
virtual void setMinOutValue(double val) noexcept = 0¶
Set the minimum value for the output.
-
virtual double getMinOutValue() const noexcept = 0¶
Get the minimum value for the output.
-
virtual bool hasMinOutValue() const noexcept = 0¶
Is the minimum value for the output set?
-
virtual void unsetMinOutValue() noexcept = 0¶
Unset the minimum value for the output.
-
virtual void setMaxOutValue(double val) noexcept = 0¶
Set the maximum value for the output.
-
virtual double getMaxOutValue() const noexcept = 0¶
Get the maximum value for the output.
-
virtual bool hasMaxOutValue() const noexcept = 0¶
Is the maximum value for the output set?
-
virtual void unsetMaxOutValue() noexcept = 0¶
Unset the maximum value for the output.
-
RangeTransform(const RangeTransform&) = delete¶
-
RangeTransform &operator=(const RangeTransform&) = delete¶
-
virtual ~RangeTransform() = default¶
Do not use (needed only for pybind11).
Public Static Functions
-
static RangeTransformRcPtr Create()¶
Creates an instance of RangeTransform.
-
inline virtual TransformType getTransformType() const noexcept override¶
-
std::ostream &OpenColorIO_v2_2::operator<<(std::ostream&, const RangeTransform&) noexcept¶
-
typedef std::shared_ptr<const RangeTransform> OpenColorIO_v2_2::ConstRangeTransformRcPtr¶
-
typedef std::shared_ptr<RangeTransform> OpenColorIO_v2_2::RangeTransformRcPtr¶