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

Function getUnmappedComponentsForInput

Engine/EffectInstance.cpp:5327–5356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5325}
5326
5327static int
5328getUnmappedComponentsForInput(EffectInstance* self,
5329 int inputNb,
5330 const std::vector<EffectInstancePtr>& inputs,
5331 int firstNonOptionalConnectedInputComps)
5332{
5333 int rawComps;
5334
5335 if (inputs[inputNb]) {
5336 rawComps = inputs[inputNb]->getMetadataNComps(-1);
5337 } else {
5338 ///The node is not connected but optional, return the closest supported components
5339 ///of the first connected non optional input.
5340 rawComps = firstNonOptionalConnectedInputComps;
5341 }
5342 if (rawComps) {
5343 if (!rawComps) {
5344 //None comps
5345 return rawComps;
5346 } else {
5347 ImagePlaneDesc supportedComps = self->findClosestSupportedComponents(inputNb, ImagePlaneDesc::mapNCompsToColorPlane(rawComps)); //turn that into a comp the plugin expects on that clip
5348 rawComps = supportedComps.getNumComponents();
5349 }
5350 }
5351 if (!rawComps) {
5352 rawComps = 4; // default to RGBA
5353 }
5354
5355 return rawComps;
5356}
5357
5358StatusEnum
5359EffectInstance::getDefaultMetadata(NodeMetadata &metadata)

Callers 1

getDefaultMetadataMethod · 0.85

Calls 3

getMetadataNCompsMethod · 0.80
getNumComponentsMethod · 0.45

Tested by

no test coverage detected