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

Method describeInContext

Rectangle/Rectangle.cpp:1237–1386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1235}
1236
1237void
1238RectanglePluginFactory::describeInContext(ImageEffectDescriptor &desc,
1239 ContextEnum context)
1240{
1241 // Source clip only in the filter context
1242 // create the mandated source clip
1243 // always declare the source clip first, because some hosts may consider
1244 // it as the default input clip (e.g. Nuke)
1245 ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
1246
1247 srcClip->addSupportedComponent(ePixelComponentRGBA);
1248 //srcClip->addSupportedComponent(ePixelComponentRGB);
1249#ifdef OFX_EXTENSIONS_NATRON
1250 //srcClip->addSupportedComponent(ePixelComponentXY);
1251#endif
1252 srcClip->addSupportedComponent(ePixelComponentAlpha);
1253 //srcClip->setTemporalClipAccess(false);
1254 srcClip->setSupportsTiles(kSupportsTiles);
1255 //srcClip->setIsMask(false);
1256 srcClip->setOptional(true);
1257
1258 // create the mandated output clip
1259 ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
1260 dstClip->addSupportedComponent(ePixelComponentRGBA);
1261 //dstClip->addSupportedComponent(ePixelComponentRGB);
1262#ifdef OFX_EXTENSIONS_NATRON
1263 //dstClip->addSupportedComponent(ePixelComponentXY);
1264#endif
1265 dstClip->addSupportedComponent(ePixelComponentAlpha);
1266 dstClip->setSupportsTiles(kSupportsTiles);
1267
1268 ClipDescriptor *maskClip = (context == eContextPaint) ? desc.defineClip("Brush") : desc.defineClip("Mask");
1269 maskClip->addSupportedComponent(ePixelComponentAlpha);
1270 maskClip->setTemporalClipAccess(false);
1271 if (context != eContextPaint) {
1272 maskClip->setOptional(true);
1273 }
1274 maskClip->setSupportsTiles(kSupportsTiles);
1275 maskClip->setIsMask(true);
1276
1277 // make some pages and to things in
1278 PageParamDescriptor *page = desc.definePageParam("Controls");
1279
1280 {
1281 BooleanParamDescriptor* param = desc.defineBooleanParam(kParamProcessR);
1282 param->setLabel(kParamProcessRLabel);
1283 param->setHint(kParamProcessRHint);
1284 param->setDefault(true);
1285 param->setLayoutHint(eLayoutHintNoNewLine, 1);
1286 if (page) {
1287 page->addChild(*param);
1288 }
1289 }
1290 {
1291 BooleanParamDescriptor* param = desc.defineBooleanParam(kParamProcessG);
1292 param->setLabel(kParamProcessGLabel);
1293 param->setHint(kParamProcessGHint);
1294 param->setDefault(true);

Callers

nothing calls this directly

Calls 2

setLabelMethod · 0.80
setHintMethod · 0.80

Tested by

no test coverage detected