OpenColorIO

Open Source Color Management

OpenColorIO 1.0.6 documentation

Python: AllocationTransform

Examples of Use

import PyOpenColorIO as OCIO

transform = OCIO.AllocationTransform()
transform.setAllocation(OCIO.Constants.ALLOCATION)
class AllocationTransform

Respans the ‘expanded’ range into the specified (often compressed) range.

Performs both squeeze (offset) and log transforms.

AllocationTransform.getAllocation()

Returns the allocation specified in the transform. Allocation is an enum, defined in Constants.

Returns:Allocation
Return type:string
AllocationTransform.setAllocation(&hwalloc)

Sets the allocation of the transform.

Parameters:hwalloc (object) – Allocation
AllocationTransform.getVars()

Returns the allocation values specified in the transform.

Returns:allocation values
Return type:list of floats
AllocationTransform.setVars(&pyvars)

Sets the allocation in the transform.

Parameters:pyvars (object) – list of floats

Python: CDLTransform

Examples of Use

import PyOpenColorIO as OCIO

cdl = OCIO.CDLTransform()

# Set the slope, offset, power, and saturation for each channel.
cdl.setSOP([, , , , , , , , ])
cdl.setSat([, , ])

cdl.getSatLumaCoefs()

Description

Used to define a transform based on a color decision list (CDL), based on the 9 numbers defined in SOP (slope, offset, and power) and Sat (saturation). Each element in SOP and Sat are characterized by three floats (for RGB).
Config.setSlope(pyData)

Sets the slope (‘S’ part of SOP) in CDLTransform.

Parameters:pyData (object) –
Config.setOffset(pyData)

Sets the offset (‘O’ part of SOP) in CDLTransform.

Parameters:pyData (object) – list of three floats
Config.setPower(pyData)

Sets the power (‘P’ part of SOP) in CDLTransform.

Parameters:pyData (object) – list of three floats
Config.setSOP(pyData)

Sets SOP in CDLTransform.

Parameters:pyData (object) – list of nine floats
Config.setSAT(pyData)

Sets SAT (saturation) in CDLTransform.

Parameters:pyData (float) – saturation
Config.getSatLumaCoefs(pyData)

Returns the SAT (saturation) and luma coefficients in CDLTransform.

Returns:saturation and luma coefficients
Return type:list of floats
Config.getID()

Returns the ID from CDLTransform.

Returns:ID
Return type:string
Config.setID(str)

Sets the ID in CDLTransform.

Parameters:str (string) – ID
Config.getDescription()

Returns the description of CDLTransform.

Returns:description
Return type:string
Config.setDescription(str)

Sets the description of CDLTransform.

Parameters:str (string) – description

Python: ColorSpaceTransform

This class is meant so that ColorSpace conversions can be reused, referencing ColorSpaces that already exist.

Note

Careless use of this may create infinite loops, so avoid referencing the colorspace you’re in.

Examples of Use

import PyOpenColorIO as OCIO

transform = OCIO.ColorSpaceTransform()
ColorSpaceTransform.getSrc()

Returns the name of the source ColorSpace in this transform.

Returns:ColorSpace
Return type:string
ColorSpaceTransform.setSrc()

Sets the source ColorSpace in this transform.

Parameters:str (string) – source ColorSpace
ColorSpaceTransform.getDst()

Returns the name of the destination ColorSpace in this transform.

Returns:ColorSpace
Return type:string
ColorSpaceTransform.setDst()

Sets the destination ColorSpace in this transform.

Parameters:str (string) – destination ColorSpace

Python: DisplayTransform

import PyOpenColorIO as OCIO

transform = OCIO.DisplayTransform()
class DisplayTransform

Used to create transforms for displays.

DisplayTransform.getInputColorSpaceName()

Returns the name of the input ColorSpace of DisplayTransform. :return: name of input ColorSpace :rtype: string

DisplayTransform.setInputColorSpaceName(name)

Sets the name of the input ColorSpace of DisplayTransform. :param name: name of input ColorSpace :type name: string

DisplayTransform.getLinearCC()

Returns the linear CC transform of DisplayTransform. :return: linear CC transform :rtype: object

DisplayTransform.setLinearCC(pyCC)

Sets the linear CC transform of DisplayTransform. :param pyCC: linear CC :type pyCC: object

DisplayTransform.getColorTimingCC()

Returns the color timing CC transform of DisplayTransform. :return: color timing CC transform :rtype: object

DisplayTransform.setColorTimingCC(pyCC)

Sets the color timing CC transform of DisplayTransform. :param pyCC: color timing CC :type pyCC: object

DisplayTransform.getChannelView()

Returns the channel view of DisplayTransform. :return: channel view :rtype: object

DisplayTransform.setChannelView(pyCC)

Sets the channel view transform of DisplayTransform. :param pyCC: channel view transform :type pyCC: object

DisplayTransform.getDisplay()

Returns the display of DisplayTransform. :return: display :rtype: string

DisplayTransform.setChannelView(str)

Sets the display of DisplayTransform. :param str: display :type str: string

DisplayTransform.getView()

Returns the view of DisplayTransform. :return: view :rtype: string

DisplayTransform.setView(str)

Sets the view of DisplayTransform. :param str: view :type str: string

DisplayTransform.getDisplayCC()

Returns the display CC transform of DisplayTransform. :return: display CC :rtype: object

DisplayTransform.setDisplayCC(pyCC)

Sets the display CC transform of DisplayTransform. :param pyCC: display CC :type pyCC: object

DisplayTransform.getLooksOverride()

Returns the looks in DisplayTransform that’s overriding Config‘s. :return: looks override :rtype: string

DisplayTransform.setLooksOverride(str)

Sets the looks override of DisplayTransform. :param str: looks override :type str: string

DisplayTransform.getLooksOverrideEnabled()

Returns whether the looks override of DisplayTransform is enabled. :return: looks override enabling :rtype: bool

DisplayTransform.setLooksOverrideEnabled(enabled)

Sets the looks override enabling of DisplayTransform. :param enabled: looks override enabling :type enabled: object

Python: ExponentTransform

import PyOpenColorIO as OCIO

transform = OCIO.ExponentTransform()
ExponentTransform.getValue()

Returns the values in the exponent transform of ExponentTransform. :return: exponent transform values :rtype: list of floats

ExponentTransform.setValue()

Sets the values in the exponent transform of ExponentTransform. :param pyData: exponent transform values :type pyData: list of 4 floats

Python: LogTransform

Examples of Use

import PyOpenColorIO as OCIO

Description

LogTransform is used to define a log transform.

The direction of the transform and its numerical base can be specified.

Config.getBase()

Returns the base of LogTransform.

Config.setBase(base)

Sets the base in LogTransform.

Parameters:base (float) – base of log transform