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

Method getView

src/OpenColorIO/Config.cpp:3475–3500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3473}
3474
3475const char * Config::getView(const char * display, int index) const
3476{
3477 if (!display || !*display) return "";
3478
3479 // Include all displays, do not limit to active displays. Consider active views only.
3480 DisplayMap::const_iterator iter = FindDisplay(getImpl()->m_displays, display);
3481 if(iter == getImpl()->m_displays.end()) return "";
3482
3483 const ViewPtrVec views = getImpl()->getViews(iter->second);
3484
3485 const StringUtils::StringVec masterViews{ GetViewNames(views) };
3486 StringUtils::StringVec activeViews = getImpl()->getActiveViews(masterViews);
3487
3488 if (index < 0 || static_cast<size_t>(index) >= activeViews.size())
3489 {
3490 return "";
3491 }
3492 int idx = FindInStringVecCaseIgnore(masterViews, activeViews[index]);
3493
3494 if(idx >= 0 && static_cast<size_t>(idx) < views.size())
3495 {
3496 return views[idx]->m_name.c_str();
3497 }
3498
3499 return "";
3500}
3501
3502int Config::getNumViews(const char * display, const char * colorspace) const
3503{

Callers 6

test_interfaceMethod · 0.95
getDisplayViewLooksMethod · 0.45
getDisplayViewRuleMethod · 0.45

Calls 10

FindDisplayFunction · 0.85
GetViewNamesFunction · 0.85
getViewsMethod · 0.80
getFilteredViewsMethod · 0.80
getImplFunction · 0.50
endMethod · 0.45
getActiveViewsMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by 1

test_interfaceMethod · 0.76