MCPcopy Create free account
hub / github.com/NatronGitHub/openfx-misc / isIdentity

Method isIdentity

PLogLin/PLogLin.cpp:711–768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711bool
712PLogLinPlugin::isIdentity(const IsIdentityArguments &args,
713 Clip * &identityClip,
714 double & /*identityTime*/
715 , int& /*view*/, std::string& /*plane*/)
716{
717 //std::cout << "isIdentity!\n";
718 const double time = args.time;
719 double mix;
720
721 _mix->getValueAtTime(time, mix);
722
723 if (mix == 0. /*|| (!processR && !processG && !processB)*/) {
724 identityClip = _srcClip;
725
726 return true;
727 }
728
729 {
730 bool processR;
731 bool processG;
732 bool processB;
733 _processR->getValueAtTime(time, processR);
734 _processG->getValueAtTime(time, processG);
735 _processB->getValueAtTime(time, processB);
736 if (!processR && !processG && !processB) {
737 identityClip = _srcClip;
738
739 return true;
740 }
741 }
742
743 // TODO: which plugin parameter values give identity?
744 //if (...) {
745 // identityClip = _srcClip;
746 // //std::cout << "isIdentity! true\n";
747 // return true;
748 //}
749
750 bool doMasking = ( ( !_maskApply || _maskApply->getValueAtTime(time) ) && _maskClip && _maskClip->isConnected() );
751 if (doMasking) {
752 bool maskInvert;
753 _maskInvert->getValueAtTime(time, maskInvert);
754 if (!maskInvert) {
755 OfxRectI maskRoD;
756 Coords::toPixelEnclosing(_maskClip->getRegionOfDefinition(time), args.renderScale, _maskClip->getPixelAspectRatio(), &maskRoD);
757 // effect is identity if the renderWindow doesn't intersect the mask RoD
758 if ( !Coords::rectIntersection<OfxRectI>(args.renderWindow, maskRoD, 0) ) {
759 identityClip = _srcClip;
760
761 return true;
762 }
763 }
764 }
765
766 //std::cout << "isIdentity! false\n";
767 return false;
768} // PLogLinPlugin::isIdentity

Callers

nothing calls this directly

Calls 3

getValueAtTimeMethod · 0.80
isConnectedMethod · 0.80
getRegionOfDefinitionMethod · 0.45

Tested by

no test coverage detected