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

Method isIdentity

CopyRectangle/CopyRectangle.cpp:519–556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517}
518
519bool
520CopyRectanglePlugin::isIdentity(const IsIdentityArguments &args,
521 Clip * &identityClip,
522 double & /*identityTime*/
523 , int& /*view*/, std::string& /*plane*/)
524{
525 double mix;
526
527 _mix->getValueAtTime(args.time, mix);
528
529 if (mix == 0.) {
530 identityClip = _srcClipB;
531
532 return true;
533 }
534
535 bool doMasking = ( ( !_maskApply || _maskApply->getValueAtTime(args.time) ) && _maskClip && _maskClip->isConnected() );
536 if (doMasking) {
537 bool maskInvert;
538 _maskInvert->getValueAtTime(args.time, maskInvert);
539 if (!maskInvert) {
540 OfxRectI maskRoD;
541 if (getImageEffectHostDescription()->supportsMultiResolution) {
542 // In Sony Catalyst Edit, clipGetRegionOfDefinition returns the RoD in pixels instead of canonical coordinates.
543 // In hosts that do not support multiResolution (e.g. Sony Catalyst Edit), all inputs have the same RoD anyway.
544 Coords::toPixelEnclosing(_maskClip->getRegionOfDefinition(args.time), args.renderScale, _maskClip->getPixelAspectRatio(), &maskRoD);
545 // effect is identity if the renderWindow doesn't intersect the mask RoD
546 if ( !Coords::rectIntersection<OfxRectI>(args.renderWindow, maskRoD, 0) ) {
547 identityClip = _srcClipB;
548
549 return true;
550 }
551 }
552 }
553 }
554
555 return false;
556}
557
558void
559CopyRectanglePlugin::getClipPreferences(ClipPreferencesSetter &clipPreferences)

Callers

nothing calls this directly

Calls 3

getValueAtTimeMethod · 0.80
isConnectedMethod · 0.80
getRegionOfDefinitionMethod · 0.45

Tested by

no test coverage detected