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
getDisplay() str
getFormat() str
getFormatMetadata() PyOpenColorIO.FormatMetadata
static getFormats() PyOpenColorIO.Baker.FormatIterator
getInputSpace() str
getLooks() str
getShaperSize() int
getShaperSpace() str
getTargetSpace() str
getView() str
setConfig(config: PyOpenColorIO.Config) None

Set the config to use.

setCubeSize(cubeSize: int) None

Override the main LUT (3d or 1d) sample size. Default value is -1, which allows each format to use its own most appropriate size.

setDisplayView(display: str, view: str) None

Set the display and view to apply during the baking. Must not be used if setTargetSpace is used.

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 shape the incoming values of the LUT. When baking 3DLUT, this will correspond to the 1D shaper used to normalise incoming values to the unit range. When baking 1D LUT, this will be used to determine the input range of the LUT.

setTargetSpace(targetSpace: str) None

Set the target (i.e., output) color space for the LUT. Must not be used if setDisplayView is used.

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