| 196 | |
| 197 | |
| 198 | bool CollectContextVariables(const Config & config, |
| 199 | const Context & context, |
| 200 | TransformDirection direction, |
| 201 | const Look & look, |
| 202 | ContextRcPtr & usedContext) |
| 203 | { |
| 204 | bool foundContextVars = false; |
| 205 | |
| 206 | switch (direction) |
| 207 | { |
| 208 | case TRANSFORM_DIR_FORWARD: |
| 209 | { |
| 210 | ConstTransformRcPtr tr = look.getTransform(); |
| 211 | if (tr) |
| 212 | { |
| 213 | if (CollectContextVariables(config, context, tr, usedContext)) |
| 214 | { |
| 215 | foundContextVars = true; |
| 216 | } |
| 217 | } |
| 218 | else |
| 219 | { |
| 220 | tr = look.getInverseTransform(); |
| 221 | if (tr && CollectContextVariables(config, context, tr, usedContext)) |
| 222 | { |
| 223 | foundContextVars = true; |
| 224 | } |
| 225 | } |
| 226 | break; |
| 227 | } |
| 228 | case TRANSFORM_DIR_INVERSE: |
| 229 | { |
| 230 | ConstTransformRcPtr tr = look.getInverseTransform(); |
| 231 | if (tr) |
| 232 | { |
| 233 | if (CollectContextVariables(config, context, tr, usedContext)) |
| 234 | { |
| 235 | foundContextVars = true; |
| 236 | } |
| 237 | } |
| 238 | else |
| 239 | { |
| 240 | tr = look.getTransform(); |
| 241 | if (tr && CollectContextVariables(config, context, tr, usedContext)) |
| 242 | { |
| 243 | foundContextVars = true; |
| 244 | } |
| 245 | } |
| 246 | break; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | const char * ps = look.getProcessSpace(); |
| 251 | if (ps) |
| 252 | { |
| 253 | ConstColorSpaceRcPtr cs = config.getColorSpace(ps); |
| 254 | if (cs) |
| 255 | { |