Applications Helpers


PyOpenColorIO.ColorSpaceHelpers.AddColorSpace(config: PyOpenColorIO.Config, name: str, transformFilePath: str, categories: str = '', connectionColorSpaceName: str)None

Add a new color space to the config instance. The output of the userTransform must be in the specified connectionColorSpace.

Note: If the config does not already use categories, we do not add them since that would make a big change to how existing color spaces show up in menus.


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.


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.

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.