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

Method isIdentity

SlitScan/SlitScan.cpp:364–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364bool
365SlitScanPlugin::isIdentity(const IsIdentityArguments &args,
366 Clip * &identityClip,
367 double &identityTime
368 , int& /*view*/, std::string& /*plane*/)
369{
370 const double time = args.time;
371 double retimeGain = _retimeGain->getValueAtTime(time);
372 RetimeFunctionEnum retimeFunction = (RetimeFunctionEnum)_retimeFunction->getValueAtTime(time);
373
374 if ( (retimeFunction == eRetimeFunctionRetimeMap) && !( _retimeMapClip && _retimeMapClip->isConnected() ) ) {
375 // no retime map, equivalent to value = 0 everywhere
376 retimeGain = 0.;
377 }
378
379 if (retimeGain == 0.) {
380 double retimeOffset = _retimeOffset->getValueAtTime(time);
381 bool retimeAbsolute = _retimeAbsolute->getValueAtTime(time);
382 identityTime = retimeAbsolute ? retimeOffset : (time + retimeOffset);
383 if (identityTime != (int)identityTime) {
384 FilterEnum filter = (FilterEnum)_filter->getValueAtTime(time);
385 if (filter == eFilterNearest) {
386 identityTime = std::floor(identityTime + 0.5);
387 } else {
388 return false; // result is blended
389 }
390 }
391 identityClip = _srcClip;
392
393 return true;
394 }
395
396 return false;
397}
398
399bool
400SlitScanPlugin::getRegionOfDefinition(const RegionOfDefinitionArguments &args,

Callers

nothing calls this directly

Calls 2

getValueAtTimeMethod · 0.80
isConnectedMethod · 0.80

Tested by

no test coverage detected