本文整理汇总了C++中ofx::BooleanParamDescriptor::setDefault方法的典型用法代码示例。如果您正苦于以下问题:C++ BooleanParamDescriptor::setDefault方法的具体用法?C++ BooleanParamDescriptor::setDefault怎么用?C++ BooleanParamDescriptor::setDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::BooleanParamDescriptor
的用法示例。
在下文中一共展示了BooleanParamDescriptor::setDefault方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: describeWriterParamsInContext
void describeWriterParamsInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::StringParamDescriptor* filename = desc.defineStringParam( kTuttlePluginFilename );
filename->setLabel( kTuttlePluginFilenameLabel );
filename->setStringType( OFX::eStringTypeFilePath );
filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
desc.addClipPreferencesSlaveParam( *filename );
OFX::ChoiceParamDescriptor* channel = desc.defineChoiceParam( kTuttlePluginChannel );
channel->setLabel( kTuttlePluginChannelLabel );
channel->appendOption( kTuttlePluginChannelAuto );
channel->appendOption( kTuttlePluginChannelGray );
channel->appendOption( kTuttlePluginChannelRGB );
channel->appendOption( kTuttlePluginChannelRGBA );
channel->setDefault( 0 );
OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kTuttlePluginBitDepth );
bitDepth->setLabel( kTuttlePluginBitDepthLabel );
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
bitDepth->setDefault( 0 );
OFX::BooleanParamDescriptor* premult = desc.defineBooleanParam( kParamPremultiplied );
premult->setLabel( kParamPremultipliedLabel );
premult->setDefault( false );
OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender );
render->setLabels( "Render", "Render", "Render step" );
render->setHint("Force render (writing)");
OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways );
renderAlways->setLabel( "Render always" );
// renderAlways->setDefault( false );
renderAlways->setDefault( true ); // because tuttle is not declared as a background renderer
OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender );
forceNewRender->setLabel( "Force new render" );
forceNewRender->setEnabled( false );
forceNewRender->setIsSecret( true );
forceNewRender->setIsPersistant( false );
forceNewRender->setAnimates( false );
forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
forceNewRender->setEvaluateOnChange( true );
forceNewRender->setDefault( 0 );
}
示例2: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void TextPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::StringParamDescriptor* text = desc.defineStringParam( kText );
text->setLabel( "Text" );
text->setStringType( OFX::eStringTypeMultiLine );
OFX::StringParamDescriptor* font = desc.defineStringParam( kFont );
font->setLabel( "Font file" );
font->setStringType( OFX::eStringTypeFilePath );
font->setDefault( "/usr/share/fonts/truetype/msttcorefonts/arial.ttf" );
OFX::IntParamDescriptor* size = desc.defineIntParam( kSize );
size->setLabel( "Size" );
size->setDefault( 18 );
size->setRange( 0, std::numeric_limits<int>::max() );
size->setDisplayRange( 0, 60 );
OFX::DoubleParamDescriptor* ratio = desc.defineDoubleParam( kRatio );
ratio->setLabel( "Ratio" );
ratio->setRange( 0.0, std::numeric_limits<double>::max() );
ratio->setDisplayRange( 0.0, 2.0 );
ratio->setDefault( 1.0 );
OFX::RGBAParamDescriptor* color = desc.defineRGBAParam( kColor );
color->setLabel( "Color" );
color->setDefault( 1.0, 1.0, 1.0, 1.0 );
OFX::Double2DParamDescriptor* position = desc.defineDouble2DParam( kPosition );
position->setLabel( "Position" );
position->setDefault( 0.0, 0.0 );
OFX::DoubleParamDescriptor* letterSpacing = desc.defineDoubleParam( kLetterSpacing );
letterSpacing->setLabel( "Letter spacing" );
letterSpacing->setDisplayRange( -10.0, 10.0 );
letterSpacing->setDefault( 0.0 );
OFX::BooleanParamDescriptor* verticalFlip = desc.defineBooleanParam( kVerticalFlip );
verticalFlip->setLabel( "Vertical flip" );
verticalFlip->setDefault( false );
verticalFlip->setAnimates( false );
verticalFlip->setHint( "Some hosts use inverted images, so you can correct this problem using this flag." );
}
示例3: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void OpenImageIOWriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
// Controls
OFX::StringParamDescriptor* filename = desc.defineStringParam( kParamWriterFilename );
filename->setLabel( "Filename" );
filename->setStringType( OFX::eStringTypeFilePath );
filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
desc.addClipPreferencesSlaveParam( *filename );
OFX::ChoiceParamDescriptor* components = desc.defineChoiceParam( kParamOutputComponents );
components->setLabel( "Components" );
components->appendOption( kParamOutputComponentsRGBA );
components->appendOption( kParamOutputComponentsRGB );
components->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
components->setDefault( 0 );
OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kParamWriterBitDepth );
bitDepth->setLabel( "Bit depth" );
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
bitDepth->appendOption( kTuttlePluginBitDepth32f );
bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
bitDepth->setDefault( 1 );
OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender );
render->setLabels( "Render", "Render", "Render step" );
render->setHint( "Force render (writing)" );
OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways );
renderAlways->setLabel( "Render always" );
renderAlways->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
renderAlways->setDefault( false );
OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender );
forceNewRender->setLabel( "Force new render" );
forceNewRender->setIsSecret( true );
forceNewRender->setIsPersistant( false );
forceNewRender->setAnimates( false );
forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
forceNewRender->setEvaluateOnChange( true );
forceNewRender->setDefault( 0 );
}
示例4: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void RampPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
describeGeneratorParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* direction = desc.defineChoiceParam( kRampDirection );
direction->appendOption( "horizontal", "Horizontal" );
direction->appendOption( "vertical", "Vertical" );
direction->setLabel( "Ramp Direction" );
direction->setHint( "Select the ramp direction." );
OFX::BooleanParamDescriptor* color = desc.defineBooleanParam( kRampColor );
color->setDefault( false );
color->setLabel( "Color Ramp" );
color->setHint( "Enable the R/G/B/Gray ramp." );
}
示例5: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void DPXWriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
// Controls
OFX::StringParamDescriptor* filename = desc.defineStringParam( kParamWriterFilename );
filename->setLabel( "Filename" );
filename->setStringType( OFX::eStringTypeFilePath );
filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
desc.addClipPreferencesSlaveParam( *filename );
OFX::ChoiceParamDescriptor* componentsType = desc.defineChoiceParam( kParamComponentsType );
componentsType->setLabel( "Components type" );
componentsType->appendOption( "rgb" );
componentsType->appendOption( "rgba" );
componentsType->appendOption( "abgr" );
componentsType->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
componentsType->setDefault( 1 );
OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kParamWriterBitDepth );
bitDepth->setLabel( "Bit depth" );
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth10 );
bitDepth->appendOption( kTuttlePluginBitDepth12 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
bitDepth->setDefault( 3 );
OFX::BooleanParamDescriptor* compressed = desc.defineBooleanParam( kParamCompressed );
compressed->setLabel( "Remove unused bits (bit streaming)" );
compressed->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
compressed->setDefault( false );
describeWriterParamsInContext( desc, context );
}
示例6: ofxsPremultDescribeParams
void
CImgFilterPluginHelperBase::describeInContextEnd(OFX::ImageEffectDescriptor &desc,
OFX::ContextEnum /*context*/,
OFX::PageParamDescriptor* page)
{
ofxsPremultDescribeParams(desc, page);
ofxsMaskMixDescribeParams(desc, page);
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kParamPremultChanged);
param->setDefault(false);
param->setIsSecret(true);
param->setAnimates(false);
param->setEvaluateOnChange(false);
if (page) {
page->addChild(*param);
}
}
}
示例7:
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void Jpeg2000WriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor &desc,
OFX::EContext context )
{
OFX::ClipDescriptor *srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor *dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
describeWriterParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* bitDepth = static_cast<OFX::ChoiceParamDescriptor*>( desc.getParamDescriptor( kTuttlePluginBitDepth ) );
bitDepth->resetOptions();
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth12 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
#ifndef TUTTLE_PRODUCTION
bitDepth->appendOption( kTuttlePluginBitDepth32 );
#endif
bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
bitDepth->setDefault( eTuttlePluginBitDepth8 );
OFX::BooleanParamDescriptor* lossless = desc.defineBooleanParam( kParamLossless );
lossless->setLabel( "lossless" );
lossless->setHint("When no cinema profile is selected, set compression to lossless.");
lossless->setDefault( false );
OFX::ChoiceParamDescriptor* cineProfil = desc.defineChoiceParam( kParamCinemaProfil );
cineProfil->appendOption( kParamCinemaProfilNoDigit );
cineProfil->appendOption( kParamCinemaProfil2k24fps );
cineProfil->appendOption( kParamCinemaProfil2k48fps );
cineProfil->appendOption( kParamCinemaProfil4k24fps );
cineProfil->setDefault( 0 );
}
示例8: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void ComponentPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::ChoiceParamDescriptor* outTo = desc.defineChoiceParam( kParamTo );
outTo->setLabel( kParamToLabel );
outTo->appendOption( kConvertToGray );
outTo->appendOption( kConvertToRGB );
outTo->appendOption( kConvertToRGBA );
outTo->setDefault( eConvertToRGBA );
OFX::ChoiceParamDescriptor* outGray = desc.defineChoiceParam( kParamToGray );
outGray->setLabel( kParamToGrayLabel );
outGray->appendOption( kConvertToGrayMean );
outGray->appendOption( kConvertToGrayRec601 );
outGray->appendOption( kConvertToGrayRec709 );
outGray->appendOption( kConvertToGraySelectRed );
outGray->appendOption( kConvertToGraySelectGreen );
outGray->appendOption( kConvertToGraySelectBlue );
outGray->appendOption( kConvertToGraySelectAlpha );
outGray->setDefault( 3 ); // terry::color::components::eConvertToGrayRec709
OFX::BooleanParamDescriptor* outPremult = desc.defineBooleanParam( kParamPremutliplied );
outPremult->setLabel( kParamPremutlipliedLabel );
outPremult->setDefault( false );
}
示例9: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void SobelPluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::EContext context)
{
OFX::ClipDescriptor* srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
srcClip->addSupportedComponent(OFX::ePixelComponentRGBA);
srcClip->addSupportedComponent(OFX::ePixelComponentRGB);
srcClip->addSupportedComponent(OFX::ePixelComponentAlpha);
srcClip->setSupportsTiles(kSupportTiles);
OFX::ClipDescriptor* dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
dstClip->addSupportedComponent(OFX::ePixelComponentRGBA);
dstClip->addSupportedComponent(OFX::ePixelComponentRGB);
dstClip->setSupportsTiles(kSupportTiles);
OFX::Double2DParamDescriptor* size = desc.defineDouble2DParam(kParamSize);
size->setLabel("Size");
size->setDefault(1.0, 1.0);
size->setRange(0.0, 0.0, std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
size->setDisplayRange(0, 0, 10, 10);
size->setDoubleType(OFX::eDoubleTypeScale);
OFX::GroupParamDescriptor* advanced = desc.defineGroupParam(kParamGroupAdvanced);
advanced->setLabel("Advanced");
OFX::BooleanParamDescriptor* unidimensional = desc.defineBooleanParam(kParamUnidimensional);
unidimensional->setLabel("Unidimensional");
unidimensional->setHint("Instead of using a square convolution matrix, use 1D kernels.");
unidimensional->setDefault(false);
unidimensional->setParent(advanced);
OFX::BooleanParamDescriptor* reverseKernel = desc.defineBooleanParam(kParamReverseKernel);
reverseKernel->setLabel("Reverse");
reverseKernel->setHint("Reverse the kernel (convolution or correlation).");
reverseKernel->setDefault(false);
reverseKernel->setParent(advanced);
OFX::BooleanParamDescriptor* normalizedKernel = desc.defineBooleanParam(kParamNormalizedKernel);
normalizedKernel->setLabel("Normalized kernel");
normalizedKernel->setHint("Use a normalized kernel to compute the gradient.");
normalizedKernel->setDefault(true);
normalizedKernel->setParent(advanced);
OFX::DoubleParamDescriptor* kernelEpsilon = desc.defineDoubleParam(kParamKernelEpsilon);
kernelEpsilon->setLabel("Kernel espilon value");
kernelEpsilon->setHint("Threshold at which we no longer consider the values of the function.");
kernelEpsilon->setDefault(0.01);
kernelEpsilon->setRange(std::numeric_limits<double>::epsilon(), 1);
kernelEpsilon->setDisplayRange(0, 0.01);
kernelEpsilon->setParent(advanced);
OFX::ChoiceParamDescriptor* pass = desc.defineChoiceParam(kParamPass);
pass->setLabel("Pass");
pass->setHint("The sobel filter is computed using a 2D separable filter. So it consists in 2 passes.\n"
"By default we compute the 2 passes, but with this option you can separate each pass.");
pass->appendOption(kParamPassFull);
pass->appendOption(kParamPass1);
pass->appendOption(kParamPass2);
pass->setDefault(0);
pass->setParent(advanced);
OFX::ChoiceParamDescriptor* border = desc.defineChoiceParam(kParamBorder);
border->setLabel("Gradient border");
border->setHint("Border method for gradient computation.");
border->appendOption(kParamBorderMirror);
border->appendOption(kParamBorderConstant);
border->appendOption(kParamBorderBlack);
border->appendOption(kParamBorderPadded);
OFX::BooleanParamDescriptor* computeNorm = desc.defineBooleanParam(kParamComputeGradientNorm);
computeNorm->setLabel("Compute norm");
computeNorm->setHint("To disable the norm computation, if you don't need it.");
computeNorm->setDefault(true);
OFX::BooleanParamDescriptor* normManhattan = desc.defineBooleanParam(kParamGradientNormManhattan);
normManhattan->setLabel("Use the manhattan norm");
normManhattan->setHint("Use manhattan norm instead of standard one.");
normManhattan->setDefault(false);
OFX::BooleanParamDescriptor* computeGradientDirection = desc.defineBooleanParam(kParamComputeGradientDirection);
computeGradientDirection->setLabel("Gradient direction");
computeGradientDirection->setHint("To disable the gradient direction computation, if you don't need it.");
computeGradientDirection->setDefault(false);
OFX::BooleanParamDescriptor* gradientDirectionAbs = desc.defineBooleanParam(kParamGradientDirectionAbs);
gradientDirectionAbs->setLabel("Angle between 0 and PI");
gradientDirectionAbs->setHint("Limit gradient direction between 0 and PI.");
gradientDirectionAbs->setDefault(true);
OFX::PushButtonParamDescriptor* infosButton = desc.definePushButtonParam(kParamInfos);
infosButton->setLabel("Infos");
OFX::ChoiceParamDescriptor* outputComponent = desc.defineChoiceParam(kParamOutputComponent);
outputComponent->setLabel("Output component");
outputComponent->appendOption(OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentRGB)
? kParamOutputComponentRGB
: "---");
//.........这里部分代码省略.........
示例10: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void NormalizePluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::ChoiceParamDescriptor* mode = desc.defineChoiceParam( kParamMode );
mode->setLabel( "Input" );
mode->appendOption( kParamModeAnalyse );
mode->appendOption( kParamModeCustom );
OFX::ChoiceParamDescriptor* analyse = desc.defineChoiceParam( kParamAnalyseMode );
analyse->setLabel( "Analyse" );
analyse->appendOption( kParamAnalysePerChannel );
analyse->appendOption( kParamAnalyseLuminosity );
analyse->appendOption( kParamAnalyseR );
analyse->appendOption( kParamAnalyseG );
analyse->appendOption( kParamAnalyseB );
analyse->appendOption( kParamAnalyseA );
OFX::PushButtonParamDescriptor* analyseNow = desc.definePushButtonParam( kParamAnalyseNow );
analyseNow->setLabel( "Analyse" );
OFX::GroupParamDescriptor* srcGroup = desc.defineGroupParam( kParamSrcGroup );
srcGroup->setLabel( "Source" );
OFX::RGBAParamDescriptor* srcMinColor = desc.defineRGBAParam( kParamSrcCustomColorMin );
srcMinColor->setLabel( "Min" );
srcMinColor->setDefault( 0.0, 0.0, 0.0, 0.0 );
srcMinColor->setParent( srcGroup );
OFX::RGBAParamDescriptor* srcMaxColor = desc.defineRGBAParam( kParamSrcCustomColorMax );
srcMaxColor->setLabel( "Max" );
srcMaxColor->setDefault( 1.0, 1.0, 1.0, 1.0 );
srcMaxColor->setParent( srcGroup );
OFX::GroupParamDescriptor* dstGroup = desc.defineGroupParam( kParamDstGroup );
dstGroup->setLabel( "Destination" );
OFX::RGBAParamDescriptor* dstMinColor = desc.defineRGBAParam( kParamDstCustomColorMin );
dstMinColor->setLabel( "Min" );
dstMinColor->setDefault( 0.0, 0.0, 0.0, 0.0 );
dstMinColor->setParent( dstGroup );
OFX::RGBAParamDescriptor* dstMaxColor = desc.defineRGBAParam( kParamDstCustomColorMax );
dstMaxColor->setLabel( "Max" );
dstMaxColor->setDefault( 1.0, 1.0, 1.0, 1.0 );
dstMaxColor->setParent( dstGroup );
OFX::GroupParamDescriptor* processGroup = desc.defineGroupParam( kParamProcessGroup );
processGroup->setLabel( "Process" );
OFX::BooleanParamDescriptor* processR = desc.defineBooleanParam( kParamProcessR );
processR->setLabel( "R" );
processR->setDefault( true );
processR->setParent( processGroup );
OFX::BooleanParamDescriptor* processG = desc.defineBooleanParam( kParamProcessG );
processG->setLabel( "G" );
processG->setDefault( true );
processG->setParent( processGroup );
OFX::BooleanParamDescriptor* processB = desc.defineBooleanParam( kParamProcessB );
processB->setLabel( "B" );
processB->setDefault( true );
processB->setParent( processGroup );
OFX::BooleanParamDescriptor* processA = desc.defineBooleanParam( kParamProcessA );
processA->setLabel( "A" );
processA->setDefault( true );
processA->setParent( processGroup );
}
示例11:
OFX::PageParamDescriptor*
CImgFilterPluginHelperBase::describeInContextBegin(bool sourceIsOptional,
OFX::ImageEffectDescriptor &desc,
OFX::ContextEnum context,
bool supportsRGBA,
bool supportsRGB,
bool supportsXY,
bool supportsAlpha,
bool supportsTiles,
bool processRGB,
bool processAlpha,
bool processIsSecret)
{
#ifdef OFX_EXTENSIONS_NATRON
desc.setChannelSelector(OFX::ePixelComponentNone); // we have our own channel selector
#endif
OFX::ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
if (supportsRGBA) {
srcClip->addSupportedComponent(OFX::ePixelComponentRGBA);
}
if (supportsRGB) {
srcClip->addSupportedComponent(OFX::ePixelComponentRGB);
}
if (supportsXY) {
srcClip->addSupportedComponent(OFX::ePixelComponentXY);
}
if (supportsAlpha) {
srcClip->addSupportedComponent(OFX::ePixelComponentAlpha);
}
srcClip->setTemporalClipAccess(false);
srcClip->setSupportsTiles(supportsTiles);
srcClip->setIsMask(false);
if (context == OFX::eContextGeneral && sourceIsOptional) {
srcClip->setOptional(sourceIsOptional);
}
OFX::ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
if (supportsRGBA) {
dstClip->addSupportedComponent(OFX::ePixelComponentRGBA);
}
if (supportsRGB) {
dstClip->addSupportedComponent(OFX::ePixelComponentRGB);
}
if (supportsXY) {
dstClip->addSupportedComponent(OFX::ePixelComponentXY);
}
if (supportsAlpha) {
dstClip->addSupportedComponent(OFX::ePixelComponentAlpha);
}
dstClip->setSupportsTiles(supportsTiles);
OFX::ClipDescriptor *maskClip = (context == OFX::eContextPaint) ? desc.defineClip("Brush") : desc.defineClip("Mask");
maskClip->addSupportedComponent(OFX::ePixelComponentAlpha);
maskClip->setTemporalClipAccess(false);
if (context != OFX::eContextPaint) {
maskClip->setOptional(true);
}
maskClip->setSupportsTiles(supportsTiles);
maskClip->setIsMask(true);
// create the params
OFX::PageParamDescriptor *page = desc.definePageParam("Controls");
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kNatronOfxParamProcessR);
param->setLabel(kNatronOfxParamProcessRLabel);
param->setHint(kNatronOfxParamProcessRHint);
param->setDefault(processRGB);
param->setIsSecret(processIsSecret);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
if (page) {
page->addChild(*param);
}
}
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kNatronOfxParamProcessG);
param->setLabel(kNatronOfxParamProcessGLabel);
param->setHint(kNatronOfxParamProcessGHint);
param->setDefault(processRGB);
param->setIsSecret(processIsSecret);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
if (page) {
page->addChild(*param);
}
}
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kNatronOfxParamProcessB);
param->setLabel(kNatronOfxParamProcessBLabel);
param->setHint(kNatronOfxParamProcessBHint);
param->setDefault(processRGB);
param->setIsSecret(processIsSecret);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
if (page) {
page->addChild(*param);
}
}
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kNatronOfxParamProcessA);
//.........这里部分代码省略.........
示例12: describeWriterParamsInContext
void describeWriterParamsInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::StringParamDescriptor* filename = desc.defineStringParam( kTuttlePluginFilename );
filename->setLabel( kTuttlePluginFilenameLabel );
filename->setStringType( OFX::eStringTypeFilePath );
filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
// the file doesn't need to exist, the writer will create it!
filename->setFilePathExists(false);
desc.addClipPreferencesSlaveParam( *filename );
OFX::ChoiceParamDescriptor* channel = desc.defineChoiceParam( kTuttlePluginChannel );
channel->setLabel( kTuttlePluginChannelLabel );
channel->appendOption( kTuttlePluginChannelAuto );
channel->appendOption( kTuttlePluginChannelGray );
channel->appendOption( kTuttlePluginChannelRGB );
channel->appendOption( kTuttlePluginChannelRGBA );
channel->setDefault( 0 );
OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kTuttlePluginBitDepth );
bitDepth->setLabel( kTuttlePluginBitDepthLabel );
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
bitDepth->setDefault( 0 );
OFX::BooleanParamDescriptor* premult = desc.defineBooleanParam( kParamPremultiplied );
premult->setLabel( "Premultiplied" );
premult->setDefault( false );
OFX::ChoiceParamDescriptor* existingFile = desc.defineChoiceParam( kParamWriterExistingFile );
existingFile->setLabel( "Existing File" );
existingFile->appendOption( kParamWriterExistingFile_overwrite );
existingFile->appendOption( kParamWriterExistingFile_error );
if( OFX::getImageEffectHostDescription()->hostName == "TuttleOfx" )
{
// Only Tuttle is able to do that, because we disable the computation
// using the IsIdentity Action. This is not in the OpenFX standard.
existingFile->appendOption( kParamWriterExistingFile_skip );
}
//existingFile->appendOption( kParamWriterExistingFile_reader ); // TODO: not implemented yet.
existingFile->setDefault( eParamWriterExistingFile_overwrite );
OFX::BooleanParamDescriptor* copyToOutput = desc.defineBooleanParam( kParamWriterCopyToOutput );
copyToOutput->setLabel( "Copy buffer to output" );
copyToOutput->setHint( "This is only useful if you connect nodes to the output clip of the writer." );
copyToOutput->setDefault( false );
OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender );
render->setLabels( "Render", "Render", "Render step" );
render->setHint("Force render (writing)");
OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways );
renderAlways->setLabel( "Render always" );
renderAlways->setHint( "This is only useful as a workaround for GUI applications." );
renderAlways->setDefault( true ); // because tuttle is not declared as a background renderer
OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender );
forceNewRender->setLabel( "Force new render" );
forceNewRender->setHint( "This is only useful as a workaround for GUI applications." );
forceNewRender->setEnabled( false );
forceNewRender->setIsSecret( true );
forceNewRender->setIsPersistant( false );
forceNewRender->setAnimates( false );
forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
forceNewRender->setEvaluateOnChange( true );
forceNewRender->setDefault( 0 );
}
示例13: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void TurboJpegWriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
// Controls
describeWriterParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* channel = static_cast<OFX::ChoiceParamDescriptor*>( desc.getParamDescriptor( kTuttlePluginChannel ) );
channel->resetOptions();
channel->appendOption( kTuttlePluginChannelRGB );
channel->setDefault( 0 );
channel->setEnabled( false );
OFX::ChoiceParamDescriptor* bitDepth = static_cast<OFX::ChoiceParamDescriptor*>( desc.getParamDescriptor( kTuttlePluginBitDepth ) );
bitDepth->resetOptions();
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->setDefault( eTuttlePluginBitDepth8 );
bitDepth->setEnabled( false );
OFX::BooleanParamDescriptor* premult = static_cast<OFX::BooleanParamDescriptor*>( desc.getParamDescriptor( kParamPremultiplied ) );
premult->setDefault( true );
OFX::IntParamDescriptor* quality = desc.defineIntParam( kParamQuality );
quality->setLabel( "Quality" );
quality->setRange( 0, 100 );
quality->setDisplayRange( 0, 100 );
quality->setDefault( 80 );
OFX::ChoiceParamDescriptor* subsampling = desc.defineChoiceParam( kParamSubsampling );
subsampling->setLabel( kParamSubsamplingLabel );
subsampling->setHint( kParamSubsamplingHint );
subsampling->appendOption( kTurboJpegSubsampling444 );
subsampling->appendOption( kTurboJpegSubsampling422 );
subsampling->appendOption( kTurboJpegSubsampling420 );
subsampling->appendOption( kTurboJpegSubsamplingGray );
subsampling->appendOption( kTurboJpegSubsampling440 );
subsampling->setDefault( eTurboJpegSubsampling420 );
OFX::ChoiceParamDescriptor* optimization = desc.defineChoiceParam( kParamOptimization );
optimization->setLabel( kParamOptimizationLabel );
optimization->setHint( kParamOptimizationHint );
optimization->appendOption( kTurboJpegOptimizationNone );
optimization->appendOption( kTurboJpegOptimizationMMX );
optimization->appendOption( kTurboJpegOptimizationSSE );
optimization->appendOption( kTurboJpegOptimizationSSE2 );
optimization->appendOption( kTurboJpegOptimizationSSE3 );
optimization->setDefault( eTurboJpegOptimizationSSE3 );
}
示例14: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void HistogramPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
//global display
OFX::BooleanParamDescriptor* boolGLOBAL = desc.defineBooleanParam(kGlobalDisplay);
boolGLOBAL->setHint("Display global overlay on screen.");
boolGLOBAL->setDefault(true);
// RGB / HSL
{
//Group Param (RGB & HSL)
OFX::GroupParamDescriptor *groupRGB = desc.defineGroupParam(kGroupRGB);
groupRGB->setLabel(kGroupRGBLabel);
OFX::GroupParamDescriptor *groupHSL = desc.defineGroupParam(kGroupHSL);
groupHSL->setLabel(kGroupHSLLabel);
//Channels checkboxes (RGB)
OFX::BooleanParamDescriptor* boolR = desc.defineBooleanParam(kBoolRed);
boolR->setDefault(true); //red channel is not selected by default
boolR->setHint("Activate Red channel");
boolR->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
boolR->setParent(groupRGB);
//red multiplier
OFX::DoubleParamDescriptor* redMultiplier = desc.defineDoubleParam(kMultiplierRed);
redMultiplier->setLabel(kMultiplierLabel);
redMultiplier->setHint("Determinate curve from selection precision.");
redMultiplier->setRange(1, 1000);
redMultiplier->setDisplayRange(0,5);
redMultiplier->setDefault(1);
redMultiplier->setParent(groupRGB);
OFX::BooleanParamDescriptor* boolG = desc.defineBooleanParam(kBoolGreen);
boolG->setDefault(true); //green channel is not selected by default
boolG->setHint("Activate Green channel");
boolG->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
boolG->setParent(groupRGB);
//green multiplier
OFX::DoubleParamDescriptor* greenMultiplier = desc.defineDoubleParam(kMultiplierGreen);
greenMultiplier->setLabel(kMultiplierLabel);
greenMultiplier->setHint("Determinate curve from selection precision.");
greenMultiplier->setRange(1, 1000);
greenMultiplier->setDisplayRange(0,5);
greenMultiplier->setDefault(1);
greenMultiplier->setParent(groupRGB);
OFX::BooleanParamDescriptor* boolB = desc.defineBooleanParam(kBoolBlue);
boolB->setHint("Activate Blue channel");
boolB->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
boolB->setDefault(true); //blue channel is not selected by default
boolB->setParent(groupRGB);
//blue multiplier
OFX::DoubleParamDescriptor* blueMultiplier = desc.defineDoubleParam(kMultiplierBlue);
blueMultiplier->setLabel(kMultiplierLabel);
blueMultiplier->setHint("Determinate curve from selection precision.");
blueMultiplier->setRange(1, 1000);
blueMultiplier->setDisplayRange(0,5);
blueMultiplier->setDefault(1);
blueMultiplier->setParent(groupRGB);
//Channels check box (HSL)
OFX::BooleanParamDescriptor* boolH = desc.defineBooleanParam(kBoolHue);
boolH->setDefault(true);
boolH->setHint("Activate Hue channel");
boolH->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
boolH->setParent(groupHSL);
//Hue multiplier
OFX::DoubleParamDescriptor* hueMultiplier = desc.defineDoubleParam(kMultiplierHue);
hueMultiplier->setLabel(kMultiplierLabel);
hueMultiplier->setHint("Determinate curve from selection precision.");
hueMultiplier->setRange(1, 1000);
hueMultiplier->setDisplayRange(0,5);
hueMultiplier->setDefault(1);
hueMultiplier->setParent(groupHSL);
OFX::BooleanParamDescriptor* boolS = desc.defineBooleanParam(kBoolSaturation);
boolS->setDefault(true);
boolS->setHint("Activate Saturation channel");
boolS->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
boolS->setParent(groupHSL);
//Saturation multiplier
OFX::DoubleParamDescriptor* saturationMultiplier = desc.defineDoubleParam(kMultiplierSaturation);
saturationMultiplier->setLabel(kMultiplierLabel);
saturationMultiplier->setHint("Determinate curve from selection precision.");
//.........这里部分代码省略.........
示例15: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void ResizePluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::EContext context)
{
OFX::ClipDescriptor* srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
srcClip->addSupportedComponent(OFX::ePixelComponentRGBA);
srcClip->addSupportedComponent(OFX::ePixelComponentRGB);
srcClip->addSupportedComponent(OFX::ePixelComponentAlpha);
srcClip->setSupportsTiles(kSupportTiles);
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
dstClip->addSupportedComponent(OFX::ePixelComponentRGBA);
dstClip->addSupportedComponent(OFX::ePixelComponentRGB);
dstClip->addSupportedComponent(OFX::ePixelComponentAlpha);
dstClip->setSupportsTiles(kSupportTiles);
OFX::ChoiceParamDescriptor* method = desc.defineChoiceParam(kParamMode);
method->setLabel("Mode");
method->appendOption(kParamModeFormat);
method->appendOption(kParamModeSize);
method->appendOption(kParamModeScale);
method->setDefault(eParamModeFormat);
OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam(kParamFormat);
format->setLabel("Format");
format->appendOption(kParamFormatPCVideo, kParamFormatPCVideoLabel);
format->appendOption(kParamFormatNTSC, kParamFormatNTSCLabel);
format->appendOption(kParamFormatPAL, kParamFormatPALLabel);
format->appendOption(kParamFormatHD, kParamFormatHDLabel);
format->appendOption(kParamFormatNTSC169, kParamFormatNTSC169Label);
format->appendOption(kParamFormatPAL169, kParamFormatPAL169Label);
format->appendOption(kParamFormat1kSuper35, kParamFormat1kSuper35Label);
format->appendOption(kParamFormat1kCinemascope, kParamFormat1kCinemascopeLabel);
format->appendOption(kParamFormat2kSuper35, kParamFormat2kSuper35Label);
format->appendOption(kParamFormat2kCinemascope, kParamFormat2kCinemascopeLabel);
format->appendOption(kParamFormat4kSuper35, kParamFormat4kSuper35Label);
format->appendOption(kParamFormat4kCinemascope, kParamFormat4kCinemascopeLabel);
format->appendOption(kParamFormatSquare256, kParamFormatSquare256Label);
format->appendOption(kParamFormatSquare512, kParamFormatSquare512Label);
format->appendOption(kParamFormatSquare1k, kParamFormatSquare1kLabel);
format->appendOption(kParamFormatSquare2k, kParamFormatSquare2kLabel);
format->setDefault(eParamFormat2kCinemascope);
OFX::Double2DParamDescriptor* scale = desc.defineDouble2DParam(kParamScale);
scale->setLabel("Scale");
scale->setDefault(1.0, 1.0);
scale->setRange(0.01, 0.01, std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
scale->setDisplayRange(0.1, 0.1, 2.5, 2.5);
scale->setHint("Scale the input image [0, 0, width*scale, height*scale].");
OFX::BooleanParamDescriptor* keepRatio = desc.defineBooleanParam(kParamSizeKeepRatio);
keepRatio->setLabel("Keep ratio");
keepRatio->setDefault(false);
keepRatio->setHint("Keep input image ratio.");
OFX::Int2DParamDescriptor* size = desc.defineInt2DParam(kParamSize);
size->setLabel("Size");
size->setDefault(200, 200);
size->setRange(1, 1, std::numeric_limits<int>::max(), std::numeric_limits<int>::max());
size->setHint("Set the output size (width, height).");
OFX::ChoiceParamDescriptor* direction = desc.defineChoiceParam(kParamSizeOrientation);
direction->setLabel("Orientation");
direction->appendOption(kParamSizeOrientationX);
direction->appendOption(kParamSizeOrientationY);
direction->setDefault(eParamSizeOrientationX);
OFX::IntParamDescriptor* width = desc.defineIntParam(kParamSizeWidth);
width->setLabel("Width");
width->setDefault(200);
width->setRange(1, std::numeric_limits<int>::max());
width->setDisplayRange(0, 3000);
width->setHint("Set the width in pixels and keep the input image ratio.");
OFX::IntParamDescriptor* height = desc.defineIntParam(kParamSizeHeight);
height->setLabel("Height");
height->setDefault(200);
height->setRange(1, std::numeric_limits<int>::max());
height->setDisplayRange(0, 3000);
height->setHint("Set the height in pixels and keep the input image ratio.");
#if(TUTTLE_EXPERIMENTAL)
OFX::BooleanParamDescriptor* center = desc.defineBooleanParam(kParamCenter);
center->setLabel("Center resizing");
center->setDefault(false);
center->setHint("Resize around the center point.");
OFX::Double2DParamDescriptor* centerPoint = desc.defineDouble2DParam(kParamCenterPoint);
centerPoint->setDefault(100, 100);
centerPoint->setLabel("Center point at");
centerPoint->setHint("Position of the center point.");
#endif
// sampler parameters //
describeSamplerParamsInContext(desc, context);
}