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

Method describeInContext

KeyMix/KeyMix.cpp:595–694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

593} // >::describe
594
595void
596KeyMixPluginFactory::describeInContext(ImageEffectDescriptor &desc,
597 ContextEnum context)
598{
599 ClipDescriptor* srcClipB = desc.defineClip(kClipB);
600
601 srcClipB->setHint(kClipBHint);
602 srcClipB->addSupportedComponent( ePixelComponentRGBA );
603 srcClipB->addSupportedComponent( ePixelComponentRGB );
604 srcClipB->addSupportedComponent( ePixelComponentXY );
605 srcClipB->addSupportedComponent( ePixelComponentAlpha );
606 srcClipB->setTemporalClipAccess(false);
607 srcClipB->setSupportsTiles(kSupportsTiles);
608
609 //Optional: If we want a render to be triggered even if one of the inputs is not connected
610 //they need to be optional.
611 srcClipB->setOptional(true); // B clip is optional
612
613 ClipDescriptor* srcClipA = desc.defineClip(kClipA);
614 srcClipA->setHint(kClipAHint);
615 srcClipA->addSupportedComponent( ePixelComponentRGBA );
616 srcClipA->addSupportedComponent( ePixelComponentRGB );
617 srcClipA->addSupportedComponent( ePixelComponentXY );
618 srcClipA->addSupportedComponent( ePixelComponentAlpha );
619 srcClipA->setTemporalClipAccess(false);
620 srcClipA->setSupportsTiles(kSupportsTiles);
621 srcClipA->setOptional(true);
622
623 //Optional: If we want a render to be triggered even if one of the inputs is not connected
624 //they need to be optional.
625 srcClipA->setOptional(true);
626
627 ClipDescriptor *maskClip = (context == eContextPaint) ? desc.defineClip("Brush") : desc.defineClip("Mask");
628 maskClip->addSupportedComponent(ePixelComponentAlpha);
629 maskClip->setTemporalClipAccess(false);
630 if (context != eContextPaint) {
631 maskClip->setOptional(true);
632 }
633 maskClip->setSupportsTiles(kSupportsTiles);
634 maskClip->setIsMask(true);
635
636 // create the mandated output clip
637 ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
638 dstClip->addSupportedComponent(ePixelComponentRGBA);
639 dstClip->addSupportedComponent(ePixelComponentRGB);
640#ifdef OFX_EXTENSIONS_NATRON
641 dstClip->addSupportedComponent(ePixelComponentXY);
642#endif
643 dstClip->addSupportedComponent(ePixelComponentAlpha);
644 dstClip->setSupportsTiles(kSupportsTiles);
645
646
647 // make some pages and to things in
648 PageParamDescriptor *page = desc.definePageParam("Controls");
649
650#ifdef OFX_EXTENSIONS_NATRON
651 desc.setChannelSelector(ePixelComponentNone); // we have our own channel selector
652#endif

Callers

nothing calls this directly

Calls 2

setHintMethod · 0.80
setLabelMethod · 0.80

Tested by

no test coverage detected