HDK
 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 (i.e., output) color space for the LUT. Must not be used if setDisplayView is used. More...
 
const char * getDisplay () const
 
const char * getView () const
 
void setDisplayView (const char *display, const char *view)
 Set the display and view to apply during the baking. Must not be used if setTargetSpace is used. 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();
baker->setConfig(config);
baker->setFormat("csp");
baker->setInputSpace("lnf");
baker->setShaperSpace("log");
baker->setTargetSpace("sRGB");
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 2634 of file OpenColorIO.h.

Constructor & Destructor Documentation

OCIO_NAMESPACE::Baker::Baker ( const Baker )
delete
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 ( )
static

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::getDisplay ( ) const
const char* OCIO_NAMESPACE::Baker::getFormat ( ) const
static const char* OCIO_NAMESPACE::Baker::getFormatExtensionByIndex ( int  index)
static

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

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

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
const char* OCIO_NAMESPACE::Baker::getView ( ) const
Baker& OCIO_NAMESPACE::Baker::operator= ( const Baker )
delete
void OCIO_NAMESPACE::Baker::setConfig ( const ConstConfigRcPtr config)

Set the config to use.

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

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

void OCIO_NAMESPACE::Baker::setDisplayView ( const char *  display,
const char *  view 
)

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

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 or NamedTransform 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.

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

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


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