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

Function GetColorSpaceReferences

src/OpenColorIO/Config.cpp:176–207  ·  view source on GitHub ↗

Return the list of all color spaces referenced by the transform (including all sub-transforms in a group). All legal context variables are expanded, so if any are remaining, the caller may want to throw.

Source from the content-addressed store, hash-verified

174// a group). All legal context variables are expanded, so if any are remaining, the caller may want
175// to throw.
176void GetColorSpaceReferences(std::set<std::string> & colorSpaceNames,
177 const ConstTransformRcPtr & transform,
178 const ConstContextRcPtr & context)
179{
180 if(!transform) return;
181
182 if(ConstGroupTransformRcPtr groupTransform = \
183 DynamicPtrCast<const GroupTransform>(transform))
184 {
185 for(int i=0; i<groupTransform->getNumTransforms(); ++i)
186 {
187 GetColorSpaceReferences(colorSpaceNames, groupTransform->getTransform(i), context);
188 }
189 }
190 else if(ConstColorSpaceTransformRcPtr colorSpaceTransform = \
191 DynamicPtrCast<const ColorSpaceTransform>(transform))
192 {
193 colorSpaceNames.insert(context->resolveStringVar(colorSpaceTransform->getSrc()));
194 colorSpaceNames.insert(context->resolveStringVar(colorSpaceTransform->getDst()));
195 }
196 else if(ConstDisplayViewTransformRcPtr displayViewTransform = \
197 DynamicPtrCast<const DisplayViewTransform>(transform))
198 {
199 colorSpaceNames.insert(displayViewTransform->getSrc());
200 }
201 else if(ConstLookTransformRcPtr lookTransform = \
202 DynamicPtrCast<const LookTransform>(transform))
203 {
204 colorSpaceNames.insert(lookTransform->getSrc());
205 colorSpaceNames.insert(lookTransform->getDst());
206 }
207}
208
209// Views are stored in two vectors of objects, using pointers to temporarily group them.
210typedef std::vector<const View *> ViewPtrVec;

Callers 2

validateMethod · 0.85
isColorSpaceUsedMethod · 0.85

Calls 6

insertMethod · 0.80
getNumTransformsMethod · 0.45
getTransformMethod · 0.45
resolveStringVarMethod · 0.45
getSrcMethod · 0.45
getDstMethod · 0.45

Tested by

no test coverage detected