| 4221 | } |
| 4222 | |
| 4223 | void |
| 4224 | EffectInstance::getComponentsNeededDefault(double time, ViewIdx view, |
| 4225 | EffectInstance::ComponentsNeededMap* comps, |
| 4226 | std::list<ImagePlaneDesc>* passThroughPlanes, |
| 4227 | bool* processAllRequested, |
| 4228 | double* passThroughTime, |
| 4229 | int* passThroughView, |
| 4230 | std::bitset<4> *processChannels, |
| 4231 | int* passThroughInputNb) |
| 4232 | { |
| 4233 | *passThroughTime = time; |
| 4234 | *passThroughView = view; |
| 4235 | *passThroughInputNb = getNode()->getPreferredInput(); |
| 4236 | *processAllRequested = false; |
| 4237 | |
| 4238 | { |
| 4239 | std::list<ImagePlaneDesc> upstreamAvailableLayers; |
| 4240 | if (*passThroughInputNb != -1) { |
| 4241 | getAvailableLayers(time, view, *passThroughInputNb, &upstreamAvailableLayers); |
| 4242 | } |
| 4243 | |
| 4244 | // upstreamAvailableLayers now contain all available planes in input of this node |
| 4245 | *passThroughPlanes = upstreamAvailableLayers; |
| 4246 | |
| 4247 | } |
| 4248 | |
| 4249 | |
| 4250 | // Get the output needed components |
| 4251 | { |
| 4252 | |
| 4253 | std::vector<ImagePlaneDesc> clipPrefsAllComps; |
| 4254 | |
| 4255 | // The clipPrefsComps is the number of components desired by the plug-in in the |
| 4256 | // getTimeInvariantMetadatas action (getClipPreferences for OpenFX) mapped to the |
| 4257 | // color-plane. |
| 4258 | // |
| 4259 | // There's a special case for a plug-in that requests a 2 component image: |
| 4260 | // OpenFX does not support 2-component images by default. 2 types of plug-in |
| 4261 | // may request such images: |
| 4262 | // - non multi-planar effect that supports 2 component images, added with the Natron OpenFX extensions |
| 4263 | // - multi-planar effect that supports The Foundry Furnace plug-in suite: the value returned is either |
| 4264 | // disparity components or a motion vector components. |
| 4265 | // |
| 4266 | ImagePlaneDesc metadataPlane, metadataPairedPlane; |
| 4267 | getMetadataComponents(-1, &metadataPlane, &metadataPairedPlane); |
| 4268 | // Some plug-ins, such as The Foundry Furnace set the meta-data to disparity/motion vector, requiring |
| 4269 | // both planes to be computed at once (Forward/Backard for motion vector) (Left/Right for Disparity) |
| 4270 | if (metadataPlane.getNumComponents() > 0) { |
| 4271 | clipPrefsAllComps.push_back(metadataPlane); |
| 4272 | } |
| 4273 | if (metadataPairedPlane.getNumComponents() > 0) { |
| 4274 | clipPrefsAllComps.push_back(metadataPairedPlane); |
| 4275 | } |
| 4276 | if (clipPrefsAllComps.empty()) { |
| 4277 | // If metada are not set yet, at least append RGBA |
| 4278 | clipPrefsAllComps.push_back(ImagePlaneDesc::getRGBAComponents()); |
| 4279 | } |
| 4280 |
nothing calls this directly
no test coverage detected