Applications Helpers¶
DisplayViewHelpers¶
-
PyOpenColorIO.DisplayViewHelpers.
GetProcessor
(config: PyOpenColorIO.Config, context: PyOpenColorIO.Context = None, workingSpaceName: str, displayName: str, viewName: str, channelView: PyOpenColorIO.MatrixTransform = None, direction: PyOpenColorIO.TransformDirection = <TransformDirection.TRANSFORM_DIR_FORWARD: 0>) → PyOpenColorIO.Processor¶ Get the processor from the working color space to (display, view) pair (forward) or (display, view) pair to working (inverse). The working color space name could be a role name or a color space name. ChannelView can be empty. If not already present, each of these functions adds ExposureContrastTransforms to enable changing exposure, contrast, and gamma after the processor has been created using dynamic properties.
-
PyOpenColorIO.DisplayViewHelpers.
GetIdentityProcessor
(config: PyOpenColorIO.Config) → PyOpenColorIO.Processor¶ Get an identity processor containing only the ExposureContrastTransforms.
-
PyOpenColorIO.DisplayViewHelpers.
AddDisplayView
(config: PyOpenColorIO.Config, displayName: str, viewName: str, lookName: str = '', colorSpaceName: str = '', colorSpaceFamily: str = '', colorSpaceDescription: str = '', colorSpaceCategories: str = '', transformFilePath: str, connectionColorSpaceName: str) → None¶ Add a new (display, view) pair and the new color space to a configuration instance. The input to the userTransform must be in the specified connectionColorSpace.
-
PyOpenColorIO.DisplayViewHelpers.
RemoveDisplayView
(config: PyOpenColorIO.Config, displayName: str, viewName: str) → None¶ Remove a (display, view) pair including the associated color space (only if not used). Note that the view is always removed but the display is only removed if empty.
-
namespace
OpenColorIO_v2_0
::
DisplayViewHelpers
¶ Functions
-
ConstProcessorRcPtr
GetProcessor
(const ConstConfigRcPtr &config, const ConstContextRcPtr &context, const char *workingName, const char *displayName, const char *viewName, const ConstMatrixTransformRcPtr &channelView, TransformDirection direction)¶ Get the processor from the working color space to (display, view) pair (forward) or (display, view) pair to working (inverse). The working color space name could be a role name or a color space name. ChannelView can be empty. If not already present, each of these functions adds ExposureContrastTransforms to enable changing exposure, contrast, and gamma after the processor has been created using dynamic properties.
-
ConstProcessorRcPtr
GetProcessor
(const ConstConfigRcPtr &config, const char *workingName, const char *displayName, const char *viewName, const ConstMatrixTransformRcPtr &channelView, TransformDirection direction)¶
-
ConstProcessorRcPtr
GetIdentityProcessor
(const ConstConfigRcPtr &config)¶ Get an identity processor containing only the ExposureContrastTransforms.
-
void
AddDisplayView
(ConfigRcPtr &config, const char *displayName, const char *viewName, const char *lookDefinition, const char *colorSpaceName, const char *colorSpaceFamily, const char *colorSpaceDescription, const char *categories, const char *transformFilePath, const char *connectionColorSpaceName)¶ Add a new (display, view) pair and the new color space to a configuration instance. The input to the userTransform must be in the specified connectionColorSpace.
-
void
RemoveDisplayView
(ConfigRcPtr &config, const char *displayName, const char *viewName)¶ Remove a (display, view) pair including the associated color space (only if not used). Note that the view is always removed but the display is only removed if empty.
-
ConstProcessorRcPtr
LegacyViewingPipeline¶
-
class
PyOpenColorIO.
LegacyViewingPipeline
¶ Whereas the DisplayViewTransform simply applies a specific view from an OCIO display, the LegacyViewingPipeline provides an example of a complete viewing pipeline of the sort that could be used to implement a viewport in a typical application. It therefore adds, around the DisplayViewTransform, various optional color correction steps and RGBA channel view swizzling. The direction of the DisplayViewTranform is used as the direction of the pipeline. Note: The LegacyViewingPipeline class provides the same functionality as the OCIO v1 DisplayTransform.
Legacy viewing pipeline: - Start in display transform input color space. - If linearCC is provided: - Go to scene_linear colorspace. - Apply linearCC transform.
If colorTimingCC is provided:
Go to color_timing colorspace.
Apply colorTimingCC transform.
Apply looks (from display transform or from looks override).
Go to first look color space.
Apply first look transform.
Iterate for all looks.
Apply channelView transform.
Apply display transform (without looks).
Apply displayCC. Note that looks are applied even if the display transform involves data color spaces.
-
LegacyViewingPipeline
() → None¶
-
getChannelView
() → PyOpenColorIO.Transform¶
-
getColorTimingCC
() → PyOpenColorIO.Transform¶
-
getDisplayCC
() → PyOpenColorIO.Transform¶
-
getDisplayViewTransform
() → PyOpenColorIO.DisplayViewTransform¶
-
getLinearCC
() → PyOpenColorIO.Transform¶
-
getLooksOverride
() → str¶
-
getLooksOverrideEnabled
() → bool¶
-
getProcessor
(config: PyOpenColorIO.Config, context: PyOpenColorIO.Context = None) → PyOpenColorIO.Processor¶
-
setChannelView
(arg0: PyOpenColorIO.Transform) → None¶
-
setColorTimingCC
(arg0: PyOpenColorIO.Transform) → None¶
-
setDisplayCC
(arg0: PyOpenColorIO.Transform) → None¶
-
setDisplayViewTransform
(arg0: PyOpenColorIO.DisplayViewTransform) → None¶
-
setLinearCC
(arg0: PyOpenColorIO.Transform) → None¶
-
setLooksOverride
(looks: str) → None¶ A user can optionally override the looks that are, by default, used with the expected display / view combination. A common use case for this functionality is in an image viewing app, where per-shot looks are supported. If for some reason a per-shot look is not defined for the current Context, the Config::getProcessor fcn will not succeed by default. Thus, with this mechanism the viewing app could override to looks = “”, and this will allow image display to continue (though hopefully) the interface would reflect this fallback option.
Looks is a potentially comma (or colon) delimited list of lookNames, where +/- prefixes are optionally allowed to denote forward/inverse look specification (and forward is assumed in the absence of either).
-
setLooksOverrideEnabled
(arg0: bool) → None¶ Specify whether the lookOverride should be used, or not. This is a separate flag, as it’s often useful to override “looks” to an empty string.
-
class
OpenColorIO_v2_0
::
LegacyViewingPipeline
¶ Whereas the DisplayViewTransform simply applies a specific view from an OCIO display, the LegacyViewingPipeline provides an example of a complete viewing pipeline of the sort that could be used to implement a viewport in a typical application. It therefore adds, around the DisplayViewTransform, various optional color correction steps and RGBA channel view swizzling. The direction of the DisplayViewTranform is used as the direction of the pipeline. Note: The LegacyViewingPipeline class provides the same functionality as the OCIO v1 DisplayTransform.
Legacy viewing pipeline:
Start in display transform input color space.
If linearCC is provided:
Go to scene_linear colorspace.
Apply linearCC transform.
If colorTimingCC is provided:
Go to color_timing colorspace.
Apply colorTimingCC transform.
Apply looks (from display transform or from looks override).
Go to first look color space.
Apply first look transform.
Iterate for all looks.
Apply channelView transform.
Apply display transform (without looks).
Apply displayCC. Note that looks are applied even if the display transform involves data color spaces.
Public Functions
-
ConstDisplayViewTransformRcPtr
getDisplayViewTransform
() const noexcept = 0¶
-
void
setDisplayViewTransform
(const ConstDisplayViewTransformRcPtr &dt) noexcept = 0¶
-
ConstTransformRcPtr
getLinearCC
() const noexcept = 0¶
-
void
setLinearCC
(const ConstTransformRcPtr &cc) noexcept = 0¶
-
ConstTransformRcPtr
getColorTimingCC
() const noexcept = 0¶
-
void
setColorTimingCC
(const ConstTransformRcPtr &cc) noexcept = 0¶
-
ConstTransformRcPtr
getChannelView
() const noexcept = 0¶
-
void
setChannelView
(const ConstTransformRcPtr &transform) noexcept = 0¶
-
ConstTransformRcPtr
getDisplayCC
() const noexcept = 0¶
-
void
setDisplayCC
(const ConstTransformRcPtr &cc) noexcept = 0¶
-
void
setLooksOverrideEnabled
(bool enable) = 0¶ Specify whether the lookOverride should be used, or not. This is a separate flag, as it’s often useful to override “looks” to an empty string.
-
bool
getLooksOverrideEnabled
() const = 0¶
-
void
setLooksOverride
(const char *looks) = 0¶ A user can optionally override the looks that are, by default, used with the expected display / view combination. A common use case for this functionality is in an image viewing app, where per-shot looks are supported. If for some reason a per-shot look is not defined for the current Context, the Config::getProcessor fcn will not succeed by default. Thus, with this mechanism the viewing app could override to looks = “”, and this will allow image display to continue (though hopefully) the interface would reflect this fallback option.
Looks is a potentially comma (or colon) delimited list of lookNames, where +/- prefixes are optionally allowed to denote forward/inverse look specification (and forward is assumed in the absence of either).
-
const char *
getLooksOverride
() const = 0¶
-
ConstProcessorRcPtr
getProcessor
(const ConstConfigRcPtr &config, const ConstContextRcPtr &context) const = 0¶
-
ConstProcessorRcPtr
getProcessor
(const ConstConfigRcPtr &config) const = 0¶
-
LegacyViewingPipeline
(const LegacyViewingPipeline&) = delete¶
-
LegacyViewingPipeline &
operator=
(const LegacyViewingPipeline&) = delete¶
-
~LegacyViewingPipeline
() = default¶ Do not use (needed only for pybind11).
Public Static Functions
-
LegacyViewingPipelineRcPtr
Create
()¶
-
std::ostream &
OpenColorIO_v2_0
::
operator<<
(std::ostream&, const LegacyViewingPipeline&)¶
-
typedef std::shared_ptr<const LegacyViewingPipeline>
OpenColorIO_v2_0
::
ConstLegacyViewingPipelineRcPtr
¶
-
typedef std::shared_ptr<LegacyViewingPipeline>
OpenColorIO_v2_0
::
LegacyViewingPipelineRcPtr
¶
MixingHelpers¶
-
class
OpenColorIO_v2_0
::
MixingSlider
¶ The MixingSlider and MixingColorSpaceManager classes are to help applications implement correct color pickers. The term “color mixing” is used here to describe what is done in a typical application “color picker” user interface.
A user may want to mix colors in different color spaces. The two most common mixing space options are a scene-linear working space or the display space.
Since scene-linear color spaces are not perceptually uniform, it is necessary to compensate UI widgets such as sliders. For example, it is nice if mid-gray falls near the center of mixing controls rather than way over near the black end. This may be done by using a mapping from linear into an approximately perceptually uniform space.
Also note that a color picking/mixing UI may want to present a given color space in several different encodings. The most common two encodings for color mixing are RGB and HSV.
Note that these helpers anticipate that a user may want to mix colors using values that extend outside the typical [0,1] domain.
Public Functions
-
void
setSliderMinEdge
(float sliderMixingMinEdge) noexcept = 0¶ Set the minimum edge of a UI slider for conversion to mixing space.
-
float
getSliderMinEdge
() const noexcept = 0¶ Minimum edge of a UI slider for conversion to mixing space.
-
void
setSliderMaxEdge
(float sliderMixingMaxEdge) noexcept = 0¶ Set the maximum edge of a UI slider for conversion to mixing space.
-
float
getSliderMaxEdge
() const noexcept = 0¶ Maximum edge of a UI slider for conversion to mixing space.
-
float
sliderToMixing
(float sliderUnits) const noexcept = 0¶ Convert from units in distance along the slider to mixing space units.
-
float
mixingToSlider
(float mixingUnits) const noexcept = 0¶ Convert from mixing space units to distance along the slider.
-
MixingSlider
(const MixingSlider&) = delete¶
-
MixingSlider &
operator=
(const MixingSlider&) = delete¶
-
~MixingSlider
() = default¶ Do not use (needed only for pybind11).
-
void
-
std::ostream &
OpenColorIO_v2_0
::
operator<<
(std::ostream&, const MixingSlider&)¶
-
class
OpenColorIO_v2_0
::
MixingColorSpaceManager
¶ Used to mix (or pick/choose) colors.
Public Functions
-
size_t
getNumMixingSpaces
() const noexcept = 0¶ Access to the mixing spaces.
-
const char *
getMixingSpaceUIName
(size_t idx) const = 0¶
-
size_t
getSelectedMixingSpaceIdx
() const noexcept = 0¶
-
void
setSelectedMixingSpaceIdx
(size_t idx) = 0¶
-
void
setSelectedMixingSpace
(const char *mixingSpace) = 0¶
-
bool
isPerceptuallyUniform
() const noexcept = 0¶
-
size_t
getNumMixingEncodings
() const noexcept = 0¶ Access to the mixing encodings.
-
const char *
getMixingEncodingName
(size_t idx) const = 0¶
-
size_t
getSelectedMixingEncodingIdx
() const noexcept = 0¶
-
void
setSelectedMixingEncodingIdx
(size_t idx) = 0¶
-
void
setSelectedMixingEncoding
(const char *mixingEncoding) = 0¶
-
void
refresh
(ConstConfigRcPtr config) = 0¶ Refresh the instance (i.e. needed following a configuration change for example).
-
ConstProcessorRcPtr
getProcessor
(const char *workingName, const char *displayName, const char *viewName, TransformDirection direction) const = 0¶
-
MixingSlider &
getSlider
() noexcept = 0¶
-
MixingSlider &
getSlider
(float sliderMixingMinEdge, float sliderMixingMaxEdge) noexcept = 0¶
-
MixingColorSpaceManager
(const MixingColorSpaceManager&) = delete¶
-
MixingColorSpaceManager &
operator=
(const MixingColorSpaceManager&) = delete¶
-
~MixingColorSpaceManager
() = default¶ Do not use (needed only for pybind11).
Public Static Functions
-
MixingColorSpaceManagerRcPtr
Create
(ConstConfigRcPtr &config)¶
-
size_t
-
std::ostream &
OpenColorIO_v2_0
::
operator<<
(std::ostream&, const MixingColorSpaceManager&)¶
-
typedef std::shared_ptr<const MixingColorSpaceManager>
OpenColorIO_v2_0
::
ConstMixingColorSpaceManagerRcPtr
¶
-
typedef std::shared_ptr<MixingColorSpaceManager>
OpenColorIO_v2_0
::
MixingColorSpaceManagerRcPtr
¶