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

Method render

Engine/DiskCacheNode.cpp:205–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205StatusEnum
206DiskCacheNode::render(const RenderActionArgs& args)
207{
208 assert(args.outputPlanes.size() == 1);
209
210 EffectInstancePtr input = getInput(0);
211 if (!input) {
212 return eStatusFailed;
213 }
214
215
216 const std::pair<ImagePlaneDesc, ImagePtr>& output = args.outputPlanes.front();
217
218 for (std::list<std::pair<ImagePlaneDesc, ImagePtr> >::const_iterator it = args.outputPlanes.begin(); it != args.outputPlanes.end(); ++it) {
219 RectI roiPixel;
220 ImagePtr srcImg = getImage(0, args.time, args.originalScale, args.view, NULL, &it->first, false /*mapToClipPrefs*/, true /*dontUpscale*/, eStorageModeRAM /*useOpenGL*/, 0 /*textureDepth*/, &roiPixel);
221 if (!srcImg) {
222 return eStatusFailed;
223 }
224 if ( srcImg->getMipMapLevel() != output.second->getMipMapLevel() ) {
225 throw std::runtime_error("Host gave image with wrong scale");
226 }
227 if ( ( srcImg->getComponents() != output.second->getComponents() ) || ( srcImg->getBitDepth() != output.second->getBitDepth() ) ) {
228 srcImg->convertToFormat( args.roi, getApp()->getDefaultColorSpaceForBitDepth( srcImg->getBitDepth() ),
229 getApp()->getDefaultColorSpaceForBitDepth( output.second->getBitDepth() ), 3, true, false, output.second.get() );
230 } else {
231 output.second->pasteFrom( *srcImg, args.roi, output.second->usesBitMap() && srcImg->usesBitMap() );
232 }
233 }
234
235 return eStatusOK;
236}
237
238bool
239DiskCacheNode::isHostChannelSelectorSupported(bool* /*defaultR*/,

Callers

nothing calls this directly

Calls 12

getAppFunction · 0.85
getComponentsMethod · 0.80
convertToFormatMethod · 0.80
pasteFromMethod · 0.80
usesBitMapMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getMipMapLevelMethod · 0.45
getBitDepthMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected