| 2023 | } |
| 2024 | |
| 2025 | StatusEnum |
| 2026 | OfxEffectInstance::render(const RenderActionArgs& args) |
| 2027 | { |
| 2028 | if (!_imp->initialized) { |
| 2029 | return eStatusFailed; |
| 2030 | } |
| 2031 | |
| 2032 | assert( !args.outputPlanes.empty() ); |
| 2033 | |
| 2034 | const std::pair<ImagePlaneDesc, ImagePtr>& firstPlane = args.outputPlanes.front(); |
| 2035 | OfxRectI ofxRoI; |
| 2036 | ofxRoI.x1 = args.roi.left(); |
| 2037 | ofxRoI.x2 = args.roi.right(); |
| 2038 | ofxRoI.y1 = args.roi.bottom(); |
| 2039 | ofxRoI.y2 = args.roi.top(); |
| 2040 | int viewsCount = getApp()->getProject()->getProjectViewsCount(); |
| 2041 | OfxStatus stat; |
| 2042 | const std::string field = kOfxImageFieldNone; // TODO: support interlaced data |
| 2043 | bool multiPlanar = isMultiPlanar(); |
| 2044 | std::list<std::string> ofxPlanes; |
| 2045 | for (std::list<std::pair<ImagePlaneDesc, ImagePtr> >::const_iterator it = args.outputPlanes.begin(); |
| 2046 | it != args.outputPlanes.end(); ++it) { |
| 2047 | if (!multiPlanar) { |
| 2048 | // When not multi-planar, the components of the image will be the colorplane |
| 2049 | ofxPlanes.push_back(ImagePlaneDesc::mapPlaneToOFXPlaneString(it->second->getComponents())); |
| 2050 | } else { |
| 2051 | ofxPlanes.push_back(ImagePlaneDesc::mapPlaneToOFXPlaneString(it->first)); |
| 2052 | } |
| 2053 | } |
| 2054 | |
| 2055 | ///before calling render, set the render scale thread storage for each clip |
| 2056 | # ifdef DEBUG |
| 2057 | { |
| 2058 | // check the dimensions of output images |
| 2059 | const RectI & dstBounds = firstPlane.second->getBounds(); |
| 2060 | const RectD & dstRodCanonical = firstPlane.second->getRoD(); |
| 2061 | RectI dstRod; |
| 2062 | dstRodCanonical.toPixelEnclosing(args.mappedScale, firstPlane.second->getPixelAspectRatio(), &dstRod); |
| 2063 | |
| 2064 | if ( !supportsTiles() && !isDuringPaintStrokeCreationThreadLocal() ) { |
| 2065 | // http://openfx.sourceforge.net/Documentation/1.3/ofxProgrammingReference.html#kOfxImageEffectPropSupportsTiles |
| 2066 | // If a clip or plugin does not support tiled images, then the host should supply full RoD images to the effect whenever it fetches one. |
| 2067 | assert(dstRod.x1 == dstBounds.x1); |
| 2068 | assert(dstRod.x2 == dstBounds.x2); |
| 2069 | assert(dstRod.y1 == dstBounds.y1); |
| 2070 | assert(dstRod.y2 == dstBounds.y2); |
| 2071 | } |
| 2072 | if ( !supportsMultiResolution() ) { |
| 2073 | // http://openfx.sourceforge.net/Documentation/1.3/ofxProgrammingReference.html#kOfxImageEffectPropSupportsMultiResolution |
| 2074 | // Multiple resolution images mean... |
| 2075 | // input and output images can be of any size |
| 2076 | // input and output images can be offset from the origin |
| 2077 | // Commented-out: Some Furnace plug-ins from The Foundry (e.g F_Steadiness) are not supporting multi-resolution but actually produce an output |
| 2078 | // with a RoD different from the input |
| 2079 | /* assert(dstRod.x1 == 0); |
| 2080 | assert(dstRod.y1 == 0);*/ |
| 2081 | } |
| 2082 | } |
nothing calls this directly
no test coverage detected