All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OCIO_NAMESPACE::Baker Class Reference

#include <OpenColorIO.h>

Public Member Functions

BakerRcPtr createEditableCopy () const
 Create a copy of this Baker. More...
ConstConfigRcPtr getConfig () const
void setConfig (const ConstConfigRcPtr &config)
 Set the config to use. More...
const char * getFormat () const
void setFormat (const char *formatName)
 Set the LUT output format. More...
const FormatMetadatagetFormatMetadata () const
FormatMetadatagetFormatMetadata ()
const char * getInputSpace () const
void setInputSpace (const char *inputSpace)
 Set the input ColorSpace that the LUT will be applied to. More...
const char * getShaperSpace () const
void setShaperSpace (const char *shaperSpace)
const char * getLooks () const
void setLooks (const char *looks)
const char * getTargetSpace () const
void setTargetSpace (const char *targetSpace)
 Set the target device colorspace for the LUT. More...
int getShaperSize () const
void setShaperSize (int shapersize)
int getCubeSize () const
void setCubeSize (int cubesize)
void bake (std::ostream &os) const
 Bake the LUT into the output stream. More...
 Baker (const Baker &)=delete
Bakeroperator= (const Baker &)=delete
 ~Baker ()
 Do not use (needed only for pybind11). More...

Static Public Member Functions

static BakerRcPtr Create ()
 Create a new Baker. More...
static int getNumFormats ()
 Get the number of LUT bakers. More...
static const char * getFormatNameByIndex (int index)
static const char * getFormatExtensionByIndex (int index)

Detailed Description

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();
auto & metadata = baker->getFormatMetadata();
metadata.addChildElement(OCIO::METADATA_DESCRIPTION, "A first comment");
metadata.addChildElement(OCIO::METADATA_DESCRIPTION, "A second comment");
std::ostringstream out;
baker->bake(out); // fresh bread anyone!
std::cout << out.str();

Definition at line 2381 of file OpenColorIO.h.

Constructor & Destructor Documentation

OCIO_NAMESPACE::Baker::Baker ( const Baker )
OCIO_NAMESPACE::Baker::~Baker ( )

Do not use (needed only for pybind11).

Member Function Documentation

void OCIO_NAMESPACE::Baker::bake ( std::ostream &  os) const

Bake the LUT into the output stream.

static BakerRcPtr OCIO_NAMESPACE::Baker::Create ( )

Create a new Baker.

BakerRcPtr OCIO_NAMESPACE::Baker::createEditableCopy ( ) const

Create a copy of this Baker.

ConstConfigRcPtr OCIO_NAMESPACE::Baker::getConfig ( ) const
int OCIO_NAMESPACE::Baker::getCubeSize ( ) const
const char* OCIO_NAMESPACE::Baker::getFormat ( ) const
static const char* OCIO_NAMESPACE::Baker::getFormatExtensionByIndex ( int  index)

Get the LUT baker format extension at index, return empty string if an invalid index is specified.

const FormatMetadata& OCIO_NAMESPACE::Baker::getFormatMetadata ( ) const
FormatMetadata& OCIO_NAMESPACE::Baker::getFormatMetadata ( )

Get editable optional format metadata. The metadata that will be used varies based on the capability of the given file format. Formats such as CSP, IridasCube, and ResolveCube will create comments in the file header using the value of any first-level children elements of the formatMetadata. The CLF/CTF formats will make use of the top-level "id" and "name" attributes and children elements "Description", "InputDescriptor", "OutputDescriptor", and "Info".

static const char* OCIO_NAMESPACE::Baker::getFormatNameByIndex ( int  index)

Get the LUT baker format name at index, return empty string if an invalid index is specified.

const char* OCIO_NAMESPACE::Baker::getInputSpace ( ) const
const char* OCIO_NAMESPACE::Baker::getLooks ( ) const
static int OCIO_NAMESPACE::Baker::getNumFormats ( )

Get the number of LUT bakers.

int OCIO_NAMESPACE::Baker::getShaperSize ( ) const
const char* OCIO_NAMESPACE::Baker::getShaperSpace ( ) const
const char* OCIO_NAMESPACE::Baker::getTargetSpace ( ) const
Baker& OCIO_NAMESPACE::Baker::operator= ( const Baker )
void OCIO_NAMESPACE::Baker::setConfig ( const ConstConfigRcPtr config)

Set the config to use.

void OCIO_NAMESPACE::Baker::setCubeSize ( int  cubesize)

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

void OCIO_NAMESPACE::Baker::setFormat ( const char *  formatName)

Set the LUT output format.

void OCIO_NAMESPACE::Baker::setInputSpace ( const char *  inputSpace)

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

void OCIO_NAMESPACE::Baker::setLooks ( const char *  looks)

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

void OCIO_NAMESPACE::Baker::setShaperSize ( int  shapersize)

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

void OCIO_NAMESPACE::Baker::setShaperSpace ( const char *  shaperSpace)

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

void OCIO_NAMESPACE::Baker::setTargetSpace ( const char *  targetSpace)

Set the target device colorspace for the LUT.

The documentation for this class was generated from the following file: