OpenColorIO

Open Source Color Management

OpenColorIO 1.1.1 documentation

C++ Transforms

Typically only needed when creating and/or manipulating configurations


class Transform
std::ostream& operator<<(std::ostream&, const Transform&)

class AllocationTransform

Forward direction wraps the ‘expanded’ range into the specified, often compressed, range.

static AllocationTransformRcPtr AllocationTransform::Create()
TransformRcPtr AllocationTransform::createEditableCopy() const
TransformDirection AllocationTransform::getDirection() const
void AllocationTransform::setDirection(TransformDirection dir)
Allocation AllocationTransform::getAllocation() const
void AllocationTransform::setAllocation(Allocation allocation)
int AllocationTransform::getNumVars() const
void AllocationTransform::getVars(float* vars) const
void AllocationTransform::setVars(int numvars, const float* vars)
std::ostream& operator<<(std::ostream&, const AllocationTransform&)

class CDLTransform

An implementation of the ASC CDL Transfer Functions and Interchange - Syntax (Based on the version 1.2 document)

Note

the clamping portion of the CDL is only applied if a non-identity power is specified.

static CDLTransformRcPtr CDLTransform::Create()
static CDLTransformRcPtr CDLTransform::CreateFromFile(const char* src, const char* cccid)

Load the CDL from the src .cc or .ccc file. If a .ccc is used, the cccid must also be specified src must be an absolute path reference, no relative directory or envvar resolution is performed.

TransformRcPtr CDLTransform::createEditableCopy() const
TransformDirection CDLTransform::getDirection() const
void CDLTransform::setDirection(TransformDirection dir)
bool CDLTransform::equals(const ConstCDLTransformRcPtr& other) const
const char* CDLTransform::getXML() const
void CDLTransform::setXML(const char* xml)

ASC_SOP

Slope, offset, power:

out = clamp( (in * slope) + offset ) ^ power
void CDLTransform::setSlope(const float* rgb)
void CDLTransform::getSlope(float* rgb) const
void CDLTransform::setOffset(const float* rgb)
void CDLTransform::getOffset(float* rgb) const
void CDLTransform::setPower(const float* rgb)
void CDLTransform::getPower(float* rgb) const
void CDLTransform::setSOP(const float* vec9)
void CDLTransform::getSOP(float* vec9) const

ASC_SAT

void CDLTransform::setSat(float sat)
float CDLTransform::getSat() const
void CDLTransform::getSatLumaCoefs(float* rgb) const

These are hard-coded, by spec, to r709

Metadata

These do not affect the image processing, but are often useful for pipeline purposes and are included in the serialization.

void CDLTransform::setID(const char* id)

Unique Identifier for this correction

const char* CDLTransform::getID() const
void CDLTransform::setDescription(const char* desc)

Textual description of color correction (stored on the SOP)

const char* CDLTransform::getDescription() const
std::ostream& operator<<(std::ostream&, const CDLTransform&)

class ColorSpaceTransform
static ColorSpaceTransformRcPtr ColorSpaceTransform::Create()
TransformRcPtr ColorSpaceTransform::createEditableCopy() const
TransformDirection ColorSpaceTransform::getDirection() const
void ColorSpaceTransform::setDirection(TransformDirection dir)
const char* ColorSpaceTransform::getSrc() const
void ColorSpaceTransform::setSrc(const char* src)
const char* ColorSpaceTransform::getDst() const
void ColorSpaceTransform::setDst(const char* dst)
std::ostream& operator<<(std::ostream&, const ColorSpaceTransform&)

class DisplayTransform
static DisplayTransformRcPtr DisplayTransform::Create()
TransformRcPtr DisplayTransform::createEditableCopy() const
TransformDirection DisplayTransform::getDirection() const
void DisplayTransform::setDirection(TransformDirection dir)
void DisplayTransform::setInputColorSpaceName(const char* name)

Step 0. Specify the incoming color space

const char* DisplayTransform::getInputColorSpaceName() const
void DisplayTransform::setLinearCC(const ConstTransformRcPtr& cc)

Step 1: Apply a Color Correction, in ROLE_SCENE_LINEAR

ConstTransformRcPtr DisplayTransform::getLinearCC() const
void DisplayTransform::setColorTimingCC(const ConstTransformRcPtr& cc)

Step 2: Apply a color correction, in ROLE_COLOR_TIMING

ConstTransformRcPtr DisplayTransform::getColorTimingCC() const
void DisplayTransform::setChannelView(const ConstTransformRcPtr& transform)

Step 3: Apply the Channel Viewing Swizzle (mtx)

ConstTransformRcPtr DisplayTransform::getChannelView() const
void DisplayTransform::setDisplay(const char* display)

Step 4: Apply the output display transform This is controlled by the specification of (display, view)

const char* DisplayTransform::getDisplay() const
void DisplayTransform::setView(const char* view)

Specify which view transform to use

const char* DisplayTransform::getView() const
void DisplayTransform::setDisplayCC(const ConstTransformRcPtr& cc)

Step 5: Apply a post display transform color correction

ConstTransformRcPtr DisplayTransform::getDisplayCC() const
void DisplayTransform::setLooksOverride(const char* looks)

A user can optionally override the looks that are, by default, used with the expected display / view combination. A common use case for this functionality is in an image viewing app, where per-shot looks are supported. If for some reason a per-shot look is not defined for the current Context, the Config::getProcessor fcn will not succeed by default. Thus, with this mechanism the viewing app could override to looks = “”, and this will allow image display to continue (though hopefully) the interface would reflect this fallback option.)

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 absense of either)

const char* DisplayTransform::getLooksOverride() const
void DisplayTransform::setLooksOverrideEnabled(bool enabled)

Specifiy whether the lookOverride should be used, or not. This is a speparate flag, as it’s often useful to override “looks” to an empty string

bool DisplayTransform::getLooksOverrideEnabled() const
std::ostream& operator<<(std::ostream&, const DisplayTransform&)

class ExponentTransform

Represents exponent transform: pow( clamp(color), value)

If the exponent is 1.0, this will not clamp. Otherwise, the input color will be clamped between [0.0, inf]

static ExponentTransformRcPtr ExponentTransform::Create()
TransformRcPtr ExponentTransform::createEditableCopy() const
TransformDirection ExponentTransform::getDirection() const
void ExponentTransform::setDirection(TransformDirection dir)
void ExponentTransform::setValue(const float* vec4)
void ExponentTransform::getValue(float* vec4) const
std::ostream& operator<<(std::ostream&, const ExponentTransform&)

class FileTransform
static FileTransformRcPtr FileTransform::Create()
TransformRcPtr FileTransform::createEditableCopy() const
TransformDirection FileTransform::getDirection() const
void FileTransform::setDirection(TransformDirection dir)
const char* FileTransform::getSrc() const
void FileTransform::setSrc(const char* src)
const char* FileTransform::getCCCId() const
void FileTransform::setCCCId(const char* id)
Interpolation FileTransform::getInterpolation() const
void FileTransform::setInterpolation(Interpolation interp)
static int FileTransform::getNumFormats()

get the number of lut readers

static const char* FileTransform::getFormatNameByIndex(int index)

get the lut readers at index, return empty string if an invalid index is specified

static const char* FileTransform::getFormatExtensionByIndex(int index)

get the lut reader extension at index, return empty string if an invalid index is specified

std::ostream& operator<<(std::ostream&, const FileTransform&)

class GroupTransform
static GroupTransformRcPtr GroupTransform::Create()
TransformRcPtr GroupTransform::createEditableCopy() const
TransformDirection GroupTransform::getDirection() const
void GroupTransform::setDirection(TransformDirection dir)
ConstTransformRcPtr GroupTransform::getTransform(int index) const
int GroupTransform::size() const
void GroupTransform::push_back(const ConstTransformRcPtr& transform)
void GroupTransform::clear()
bool GroupTransform::empty() const
std::ostream& operator<<(std::ostream&, const GroupTransform&)

class LogTransform

Represents log transform: log(color, base)

  • The input will be clamped for negative numbers.
  • Default base is 2.0
  • Only the rgb channels are affected
static LogTransformRcPtr LogTransform::Create()
TransformRcPtr LogTransform::createEditableCopy() const
TransformDirection LogTransform::getDirection() const
void LogTransform::setDirection(TransformDirection dir)
void LogTransform::setBase(float val)
float LogTransform::getBase() const
std::ostream& operator<<(std::ostream&, const LogTransform&)

class LookTransform
static LookTransformRcPtr LookTransform::Create()
TransformRcPtr LookTransform::createEditableCopy() const
TransformDirection LookTransform::getDirection() const
void LookTransform::setDirection(TransformDirection dir)
const char* LookTransform::getSrc() const
void LookTransform::setSrc(const char* src)
const char* LookTransform::getDst() const
void LookTransform::setDst(const char* dst)
void LookTransform::setLooks(const char* looks)

Specify looks to apply. Looks is a potentially comma (or colon) delimited list of look names, Where +/- prefixes are optionally allowed to denote forward/inverse look specification. (And forward is assumed in the absense of either)

const char* LookTransform::getLooks() const
std::ostream& operator<<(std::ostream&, const LookTransform&)

class MatrixTransform

Represents an MX+B Matrix transform

static MatrixTransformRcPtr MatrixTransform::Create()
TransformRcPtr MatrixTransform::createEditableCopy() const
TransformDirection MatrixTransform::getDirection() const
void MatrixTransform::setDirection(TransformDirection dir)
bool MatrixTransform::equals(const MatrixTransform& other) const
void MatrixTransform::setValue(const float* m44, const float* offset4)
void MatrixTransform::getValue(float* m44, float* offset4) const
void MatrixTransform::setMatrix(const float* m44)
void MatrixTransform::getMatrix(float* m44) const
void MatrixTransform::setOffset(const float* offset4)
void MatrixTransform::getOffset(float* offset4) const

Convenience functions

to get the mtx and offset corresponding to higher-level concepts

Note

These can throw an exception if for any component oldmin == oldmax. (divide by 0)

static void MatrixTransform::Fit(float* m44, float* offset4, const float* oldmin4, const float* oldmax4, const float* newmin4, const float* newmax4)
static void MatrixTransform::Identity(float* m44, float* offset4)
static void MatrixTransform::Sat(float* m44, float* offset4, float sat, const float* lumaCoef3)
static void MatrixTransform::Scale(float* m44, float* offset4, const float* scale4)
static void MatrixTransform::View(float* m44, float* offset4, int* channelHot4, const float* lumaCoef3)
std::ostream& operator<<(std::ostream&, const MatrixTransform&)

class TruelightTransform

Truelight transform using its API

static TruelightTransformRcPtr TruelightTransform::Create()
TransformRcPtr TruelightTransform::createEditableCopy() const
TransformDirection TruelightTransform::getDirection() const
void TruelightTransform::setDirection(TransformDirection dir)
void TruelightTransform::setConfigRoot(const char* configroot)
const char* TruelightTransform::getConfigRoot() const
void TruelightTransform::setProfile(const char* profile)
const char* TruelightTransform::getProfile() const
void TruelightTransform::setCamera(const char* camera)
const char* TruelightTransform::getCamera() const
void TruelightTransform::setInputDisplay(const char* display)
const char* TruelightTransform::getInputDisplay() const
void TruelightTransform::setRecorder(const char* recorder)
const char* TruelightTransform::getRecorder() const
void TruelightTransform::setPrint(const char* print)
const char* TruelightTransform::getPrint() const
void TruelightTransform::setLamp(const char* lamp)
const char* TruelightTransform::getLamp() const
void TruelightTransform::setOutputCamera(const char* camera)
const char* TruelightTransform::getOutputCamera() const
void TruelightTransform::setDisplay(const char* display)
const char* TruelightTransform::getDisplay() const
void TruelightTransform::setCubeInput(const char* type)
const char* TruelightTransform::getCubeInput() const
std::ostream& operator<<(std::ostream&, const TruelightTransform&)