MCPcopy Create free account
hub / github.com/NatronGitHub/openfx-misc / describeInContext

Method describeInContext

OneView/OneView.cpp:338–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338void
339OneViewPluginFactory::describeInContext(ImageEffectDescriptor &desc,
340 ContextEnum /*context*/)
341{
342 if ( !fetchSuite(kOfxVegasStereoscopicImageEffectSuite, 1, true) &&
343 !fetchSuite(kFnOfxImageEffectPlaneSuite, 2, true) ) {
344 throwHostMissingSuiteException(kFnOfxImageEffectPlaneSuite);
345 }
346#ifdef OFX_EXTENSIONS_NATRON
347 gHostSupportsDynamicChoices = getImageEffectHostDescription()->supportsDynamicChoices;
348#endif
349
350 // Source clip only in the filter context
351 // create the mandated source clip
352 ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
353 srcClip->addSupportedComponent(ePixelComponentRGBA);
354 srcClip->addSupportedComponent(ePixelComponentRGB);
355#ifdef OFX_EXTENSIONS_NATRON
356 srcClip->addSupportedComponent(ePixelComponentXY);
357#endif
358 srcClip->addSupportedComponent(ePixelComponentAlpha);
359 srcClip->setTemporalClipAccess(false);
360 srcClip->setSupportsTiles(kSupportsTiles);
361 srcClip->setIsMask(false);
362
363 // create the mandated output clip
364 ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
365 dstClip->addSupportedComponent(ePixelComponentRGBA);
366 dstClip->addSupportedComponent(ePixelComponentRGB);
367#ifdef OFX_EXTENSIONS_NATRON
368 dstClip->addSupportedComponent(ePixelComponentXY);
369#endif
370 dstClip->addSupportedComponent(ePixelComponentAlpha);
371 dstClip->setSupportsTiles(kSupportsTiles);
372
373 // make some pages and to things in
374 PageParamDescriptor *page = desc.definePageParam("Controls");
375
376 // view
377 {
378 ChoiceParamDescriptor *param = desc.defineChoiceParam(kParamView);
379 param->setLabel(kParamViewLabel);
380 param->setHint(kParamViewHint);
381 param->appendOption(kParamViewOptionLeft);
382 param->appendOption(kParamViewOptionRight);
383 param->setDefault(0);
384 param->setAnimates(true);
385 if (page) {
386 page->addChild(*param);
387 }
388 }
389}
390
391ImageEffect*
392OneViewPluginFactory::createInstance(OfxImageEffectHandle handle,

Callers

nothing calls this directly

Calls 2

setLabelMethod · 0.80
setHintMethod · 0.80

Tested by

no test coverage detected