MCPcopy Create free account
hub / github.com/MrKepzie/Natron / getImage

Method getImage

Engine/EffectInstance.cpp:717–1177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715}
716
717ImagePtr
718EffectInstance::getImage(int inputNb,
719 const double time,
720 const RenderScale & scale,
721 const ViewIdx view,
722 const RectD *optionalBoundsParam, //!< optional region in canonical coordinates
723 const ImagePlaneDesc* layer,
724 const bool mapToClipPrefs,
725 const bool dontUpscale,
726 const StorageModeEnum returnStorage,
727 const ImageBitDepthEnum* /*textureDepth*/, // < ignore requested texture depth because internally we use 32bit fp textures, so we offer the highest possible quality anyway.
728 RectI* roiPixel,
729 boost::shared_ptr<Transform::Matrix3x3>* transform)
730{
731 if (time != time) {
732 // time is NaN
733 return ImagePtr();
734 }
735
736 ///The input we want the image from
737 EffectInstPtr inputEffect;
738
739 //Check for transform redirections
740 boost::shared_ptr<InputMatrixMap> transformRedirections;
741 EffectDataTLSPtr tls = _imp->tlsData->getTLSData();
742 if (tls && tls->currentRenderArgs.validArgs) {
743 transformRedirections = tls->currentRenderArgs.transformRedirections;
744 if (transformRedirections) {
745 InputMatrixMap::const_iterator foundRedirection = transformRedirections->find(inputNb);
746 if ( ( foundRedirection != transformRedirections->end() ) && foundRedirection->second.newInputEffect ) {
747 inputEffect = foundRedirection->second.newInputEffect->getInput(foundRedirection->second.newInputNbToFetchFrom);
748 if (transform) {
749 *transform = foundRedirection->second.cat;
750 }
751 }
752 }
753 }
754
755 NodePtr node = getNode();
756
757 if (!inputEffect) {
758 inputEffect = getInput(inputNb);
759 }
760
761 ///Is this input a mask or not
762 bool isMask = isInputMask(inputNb);
763
764 ///If the input is a mask, this is the channel index in the layer of the mask channel
765 int channelForMask = -1;
766
767 ///Is this node a roto node or not. If so, find out if this input is the roto-brush
768 boost::shared_ptr<RotoContext> roto;
769 boost::shared_ptr<RotoDrawableItem> attachedStroke = node->getAttachedRotoItem();
770
771 if (attachedStroke) {
772 roto = attachedStroke->getContext();
773 }
774 bool useRotoInput = false;

Calls 15

isInputMaskFunction · 0.85
isInputRotoBrushFunction · 0.85
getBitDepthFunction · 0.85
getAppFunction · 0.85
RenderRoIArgsClass · 0.85
getAttachedRotoItemMethod · 0.80
isInputOnlyAlphaMethod · 0.80
emptyMethod · 0.80
getFrameViewRequestMethod · 0.80
getEffectInstanceMethod · 0.80

Tested by

no test coverage detected