本文整理汇总了C++中ofx::BooleanParamDescriptor::setLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ BooleanParamDescriptor::setLabel方法的具体用法?C++ BooleanParamDescriptor::setLabel怎么用?C++ BooleanParamDescriptor::setLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::BooleanParamDescriptor
的用法示例。
在下文中一共展示了BooleanParamDescriptor::setLabel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void TurboJpegReaderPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
// 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 );
describeReaderParamsInContext( desc, context );
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 );
OFX::BooleanParamDescriptor* fastupsampling = desc.defineBooleanParam( kParamFastUpsampling );
fastupsampling->setLabel( kParamFastUpsamplingLabel );
fastupsampling->setHint( kParamFastUpsamplingHint );
fastupsampling->setDefault( false );
}
示例2: 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 );
}
示例3: 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." );
}
示例4: 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 );
}
示例5: 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." );
}
示例6: 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 );
}
示例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 PrintPluginFactory::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( "Mode" );
mode->appendOption( kParamModeImage );
mode->appendOption( kParamModeRegion );
mode->appendOption( kParamModePixel );
OFX::Int2DParamDescriptor* pixel = desc.defineInt2DParam( kParamPixel );
pixel->setLabel( "Pixel" );
pixel->setDisplayRange( 0, 0, 2000, 2000 );
OFX::Int2DParamDescriptor* regionMin = desc.defineInt2DParam( kParamRegionMin );
regionMin->setLabel( "Region min" );
regionMin->setDisplayRange( 0, 0, 2000, 2000 );
OFX::Int2DParamDescriptor* regionMax = desc.defineInt2DParam( kParamRegionMax );
regionMax->setLabel( "Region max" );
regionMax->setDefault( 1,1 );
regionMax->setDisplayRange( 0, 0, 2000, 2000 );
OFX::IntParamDescriptor* outputColumns = desc.defineIntParam( kParamColumns );
outputColumns->setDefault(80);
outputColumns->setDisplayRange(1,500);
OFX::ChoiceParamDescriptor* colorType = desc.defineChoiceParam( kParamColor );
colorType->appendOption( kParamColorMono );
colorType->appendOption( kParamColorGray );
colorType->appendOption( kParamColor8 );
colorType->appendOption( kParamColor16 );
colorType->appendOption( kParamColorFullGray );
colorType->appendOption( kParamColorFull8 );
colorType->appendOption( kParamColorFull16 );
colorType->setLabel( "Color type for the output." );
OFX::ChoiceParamDescriptor* output = desc.defineChoiceParam( kParamOutput );
output->setLabel( "Output" );
output->appendOption( kParamOutputAscii );
output->appendOption( kParamOutputNumeric );
OFX::BooleanParamDescriptor* flip = desc.defineBooleanParam( kParamFlip );
flip->setLabel( "Flip" );
OFX::BooleanParamDescriptor* openGlWindow = desc.defineBooleanParam( kParamOutputOpenGL );
openGlWindow->setLabel( "Show in OpenGL Window." );
}
示例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: 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);
}
示例13: 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 );
}
示例14: describeGeneratorParamsInContext
void describeGeneratorParamsInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
/* to activate this
// Create the mandated optional input clip
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
srcClip->setOptional(true);
*/
// 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* explicitConversion = desc.defineChoiceParam( kParamGeneratorExplicitConversion );
explicitConversion->setLabel( "Explicit conversion" );
explicitConversion->appendOption( kTuttlePluginBitDepthAuto );
explicitConversion->appendOption( kTuttlePluginBitDepth8 );
explicitConversion->appendOption( kTuttlePluginBitDepth16 );
explicitConversion->appendOption( kTuttlePluginBitDepth32f );
explicitConversion->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
explicitConversion->setAnimates( false );
desc.addClipPreferencesSlaveParam( *explicitConversion );
if( OFX::getImageEffectHostDescription()->supportsMultipleClipDepths )
{
explicitConversion->setDefault( 0 );
}
else
{
explicitConversion->setIsSecret( true );
explicitConversion->setDefault( static_cast<int>( OFX::getImageEffectHostDescription()->getPixelDepth() ) );
}
OFX::ChoiceParamDescriptor* method = desc.defineChoiceParam( kParamMode );
method->setLabel ( "Mode" );
method->appendOption( kParamModeFormat );
method->appendOption( kParamModeSize );
method->setDefault ( eParamModeFormat );
OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam( kParamFormat );
format->setLabel( "Format" );
format->appendOption( kParamFormatPCVideo );
format->appendOption( kParamFormatNTSC );
format->appendOption( kParamFormatPAL );
format->appendOption( kParamFormatHD );
format->appendOption( kParamFormatNTSC169 );
format->appendOption( kParamFormatPAL169 );
format->appendOption( kParamFormat1kSuper35 );
format->appendOption( kParamFormat1kCinemascope );
format->appendOption( kParamFormat2kSuper35 );
format->appendOption( kParamFormat2kCinemascope );
format->appendOption( kParamFormat4kSuper35 );
format->appendOption( kParamFormat4kCinemascope );
format->appendOption( kParamFormatSquare256 );
format->appendOption( kParamFormatSquare512 );
format->appendOption( kParamFormatSquare1k );
format->appendOption( kParamFormatSquare2k );
format->setDefault( eParamFormat2kCinemascope );
OFX::BooleanParamDescriptor* specificRatio = desc.defineBooleanParam( kParamSizeSpecificRatio );
specificRatio->setLabel( "Specific ratio" );
specificRatio->setDefault( false );
specificRatio->setHint( "Specific 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::DoubleParamDescriptor* ratioValue = desc.defineDoubleParam( kParamSizeRatioValue );
ratioValue->setLabel( "Ratio Value" );
ratioValue->setDefault( 1.0 );
ratioValue->setRange( 1, std::numeric_limits<int>::max() );
ratioValue->setDisplayRange( 0, 50 );
ratioValue->setHint( "Set the ratio." );
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 specify the ratio." );
OFX::IntParamDescriptor* height = desc.defineIntParam( kParamSizeHeight );
height->setLabel( "Height" );
height->setDefault( 200 );
//.........这里部分代码省略.........
示例15: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void PushPixelPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
// no tiles on src clip, because it depends on the mask content so we can't
// define the maximal bounding box needed...
srcClip->setSupportsTiles( false );
OFX::ClipDescriptor* maskClip = desc.defineClip( kClipMask );
maskClip->addSupportedComponent( OFX::ePixelComponentRGBA );
maskClip->addSupportedComponent( OFX::ePixelComponentAlpha );
maskClip->setIsMask( true );
maskClip->setOptional( true );
maskClip->setSupportsTiles( true );
OFX::ChoiceParamDescriptor* output = desc.defineChoiceParam( kParamOutput );
output->setLabel( "Output" );
output->appendOption( kParamOutputMotionVectors );
output->appendOption( kParamOutputPushPixel );
output->setDefault( 1 );
OFX::DoubleParamDescriptor* size = desc.defineDoubleParam( kParamSize );
size->setLabel( "Size" );
size->setHint( "Size of the gradient window." );
size->setRange( 0.0, std::numeric_limits<double>::max() );
size->setDisplayRange( 1.0, 10.0 );
size->setDefault( 2.0 );
OFX::BooleanParamDescriptor* normalizedKernel = desc.defineBooleanParam( kParamNormalizedKernel );
normalizedKernel->setLabel( "Normalized kernel" );
normalizedKernel->setHint( "Use a normalized kernel to compute the gradient." );
normalizedKernel->setDefault( true );
//#ifndef TUTTLE_PRODUCTION
normalizedKernel->setIsSecret( true );
//#endif
OFX::DoubleParamDescriptor* intensity = desc.defineDoubleParam( kParamIntensity );
intensity->setLabel( "Intensity" );
intensity->setHint( "Scale motion vectors." );
intensity->setDisplayRange( 0.0, 2.0 );
intensity->setDefault( 0.75 );
OFX::DoubleParamDescriptor* angle = desc.defineDoubleParam( kParamAngle );
angle->setLabel( "Angle" );
angle->setHint( "Rotation on the gradient." );
angle->setDisplayRange(-180, 180);
angle->setDoubleType( OFX::eDoubleTypeAngle );
angle->setDefault( 0.0 );
OFX::ChoiceParamDescriptor* interpolation = desc.defineChoiceParam( kParamInterpolation );
interpolation->setLabel( "Interpolation" );
interpolation->setHint( "Interpolation method." );
interpolation->appendOption( kParamInterpolationNearest );
interpolation->appendOption( kParamInterpolationBilinear );
interpolation->setDefault( 1 );
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 );
}