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

Method getColorSpace

src/OpenColorIO/ViewingRules.cpp:240–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240const char * ViewingRules::getColorSpace(size_t ruleIndex, size_t colorSpaceIndex) const
241{
242 m_impl->validatePosition(ruleIndex);
243 const auto numCS = m_impl->m_rules[ruleIndex]->m_colorSpaces.getNumTokens();
244 if (static_cast<int>(colorSpaceIndex) >= numCS)
245 {
246 std::ostringstream oss;
247 oss << "Viewing rules: rule '" << std::string(m_impl->m_rules[ruleIndex]->getName())
248 << "' at index '" << ruleIndex << "': colorspace index '" << colorSpaceIndex
249 << "' is invalid. There are only '" << numCS << "' colorspaces.";
250 throw Exception(oss.str().c_str());
251 }
252 return m_impl->m_rules[ruleIndex]->m_colorSpaces.getToken(static_cast<int>(colorSpaceIndex));
253}
254
255void ViewingRules::addColorSpace(size_t ruleIndex, const char * colorSpace)
256{

Callers 1

ViewingRules.cppFile · 0.45

Calls 4

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

Tested by

no test coverage detected