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

Method getEncoding

src/OpenColorIO/ViewingRules.cpp:288–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288const char * ViewingRules::getEncoding(size_t ruleIndex, size_t encodingIndex) const
289{
290 m_impl->validatePosition(ruleIndex);
291 const auto numEnc = m_impl->m_rules[ruleIndex]->m_encodings.getNumTokens();
292 if (static_cast<int>(encodingIndex) >= numEnc)
293 {
294 std::ostringstream oss;
295 oss << "Viewing rules: rule '" << std::string(m_impl->m_rules[ruleIndex]->getName())
296 << "' at index '" << ruleIndex << "': encoding index '" << encodingIndex
297 << "' is invalid. There are only '" << numEnc << "' encodings.";
298 throw Exception(oss.str().c_str());
299 }
300 return m_impl->m_rules[ruleIndex]->m_encodings.getToken(static_cast<int>(encodingIndex));
301}
302
303void ViewingRules::addEncoding(size_t ruleIndex, const char * encoding)
304{

Callers 2

IsEncodingUsedFunction · 0.45
ViewingRules.cppFile · 0.45

Calls 4

getNumTokensMethod · 0.80
getTokenMethod · 0.80
validatePositionMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected