Baker

class PyOpenColorIO.Baker

In certain situations it is necessary to serialize transforms into a variety of application specific LUT formats. Note that not all file formats that may be read also support baking.

Usage Example: Bake a CSP sRGB viewer LUT

OCIO::ConstConfigRcPtr config = OCIO::Config::CreateFromEnv();
OCIO::BakerRcPtr baker = OCIO::Baker::Create();
baker->setConfig(config);
baker->setFormat("csp");
baker->setInputSpace("lnf");
baker->setShaperSpace("log");
baker->setTargetSpace("sRGB");
auto & metadata = baker->getFormatMetadata();
metadata.addChildElement(:ref:`OCIO::METADATA_DESCRIPTION`, "A first comment");
metadata.addChildElement(:ref:`OCIO::METADATA_DESCRIPTION`, "A second comment");
std::ostringstream out;
baker->bake(out); // fresh bread anyone!
std::cout << out.str();
Baker(*args, **kwargs)

Overloaded function.

  1. __init__(self: PyOpenColorIO.Baker) -> None

Create a new Baker.

  1. __init__(self: PyOpenColorIO.Baker, config: PyOpenColorIO.Config, format: str, inputSpace: str, targetSpace: str, looks: str = ‘’, cubeSize: int = -1, shaperSpace: str = ‘’, shaperSize: int = -1) -> None

Create a new Baker.

bake(*args, **kwargs)

Overloaded function.

  1. bake(self: PyOpenColorIO.Baker, fileName: str) -> None

  2. bake(self: PyOpenColorIO.Baker) -> str

Bake the LUT into the output stream.

getConfig()PyOpenColorIO.Config
getCubeSize()int
getFormat()str
getFormatMetadata()PyOpenColorIO.FormatMetadata
static getFormats()PyOpenColorIO.Baker.FormatIterator
getInputSpace()str
getLooks()str
getShaperSize()int
getShaperSpace()str
getTargetSpace()str
setConfig(config: PyOpenColorIO.Config)None

Set the config to use.

setCubeSize(cubeSize: int)None

Override the default cube sample size. default: <format specific>

setFormat(formatName: str)None

Set the LUT output format.

setInputSpace(inputSpace: str)None

Set the input ColorSpace that the LUT will be applied to.

setLooks(looks: str)None

Set the looks to be applied during baking. 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).

setShaperSize(shaperSize: int)None

Override the default shaper LUT size. Default value is -1, which allows each format to use its own most appropriate size. For the CLF format, the default uses a half-domain LUT1D (which is ideal for scene-linear inputs).

setShaperSpace(shaperSpace: str)None

Set an optional ColorSpace to be used to shape / transfer the input colorspace. This is mostly used to allocate an HDR luminance range into an LDR one. If a shaper space is not explicitly specified, and the file format supports one, the ColorSpace Allocation will be used (not implemented for all formats).

setTargetSpace(targetSpace: str)None

Set the target device colorspace for the LUT.

class PyOpenColorIO.Baker.FormatIterator

Iterator on LUT baker Formats.

Each item is a tuple containing format name and format extension.

self[arg0: int]tuple
iter(self)PyOpenColorIO.Baker.FormatIterator
len(self)int
next(self)tuple