Skip to content

Commit

Permalink
Merge: if an output channel is checked, do not be identity if the B c…
Browse files Browse the repository at this point in the history
…hannel is unchecked
  • Loading branch information
MrKepzie committed Jul 25, 2017
1 parent 00e5c66 commit ae3326d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Merge/Merge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1295,15 +1295,28 @@ MergePlugin::isIdentity(const IsIdentityArguments &args,
}

bool outputChannels[4];
bool srcBChannels[4];
for (int c = 0; c < 4; ++c) {
_outputChannels[c]->getValueAtTime(time, outputChannels[c]);
_bChannels[c]->getValueAtTime(time, srcBChannels[c]);
}
if (!outputChannels[0] && !outputChannels[1] && !outputChannels[2] && !outputChannels[3] && plane == kFnOfxImagePlaneColour) {
identityClip = _srcClipB;

return true;
}

// For each checked output channels, if srcB channel is unchecked, we are not identity
for (int i = 0; i < 4; ++i) {
if (!outputChannels[i]) {
continue;
}
if (!srcBChannels[i]) {
return false;
}
}


OfxRectI maskRoD;
bool maskRoDValid = false;
bool doMasking = ( ( !_maskApply || _maskApply->getValueAtTime(time) ) && _maskClip && _maskClip->isConnected() );
Expand All @@ -1329,6 +1342,10 @@ MergePlugin::isIdentity(const IsIdentityArguments &args,
return false;
}

if (Coords::rectIsInfinite(args.renderWindow)) {
return false;
}

// The region of effect is only the set of the intersections between the A inputs and the mask.
// If at least one of these regions intersects the renderwindow, the effect is not identity.

Expand Down

0 comments on commit ae3326d

Please sign in to comment.