| 5325 | } |
| 5326 | |
| 5327 | static int |
| 5328 | getUnmappedComponentsForInput(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 | |
| 5358 | StatusEnum |
| 5359 | EffectInstance::getDefaultMetadata(NodeMetadata &metadata) |
no test coverage detected