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.
| 174 | // a group). All legal context variables are expanded, so if any are remaining, the caller may want |
| 175 | // to throw. |
| 176 | void 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. |
| 210 | typedef std::vector<const View *> ViewPtrVec; |
no test coverage detected