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

Method parseColorSpaceFromString

src/OpenColorIO/Config.cpp:2936–2962  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2934///////////////////////////////////////////////////////////////////////////
2935
2936const char * Config::parseColorSpaceFromString(const char * str) const
2937{
2938 int rightMostColorSpaceIndex = ParseColorSpaceFromString(*this, str);
2939
2940 // Index is using all color spaces.
2941 if(rightMostColorSpaceIndex>=0)
2942 {
2943 return getImpl()->m_allColorSpaces->getColorSpaceNameByIndex(rightMostColorSpaceIndex);
2944 }
2945
2946 if(!getImpl()->m_strictParsing)
2947 {
2948 // Is a default role defined?
2949 const char* csname = LookupRole(getImpl()->m_roles, ROLE_DEFAULT);
2950 if(csname && *csname)
2951 {
2952 const int csindex = getImpl()->getColorSpaceIndex(csname);
2953 if (-1 != csindex)
2954 {
2955 // This is necessary to not return a reference to a local variable.
2956 return getImpl()->m_allColorSpaces->getColorSpaceNameByIndex(csindex);
2957 }
2958 }
2959 }
2960
2961 return "";
2962}
2963
2964bool Config::isStrictParsingEnabled() const
2965{

Callers

nothing calls this directly

Calls 5

LookupRoleFunction · 0.85
getImplFunction · 0.50
getColorSpaceIndexMethod · 0.45

Tested by

no test coverage detected