本文整理汇总了C++中ofx::ImageEffectDescriptor::definePageParam方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageEffectDescriptor::definePageParam方法的具体用法?C++ ImageEffectDescriptor::definePageParam怎么用?C++ ImageEffectDescriptor::definePageParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::ImageEffectDescriptor
的用法示例。
在下文中一共展示了ImageEffectDescriptor::definePageParam方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: describeInContext
void SwitchPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum context)
{
// Source clip only in the filter context
// create the mandated source clip
for (int i = 0; i < kSwitchPluginSourceClipCount; ++i) {
std::stringstream s;
s << i;
ClipDescriptor *srcClip = desc.defineClip(s.str());
srcClip->addSupportedComponent(ePixelComponentRGB);
srcClip->addSupportedComponent(ePixelComponentRGBA);
srcClip->addSupportedComponent(ePixelComponentAlpha);
srcClip->setTemporalClipAccess(false);
srcClip->setSupportsTiles(true);
srcClip->setIsMask(false);
if (i >= 2) {
srcClip->setOptional(true);
}
}
// create the mandated output clip
ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
dstClip->addSupportedComponent(ePixelComponentRGB);
dstClip->addSupportedComponent(ePixelComponentRGBA);
dstClip->addSupportedComponent(ePixelComponentAlpha);
dstClip->setSupportsTiles(true);
// make some pages and to things in
PageParamDescriptor *page = desc.definePageParam("Controls");
IntParamDescriptor *which = desc.defineIntParam(kSwitchPluginParamWhich);
which->setLabels(kSwitchPluginParamWhichLabel, kSwitchPluginParamWhichLabel, kSwitchPluginParamWhichLabel);
which->setHint(kSwitchPluginParamWhichHint);
which->setDefault(0);
which->setRange(0, kSwitchPluginSourceClipCount);
which->setDisplayRange(0, 1);
which->setAnimates(true);
page->addChild(*which);
#ifdef OFX_EXTENSIONS_NUKE
// Enable transform by the host.
// It is only possible for transforms which can be represented as a 3x3 matrix.
desc.setCanTransform(true);
#endif
}
示例2: describeInContext
void NoiseExamplePluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, ContextEnum context)
{
ClipDescriptor *dstClip = desc.defineClip("Output");
dstClip->addSupportedComponent(ePixelComponentRGBA);
dstClip->addSupportedComponent(ePixelComponentAlpha);
dstClip->setSupportsTiles(true);
dstClip->setFieldExtraction(eFieldExtractSingle);
DoubleParamDescriptor *param = desc.defineDoubleParam("Noise");
param->setLabels("noise", "noise", "noise");
param->setScriptName("noise");
param->setHint("How much noise to make.");
param->setDefault(0.2);
param->setRange(0, 10);
param->setIncrement(0.1);
param->setDisplayRange(0, 1);
param->setAnimates(true); // can animate
param->setDoubleType(eDoubleTypeScale);
PageParamDescriptor *page = desc.definePageParam("Controls");
page->addChild(*param);
}
示例3: describeInContext
void BasicExamplePluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::ContextEnum context)
{
// Source clip only in the filter context
// create the mandated source clip
ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
srcClip->addSupportedComponent(ePixelComponentRGBA);
srcClip->addSupportedComponent(ePixelComponentAlpha);
srcClip->setTemporalClipAccess(false);
srcClip->setSupportsTiles(true);
srcClip->setIsMask(false);
// if general or paint context, define the mask clip
if(context == eContextGeneral || context == eContextPaint) {
// if paint context, it is a mandated input called 'brush'
ClipDescriptor *maskClip = context == eContextGeneral ? desc.defineClip("Mask") : desc.defineClip("Brush");
maskClip->addSupportedComponent(ePixelComponentAlpha);
maskClip->setTemporalClipAccess(false);
if(context == eContextGeneral)
maskClip->setOptional(true);
maskClip->setSupportsTiles(true);
maskClip->setIsMask(true); // we are a mask input
}
// create the mandated output clip
ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
dstClip->addSupportedComponent(ePixelComponentRGBA);
dstClip->addSupportedComponent(ePixelComponentAlpha);
dstClip->setSupportsTiles(true);
// make some pages and to things in
PageParamDescriptor *page = desc.definePageParam("Controls");
// group param to group the scales
GroupParamDescriptor *componentScalesGroup = desc.defineGroupParam("componentScales");
componentScalesGroup->setHint("Scales on the individual component");
componentScalesGroup->setLabels("Components", "Components", "Components");
// make overall scale params
DoubleParamDescriptor *param = defineScaleParam(desc, "scale", "scale", "Scales all component in the image", 0);
page->addChild(*param);
// add a boolean to enable the component scale
BooleanParamDescriptor *boolP = desc.defineBooleanParam("scaleComponents");
boolP->setDefault(true);
boolP->setHint("Enables scales on individual components");
boolP->setLabels("Scale Components", "Scale Components", "Scale Components");
boolP->setParent(*componentScalesGroup);
page->addChild(*boolP);
// make the four component scale params
param = defineScaleParam(desc, "scaleR", "red", "Scales the red component of the image", componentScalesGroup);
page->addChild(*param);
param = defineScaleParam(desc, "scaleG", "green", "Scales the green component of the image", componentScalesGroup);
page->addChild(*param);
param = defineScaleParam(desc, "scaleB", "blue", "Scales the blue component of the image", componentScalesGroup);
page->addChild(*param);
param = defineScaleParam(desc, "scaleA", "alpha", "Scales the alpha component of the image", componentScalesGroup);
page->addChild(*param);
}
示例4: describeInContext
void InvertPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum context)
{
// Source clip only in the filter context
// create the mandated source clip
ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
srcClip->addSupportedComponent(ePixelComponentRGBA);
srcClip->addSupportedComponent(ePixelComponentRGB);
srcClip->addSupportedComponent(ePixelComponentAlpha);
srcClip->setTemporalClipAccess(false);
srcClip->setSupportsTiles(true);
srcClip->setIsMask(false);
// create the mandated output clip
ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
dstClip->addSupportedComponent(ePixelComponentRGBA);
dstClip->addSupportedComponent(ePixelComponentRGB);
dstClip->addSupportedComponent(ePixelComponentAlpha);
dstClip->setSupportsTiles(true);
if (context == eContextGeneral || context == eContextPaint) {
ClipDescriptor *maskClip = context == eContextGeneral ? desc.defineClip("Mask") : desc.defineClip("Brush");
maskClip->addSupportedComponent(ePixelComponentAlpha);
maskClip->setTemporalClipAccess(false);
if (context == eContextGeneral) {
maskClip->setOptional(true);
}
maskClip->setSupportsTiles(true);
maskClip->setIsMask(true);
}
// make some pages and to things in
PageParamDescriptor *page = desc.definePageParam("Controls");
OFX::BooleanParamDescriptor* processR = desc.defineBooleanParam(kParamProcessR);
processR->setLabels(kParamProcessRLabel, kParamProcessRLabel, kParamProcessRLabel);
processR->setHint(kParamProcessRHint);
processR->setDefault(true);
processR->setLayoutHint(eLayoutHintNoNewLine);
page->addChild(*processR);
OFX::BooleanParamDescriptor* processG = desc.defineBooleanParam(kParamProcessG);
processG->setLabels(kParamProcessGLabel, kParamProcessGLabel, kParamProcessGLabel);
processG->setHint(kParamProcessGHint);
processG->setDefault(true);
processG->setLayoutHint(eLayoutHintNoNewLine);
page->addChild(*processG);
OFX::BooleanParamDescriptor* processB = desc.defineBooleanParam( kParamProcessB );
processB->setLabels(kParamProcessBLabel, kParamProcessBLabel, kParamProcessBLabel);
processB->setHint(kParamProcessBHint);
processB->setDefault(true);
processB->setLayoutHint(eLayoutHintNoNewLine);
page->addChild(*processB);
OFX::BooleanParamDescriptor* processA = desc.defineBooleanParam( kParamProcessA );
processA->setLabels(kParamProcessALabel, kParamProcessALabel, kParamProcessALabel);
processA->setHint(kParamProcessAHint);
processA->setDefault(true);
page->addChild(*processA);
ofxsMaskMixDescribeParams(desc, page);
}
示例5: describeInContext
/** @brief The describe in context function, passed a plugin descriptor and a context */
void PropTesterPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, ContextEnum context)
{
// Source clip only in the filter context
if(context == eContextGeneral) {
// create the mandated source clip
ClipDescriptor *srcClip = desc.defineClip("Extra");
srcClip->addSupportedComponent(ePixelComponentRGBA);
srcClip->setTemporalClipAccess(false);
srcClip->setOptional(false);
srcClip->setSupportsTiles(true);
srcClip->setIsMask(false);
}
// Source clip only in the filter context
if(context == eContextFilter || context == eContextGeneral) {
// create the mandated source clip
ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
srcClip->addSupportedComponent(ePixelComponentRGBA);
srcClip->setTemporalClipAccess(false);
//srcClip->setOptional(false);
srcClip->setSupportsTiles(true);
srcClip->setIsMask(false);
}
// create the mandated output clip
ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
dstClip->addSupportedComponent(ePixelComponentRGBA);
dstClip->setTemporalClipAccess(false);
//dstClip->setOptional(false);
dstClip->setSupportsTiles(true);
dstClip->setIsMask(false);
// make some pages and to things in
PageParamDescriptor *page1 = desc.definePageParam("page1");
PageParamDescriptor *page2 = desc.definePageParam("page2");
PageParamDescriptor *page3 = desc.definePageParam("page3");
// make an int param
IntParamDescriptor *iParam = desc.defineIntParam("Int");
iParam->setLabels("Int", "Int", "Int");
iParam->setScriptName("int");
iParam->setHint("An integer parameter");
iParam->setDefault(0);
iParam->setRange(-100, 100);
iParam->setDisplayRange(-100, 100);
page1->addChild(*iParam);
// make a 2D int param
Int2DParamDescriptor *i2DParam = desc.defineInt2DParam("Int2D");
i2DParam->setLabels("Int2D", "Int2D", "Int2D");
i2DParam->setScriptName("int2D");
i2DParam->setHint("A 2D integer parameter");
i2DParam->setDefault(0, 0);
i2DParam->setRange(-100, -100, 100, 100);
i2DParam->setDisplayRange(-100, -100, 100, 100);
page1->addChild(*i2DParam);
// make a 3D int param
Int3DParamDescriptor *i3DParam = desc.defineInt3DParam("Int3D");
i3DParam->setLabels("Int3D", "Int3D", "Int2D");
i3DParam->setScriptName("int3D");
i3DParam->setHint("A 3D integer parameter");
i3DParam->setDefault(0, 0, 0);
i3DParam->setRange(-100, -100, -100, 100, 100, 100);
i3DParam->setDisplayRange(-100, -100, -100, 100, 100, 100);
page1->addChild(*i3DParam);
page1->addChild(PageParamDescriptor::gSkipColumn);
// boolean
BooleanParamDescriptor *boolean = desc.defineBooleanParam("bool");
boolean->setLabels("bool", "bool", "bool");
boolean->setDefault(false);
page1->addChild(*boolean);
// choice
ChoiceParamDescriptor *choice = desc.defineChoiceParam("choice");
choice->setLabels("choice", "choice", "choice");
choice->appendOption("This", "This");
choice->appendOption("That", "That");
choice->appendOption("The Other", "The Other");
choice->resetOptions();
choice->appendOption("Tom", "Tom");
choice->appendOption("Dick", "Dick");
choice->appendOption("Harry", "Harry");
choice->setDefault(0);
page1->addChild(*choice);
page1->addChild(PageParamDescriptor::gSkipColumn);
// push button
PushButtonParamDescriptor *push = desc.definePushButtonParam("push");
push->setLabels("push me", "push me", "push me Big Nose");
//.........这里部分代码省略.........