ViewingRules

Caution

API Docs are a work in progress, expect them to improve over time.

class ViewingRules

ViewingRulesRcPtr createEditableCopy() const

The method clones the content decoupling the two instances.

size_t getNumEntries() const noexcept
size_t getIndexForRule(const char *ruleName) const

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

const char *getName(size_t ruleIndex) const

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

size_t getNumColorSpaces(size_t ruleIndex) const

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

const char *getColorSpace(size_t ruleIndex, size_t colorSpaceIndex) const

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

void addColorSpace(size_t ruleIndex, const char *colorSpace)

Add colorspace name. Will throw if:

  • RuleIndex is invalid.

  • :cpp:func:`ViewingRules::getNumEncodings`_ is not 0.

void removeColorSpace(size_t ruleIndex, size_t colorSpaceIndex)

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

size_t getNumEncodings(size_t ruleIndex) const

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

const char *getEncoding(size_t ruleIndex, size_t encodingIndex) const

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

void addEncoding(size_t ruleIndex, const char *encoding)

Add encoding name. Will throw if:

  • RuleIndex is invalid.

  • :cpp:func:`ViewingRules::getNumColorSpaces`_ is not 0.

void removeEncoding(size_t ruleIndex, size_t encodingIndex)

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

size_t getNumCustomKeys(size_t ruleIndex) const

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

const char *getCustomKeyName(size_t ruleIndex, size_t keyIndex) const

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

const char *getCustomKeyValue(size_t ruleIndex, size_t keyIndex) const

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

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

void 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 :cpp:func:ViewingRules::getNumEntries new rule will be added at the end. Will throw if:

  • RuleIndex is invalid (must be less than or equal to

    cpp:func:ViewingRules::getNumEntries).

  • RuleName already exists.

void removeRule(size_t ruleIndex)

Remove a rule. Throws if ruleIndex is not valid.

ViewingRules(const ViewingRules&) = delete
`ViewingRules`_ &operator=(const ViewingRules&) = delete
~ViewingRules()

-[ Public Static Functions ]-

ViewingRulesRcPtr Create()

Creates ViewingRules for a Config.

class ViewingRuleColorSpaceIterator
class ViewingRuleEncodingIterator
addColorSpace(self: PyOpenColorIO.ViewingRules, ruleIndex: int, colorSpaceName: str) → None
addEncoding(self: PyOpenColorIO.ViewingRules, ruleIndex: int, encodingName: str) → None
getColorSpaces(self: PyOpenColorIO.ViewingRules, ruleIndex: int) → OpenColorIO_v2_0dev::PyIterator<std::shared_ptr<OpenColorIO_v2_0dev::ViewingRules>, 0, unsigned long>
getCustomKeyName(self: PyOpenColorIO.ViewingRules, ruleIndex: int, key: int) → str
getCustomKeyValue(self: PyOpenColorIO.ViewingRules, ruleIndex: int, key: int) → str
getEncodings(self: PyOpenColorIO.ViewingRules, ruleIndex: int) → OpenColorIO_v2_0dev::PyIterator<std::shared_ptr<OpenColorIO_v2_0dev::ViewingRules>, 1, unsigned long>
getIndexForRule(self: PyOpenColorIO.ViewingRules, ruleName: str) → int
getName(self: PyOpenColorIO.ViewingRules, ruleIndex: int) → str
getNumCustomKeys(self: PyOpenColorIO.ViewingRules, ruleIndex: int) → int
getNumEntries(self: PyOpenColorIO.ViewingRules) → int
insertRule(self: PyOpenColorIO.ViewingRules, ruleIndex: int, name: str) → None
removeColorSpace(self: PyOpenColorIO.ViewingRules, ruleIndex: int, colorSpaceIndex: int) → None
removeEncoding(self: PyOpenColorIO.ViewingRules, ruleIndex: int, encodingIndex: int) → None
removeRule(self: PyOpenColorIO.ViewingRules, ruleIndex: int) → None
setCustomKey(self: PyOpenColorIO.ViewingRules, ruleIndex: int, key: str, value: str) → None