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

#include <OpenColorIO.h>

Public Member Functions

ViewingRulesRcPtr createEditableCopy () const
 The method clones the content decoupling the two instances. More...
 
size_t getNumEntries () const noexcept
 
size_t getIndexForRule (const char *ruleName) const
 
const char * getName (size_t ruleIndex) const
 Get name of the rule. Will throw if ruleIndex is invalid. More...
 
size_t getNumColorSpaces (size_t ruleIndex) const
 Get number of colorspaces. Will throw if ruleIndex is invalid. More...
 
const char * getColorSpace (size_t ruleIndex, size_t colorSpaceIndex) const
 Get colorspace name. Will throw if ruleIndex or colorSpaceIndex is invalid. More...
 
void addColorSpace (size_t ruleIndex, const char *colorSpace)
 Add colorspace name. Will throw if: More...
 
void removeColorSpace (size_t ruleIndex, size_t colorSpaceIndex)
 Remove colorspace. Will throw if ruleIndex or colorSpaceIndex is invalid. More...
 
size_t getNumEncodings (size_t ruleIndex) const
 Get number of encodings. Will throw if ruleIndex is invalid. More...
 
const char * getEncoding (size_t ruleIndex, size_t encodingIndex) const
 Get encoding name. Will throw if ruleIndex or encodingIndex is invalid. More...
 
void addEncoding (size_t ruleIndex, const char *encoding)
 Add encoding name. Will throw if: More...
 
void removeEncoding (size_t ruleIndex, size_t encodingIndex)
 Remove encoding. Will throw if ruleIndex or encodingIndex is invalid. More...
 
size_t getNumCustomKeys (size_t ruleIndex) const
 Get number of key/value pairs. Will throw if ruleIndex is invalid. More...
 
const char * getCustomKeyName (size_t ruleIndex, size_t keyIndex) const
 Get name of key. Will throw if ruleIndex or keyIndex is invalid. More...
 
const char * getCustomKeyValue (size_t ruleIndex, size_t keyIndex) const
 Get value for the key. Will throw if ruleIndex or keyIndex is invalid. More...
 
void setCustomKey (size_t ruleIndex, const char *key, const char *value)
 
void insertRule (size_t ruleIndex, const char *ruleName)
 Insert a rule at a given ruleIndex. More...
 
void removeRule (size_t ruleIndex)
 Remove a rule. Throws if ruleIndex is not valid. More...
 
 ViewingRules (const ViewingRules &)=delete
 
ViewingRulesoperator= (const ViewingRules &)=delete
 
virtual ~ViewingRules ()
 Do not use (needed only for pybind11). More...
 

Static Public Member Functions

static ViewingRulesRcPtr Create ()
 Creates ViewingRules for a Config. More...
 

Friends

class Config
 

Detailed Description

ViewingRules

Viewing Rules allow config authors to filter the list of views an application should offer based on the color space of an image. For example, a config may define a large number of views but not all of them may be appropriate for use with all color spaces. E.g., some views may be intended for use with scene-linear color space encodings and others with video color space encodings.

Each rule has a name key for applications to refer to the rule. Name values must be unique (using case insensitive comparison). Viewing Rules may also have the following keys:

  • colorspaces: Either a single colorspace name or a list of names.
  • encodings: One or more strings to be found in the colorspace's encoding attribute. Either this attribute or colorspaces must be present, but not both.
  • custom : Allows arbitrary key / value string pairs, similar to FileRules.

Getters and setters are using the rule position, they will throw if the position is not valid.

Definition at line 1603 of file OpenColorIO.h.

Constructor & Destructor Documentation

OCIO_NAMESPACE::ViewingRules::ViewingRules ( const ViewingRules )
delete
virtual OCIO_NAMESPACE::ViewingRules::~ViewingRules ( )
virtual

Do not use (needed only for pybind11).

Member Function Documentation

void OCIO_NAMESPACE::ViewingRules::addColorSpace ( size_t  ruleIndex,
const char *  colorSpace 
)

Add colorspace name. Will throw if:

void OCIO_NAMESPACE::ViewingRules::addEncoding ( size_t  ruleIndex,
const char *  encoding 
)

Add encoding name. Will throw if:

static ViewingRulesRcPtr OCIO_NAMESPACE::ViewingRules::Create ( )
static

Creates ViewingRules for a Config.

ViewingRulesRcPtr OCIO_NAMESPACE::ViewingRules::createEditableCopy ( ) const

The method clones the content decoupling the two instances.

const char* OCIO_NAMESPACE::ViewingRules::getColorSpace ( size_t  ruleIndex,
size_t  colorSpaceIndex 
) const

Get colorspace name. Will throw if ruleIndex or colorSpaceIndex is invalid.

const char* OCIO_NAMESPACE::ViewingRules::getCustomKeyName ( size_t  ruleIndex,
size_t  keyIndex 
) const

Get name of key. Will throw if ruleIndex or keyIndex is invalid.

const char* OCIO_NAMESPACE::ViewingRules::getCustomKeyValue ( size_t  ruleIndex,
size_t  keyIndex 
) const

Get value for the key. Will throw if ruleIndex or keyIndex is invalid.

const char* OCIO_NAMESPACE::ViewingRules::getEncoding ( size_t  ruleIndex,
size_t  encodingIndex 
) const

Get encoding name. Will throw if ruleIndex or encodingIndex is invalid.

size_t OCIO_NAMESPACE::ViewingRules::getIndexForRule ( const char *  ruleName) const

Get the index from the rule name. Will throw if there is no rule named ruleName.

const char* OCIO_NAMESPACE::ViewingRules::getName ( size_t  ruleIndex) const

Get name of the rule. Will throw if ruleIndex is invalid.

size_t OCIO_NAMESPACE::ViewingRules::getNumColorSpaces ( size_t  ruleIndex) const

Get number of colorspaces. Will throw if ruleIndex is invalid.

size_t OCIO_NAMESPACE::ViewingRules::getNumCustomKeys ( size_t  ruleIndex) const

Get number of key/value pairs. Will throw if ruleIndex is invalid.

size_t OCIO_NAMESPACE::ViewingRules::getNumEncodings ( size_t  ruleIndex) const

Get number of encodings. Will throw if ruleIndex is invalid.

size_t OCIO_NAMESPACE::ViewingRules::getNumEntries ( ) const
noexcept
void OCIO_NAMESPACE::ViewingRules::insertRule ( size_t  ruleIndex,
const char *  ruleName 
)

Insert a rule at a given ruleIndex.

Rule currently at ruleIndex will be pushed to index: ruleIndex + 1. If ruleIndex is ViewingRules::getNumEntries, a new rule will be added at the end. Will throw if:

ViewingRules& OCIO_NAMESPACE::ViewingRules::operator= ( const ViewingRules )
delete
void OCIO_NAMESPACE::ViewingRules::removeColorSpace ( size_t  ruleIndex,
size_t  colorSpaceIndex 
)

Remove colorspace. Will throw if ruleIndex or colorSpaceIndex is invalid.

void OCIO_NAMESPACE::ViewingRules::removeEncoding ( size_t  ruleIndex,
size_t  encodingIndex 
)

Remove encoding. Will throw if ruleIndex or encodingIndex is invalid.

void OCIO_NAMESPACE::ViewingRules::removeRule ( size_t  ruleIndex)

Remove a rule. Throws if ruleIndex is not valid.

void OCIO_NAMESPACE::ViewingRules::setCustomKey ( size_t  ruleIndex,
const char *  key,
const char *  value 
)

Adds a key/value or replace value if key exists. Setting a NULL or an empty value will erase the key. Will throw if ruleIndex is invalid.

Friends And Related Function Documentation

friend class Config
friend

Definition at line 1689 of file OpenColorIO.h.


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