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

Method getIndexForColorSpace

src/OpenColorIO/Config.cpp:2527–2549  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2525}
2526
2527int Config::getIndexForColorSpace(const char * name) const
2528{
2529 ConstColorSpaceRcPtr cs = getColorSpace(name);
2530 if (!cs)
2531 {
2532 return -1;
2533 }
2534
2535 // Check to see if the name is an active color space.
2536 for (int idx = 0; idx < getNumColorSpaces(SEARCH_REFERENCE_SPACE_ALL,
2537 COLORSPACE_ACTIVE); ++idx)
2538 {
2539 if (strcmp(getColorSpaceNameByIndex(SEARCH_REFERENCE_SPACE_ALL, COLORSPACE_ACTIVE, idx),
2540 cs->getName()) == 0)
2541 {
2542 return idx;
2543 }
2544 }
2545
2546 // Requests for an inactive color space or a role mapping
2547 // to an inactive color space will both fail.
2548 return -1;
2549}
2550
2551void Config::setInactiveColorSpaces(const char * inactiveColorSpaces)
2552{

Callers 3

test_interfaceMethod · 0.95
OCIO_ADD_TESTFunction · 0.45
OCIO_ADD_TESTFunction · 0.45

Calls 1

getNameMethod · 0.45

Tested by 3

test_interfaceMethod · 0.76
OCIO_ADD_TESTFunction · 0.36
OCIO_ADD_TESTFunction · 0.36