| 238 | } |
| 239 | |
| 240 | const 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 | |
| 255 | void ViewingRules::addColorSpace(size_t ruleIndex, const char * colorSpace) |
| 256 | { |
no test coverage detected