| 352 | namespace |
| 353 | { |
| 354 | OptimizationFlags EnvironmentOverride(OptimizationFlags oFlags) |
| 355 | { |
| 356 | const std::string envFlag = GetEnvVariable(OCIO_OPTIMIZATION_FLAGS_ENVVAR); |
| 357 | if (!envFlag.empty()) |
| 358 | { |
| 359 | try |
| 360 | { |
| 361 | // Use 0 to allow base to be determined by the format. |
| 362 | oFlags = static_cast<OptimizationFlags>(std::stoul(envFlag, nullptr, 0)); |
| 363 | } |
| 364 | catch (const std::exception & e) |
| 365 | { |
| 366 | std::string msg("Illegal value for "); |
| 367 | msg += OCIO_OPTIMIZATION_FLAGS_ENVVAR; |
| 368 | msg += ": "; |
| 369 | msg += e.what(); |
| 370 | throw Exception(msg.c_str()); |
| 371 | } |
| 372 | } |
| 373 | return oFlags; |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | ConstProcessorRcPtr Processor::Impl::getOptimizedProcessor(OptimizationFlags oFlags) const |