..
  SPDX-License-Identifier: CC-BY-4.0
  Copyright Contributors to the OpenColorIO Project.
  Do not edit! This file was automatically generated by share/docs/frozendoc.py.

.. py:class:: Baker
   :module: PyOpenColorIO

   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*

   .. code-block:: cpp

       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();


   .. py:method:: Baker.__init__(*args, **kwargs)
      :module: PyOpenColorIO

      Overloaded function.

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

      Create a new :ref:`Baker`.

      2. __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 :ref:`Baker`.


   .. py:method:: Baker.bake(*args, **kwargs)
      :module: PyOpenColorIO

      Overloaded function.

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

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

      Bake the LUT into the output stream.


   .. py:method:: Baker.getConfig(self: PyOpenColorIO.Baker) -> PyOpenColorIO.Config
      :module: PyOpenColorIO


   .. py:method:: Baker.getCubeSize(self: PyOpenColorIO.Baker) -> int
      :module: PyOpenColorIO


   .. py:method:: Baker.getDisplay(self: PyOpenColorIO.Baker) -> str
      :module: PyOpenColorIO


   .. py:method:: Baker.getFormat(self: PyOpenColorIO.Baker) -> str
      :module: PyOpenColorIO


   .. py:method:: Baker.getFormatMetadata(self: PyOpenColorIO.Baker) -> PyOpenColorIO.FormatMetadata
      :module: PyOpenColorIO


   .. py:method:: Baker.getFormats() -> PyOpenColorIO.Baker.FormatIterator
      :module: PyOpenColorIO
      :staticmethod:


   .. py:method:: Baker.getInputSpace(self: PyOpenColorIO.Baker) -> str
      :module: PyOpenColorIO


   .. py:method:: Baker.getLooks(self: PyOpenColorIO.Baker) -> str
      :module: PyOpenColorIO


   .. py:method:: Baker.getShaperSize(self: PyOpenColorIO.Baker) -> int
      :module: PyOpenColorIO


   .. py:method:: Baker.getShaperSpace(self: PyOpenColorIO.Baker) -> str
      :module: PyOpenColorIO


   .. py:method:: Baker.getTargetSpace(self: PyOpenColorIO.Baker) -> str
      :module: PyOpenColorIO


   .. py:method:: Baker.getView(self: PyOpenColorIO.Baker) -> str
      :module: PyOpenColorIO


   .. py:method:: Baker.setConfig(self: PyOpenColorIO.Baker, config: PyOpenColorIO.Config) -> None
      :module: PyOpenColorIO

      Set the config to use.


   .. py:method:: Baker.setCubeSize(self: PyOpenColorIO.Baker, cubeSize: int) -> None
      :module: PyOpenColorIO

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


   .. py:method:: Baker.setDisplayView(self: PyOpenColorIO.Baker, display: str, view: str) -> None
      :module: PyOpenColorIO

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


   .. py:method:: Baker.setFormat(self: PyOpenColorIO.Baker, formatName: str) -> None
      :module: PyOpenColorIO

      Set the LUT output format.


   .. py:method:: Baker.setInputSpace(self: PyOpenColorIO.Baker, inputSpace: str) -> None
      :module: PyOpenColorIO

      Set the input :ref:`ColorSpace` that the LUT will be applied to.


   .. py:method:: Baker.setLooks(self: PyOpenColorIO.Baker, looks: str) -> None
      :module: PyOpenColorIO

      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).


   .. py:method:: Baker.setShaperSize(self: PyOpenColorIO.Baker, shaperSize: int) -> None
      :module: PyOpenColorIO

      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).


   .. py:method:: Baker.setShaperSpace(self: PyOpenColorIO.Baker, shaperSpace: str) -> None
      :module: PyOpenColorIO

      Set an *optional* :ref:`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.


   .. py:method:: Baker.setTargetSpace(self: PyOpenColorIO.Baker, targetSpace: str) -> None
      :module: PyOpenColorIO

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


.. py:class:: FormatIterator
   :module: PyOpenColorIO.Baker

   Iterator on LUT baker Formats.

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


   .. py:method:: FormatIterator.__getitem__(self: PyOpenColorIO.Baker.FormatIterator, arg0: int) -> tuple
      :module: PyOpenColorIO.Baker


   .. py:method:: FormatIterator.__iter__(self: PyOpenColorIO.Baker.FormatIterator) -> PyOpenColorIO.Baker.FormatIterator
      :module: PyOpenColorIO.Baker


   .. py:method:: FormatIterator.__len__(self: PyOpenColorIO.Baker.FormatIterator) -> int
      :module: PyOpenColorIO.Baker


   .. py:method:: FormatIterator.__next__(self: PyOpenColorIO.Baker.FormatIterator) -> tuple
      :module: PyOpenColorIO.Baker

