| 700 | } |
| 701 | |
| 702 | void |
| 703 | AddPluginFactory::describeInContext(ImageEffectDescriptor &desc, |
| 704 | ContextEnum context) |
| 705 | { |
| 706 | // Source clip only in the filter context |
| 707 | // create the mandated source clip |
| 708 | ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName); |
| 709 | |
| 710 | srcClip->addSupportedComponent(ePixelComponentRGBA); |
| 711 | srcClip->addSupportedComponent(ePixelComponentRGB); |
| 712 | srcClip->addSupportedComponent(ePixelComponentAlpha); |
| 713 | srcClip->setTemporalClipAccess(false); |
| 714 | srcClip->setSupportsTiles(kSupportsTiles); |
| 715 | srcClip->setIsMask(false); |
| 716 | |
| 717 | // create the mandated output clip |
| 718 | ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName); |
| 719 | dstClip->addSupportedComponent(ePixelComponentRGBA); |
| 720 | dstClip->addSupportedComponent(ePixelComponentRGB); |
| 721 | dstClip->addSupportedComponent(ePixelComponentAlpha); |
| 722 | dstClip->setSupportsTiles(kSupportsTiles); |
| 723 | |
| 724 | ClipDescriptor *maskClip = (context == eContextPaint) ? desc.defineClip("Brush") : desc.defineClip("Mask"); |
| 725 | maskClip->addSupportedComponent(ePixelComponentAlpha); |
| 726 | maskClip->setTemporalClipAccess(false); |
| 727 | if (context != eContextPaint) { |
| 728 | maskClip->setOptional(true); |
| 729 | } |
| 730 | maskClip->setSupportsTiles(kSupportsTiles); |
| 731 | maskClip->setIsMask(true); |
| 732 | |
| 733 | // make some pages and to things in |
| 734 | PageParamDescriptor *page = desc.definePageParam("Controls"); |
| 735 | |
| 736 | { |
| 737 | BooleanParamDescriptor* param = desc.defineBooleanParam(kParamProcessR); |
| 738 | param->setLabel(kParamProcessRLabel); |
| 739 | param->setHint(kParamProcessRHint); |
| 740 | param->setDefault(true); |
| 741 | param->setLayoutHint(eLayoutHintNoNewLine, 1); |
| 742 | if (page) { |
| 743 | page->addChild(*param); |
| 744 | } |
| 745 | } |
| 746 | { |
| 747 | BooleanParamDescriptor* param = desc.defineBooleanParam(kParamProcessG); |
| 748 | param->setLabel(kParamProcessGLabel); |
| 749 | param->setHint(kParamProcessGHint); |
| 750 | param->setDefault(true); |
| 751 | param->setLayoutHint(eLayoutHintNoNewLine, 1); |
| 752 | if (page) { |
| 753 | page->addChild(*param); |
| 754 | } |
| 755 | } |
| 756 | { |
| 757 | BooleanParamDescriptor* param = desc.defineBooleanParam(kParamProcessB); |
| 758 | param->setLabel(kParamProcessBLabel); |
| 759 | param->setHint(kParamProcessBHint); |