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

Function parse_luts

src/apps/ociobakelut/main.cpp:431–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429// resulting in an invalid (or at least undesired) scale value.
430
431OCIO::GroupTransformRcPtr parse_luts(int argc, const char *argv[])
432{
433 OCIO::GroupTransformRcPtr groupTransform = OCIO::GroupTransform::Create();
434 const char *lastCCCId = NULL; // Ugly to use this but using GroupTransform::getTransform()
435 // returns a const object so we must set this
436 // prior to using --lut for now.
437
438 for(int i=0; i<argc; ++i)
439 {
440 std::string arg(argv[i]);
441
442 if(arg == "--lut" || arg == "-lut")
443 {
444 if(i+1>=argc)
445 {
446 throw OCIO::Exception("Error parsing --lut. Invalid num args");
447 }
448
449 OCIO::FileTransformRcPtr t = OCIO::FileTransform::Create();
450 t->setSrc(argv[i+1]);
451 t->setInterpolation(OCIO::INTERP_BEST);
452 if (lastCCCId)
453 {
454 t->setCCCId(lastCCCId);
455 }
456 groupTransform->appendTransform(t);
457
458 i += 1;
459 }
460 else if(arg == "--cccid" || arg == "-cccid")
461 {
462 if(i+1>=argc)
463 {
464 throw OCIO::Exception("Error parsing --cccid. Invalid num args");
465 }
466
467 lastCCCId = argv[i+1];
468
469 i += 1;
470 }
471 else if(arg == "--invlut" || arg == "-invlut")
472 {
473 if(i+1>=argc)
474 {
475 throw OCIO::Exception("Error parsing --invlut. Invalid num args");
476 }
477
478 OCIO::FileTransformRcPtr t = OCIO::FileTransform::Create();
479 t->setSrc(argv[i+1]);
480 t->setInterpolation(OCIO::INTERP_BEST);
481 t->setDirection(OCIO::TRANSFORM_DIR_INVERSE);
482 groupTransform->appendTransform(t);
483
484 i += 1;
485 }
486 else if(arg == "--slope" || arg == "-slope")
487 {
488 if(i+3>=argc)

Callers 1

mainFunction · 0.85

Calls 9

appendTransformMethod · 0.80
setSrcMethod · 0.45
setInterpolationMethod · 0.45
setCCCIdMethod · 0.45
setDirectionMethod · 0.45
setSlopeMethod · 0.45
setOffsetMethod · 0.45
setPowerMethod · 0.45
setSatMethod · 0.45

Tested by

no test coverage detected