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

Method getIndexForNamedTransform

src/OpenColorIO/Config.cpp:3146–3167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3144}
3145
3146int Config::getIndexForNamedTransform(const char * name) const noexcept
3147{
3148 ConstNamedTransformRcPtr nt = getNamedTransform(name);
3149 if (!nt)
3150 {
3151 return -1;
3152 }
3153
3154 // Check to see if the name is an active named transform.
3155 const auto num = getNumNamedTransforms(NAMEDTRANSFORM_ACTIVE);
3156 for (int idx = 0; idx < num; ++idx)
3157 {
3158 if (strcmp(getNamedTransformNameByIndex(NAMEDTRANSFORM_ACTIVE, idx), nt->getName()) == 0)
3159 {
3160 return idx;
3161 }
3162 }
3163
3164 // Requests for an inactive named transform or an inactive color space will both fail.
3165 return -1;
3166
3167}
3168
3169void Config::addNamedTransform(const ConstNamedTransformRcPtr & nt)
3170{

Callers 1

OCIO_ADD_TESTFunction · 0.80

Calls 1

getNameMethod · 0.45

Tested by 1

OCIO_ADD_TESTFunction · 0.64