OpenColorIO

Open Source Color Management

OpenColorIO 1.0.9 documentation

Python Transforms

Transform

class PyOpenColorIO.Transform

These are typically only needed when creating or manipulating configurations.

createEditableCopy()
getDirection()
isEditable()
setDirection()

AllocationTransform

import PyOpenColorIO as OCIO
transform = OCIO.AllocationTransform()
transform.setAllocation(OCIO.Constants.ALLOCATION)
class PyOpenColorIO.AllocationTransform

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

Performs both squeeze (offset) and log transforms.

createEditableCopy()
getAllocation()

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

Returns:Allocation
Return type:string
getDirection()
getNumVars()
getVars()

Returns the allocation values specified in the transform.

Returns:allocation values
Return type:list of floats
isEditable()
setAllocation(hwalloc)

Sets the allocation of the transform.

Parameters:hwalloc (object) – Allocation
setDirection()
setVars(pyvars)

Sets the allocation in the transform.

Parameters:pyvars (object) – list of floats

CDLTransform

import PyOpenColorIO as OCIO

cdl = OCIO.CDLTransform()
# Set the slope, offset, power, and saturation for each channel.
cdl.setSOP([, , , , , , , , ])
cdl.setSat([, , ])
cdl.getSatLumaCoefs()
class PyOpenColorIO.CDLTransform

CDLTransform

CreateFromFile()
createEditableCopy()
equals()
getDescription()

Returns the description of PyOpenColorIO.CDLTransform.

Returns:description
Return type:string
getDirection()
getID()

Returns the ID from PyOpenColorIO.CDLTransform.

Returns:ID
Return type:string
getOffset()
getPower()
getSOP()
getSat()
getSatLumaCoefs(pyData)

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

Returns:saturation and luma coefficients
Return type:list of floats
getSlope()
getXML()
isEditable()
setDescription(str)

Sets the description of PyOpenColorIO.CDLTransform.

Parameters:str (string) – description
setDirection()
setID(str)

Sets the ID in PyOpenColorIO.CDLTransform.

Parameters:str (string) – ID
setOffset(pyData)

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

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

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

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

Sets SOP in PyOpenColorIO.CDLTransform.

Parameters:pyData (object) – list of nine floats
setSat()

setSAT(pyData)

Sets SAT (saturation) in PyOpenColorIO.CDLTransform.

Parameters:pyData (float) – saturation
setSlope(pyData)

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

Parameters:pyData (object) –
setXML()

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.

import PyOpenColorIO as OCIO
transform = OCIO.ColorSpaceTransform()
class PyOpenColorIO.ColorSpaceTransform

ColorSpaceTransform

createEditableCopy()
getDirection()
getDst()

Returns the name of the destination ColorSpace in this transform.

Returns:ColorSpace
Return type:string
getSrc()

Returns the name of the source ColorSpace in this transform.

Returns:ColorSpace
Return type:string
isEditable()
setDirection()
setDst(dstname)

Sets the destination ColorSpace in this transform.

Parameters:str (string) – destination ColorSpace
setSrc(srcname)

Sets the source ColorSpace in this transform.

Parameters:str (string) – source ColorSpace

DisplayTransform

import PyOpenColorIO as OCIO
transform = OCIO.DisplayTransform()
class PyOpenColorIO.DisplayTransform

Used to create transforms for displays.

createEditableCopy()
getChannelView()

Returns the channel view of PyOpenColorIO.DisplayTransform.

Returns:channel view
Return type:object
getColorTimingCC()

Returns the color timing CC transform of PyOpenColorIO.DisplayTransform.

Returns:color timing CC transform
Return type:object
getDirection()
getDisplay()

Returns the display of PyOpenColorIO.DisplayTransform.

Returns:display
Return type:string
getDisplayCC()

Returns the display CC transform of PyOpenColorIO.DisplayTransform.

Returns:display CC
Return type:object
getInputColorSpaceName()

Returns the name of the input ColorSpace of PyOpenColorIO.DisplayTransform.

Returns:name of input ColorSpace
Return type:string
getLinearCC()

Returns the linear CC transform of PyOpenColorIO.DisplayTransform.

Returns:linear CC transform
Return type:object
getLooksOverride()

Returns the looks in PyOpenColorIO.DisplayTransform that’s overriding PyOpenColorIO.Config‘s.

Returns:looks override
Return type:string
getLooksOverrideEnabled()

Returns whether the looks override of PyOpenColorIO.DisplayTransform is enabled.

Returns:looks override enabling
Return type:bool
getView()

Returns the view of PyOpenColorIO.DisplayTransform.

Returns:view
Return type:string
isEditable()
setChannelView(pyCC)

Sets the channel view transform of PyOpenColorIO.DisplayTransform.

Parameters:pyCC (object) – channel view transform
setColorTimingCC(pyCC)

Sets the color timing CC transform of PyOpenColorIO.DisplayTransform.

Parameters:pyCC (object) – color timing CC
setDirection()
setDisplay(str)

Sets the display of PyOpenColorIO.DisplayTransform.

Parameters:str (string) – display
setDisplayCC(pyCC)

Sets the display CC transform of PyOpenColorIO.DisplayTransform.

Parameters:pyCC (object) – display CC
setInputColorSpaceName(name)

Sets the name of the input ColorSpace of PyOpenColorIO.DisplayTransform.

Parameters:name (string) – name of input ColorSpace
setLinearCC(pyCC)

Sets the linear CC transform of PyOpenColorIO.DisplayTransform.

Parameters:pyCC (object) – linear CC
setLooksOverride(str)

Sets the looks override of PyOpenColorIO.DisplayTransform.

Parameters:str (string) – looks override
setLooksOverrideEnabled(enabled)

Sets the looks override enabling of PyOpenColorIO.DisplayTransform.

Parameters:enabled (object) – looks override enabling
setView(str)

Sets the view of PyOpenColorIO.DisplayTransform.

Parameters:str (string) – view

ExponentTransform

import PyOpenColorIO as OCIO
transform = OCIO.ExponentTransform()
class PyOpenColorIO.ExponentTransform

ExponentTransform

createEditableCopy()
getDirection()
getValue()

Returns the values in the exponent transform of PyOpenColorIO.ExponentTransform.

Returns:exponent transform values
Return type:list of floats
isEditable()
setDirection()
setValue()

Sets the values in the exponent transform of PyOpenColorIO.ExponentTransform.

Parameters:pyData (list of 4 floats) – exponent transform values

FileTransform

class PyOpenColorIO.FileTransform

FileTransform

createEditableCopy()
getCCCId()
getDirection()
getFormatExtensionByIndex()
getFormatNameByIndex()
getInterpolation()
getNumFormats()
getSrc()
isEditable()
setCCCId()
setDirection()
setInterpolation()
setSrc()

GroupTransform

class PyOpenColorIO.GroupTransform

GroupTransform

clear()
createEditableCopy()
empty()
getDirection()
getTransform()
getTransforms()
isEditable()
push_back()
setDirection()
setTransforms()
size()

LogTransform

import PyOpenColorIO as OCIO

PyOpenColorIO.LogTransform is used to define a log transform. The direction of the transform and its numerical base can be specified.

class PyOpenColorIO.LogTransform

LogTransform

createEditableCopy()
getBase()

Returns the base of PyOpenColorIO.LogTransform.

getDirection()
isEditable()
setBase(base)

Sets the base in PyOpenColorIO.LogTransform.

Parameters:base (float) – base of log transform
setDirection()

LookTransform

class PyOpenColorIO.LookTransform

LookTransform

createEditableCopy()
getDirection()
getDst()
getLooks()
getSrc()
isEditable()
setDirection()
setDst()
setLooks()
setSrc()

MatrixTransform

class PyOpenColorIO.MatrixTransform

MatrixTransfom

static Fit()
static Identity()
static Sat()
static Scale()
static View()
createEditableCopy()
equals()
getDirection()
getMatrix()
getOffset()
getValue()
isEditable()
setDirection()
setMatrix()
setOffset()
setValue()