| 203 | } |
| 204 | |
| 205 | StatusEnum |
| 206 | DiskCacheNode::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 | |
| 238 | bool |
| 239 | DiskCacheNode::isHostChannelSelectorSupported(bool* /*defaultR*/, |
nothing calls this directly
no test coverage detected