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

Method describeInContext

SlitScan/SlitScan.cpp:934–1041  ·  view source on GitHub ↗

@brief The describe in context function, passed a plugin descriptor and a context */

Source from the content-addressed store, hash-verified

932
933/** @brief The describe in context function, passed a plugin descriptor and a context */
934void
935SlitScanPluginFactory::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);

Callers

nothing calls this directly

Calls 2

setLabelMethod · 0.80
setHintMethod · 0.80

Tested by

no test coverage detected