本文整理汇总了C++中ofx::ImageEffectDescriptor::definePushButtonParam方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageEffectDescriptor::definePushButtonParam方法的具体用法?C++ ImageEffectDescriptor::definePushButtonParam怎么用?C++ ImageEffectDescriptor::definePushButtonParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::ImageEffectDescriptor
的用法示例。
在下文中一共展示了ImageEffectDescriptor::definePushButtonParam方法的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 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 );
}
示例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 ConvolutionPluginFactory::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::Int2DParamDescriptor* size = desc.defineInt2DParam( kParamSize );
size->setLabel( "Size" );
size->setDefault( 3, 3 );
// size->setIncrement( 2, 2 );
size->setRange( 3, 3, kParamSizeMax, kParamSizeMax );
for( unsigned int y = 0; y < kParamSizeMax; ++y )
{
for( unsigned int x = 0; x < kParamSizeMax; ++x )
{
const std::string name( getCoefName( y, x ) );
OFX::DoubleParamDescriptor* coef = desc.defineDoubleParam( name );
coef->setLabel( name );
coef->setDisplayRange( -10.0, 10.0 );
coef->setDefault( 0.0 );
}
}
OFX::PushButtonParamDescriptor* helpButton = desc.definePushButtonParam( kHelpButton );
helpButton->setLabel( "Help" );
}
示例4: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void CropPluginFactory::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::BooleanParamDescriptor* bop = desc.defineBooleanParam( kParamFillMode );
bop->setLabels( kParamFillModeLabel, kParamFillModeLabel, kParamFillModeLabel );
bop->setScriptName( "BandsOperations" );
bop->setHint( "Fill bands with black color or repeat last pixel and reset Rod." );
bop->setDefault( true );
OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam( kParamPresets );
format->setLabels( kParamPresetsLabel, kParamPresetsLabel, kParamPresetsLabel );
format->setScriptName( "formats" );
format->appendOption( "1.33 (4/3) bands" );
format->appendOption( "1.77 (16/9e) bands" );
format->appendOption( "1.85 bands" );
format->appendOption( "2.35 (Cinemascope) bands" );
format->appendOption( "2.40 bands" );
format->setDefault( 0 );
OFX::BooleanParamDescriptor* shape = desc.defineBooleanParam( kParamDisplayRect );
shape->setLabels( kParamDisplayRectLabel, kParamDisplayRectLabel, kParamDisplayRectLabel );
shape->setDefault( false );
OFX::BooleanParamDescriptor* anamorphic = desc.defineBooleanParam( kParamAnamorphic );
anamorphic->setLabels( kParamAnamorphicLabel, kParamAnamorphicLabel, "Anamorphic (stretch)" );
anamorphic->setDefault( false );
anamorphic->setIsSecret( true );
OFX::GroupParamDescriptor* bandsGroup = desc.defineGroupParam( "Bands sizes" );
OFX::IntParamDescriptor* upBand = desc.defineIntParam( kParamUp );
upBand->setLabels( kParamUpLabel, kParamUpLabel, kParamUpLabel );
upBand->setParent( *bandsGroup );
OFX::IntParamDescriptor* downBand = desc.defineIntParam( kParamDown );
downBand->setLabels( kParamDownLabel, kParamDownLabel, kParamDownLabel );
downBand->setParent( *bandsGroup );
OFX::IntParamDescriptor* leftBand = desc.defineIntParam( kParamLeft );
leftBand->setLabels( kParamLeftLabel, kParamLeftLabel, kParamLeftLabel );
leftBand->setParent( *bandsGroup );
OFX::IntParamDescriptor* rightBand = desc.defineIntParam( kParamRight );
rightBand->setLabels( kParamRightLabel, kParamRightLabel, kParamRightLabel );
rightBand->setParent( *bandsGroup );
OFX::PushButtonParamDescriptor* helpButton = desc.definePushButtonParam( kCropHelpButton );
helpButton->setScriptName( "&Help" );
}
示例5: 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 );
}
示例6: 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 );
}
示例7: 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");
//.........这里部分代码省略.........
示例8: describeInContext
//.........这里部分代码省略.........
OFX::IntParamDescriptor *param = desc.defineIntParam(kParamCalibGridSize);
param->setLabel("Max Calibration Grid Size");
param->setHint("Define the number of cells per edge.");
param->setRange(0, kOfxFlagInfiniteMax);
param->setDisplayRange(0, 100);
param->setDefault(10);
param->setAnimates(false);
param->setParent(*groupCalibration);
}
{
OFX::IntParamDescriptor *param = desc.defineIntParam(kParamMinInputFrames);
param->setLabel("Min Input Frames");
param->setHint("Minimal number of frames to limit the calibration refinement loop.");
param->setRange(0, kOfxFlagInfiniteMax);
param->setDisplayRange(0, 1000);
param->setDefault(10);
param->setAnimates(false);
param->setParent(*groupCalibration);
}
{
OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamMaxTotalAvgErr);
param->setLabel("Max Total Average Error");
param->setHint("Maximal limit of the total average error");
param->setRange(0, 1);
param->setDisplayRange(0, 1);
param->setDefault(0.1);
param->setAnimates(false);
param->setParent(*groupCalibration);
}
{
OFX::PushButtonParamDescriptor *param = desc.definePushButtonParam(kParamCalibrate);
param->setLabel("Calibrate");
param->setHint("calibrate");
param->setParent(*groupCalibration);
}
}
//Output Group
{
OFX::GroupParamDescriptor *groupOutput = desc.defineGroupParam(kParamGroupOutput);
groupOutput->setLabel("Output");
groupOutput->setAsTab();
{
OFX::BooleanParamDescriptor *param = desc.defineBooleanParam(kParamOutputIsCalibrated);
param->setLabel("Is calibrated");
param->setHint("Is calibrated");
param->setParent(*groupOutput);
}
{
OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputAvgReprojErr);
param->setLabel("Average Reprojection Error");
param->setDisplayRange(0, 10);
param->setEvaluateOnChange(false);
param->setEnabled(false);
param->setAnimates(true);
param->setParent(*groupOutput);
param->setLayoutHint(OFX::eLayoutHintDivider);
}
{
示例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 PinningPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
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::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
//////////////////// Options ////////////////////
OFX::ChoiceParamDescriptor* method = desc.defineChoiceParam( kParamMethod );
method->setLabel( "Method" );
method->appendOption( kParamMethodAffine );
method->appendOption( kParamMethodPerspective );
method->appendOption( kParamMethodBilinear );
method->setDefault( 1 );
method->setHint( "Interpolation method" );
OFX::ChoiceParamDescriptor* interpolation = desc.defineChoiceParam( kParamInterpolation );
interpolation->setLabel( "Interpolation" );
interpolation->appendOption( kParamInterpolationNearest );
interpolation->appendOption( kParamInterpolationBilinear );
interpolation->setDefault( 1 );
interpolation->setHint( "Interpolation method" );
OFX::PushButtonParamDescriptor* setToCornersIn = desc.definePushButtonParam( kParamSetToCornersIn);
setToCornersIn->setLabel( "Set In" );
setToCornersIn->setHint("Set to corners in points");
OFX::PushButtonParamDescriptor* setToCornersOut = desc.definePushButtonParam( kParamSetToCornersOut);
setToCornersOut->setLabel( "Set Out" );
setToCornersOut->setHint("Set to corners out points");
OFX::BooleanParamDescriptor* overlay = desc.defineBooleanParam( kParamOverlay );
overlay->setLabel( "Overlay" );
overlay->setDefault( true );
OFX::BooleanParamDescriptor* inverse = desc.defineBooleanParam( kParamInverse );
inverse->setLabel( "Inverse" );
inverse->setDefault( false );
/*
//TODO-vince///////////
//////////////////// Transform Centre Point ////////////////////
OFX::GroupParamDescriptor* groupCentre = desc.defineGroupParam( kParamGroupCentre );
groupCentre->setLabel( "Centre point" );
groupCentre->setOpen(false);
OFX::ChoiceParamDescriptor* manipulatorMode = desc.defineChoiceParam( kParamManipulatorMode );
manipulatorMode->appendOption( kParamManipulatorModeTranslate );
manipulatorMode->appendOption( kParamManipulatorModeRotate );
manipulatorMode->appendOption( kParamManipulatorModeScale );
OFX::Double2DParamDescriptor* pCentre = desc.defineDouble2DParam( kParamPointCentre);
pCentre->setLabel( "Centre point" );
pCentre->setHint( "Transform Centre point" );
pCentre->setDefault( 0.0, 0.0 );
pCentre->setParent( groupCentre );
OFX::BooleanParamDescriptor* overlayCentre = desc.defineBooleanParam( kParamOverlayCentre );
overlayCentre->setLabel( "Overlay" );
overlayCentre->setDefault( true );
overlayCentre->setParent( groupCentre );
OFX::RGBParamDescriptor* ouverlayCentreColor = desc.defineRGBParam( kParamOverlayCentreColor );
ouverlayCentreColor->setLabel( "Color" );
ouverlayCentreColor->setHint( "Centre point overlay color" );
ouverlayCentreColor->setDefault( 0.0, 1.0, 0.0 );
ouverlayCentreColor->setParent( groupCentre );
*/
//////////////////// IN Points ////////////////////
OFX::GroupParamDescriptor* groupIn = desc.defineGroupParam( kParamGroupIn );
groupIn->setLabel( "Input points" );
groupIn->setOpen(false);
OFX::Double2DParamDescriptor* pIn0 = desc.defineDouble2DParam( kParamPointIn + "0" );
pIn0->setLabel( "In 0" );
pIn0->setHint( "Input point 0" );
pIn0->setDefault( -0.5, -0.5 );
pIn0->setParent( groupIn );
OFX::Double2DParamDescriptor* pIn1 = desc.defineDouble2DParam( kParamPointIn + "1" );
pIn1->setLabel( "In 1" );
pIn1->setHint( "Input point 1" );
pIn1->setDefault( 0.5, -0.5 );
pIn1->setParent( groupIn );
OFX::Double2DParamDescriptor* pIn2 = desc.defineDouble2DParam( kParamPointIn + "2" );
pIn2->setLabel( "In 2" );
pIn2->setHint( "Input point 2" );
pIn2->setDefault( -0.5, 0.5 );
//.........这里部分代码省略.........
示例11: describeInContext
void GenericTestExamplePluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum /*context*/)
{
ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
srcClip->addSupportedComponent(ePixelComponentRGBA);
srcClip->addSupportedComponent(ePixelComponentAlpha);
srcClip->setTemporalClipAccess(false);
srcClip->setSupportsTiles(true);
srcClip->setIsMask(false);
ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
dstClip->addSupportedComponent(ePixelComponentRGBA);
dstClip->addSupportedComponent(ePixelComponentAlpha);
dstClip->setSupportsTiles(true);
DoubleParamDescriptor *param1 = desc.defineDoubleParam("MinMaxTest");
param1->setLabels("Min/Max Test", "Min/Max Test", "Min/Max Test");
param1->setScriptName("minMaxTest");
param1->setHint("A double parameter to illustrate visual min/max.");
param1->setDefault(50.0);
param1->setRange(-1000, 1000);
param1->setDisplayRange(-1000, 1000);
param1->setDoubleType(eDoubleTypePlain);
ChoiceParamDescriptor* param2 = desc.defineChoiceParam("enableTest");
param2->setLabels("Enabler", "Enabler", "Enabler");
param2->appendOption("Enable parameter", "Enable parameter");
param2->appendOption("Disable parameter", "Disable parameter");
DoubleParamDescriptor *param3 = desc.defineDoubleParam("enableDbl");
param3->setLabels("Enabled by Enabler", "Enabled by Enabler", "Enabled by Enabler");
BooleanParamDescriptor* bparam = desc.defineBooleanParam("Insignificant");
bparam->setLabels("Insignificant", "Insignificant", "Insignificant");
bparam->setHint("Shouldn't cause a re-render.");
bparam->setEvaluateOnChange(false);
BooleanParamDescriptor* bparam2 = desc.defineBooleanParam("secretTest");
bparam2->setLabels("SECRET!", "SECRET!", "SECRET!");
bparam2->setIsSecret(true);
bparam2->setHint("Shouldn't be shown in the user interface.");
BooleanParamDescriptor* bparam3 = desc.defineBooleanParam("nonPersistent");
bparam3->setLabels("Non-persistent", "Non-persistent", "Non-persistent");
bparam3->setHint("Shouldn't be saved in the plugin description.");
bparam3->setIsPersistent(false);
DoubleParamDescriptor *param5 = desc.defineDoubleParam("animateDbl");
param5->setLabels("No Animation", "No Animation", "No Animation");
param5->setAnimates(false);
DoubleParamDescriptor *param6 = desc.defineDoubleParam("angleTest");
param6->setLabels("Angle?", "Angle?", "Angle?");
param6->setRange(-180.0, 180.0);
param6->setHint("An angle parameter.");
param6->setDoubleType(eDoubleTypeAngle);
PushButtonParamDescriptor* pb = desc.definePushButtonParam("pbButton");
pb->setLabels("Push Me", "Push Me", "Push Me");
PushButtonParamDescriptor* pb2 = desc.definePushButtonParam("analyseButton");
pb2->setLabels("Analyse", "Analyse", "Analyse");
DoubleParamDescriptor *param7 = desc.defineDoubleParam("analysisParam");
param7->setLabels("Analysis Slave", "Analysis Slave", "Analysis Slave");
Double2DParamDescriptor* widgetPos = desc.defineDouble2DParam("widgetPos");
widgetPos->setLabels("Widget Position", "Widget Position", "Widget Position");
widgetPos->setDoubleType(OFX::eDoubleTypeXYAbsolute);
widgetPos->setDefaultCoordinateSystem(eCoordinatesNormalised);
widgetPos->setDimensionLabels("X Position", "Y Position");
widgetPos->setDefault(0.5, 0.5);
}
示例12: describeInContext
//.........这里部分代码省略.........
OFX::DoubleParamDescriptor* preScale = desc.defineDoubleParam( kParamPreScale );
preScale->setLabel( "Pre-scale" );
// preScale->setDoubleType( eDoubleTypeNormalisedXY );
preScale->setDefault( 1.0 );
preScale->setRange( 0.00001, std::numeric_limits<double>::max() );
preScale->setDisplayRange( 0.0, 2.5 );
preScale->setHint( "If the transformation of optics is high, you may need to change the scale of the result to be globally closer to the source image or preserve a good resolution." );
OFX::DoubleParamDescriptor* postScale = desc.defineDoubleParam( kParamPostScale );
postScale->setLabel( "Post-scale" );
// scale->setDoubleType( eDoubleTypeNormalisedXY );
postScale->setDefault( 1.0 );
postScale->setRange( 0.00001, std::numeric_limits<double>::max() );
postScale->setDisplayRange( 0.0, 2.5 );
postScale->setHint( "If the transformation of optics is high, you may need to change the scale of the result to be globally closer to the source image or preserve a good resolution." );
OFX::ChoiceParamDescriptor* interpolation = desc.defineChoiceParam( kParamInterpolation );
interpolation->setLabel( "Interpolation" );
interpolation->appendOption( kParamInterpolationNearest );
interpolation->appendOption( kParamInterpolationBilinear );
interpolation->setDefault( 1 );
interpolation->setHint( "Interpolation method" );
OFX::ChoiceParamDescriptor* resizeRod = desc.defineChoiceParam( kParamResizeRod );
resizeRod->setLabel( "Resize RoD" );
resizeRod->appendOption( kParamResizeRodNo );
resizeRod->appendOption( kParamResizeRodSourceRef );
resizeRod->appendOption( kParamResizeRodMin );
resizeRod->appendOption( kParamResizeRodMax );
resizeRod->appendOption( kParamResizeRodManual );
resizeRod->setDefault( 0 );
resizeRod->setHint( "Resize output RoD" );
OFX::DoubleParamDescriptor* scaleRod = desc.defineDoubleParam( kParamResizeRodManualScale );
scaleRod->setLabel( "Scale RoD" );
// scaleRod->setDoubleType( eDoubleTypeNormalisedXY );
// scaleRod->setIsSecret( true );
// scaleRod->setEnabled( false );
scaleRod->setDefault( 1.0 );
scaleRod->setRange( 0.0, std::numeric_limits<double>::max() );
scaleRod->setDisplayRange( 0, 2.5 );
scaleRod->setHint( "Adjust the output RoD." );
OFX::GroupParamDescriptor* displayOptions = desc.defineGroupParam( kParamDisplayOptions );
displayOptions->setLabel( "Display options" );
displayOptions->setHint( "Display options (change nothing on the image)" );
OFX::BooleanParamDescriptor* displayGrid = desc.defineBooleanParam( kParamGridOverlay );
displayGrid->setLabel( "Display grid" );
displayGrid->setParent( *displayOptions );
displayGrid->setDefault( false );
displayGrid->setEvaluateOnChange( false );
displayGrid->setHint( "Display the grid" );
OFX::Double2DParamDescriptor* gridCenter = desc.defineDouble2DParam( kParamGridCenter );
gridCenter->setLabel( "Grid center" );
gridCenter->setDoubleType( OFX::eDoubleTypePlain );
gridCenter->setParent( *displayOptions );
gridCenter->setDefault( 0.0, 0.0 );
gridCenter->setDisplayRange( -1.0, -1.0, 1.0, 1.0 );
gridCenter->setEvaluateOnChange( false );
gridCenter->setHint( "Allows you to shift the center of the display grid." );
OFX::BooleanParamDescriptor* gridCenterOverlay = desc.defineBooleanParam( kParamGridCenterOverlay );
gridCenterOverlay->setLabel( "Display grid center" );
gridCenterOverlay->setParent( *displayOptions );
gridCenterOverlay->setDefault( false );
gridCenterOverlay->setEvaluateOnChange( false );
gridCenterOverlay->setHint( "Active grid center point overlay." );
OFX::Double2DParamDescriptor* gridScale = desc.defineDouble2DParam( kParamGridScale );
gridScale->setLabel( "Grid scale" );
gridScale->setDoubleType( OFX::eDoubleTypePlain );
gridScale->setParent( *displayOptions );
gridScale->setDefault( 1.0, 1.0 );
gridScale->setDisplayRange( -10.0, -10.0, 10.0, 10.0 );
gridScale->setEvaluateOnChange( false );
gridScale->setHint( "Allows you to scale the display grid." );
OFX::GroupParamDescriptor* debugOptions = desc.defineGroupParam( kParamDebugOptions );
debugOptions->setLabel( "Debug options" );
debugOptions->setHint( "Debug options" );
debugOptions->setParent( *displayOptions );
#ifdef TUTTLE_PRODUCTION
debugOptions->setIsSecret( true );
#endif
OFX::BooleanParamDescriptor* debugDisplayRoi = desc.defineBooleanParam( kParamDebugDisplayRoi );
debugDisplayRoi->setLabel( "Display RoI" );
#ifdef TUTTLE_PRODUCTION
debugDisplayRoi->setIsSecret( true );
#endif
debugDisplayRoi->setParent( *debugOptions );
debugDisplayRoi->setDefault( false );
debugDisplayRoi->setEvaluateOnChange( false );
debugDisplayRoi->setHint( "Display RoI" );
OFX::PushButtonParamDescriptor* helpButton = desc.definePushButtonParam( kParamHelp );
helpButton->setLabel( "Help" );
}
示例13: describeInContext
//.........这里部分代码省略.........
hueMultiplier->setDefault(1);
hueMultiplier->setParent(groupHSL);
OFX::BooleanParamDescriptor* boolS = desc.defineBooleanParam(kBoolSaturation);
boolS->setDefault(false);
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.");
saturationMultiplier->setRange(1, 1000);
saturationMultiplier->setDisplayRange(0,5);
saturationMultiplier->setDefault(1);
saturationMultiplier->setParent(groupHSL);
OFX::BooleanParamDescriptor* boolL = desc.defineBooleanParam(kBoolLightness);
boolL->setHint("Activate Lightness channel");
boolL->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
boolL->setDefault(false);
boolL->setParent(groupHSL);
//Lightness multiplier
OFX::DoubleParamDescriptor* lightnessMultiplier = desc.defineDoubleParam(kMultiplierLightness);
lightnessMultiplier->setLabel(kMultiplierLabel);
lightnessMultiplier->setHint("Determinate curve from selection precision.");
lightnessMultiplier->setRange(1, 1000);
lightnessMultiplier->setDisplayRange(0,5);
lightnessMultiplier->setDefault(1);
lightnessMultiplier->setParent(groupHSL);
//Clean Button (RGB)
OFX::PushButtonParamDescriptor* resetButtonRGB = desc.definePushButtonParam(kButtonResetRGB);
resetButtonRGB->setLabel(kButtonResetRGBLabel);
resetButtonRGB->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
resetButtonRGB->setHint("Reset the selected RGB curves. \n Warning : the curves may not be refreshed click on overlay to refresh.");
resetButtonRGB->setParent(groupRGB);
//Selection To Curves Button (RGB)
OFX::PushButtonParamDescriptor* selectionToCurveButtonRGB = desc.definePushButtonParam(kButtonSelectionToCurveRGB);
selectionToCurveButtonRGB->setLabel(kButtonSelectionToCurveRGBLabel);
selectionToCurveButtonRGB->setHint("Load selected RGB curves with selection data. \n Warning : the curves may not be refreshed click on overlay to refresh.");
selectionToCurveButtonRGB->setParent(groupRGB);
//Append selection to curves button (RGB)
OFX::PushButtonParamDescriptor* appendSelectionToCurveRGB = desc.definePushButtonParam(kButtonAppendSelectionToCurveRGB);
appendSelectionToCurveRGB->setLabel(kButtonAppendSelectionToCurveRGBLabel); //add label
appendSelectionToCurveRGB->setHint("Append current selection to selected RGB channels");//help
appendSelectionToCurveRGB->setParent(groupRGB); //add to RGB group
//Clean Button (HSL)
OFX::PushButtonParamDescriptor* resetButtonHSL = desc.definePushButtonParam(kButtonResetHSL);
resetButtonHSL->setLabel(kButtonResetHSLLabel);
resetButtonHSL->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
resetButtonHSL->setHint("Reset the selected HSL curves \n Warning : the curves may not be refreshed click on overlay to refresh.");
resetButtonHSL->setParent(groupHSL);
//Selection To Curves Button (HSL)
OFX::PushButtonParamDescriptor* selectionToCurveButtonHSL = desc.definePushButtonParam(kButtonSelectionToCurveHSL);
selectionToCurveButtonHSL->setLabel(kButtonSelectionToCurveHSLLabel);
selectionToCurveButtonHSL->setHint("Load selected HSL curves with selection data. \n Warning : the curves may not be refreshed click on overlay to refresh.");
selectionToCurveButtonHSL->setParent(groupHSL);
//Append selection to curves button (HSL)
OFX::PushButtonParamDescriptor* appendSelectionToCurveHSL = desc.definePushButtonParam(kButtonAppendSelectionToCurveHSL);
示例14: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void PinningPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); // clip de source nomme source
//OFX::ClipDescriptor* toto = desc.defineClip( "toto" );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); //proprietes de la source
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); //sortie, laisser comme ca et pi c'est tout
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::GroupParamDescriptor* grpSrc = desc.defineGroupParam( kParamGroupSource ); //groupe source
grpSrc->setLabel( "Points de départ" );
grpSrc->setHint( "Selectionnez 4 points de départ" );
OFX::Double2DParamDescriptor* src0 = desc.defineDouble2DParam( kParamPointSource + "0" ); //kpa... nom utilisé par le plug
src0->setLabel( "src0" ); //nom que voit l'utilisateur
src0->setDefault( 0, 0 );
src0->setParent(grpSrc);
OFX::Double2DParamDescriptor* src1 = desc.defineDouble2DParam( kParamPointSource + "1" );
src1->setLabel( "src1" );
src1->setDefault( 0, 1 );
src1->setParent(grpSrc);
OFX::Double2DParamDescriptor* src2 = desc.defineDouble2DParam( kParamPointSource + "2" );
src2->setLabel( "src2" );
src2->setDefault( 1, 1 );
src2->setParent(grpSrc);
OFX::Double2DParamDescriptor* src3 = desc.defineDouble2DParam( kParamPointSource + "3" );
src3->setLabel( "src3" );
src3->setDefault( 1, 0 );
src3->setParent(grpSrc);
OFX::GroupParamDescriptor* grpDst = desc.defineGroupParam( kParamGroupDestination ); //groupe destination
grpDst->setLabel( "Points d'arrivée" );
grpDst->setHint( "Selectionnez 4 points d'arrivée" );
OFX::Double2DParamDescriptor* dest0 = desc.defineDouble2DParam( kParamPointDestination + "0" ); //kpa... nom utilisé par le plug
dest0->setLabel( "dst0" ); //nom que voit l'utilisateur
dest0->setDefault( 0, 0 );
dest0->setParent(grpDst);
OFX::Double2DParamDescriptor* dest1 = desc.defineDouble2DParam( kParamPointDestination + "1" );
dest1->setLabel( "dst1" );
dest1->setDefault( 0, 1 );
dest1->setParent(grpDst);
OFX::Double2DParamDescriptor* dest2 = desc.defineDouble2DParam( kParamPointDestination + "2" );
dest2->setLabel( "dst2" );
dest2->setDefault( 1, 1 );
dest2->setParent(grpDst);
OFX::Double2DParamDescriptor* dest3 = desc.defineDouble2DParam( kParamPointDestination + "3" );
dest3->setLabel( "dst3" );
dest3->setDefault( 1, 0 );
dest3->setParent(grpDst);
OFX::PushButtonParamDescriptor* helpButton = desc.definePushButtonParam( kParamHelpButton ); //cree un bouton help
//helpButton->setHint( "bla bla" );
helpButton->setLabel( "Help" );
OFX::GroupParamDescriptor* displayOptions = desc.defineGroupParam( kParamDisplayOptions );
displayOptions->setLabel( "Options d'affichage" );
displayOptions->setHint( "Options d'affichage (Ne change rien sur l'image)" );
OFX::BooleanParamDescriptor* displayGrid = desc.defineBooleanParam( kParamGridOverlay );
displayGrid->setLabel( "Afficher la grille" );
displayGrid->setParent( *displayOptions );
displayGrid->setDefault( false );
displayGrid->setEvaluateOnChange( false );
displayGrid->setHint( "Afficher la grille" );
OFX::Double2DParamDescriptor* gridCenter = desc.defineDouble2DParam( kParamGridCenter );
gridCenter->setLabel( "Centre de la grille" );
gridCenter->setDoubleType( OFX::eDoubleTypePlain );
gridCenter->setParent( *displayOptions );
gridCenter->setDefault( 0.0, 0.0 );
gridCenter->setDisplayRange( -1.0, -1.0, 1.0, 1.0 );
gridCenter->setEvaluateOnChange( false );
gridCenter->setHint( "Allows you to shift the center of the display grid." );
OFX::Double2DParamDescriptor* center = desc.defineDouble2DParam( kParamCenter );
center->setLabel( "Center" );
center->setDoubleType( OFX::eDoubleTypePlain );
center->setDefault( 0.0, 0.0 );
center->setDisplayRange( -1.0, -1.0, 1.0, 1.0 );
center->setHint( "Center parameter allows you to shift the center of distortion." );
OFX::Double2DParamDescriptor* gridScale = desc.defineDouble2DParam( kParamGridScale );
gridScale->setLabel( "Echelle de la grille" );
gridScale->setDoubleType( OFX::eDoubleTypePlain );
gridScale->setParent( *displayOptions );
gridScale->setDefault( 1.0, 1.0 );
//.........这里部分代码省略.........
示例15: describeInContext
//.........这里部分代码省略.........
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.");
saturationMultiplier->setRange(1, 1000);
saturationMultiplier->setDisplayRange(0,5);
saturationMultiplier->setDefault(1);
saturationMultiplier->setParent(groupHSL);
OFX::BooleanParamDescriptor* boolL = desc.defineBooleanParam(kBoolLightness);
boolL->setHint("Activate Lightness channel");
boolL->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
boolL->setDefault(true);
boolL->setParent(groupHSL);
//Lightness multiplier
OFX::DoubleParamDescriptor* lightnessMultiplier = desc.defineDoubleParam(kMultiplierLightness);
lightnessMultiplier->setLabel(kMultiplierLabel);
lightnessMultiplier->setHint("Determinate curve from selection precision.");
lightnessMultiplier->setRange(1, 1000);
lightnessMultiplier->setDisplayRange(0,5);
lightnessMultiplier->setDefault(1);
lightnessMultiplier->setParent(groupHSL);
//Close RGB group (group states by default on screen)
groupRGB->setOpen(true);
groupHSL->setOpen(true);
}
//Histogram overlay group
{
OFX::GroupParamDescriptor *groupHistogramOverlay = desc.defineGroupParam(kGroupHistogramOverlay);
groupHistogramOverlay->setLabel(kGroupHistogramOverlayLabel);
groupHistogramOverlay->setOpen(true);
// groupHistogramOverlay->setAsTab();
//Histogram display settings
OFX::ChoiceParamDescriptor* gammaType = desc.defineChoiceParam(kHistoDisplayListParamLabel);
gammaType->setLabel(kHistoDisplayListParamLabel);
gammaType->setEvaluateOnChange(false); // don't need to recompute on change
gammaType->setHint("Histogram display \n -global : normalize all of channels \n -by channel : keep proportions between channels");
gammaType->appendOption(kHistoDisplayListParamOpt2);
gammaType->appendOption(kHistoDisplayListParamOpt1);
gammaType->setParent(groupHistogramOverlay);
//nbOfstep (advanced group)
OFX::IntParamDescriptor* nbStepRange = desc.defineIntParam(knbStepRange);
nbStepRange->setLabel(knbStepRangeLabel);
nbStepRange->setHint("Determinate histogram overlay precision.");
nbStepRange->setRange(1, 1000);
nbStepRange->setDisplayRange(1, 600.0 );
nbStepRange->setDefault(255);
nbStepRange->setEvaluateOnChange(false); // don't need to recompute on change
nbStepRange->setParent(groupHistogramOverlay);
//selection multiplier (advanced group)
OFX::DoubleParamDescriptor* selectionMultiplier = desc.defineDoubleParam(kselectionMultiplier);
selectionMultiplier->setLabel(kselectionMultiplierLabel);
selectionMultiplier->setHint("With high values, small selection are more visible.");
selectionMultiplier->setRange(0.001,1000.0);
selectionMultiplier->setDisplayRange(0.0, 100.0 );
selectionMultiplier->setDefault(2.0);
selectionMultiplier->setEvaluateOnChange(false); // don't need to recompute on change
selectionMultiplier->setParent(groupHistogramOverlay);
//Refresh histograms overlay Button
OFX::PushButtonParamDescriptor* refreshOverlayButton = desc.definePushButtonParam(kButtonRefreshOverlay);
refreshOverlayButton->setLabel(kButtonRefreshOverlayLabel);
refreshOverlayButton->setHint("Refresh histogram overlay.");
refreshOverlayButton->setParent(groupHistogramOverlay);
}
//Selection group
{
OFX::GroupParamDescriptor *groupSelection = desc.defineGroupParam(kGroupSelection);
groupSelection->setLabel(kGroupSelectionLabel);
groupSelection->setOpen(false);
// groupSelection->setAsTab();
//display selection
OFX::BooleanParamDescriptor* boolDisplaySelection = desc.defineBooleanParam(kBoolSelection);
boolDisplaySelection->setDefault(true);
boolDisplaySelection->setEvaluateOnChange(false);// don't need to recompute on change
boolDisplaySelection->setHint("Display the selected zone on screen.");
boolDisplaySelection->setParent(groupSelection);
//clear selection
OFX::PushButtonParamDescriptor* resetSelectionButton = desc.definePushButtonParam(kButtonResetSelection);
resetSelectionButton->setLabel(kButtonResetSelectionLabel);
resetSelectionButton->setHint("Reset user's selection.");
resetSelectionButton->setParent(groupSelection);
//selection mode
OFX::ChoiceParamDescriptor* selectionMode = desc.defineChoiceParam(kSelectionModeListParamLabel);
selectionMode->setLabel(kSelectionModeListParamLabel);
selectionMode->setHint( "Selection mode \n - unique : reset past selection before selection \n - additive : add pixels to current selection \n -subtractive : remote pixel from current selection");
selectionMode->appendOption(kSelectionModeListParamOpt2);
selectionMode->appendOption(kSelectionModeListParamOpt1);
selectionMode->appendOption(kSelectionModeListParamOpt3);
selectionMode->setParent(groupSelection);
}
}