MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / getRenderScaleRecursive

Method getRenderScaleRecursive

Engine/OfxImageEffectInstance.cpp:438–455  ·  view source on GitHub ↗

This is called whenever a param is changed by the plugin so that the recursive instanceChangedAction will be fed the correct renderScale

Source from the content-addressed store, hash-verified

436/// the recursive instanceChangedAction will be fed the correct
437/// renderScale
438void
439OfxImageEffectInstance::getRenderScaleRecursive(double &x,
440 double &y) const
441{
442 assert( getOfxEffectInstance() );
443 std::list<ViewerInstance*> attachedViewers;
444 getOfxEffectInstance()->getNode()->hasViewersConnected(&attachedViewers);
445 ///get the render scale of the 1st viewer
446 if ( !attachedViewers.empty() ) {
447 ViewerInstance* first = attachedViewers.front();
448 int mipMapLevel = first->getMipMapLevel();
449 x = Image::getScaleFromMipMapLevel( (unsigned int)mipMapLevel );
450 y = x;
451 } else {
452 x = 1.;
453 y = 1.;
454 }
455}
456
457OfxStatus
458OfxImageEffectInstance::getViewCount(int *nViews) const

Callers 1

Calls 5

getOfxEffectInstanceFunction · 0.85
hasViewersConnectedMethod · 0.80
emptyMethod · 0.80
getNodeMethod · 0.45
getMipMapLevelMethod · 0.45

Tested by

no test coverage detected