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

Method getComponentsNeededDefault

Engine/EffectInstance.cpp:4257–4415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4255}
4256
4257void
4258EffectInstance::getComponentsNeededDefault(double time, ViewIdx view,
4259 EffectInstance::ComponentsNeededMap* comps,
4260 std::list<ImagePlaneDesc>* passThroughPlanes,
4261 bool* processAllRequested,
4262 double* passThroughTime,
4263 int* passThroughView,
4264 std::bitset<4> *processChannels,
4265 int* passThroughInputNb)
4266{
4267 *passThroughTime = time;
4268 *passThroughView = view;
4269 *passThroughInputNb = getNode()->getPreferredInput();
4270 *processAllRequested = false;
4271
4272 {
4273 std::list<ImagePlaneDesc> upstreamAvailableLayers;
4274 if (*passThroughInputNb != -1) {
4275 getAvailableLayers(time, view, *passThroughInputNb, &upstreamAvailableLayers);
4276 }
4277
4278 // upstreamAvailableLayers now contain all available planes in input of this node
4279 *passThroughPlanes = upstreamAvailableLayers;
4280
4281 }
4282
4283
4284 // Get the output needed components
4285 {
4286
4287 std::vector<ImagePlaneDesc> clipPrefsAllComps;
4288
4289 // The clipPrefsComps is the number of components desired by the plug-in in the
4290 // getTimeInvariantMetadatas action (getClipPreferences for OpenFX) mapped to the
4291 // color-plane.
4292 //
4293 // There's a special case for a plug-in that requests a 2 component image:
4294 // OpenFX does not support 2-component images by default. 2 types of plug-in
4295 // may request such images:
4296 // - non multi-planar effect that supports 2 component images, added with the Natron OpenFX extensions
4297 // - multi-planar effect that supports The Foundry Furnace plug-in suite: the value returned is either
4298 // disparity components or a motion vector components.
4299 //
4300 ImagePlaneDesc metadataPlane, metadataPairedPlane;
4301 getMetadataComponents(-1, &metadataPlane, &metadataPairedPlane);
4302 // Some plug-ins, such as The Foundry Furnace set the meta-data to disparity/motion vector, requiring
4303 // both planes to be computed at once (Forward/Backard for motion vector) (Left/Right for Disparity)
4304 if (metadataPlane.getNumComponents() > 0) {
4305 clipPrefsAllComps.push_back(metadataPlane);
4306 }
4307 if (metadataPairedPlane.getNumComponents() > 0) {
4308 clipPrefsAllComps.push_back(metadataPairedPlane);
4309 }
4310 if (clipPrefsAllComps.empty()) {
4311 // If metada are not set yet, at least append RGBA
4312 clipPrefsAllComps.push_back(ImagePlaneDesc::getRGBAComponents());
4313 }
4314

Callers

nothing calls this directly

Calls 15

getAppFunction · 0.85
mergeLayersListFunction · 0.85
getPreferredInputMethod · 0.80
emptyMethod · 0.80
getProjectMethod · 0.80
getSelectedLayerMethod · 0.80
getNodeFunction · 0.70
getNumComponentsMethod · 0.45
push_backMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected