本文整理汇总了C++中ofx::ChoiceParamDescriptor类的典型用法代码示例。如果您正苦于以下问题:C++ ChoiceParamDescriptor类的具体用法?C++ ChoiceParamDescriptor怎么用?C++ ChoiceParamDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ChoiceParamDescriptor类的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 LocalMaximaPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::ChoiceParamDescriptor* border = desc.defineChoiceParam( kParamBorder );
border->setLabel( "Border" );
// border->setHint( "Border method." );
border->appendOption( kParamBorderBlack );
// border->appendOption( kParamBorderPadded );
border->setDefault( 0 );
OFX::ChoiceParamDescriptor* outputComponent = desc.defineChoiceParam( kParamOutputComponent );
outputComponent->setLabel( "Output component" );
outputComponent->appendOption( OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentRGBA) ? kParamOutputComponentRGBA : "---" );
outputComponent->appendOption( OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentRGB) ? kParamOutputComponentRGB : "---" );
outputComponent->appendOption( OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentAlpha) ? kParamOutputComponentAlpha : "---" );
outputComponent->setIsSecret( OFX::getImageEffectHostDescription()->_supportedComponents.size() == 1 );
}
示例2: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void SeExprPluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::EContext context)
{
describeGeneratorParamsInContext(desc, context);
OFX::ChoiceParamDescriptor* chooseInput = desc.defineChoiceParam(kParamChooseInput);
chooseInput->appendOption(kParamChooseInputCode);
chooseInput->appendOption(kParamChooseInputFile);
chooseInput->setDefault(eParamChooseInputCode);
OFX::StringParamDescriptor* code = desc.defineStringParam(kParamSeExprCode);
code->setLabel("SeExpr code");
code->setHint("Write your SeExpr code.");
code->setStringType(OFX::eStringTypeMultiLine);
code->setDefault("cfbm([10*u,10*v,.5])");
OFX::StringParamDescriptor* file = desc.defineStringParam(kTuttlePluginFilename);
file->setLabel(kTuttlePluginFilenameLabel);
file->setHint("SeExpr source code file.");
file->setStringType(OFX::eStringTypeFilePath);
OFX::Double2DParamDescriptor* textureOffset = desc.defineDouble2DParam(kParamTextureOffset);
textureOffset->setLabel("Texture Offset (u, v)");
textureOffset->setHint("Set the u,v offset texture parameters.");
textureOffset->setDisplayRange(-100, -100, 100, 100);
textureOffset->setDefault(0.0, 0.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 ColorBarsPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
describeGeneratorParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* levels = desc.defineChoiceParam( kColorBarsLevels );
levels->setLabel( "Levels" );
levels->appendOption( kColorBarsLevels100 );
levels->appendOption( kColorBarsLevels75 );
levels->setDefault( eColorBarsLevels75 );
}
示例4: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void RampPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
describeGeneratorParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* direction = desc.defineChoiceParam( kRampDirection );
direction->appendOption( "horizontal", "Horizontal" );
direction->appendOption( "vertical", "Vertical" );
direction->setLabel( "Ramp Direction" );
direction->setHint( "Select the ramp direction." );
OFX::BooleanParamDescriptor* color = desc.defineBooleanParam( kRampColor );
color->setDefault( false );
color->setLabel( "Color Ramp" );
color->setHint( "Enable the R/G/B/Gray ramp." );
}
示例5: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void 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 );
}
示例6: catch
void
GenericOCIO::describeInContextOutput(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum /*context*/, OFX::PageParamDescriptor *page, const char* outputSpaceNameDefault, const char* outputSpaceLabel)
{
#ifdef OFX_IO_USING_OCIO
gHostIsNatron = (OFX::getImageEffectHostDescription()->isNatron);
char* file = std::getenv("OCIO");
OCIO::ConstConfigRcPtr config;
if (file != NULL) {
//Add choices
try {
config = OCIO::Config::CreateFromFile(file);
gWasOCIOEnvVarFound = true;
} catch (OCIO::Exception &e) {
}
}
std::string outputSpaceName;
if (config) {
outputSpaceName = canonicalizeColorSpace(config, colorSpaceName(config, outputSpaceNameDefault));
}
///////////Output Color-space
{
OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamOutputSpace);
param->setLabel(outputSpaceLabel);
param->setHint(kOCIOParamOutputSpaceHint);
param->setAnimates(true);
if (config) {
param->setDefault(outputSpaceName);
} else {
param->setEnabled(false);
}
page->addChild(*param);
}
#ifdef OFX_OCIO_CHOICE
{
OFX::ChoiceParamDescriptor* param = desc.defineChoiceParam(kOCIOParamOutputSpaceChoice);
param->setLabel(outputSpaceLabel);
param->setHint(kOCIOParamOutputSpaceHint);
param->setCascading(OFX::getImageEffectHostDescription()->supportsCascadingChoices);
if (config) {
buildChoiceMenu(config, param, OFX::getImageEffectHostDescription()->supportsCascadingChoices, outputSpaceName);
} else {
param->setEnabled(false);
//param->setIsSecret(true); // done in the plugin constructor
}
param->setAnimates(true);
param->setEvaluateOnChange(false); // evaluate only when the StringParam is changed
param->setIsPersistant(false); // don't save/serialize
page->addChild(*param);
}
#endif
#endif
}
示例7: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void DiffPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClipA = desc.defineClip( kDiffSourceA );
assert( srcClipA );
srcClipA->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClipA->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClipA->setSupportsTiles( kSupportTiles );
srcClipA->setOptional( false );
OFX::ClipDescriptor* srcClipB = desc.defineClip( kDiffSourceB );
assert( srcClipB );
srcClipB->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClipB->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClipB->setSupportsTiles( kSupportTiles );
srcClipB->setOptional( false );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
assert( dstClip );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::ChoiceParamDescriptor* diffFunction = desc.defineChoiceParam( kMeasureFunction );
assert( diffFunction );
diffFunction->setLabel( "Quality mesure function" );
diffFunction->appendOption( "PSNR (Peak Signal to Noise Ratio)" );
// diffFunction->appendOption( "MSE (Mean Square Error)" );
// diffFunction->appendOption( "SSIM (Structural SIMilarity)" );
diffFunction->setDefault( 0 );
OFX::RGBAParamDescriptor* outputQualityMesure = desc.defineRGBAParam( kOutputQualityMesure );
assert( outputQualityMesure );
outputQualityMesure->setLabel( "Quality" );
outputQualityMesure->setEvaluateOnChange( false );
// OFX::PushButtonParamDescriptor* helpButton = desc.definePushButtonParam( kHelpButton );
// assert( helpButton );
// helpButton->setLabel( "Help" );
}
示例8: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void ThinningPluginFactory::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* border = desc.defineChoiceParam( kParamBorder );
border->setLabel( "Gradient border" );
border->setHint( "Border method for gradient computation." );
border->appendOption( kParamBorderBlack );
border->appendOption( kParamBorderPadded );
// border->appendOption( kParamBorderMirror );
// border->appendOption( kParamBorderConstant );
border->setDefault( 1 );
}
示例9: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void ColorWheelPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
describeGeneratorParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* mode = desc.defineChoiceParam( kColorWheelMode );
mode->setLabel( "Type" );
mode->setHint( "Select mode for the color wheel." );
mode->appendOption( kColorWheelModeWhite );
mode->appendOption( kColorWheelModeBlack );
mode->appendOption( kColorWheelModeRainbow );
mode->setDefault( 0 );
}
示例10: describe
void ParamMathPluginFactory::describe(OFX::ImageEffectDescriptor& desc)
{
desc.setLabels("TuttleMathParam", "MathParam", "Math Param");
desc.setPluginGrouping("tuttle/param");
OFX::ChoiceParamDescriptor* op = desc.defineChoiceParam("operation");
op->appendOption("Multiply");
op->appendOption("Divide");
op->appendOption("Addition");
op->appendOption("Subtraction");
op->appendOption("Modulo");
op->setDefault(0);
OFX::Descriptor<ParamType>* a = desc.define<ParamType>("a");
OFX::Descriptor<ParamType>* b = desc.define<ParamType>("b");
OFX::Descriptor<ParamType>* output = desc.define<ParamType>("Output");
}
示例11: 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 );
OFX::ChoiceParamDescriptor* border = desc.defineChoiceParam( kParamBorder );
border->setLabel( "Border" );
border->appendOption( kParamBorderMirror );
border->appendOption( kParamBorderConstant );
border->appendOption( kParamBorderBlack );
border->appendOption( kParamBorderPadded );
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 );
}
}
}
示例12: 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 );
}
示例13: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void EXRReaderPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
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* outRedIs = desc.defineChoiceParam( kParamOutputRedIs );
outRedIs->appendOption( "0" );
outRedIs->appendOption( "1" );
outRedIs->appendOption( "2" );
outRedIs->appendOption( "3" );
outRedIs->setLabel( "Red is" );
outRedIs->setDefault( 0 );
outRedIs->setHint(
"Read-only information to get index of red component in the file.");
OFX::ChoiceParamDescriptor* outGreenIs = desc.defineChoiceParam( kParamOutputGreenIs );
outGreenIs->appendOption( "0" );
outGreenIs->appendOption( "1" );
outGreenIs->appendOption( "2" );
outGreenIs->appendOption( "3" );
outGreenIs->setLabel( "Green is" );
outGreenIs->setDefault( 0 );
outGreenIs->setHint(
"Read-only information to get index of green component in the file.");
OFX::ChoiceParamDescriptor* outBlueIs = desc.defineChoiceParam( kParamOutputBlueIs );
outBlueIs->appendOption( "0" );
outBlueIs->appendOption( "1" );
outBlueIs->appendOption( "2" );
outBlueIs->appendOption( "3" );
outBlueIs->setLabel( "Blue is" );
outBlueIs->setDefault( 0 );
outBlueIs->setHint(
"Read-only information to get index of blue component in the file.");
OFX::ChoiceParamDescriptor* outAlphaIs = desc.defineChoiceParam( kParamOutputAlphaIs );
outAlphaIs->appendOption( "0" );
outAlphaIs->appendOption( "1" );
outAlphaIs->appendOption( "2" );
outAlphaIs->appendOption( "3" );
outAlphaIs->setLabel( "Alpha is" );
outAlphaIs->setDefault( 0 );
outAlphaIs->setHint(
"Read-only information to get index of alpha component in the file.");
OFX::ChoiceParamDescriptor* outputData = desc.defineChoiceParam( kParamOutputData );
outputData->appendOption( "display" );
outputData->appendOption( "data" );
outputData->setLabel( "Output Data" );
outputData->setDefault( 0 );
OFX::ChoiceParamDescriptor* fileBitDepth = desc.defineChoiceParam( kParamFileBitDepth );
fileBitDepth->setLabel( "File Bit Depth" );
fileBitDepth->appendOption( kTuttlePluginBitDepth16f );
fileBitDepth->appendOption( kTuttlePluginBitDepth32 );
fileBitDepth->appendOption( kTuttlePluginBitDepth32f );
fileBitDepth->appendOption( kTuttlePluginBitDepthNone );
fileBitDepth->setDefault( eTuttlePluginFileBitDepthNone );
fileBitDepth->setHint(
"Read-only information about the image bit depth stored in the file.\n"
"Data type is per channel in EXR. So we read the type of the first channel.");
OFX::ChoiceParamDescriptor* compression = desc.defineChoiceParam( kParamCompression );
compression->setLabel( "Compression" );
compression->appendOption( kParamCompressionNone, kParamCompressionHintNone );
compression->appendOption( kParamCompressionRLE, kParamCompressionHintRLE );
compression->appendOption( kParamCompressionZIPS, kParamCompressionHintZIPS );
compression->appendOption( kParamCompressionZIP, kParamCompressionHintZIP );
compression->appendOption( kParamCompressionPIZ, kParamCompressionHintPIZ );
compression->appendOption( kParamCompressionPXR24, kParamCompressionHintPXR24 );
compression->appendOption( kParamCompressionB44, kParamCompressionHintB44 );
compression->appendOption( kParamCompressionB44A, kParamCompressionHintB44A );
compression->setDefault( eParamCompression_None );
compression->setHint(
"Read-only information about the image compression stored in the file.");
}
示例14: 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 );
}
示例15: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void TurboJpegWriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
// Controls
describeWriterParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* channel = static_cast<OFX::ChoiceParamDescriptor*>( desc.getParamDescriptor( kTuttlePluginChannel ) );
channel->resetOptions();
channel->appendOption( kTuttlePluginChannelRGB );
channel->setDefault( 0 );
channel->setEnabled( false );
OFX::ChoiceParamDescriptor* bitDepth = static_cast<OFX::ChoiceParamDescriptor*>( desc.getParamDescriptor( kTuttlePluginBitDepth ) );
bitDepth->resetOptions();
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->setDefault( eTuttlePluginBitDepth8 );
bitDepth->setEnabled( false );
OFX::BooleanParamDescriptor* premult = static_cast<OFX::BooleanParamDescriptor*>( desc.getParamDescriptor( kParamPremultiplied ) );
premult->setDefault( true );
OFX::IntParamDescriptor* quality = desc.defineIntParam( kParamQuality );
quality->setLabel( "Quality" );
quality->setRange( 0, 100 );
quality->setDisplayRange( 0, 100 );
quality->setDefault( 80 );
OFX::ChoiceParamDescriptor* subsampling = desc.defineChoiceParam( kParamSubsampling );
subsampling->setLabel( kParamSubsamplingLabel );
subsampling->setHint( kParamSubsamplingHint );
subsampling->appendOption( kTurboJpegSubsampling444 );
subsampling->appendOption( kTurboJpegSubsampling422 );
subsampling->appendOption( kTurboJpegSubsampling420 );
subsampling->appendOption( kTurboJpegSubsamplingGray );
subsampling->appendOption( kTurboJpegSubsampling440 );
subsampling->setDefault( eTurboJpegSubsampling420 );
OFX::ChoiceParamDescriptor* optimization = desc.defineChoiceParam( kParamOptimization );
optimization->setLabel( kParamOptimizationLabel );
optimization->setHint( kParamOptimizationHint );
optimization->appendOption( kTurboJpegOptimizationNone );
optimization->appendOption( kTurboJpegOptimizationMMX );
optimization->appendOption( kTurboJpegOptimizationSSE );
optimization->appendOption( kTurboJpegOptimizationSSE2 );
optimization->appendOption( kTurboJpegOptimizationSSE3 );
optimization->setDefault( eTurboJpegOptimizationSSE3 );
}