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

Function getUnmappedComponentsForInput

Engine/EffectInstance.cpp:5253–5282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5251}
5252
5253static int
5254getUnmappedComponentsForInput(EffectInstance* self,
5255 int inputNb,
5256 const std::vector<EffectInstPtr>& inputs,
5257 int firstNonOptionalConnectedInputComps)
5258{
5259 int rawComps;
5260
5261 if (inputs[inputNb]) {
5262 rawComps = inputs[inputNb]->getMetadataNComps(-1);
5263 } else {
5264 ///The node is not connected but optional, return the closest supported components
5265 ///of the first connected non optional input.
5266 rawComps = firstNonOptionalConnectedInputComps;
5267 }
5268 if (rawComps) {
5269 if (!rawComps) {
5270 //None comps
5271 return rawComps;
5272 } else {
5273 ImagePlaneDesc supportedComps = self->findClosestSupportedComponents(inputNb, ImagePlaneDesc::mapNCompsToColorPlane(rawComps)); //turn that into a comp the plugin expects on that clip
5274 rawComps = supportedComps.getNumComponents();
5275 }
5276 }
5277 if (!rawComps) {
5278 rawComps = 4; // default to RGBA
5279 }
5280
5281 return rawComps;
5282}
5283
5284StatusEnum
5285EffectInstance::getDefaultMetadata(NodeMetadata &metadata)

Callers 1

getDefaultMetadataMethod · 0.85

Calls 3

getMetadataNCompsMethod · 0.80
getNumComponentsMethod · 0.45

Tested by

no test coverage detected