Global

Caching

PyOpenColorIO.ClearAllCaches() None

During normal usage, OpenColorIO tends to cache certain global information (such as the contents of LUTs on disk, intermediate results, etc.). Calling this function will flush all such information. The global information are related to LUT file identifications, loaded LUT file content and CDL transforms from loaded CDL files.

Under normal usage, this is not necessary, but it can be helpful in particular instances, such as designing OCIO profiles, and wanting to re-read luts without restarting.

Note

The method does not apply to instance specific caches such as the processor cache in a config instance or the GPU and CPU processor caches in a processor instance. Here deleting the instance flushes the cache.

Constants: Caches

Version

PyOpenColorIO.GetVersion() str

Get the version number for the library, as a dot-delimited string (e.g., “1.0.0”).

This is also available at compile time as OCIO_VERSION_FULL_STR.

PyOpenColorIO.GetVersionHex() int

Get the version number for the library, as a single 4-byte hex number (e.g., 0x01050200 for “1.5.2”), to be used for numeric comparisons.

This is also at compile time as OCIO_VERSION_HEX.

Logging

PyOpenColorIO.GetLoggingLevel() PyOpenColorIO.LoggingLevel

Get the global logging level.

You can override this at runtime using the OCIO_LOGGING_LEVEL environment variable. The client application that sets this should use SetLoggingLevel, and not the environment variable. The default value is INFO.

PyOpenColorIO.SetLoggingLevel(level: PyOpenColorIO.LoggingLevel) None

Set the global logging level.

Logging Function

PyOpenColorIO.SetLoggingFunction(logFunction: Callable[[str], None]) None

Set the logging function to use; otherwise, use the default (i.e. std::cerr).

Note

The logging mechanism is thread-safe.

PyOpenColorIO.ResetToDefaultLoggingFunction() None
PyOpenColorIO.LogMessage(level: PyOpenColorIO.LoggingLevel, message: str) None

Log a message using the library logging function.

Compute Hash Function

PyOpenColorIO.SetComputeHashFunction(hashFunction: Callable[[str], str]) None

Set the Compute Hash Function to use; otherwise, use the default.

This is not used when using CreateFromFile with an OCIOZ archive or CreateFromConfigIOProxy.

Parameters:

ComputeHashFunction

PyOpenColorIO.ResetComputeHashFunction() None

Environment Variables

PyOpenColorIO.GetEnvVariable(name: str) str

Another call modifies the string obtained from a previous call as the method always uses the same memory buffer.

PyOpenColorIO.SetEnvVariable(name: str, value: str) None

Warning

This method is not thread safe.

PyOpenColorIO.UnsetEnvVariable(name: str) None

Warning

This method is not thread safe.

PyOpenColorIO.IsEnvVariablePresent(name: str) bool

cpp:function:

Constants: Environment Variables

Casting

template<class T, class U>
inline std::shared_ptr<T> OpenColorIO_v2_3dev::DynamicPtrCast(std::shared_ptr<U> const &ptr)

Conversions

Bool

PyOpenColorIO.BoolToString(value: bool) str
PyOpenColorIO.BoolFromString(str: str) bool

LoggingLevel

PyOpenColorIO.LoggingLevelToString(level: PyOpenColorIO.LoggingLevel) str
PyOpenColorIO.LoggingLevelFromString(str: str) PyOpenColorIO.LoggingLevel

TransformDirection

PyOpenColorIO.TransformDirectionToString(direction: PyOpenColorIO.TransformDirection) str
PyOpenColorIO.TransformDirectionFromString(str: str) PyOpenColorIO.TransformDirection

Will throw if string is not recognized.

PyOpenColorIO.GetInverseTransformDirection(direction: PyOpenColorIO.TransformDirection) PyOpenColorIO.TransformDirection
PyOpenColorIO.CombineTransformDirections(direction1: PyOpenColorIO.TransformDirection, direction2: PyOpenColorIO.TransformDirection) PyOpenColorIO.TransformDirection

BitDepth

PyOpenColorIO.BitDepthToString(bitDepth: PyOpenColorIO.BitDepth) str
PyOpenColorIO.BitDepthFromString(str: str) PyOpenColorIO.BitDepth
PyOpenColorIO.BitDepthIsFloat(bitDepth: PyOpenColorIO.BitDepth) bool
PyOpenColorIO.BitDepthToInt(bitDepth: PyOpenColorIO.BitDepth) int

Allocation

PyOpenColorIO.AllocationToString(allocation: PyOpenColorIO.Allocation) str
PyOpenColorIO.AllocationFromString(str: str) PyOpenColorIO.Allocation

Interpolation

PyOpenColorIO.InterpolationToString(interpolation: PyOpenColorIO.Interpolation) str
PyOpenColorIO.InterpolationFromString(str: str) PyOpenColorIO.Interpolation

GpuLanguage

PyOpenColorIO.GpuLanguageToString(language: PyOpenColorIO.GpuLanguage) str
PyOpenColorIO.GpuLanguageFromString(str: str) PyOpenColorIO.GpuLanguage

EnvironmentMode

PyOpenColorIO.EnvironmentModeToString(mode: PyOpenColorIO.EnvironmentMode) str
PyOpenColorIO.EnvironmentModeFromString(str: str) PyOpenColorIO.EnvironmentMode

CDLStyle

PyOpenColorIO.CDLStyleToString(style: PyOpenColorIO.CDLStyle) str
PyOpenColorIO.CDLStyleFromString(str: str) PyOpenColorIO.CDLStyle

RangeStyle

PyOpenColorIO.RangeStyleToString(style: PyOpenColorIO.RangeStyle) str
PyOpenColorIO.RangeStyleFromString(str: str) PyOpenColorIO.RangeStyle

FixedFunctionStyle

PyOpenColorIO.FixedFunctionStyleToString(style: PyOpenColorIO.FixedFunctionStyle) str
PyOpenColorIO.FixedFunctionStyleFromString(str: str) PyOpenColorIO.FixedFunctionStyle

GradingStyle

PyOpenColorIO.GradingStyleToString(style: PyOpenColorIO.GradingStyle) str
PyOpenColorIO.GradingStyleFromString(str: str) PyOpenColorIO.GradingStyle

ExposureContrastStyle

PyOpenColorIO.ExposureContrastStyleToString(style: PyOpenColorIO.ExposureContrastStyle) str
PyOpenColorIO.ExposureContrastStyleFromString(str: str) PyOpenColorIO.ExposureContrastStyle

NegativeStyle

PyOpenColorIO.NegativeStyleToString(style: PyOpenColorIO.NegativeStyle) str
PyOpenColorIO.NegativeStyleFromString(str: str) PyOpenColorIO.NegativeStyle