@brief The describe in context function, passed a plugin descriptor and a context */
| 932 | |
| 933 | /** @brief The describe in context function, passed a plugin descriptor and a context */ |
| 934 | void |
| 935 | SlitScanPluginFactory::describeInContext(ImageEffectDescriptor &desc, |
| 936 | ContextEnum /*context*/) |
| 937 | { |
| 938 | ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName); |
| 939 | |
| 940 | srcClip->addSupportedComponent(ePixelComponentRGBA); |
| 941 | srcClip->addSupportedComponent(ePixelComponentRGB); |
| 942 | #ifdef OFX_EXTENSIONS_NATRON |
| 943 | srcClip->addSupportedComponent(ePixelComponentXY); |
| 944 | #endif |
| 945 | srcClip->addSupportedComponent(ePixelComponentAlpha); |
| 946 | srcClip->setTemporalClipAccess(true); // say we will be doing random time access on this clip |
| 947 | srcClip->setSupportsTiles(kSupportsTiles); |
| 948 | srcClip->setFieldExtraction(eFieldExtractDoubled); // which is the default anyway |
| 949 | |
| 950 | ClipDescriptor *retimeMapClip = desc.defineClip(kClipRetimeMap); |
| 951 | retimeMapClip->addSupportedComponent(ePixelComponentAlpha); |
| 952 | retimeMapClip->setSupportsTiles(kSupportsTiles); |
| 953 | retimeMapClip->setOptional(true); |
| 954 | retimeMapClip->setIsMask(false); |
| 955 | |
| 956 | // create the mandated output clip |
| 957 | ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName); |
| 958 | dstClip->addSupportedComponent(ePixelComponentRGBA); |
| 959 | dstClip->addSupportedComponent(ePixelComponentRGB); |
| 960 | #ifdef OFX_EXTENSIONS_NATRON |
| 961 | dstClip->addSupportedComponent(ePixelComponentXY); |
| 962 | #endif |
| 963 | dstClip->addSupportedComponent(ePixelComponentAlpha); |
| 964 | dstClip->setFieldExtraction(eFieldExtractDoubled); // which is the default anyway |
| 965 | dstClip->setSupportsTiles(kSupportsTiles); |
| 966 | |
| 967 | // make a page to put it in |
| 968 | PageParamDescriptor *page = desc.definePageParam("Controls"); |
| 969 | |
| 970 | { |
| 971 | ChoiceParamDescriptor *param = desc.defineChoiceParam(kParamRetimeFunction); |
| 972 | param->setLabel(kParamRetimeFunctionLabel); |
| 973 | param->setHint(kParamRetimeFunctionHint); |
| 974 | assert(param->getNOptions() == eRetimeFunctionHorizontalSlit); |
| 975 | param->appendOption(kParamRetimeFunctionOptionHorizontalSlit); |
| 976 | assert(param->getNOptions() == eRetimeFunctionVerticalSlit); |
| 977 | param->appendOption(kParamRetimeFunctionOptionVerticalSlit); |
| 978 | assert(param->getNOptions() == eRetimeFunctionRetimeMap); |
| 979 | param->appendOption(kParamRetimeFunctionOptionRetimeMap); |
| 980 | param->setDefault( (int)kParamRetimeFunctionDefault ); |
| 981 | if (page) { |
| 982 | page->addChild(*param); |
| 983 | } |
| 984 | } |
| 985 | |
| 986 | { |
| 987 | DoubleParamDescriptor *param = desc.defineDoubleParam(kParamRetimeOffset); |
| 988 | param->setDefault(kParamRetimeOffsetDefault); |
| 989 | param->setHint(kParamRetimeOffsetHint); |
| 990 | param->setLabel(kParamRetimeOffsetLabel); |
| 991 | param->setAnimates(true); |