| 517 | } |
| 518 | |
| 519 | bool |
| 520 | CopyRectanglePlugin::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 | |
| 558 | void |
| 559 | CopyRectanglePlugin::getClipPreferences(ClipPreferencesSetter &clipPreferences) |
nothing calls this directly
no test coverage detected