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