MCPcopy Create free account
hub / github.com/AcademySoftwareFoundation/OpenColorIO / addEncoding

Method addEncoding

src/OpenColorIO/ViewingRules.cpp:303–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303void ViewingRules::addEncoding(size_t ruleIndex, const char * encoding)
304{
305 m_impl->validatePosition(ruleIndex);
306 if (!encoding || !*encoding)
307 {
308 std::ostringstream oss;
309 oss << "Viewing rules: rule '" << std::string(m_impl->m_rules[ruleIndex]->getName())
310 << "' at index '" << ruleIndex << "': encoding should have a non-empty name.";
311 throw Exception(oss.str().c_str());
312 }
313 if (m_impl->m_rules[ruleIndex]->m_colorSpaces.getNumTokens() != 0)
314 {
315 std::ostringstream oss;
316 oss << "Viewing rules: rule '" << std::string(m_impl->m_rules[ruleIndex]->getName())
317 << "' at index '" << ruleIndex
318 << "': encoding can't be added if there are colorspaces.";
319 throw Exception(oss.str().c_str());
320 }
321 m_impl->m_rules[ruleIndex]->m_encodings.addToken(encoding);
322}
323
324void ViewingRules::removeEncoding(size_t ruleIndex, size_t encodingIndex)
325{

Callers 8

_insert_ruleMethod · 0.80
loadFunction · 0.80
copyViewingRuleFunction · 0.80
test_copyMethod · 0.80
test_color_spacesMethod · 0.80
test_encodingsMethod · 0.80
test_configMethod · 0.80
OCIO_ADD_TESTFunction · 0.80

Calls 4

getNumTokensMethod · 0.80
addTokenMethod · 0.80
validatePositionMethod · 0.45
getNameMethod · 0.45

Tested by 5

test_copyMethod · 0.64
test_color_spacesMethod · 0.64
test_encodingsMethod · 0.64
test_configMethod · 0.64
OCIO_ADD_TESTFunction · 0.64