| 5251 | } |
| 5252 | |
| 5253 | static int |
| 5254 | getUnmappedComponentsForInput(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 | |
| 5284 | StatusEnum |
| 5285 | EffectInstance::getDefaultMetadata(NodeMetadata &metadata) |
no test coverage detected