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

Method isDefault

src/OpenColorIO/FileRules.cpp:872–888  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

870}
871
872bool FileRules::isDefault() const noexcept
873{
874 if (m_impl->m_rules.size() == 1)
875 {
876 const auto & rule = m_impl->m_rules[0];
877 if (rule->m_customKeys.getSize() == 0)
878 {
879 // NB: Don't need to check the rule name -- the default rule may not be removed, so if
880 // there is only one rule, it's the default one.
881 if (StringUtils::Compare(rule->getColorSpace(), ROLE_DEFAULT))
882 {
883 return true;
884 }
885 }
886 }
887 return false;
888}
889
890const char * FileRules::Impl::getColorSpaceFromFilepath(const Config & config,
891 const char * filePath) const

Callers 2

test_defaultMethod · 0.95
OCIO_ADD_TESTFunction · 0.80

Calls 4

CompareFunction · 0.85
getSizeMethod · 0.80
sizeMethod · 0.45
getColorSpaceMethod · 0.45

Tested by 2

test_defaultMethod · 0.76
OCIO_ADD_TESTFunction · 0.64