本文整理汇总了C++中ofx::ImageEffectDescriptor::defineStringParam方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageEffectDescriptor::defineStringParam方法的具体用法?C++ ImageEffectDescriptor::defineStringParam怎么用?C++ ImageEffectDescriptor::defineStringParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::ImageEffectDescriptor
的用法示例。
在下文中一共展示了ImageEffectDescriptor::defineStringParam方法的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 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);
}
示例2: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void TextPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::StringParamDescriptor* text = desc.defineStringParam( kText );
text->setLabel( "Text" );
text->setStringType( OFX::eStringTypeMultiLine );
OFX::StringParamDescriptor* font = desc.defineStringParam( kFont );
font->setLabel( "Font file" );
font->setStringType( OFX::eStringTypeFilePath );
font->setDefault( "/usr/share/fonts/truetype/msttcorefonts/arial.ttf" );
OFX::IntParamDescriptor* size = desc.defineIntParam( kSize );
size->setLabel( "Size" );
size->setDefault( 18 );
size->setRange( 0, std::numeric_limits<int>::max() );
size->setDisplayRange( 0, 60 );
OFX::DoubleParamDescriptor* ratio = desc.defineDoubleParam( kRatio );
ratio->setLabel( "Ratio" );
ratio->setRange( 0.0, std::numeric_limits<double>::max() );
ratio->setDisplayRange( 0.0, 2.0 );
ratio->setDefault( 1.0 );
OFX::RGBAParamDescriptor* color = desc.defineRGBAParam( kColor );
color->setLabel( "Color" );
color->setDefault( 1.0, 1.0, 1.0, 1.0 );
OFX::Double2DParamDescriptor* position = desc.defineDouble2DParam( kPosition );
position->setLabel( "Position" );
position->setDefault( 0.0, 0.0 );
OFX::DoubleParamDescriptor* letterSpacing = desc.defineDoubleParam( kLetterSpacing );
letterSpacing->setLabel( "Letter spacing" );
letterSpacing->setDisplayRange( -10.0, 10.0 );
letterSpacing->setDefault( 0.0 );
OFX::BooleanParamDescriptor* verticalFlip = desc.defineBooleanParam( kVerticalFlip );
verticalFlip->setLabel( "Vertical flip" );
verticalFlip->setDefault( false );
verticalFlip->setAnimates( false );
verticalFlip->setHint( "Some hosts use inverted images, so you can correct this problem using this flag." );
}
示例3: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void OpenImageIOWriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
// Controls
OFX::StringParamDescriptor* filename = desc.defineStringParam( kParamWriterFilename );
filename->setLabel( "Filename" );
filename->setStringType( OFX::eStringTypeFilePath );
filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
desc.addClipPreferencesSlaveParam( *filename );
OFX::ChoiceParamDescriptor* components = desc.defineChoiceParam( kParamOutputComponents );
components->setLabel( "Components" );
components->appendOption( kParamOutputComponentsRGBA );
components->appendOption( kParamOutputComponentsRGB );
components->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
components->setDefault( 0 );
OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kParamWriterBitDepth );
bitDepth->setLabel( "Bit depth" );
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
bitDepth->appendOption( kTuttlePluginBitDepth32f );
bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
bitDepth->setDefault( 1 );
OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender );
render->setLabels( "Render", "Render", "Render step" );
render->setHint( "Force render (writing)" );
OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways );
renderAlways->setLabel( "Render always" );
renderAlways->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
renderAlways->setDefault( false );
OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender );
forceNewRender->setLabel( "Force new render" );
forceNewRender->setIsSecret( true );
forceNewRender->setIsPersistant( false );
forceNewRender->setAnimates( false );
forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
forceNewRender->setEvaluateOnChange( true );
forceNewRender->setDefault( 0 );
}
示例4: describeStringParam
/** @brief describe a string param with the given name and type */
void describeStringParam(OFX::ImageEffectDescriptor &desc, const std::string &name, StringTypeEnum strType, PageParamDescriptor *page)
{
StringParamDescriptor *param = desc.defineStringParam(name);
param->setDefault(name);
param->setScriptName(name);
param->setHint("A string parameter");
param->setLabels(name, name, name);
param->setStringType(strType);
page->addChild(*param);
}
示例5: 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
}
示例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 );
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 );
}
示例7: 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 );
}
示例8: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void LutPluginFactory::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( kTuttlePluginFilename );
filename->setDefault( "" );
filename->setLabels( kTuttlePluginFilenameLabel, kTuttlePluginFilenameLabel, kTuttlePluginFilenameLabel );
filename->setStringType( OFX::eStringTypeFilePath );
}
示例9: describeReaderParamsInContext
void describeReaderParamsInContext( 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* component = desc.defineChoiceParam( kTuttlePluginChannel );
component->appendOption( kTuttlePluginChannelAuto );
component->appendOption( kTuttlePluginChannelGray );
component->appendOption( kTuttlePluginChannelRGB );
component->appendOption( kTuttlePluginChannelRGBA );
component->setLabel( kTuttlePluginChannelLabel );
component->setDefault( eParamReaderChannelAuto );
OFX::ChoiceParamDescriptor* explicitConversion = desc.defineChoiceParam( kTuttlePluginBitDepth );
explicitConversion->setLabel( kTuttlePluginBitDepthLabel );
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() ) );
}
}
示例10: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void PngWriterPluginFactory::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 );
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->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
bitDepth->setDefault( 1 );
describeWriterParamsInContext( desc, context );
}
示例11: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void AVReaderPluginFactory::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);
// Groups
OFX::GroupParamDescriptor* formatGroup = desc.defineGroupParam(kParamFormatGroup);
OFX::GroupParamDescriptor* videoGroup = desc.defineGroupParam(kParamVideoGroup);
OFX::GroupParamDescriptor* metaGroup = desc.defineGroupParam(kParamMetaGroup);
formatGroup->setLabel("Format");
videoGroup->setLabel("Video");
metaGroup->setLabel("Metadata");
formatGroup->setAsTab();
videoGroup->setAsTab();
metaGroup->setAsTab();
/// FORMAT PARAMETERS
avtranscoder::FormatContext formatContext(AV_OPT_FLAG_DECODING_PARAM);
avtranscoder::OptionArray formatOptions = formatContext.getOptions();
common::addOptionsToGroup(desc, formatGroup, formatOptions, common::kPrefixFormat);
OFX::GroupParamDescriptor* formatDetailedGroup = desc.defineGroupParam(kParamFormatDetailedGroup);
formatDetailedGroup->setLabel("Detailed");
formatDetailedGroup->setAsTab();
formatDetailedGroup->setParent(formatGroup);
avtranscoder::OptionArrayMap formatDetailedGroupOptions = avtranscoder::getAvailableOptionsPerOutputFormat();
common::addOptionsToGroup(desc, formatDetailedGroup, formatDetailedGroupOptions, common::kPrefixFormat);
/// VIDEO PARAMETERS
AVCodecContext* videoContext = avcodec_alloc_context3(NULL);
avtranscoder::OptionArray videoOptions;
avtranscoder::loadOptions(videoOptions, videoContext, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM);
common::addOptionsToGroup(desc, videoGroup, videoOptions, common::kPrefixVideo);
av_free(videoContext);
OFX::BooleanParamDescriptor* useCustomSAR = desc.defineBooleanParam(kParamUseCustomSAR);
useCustomSAR->setLabel("Override SAR");
useCustomSAR->setDefault(false);
useCustomSAR->setHint("Override the file SAR (Storage Aspect Ratio) with a custom SAR value.");
useCustomSAR->setParent(videoGroup);
OFX::DoubleParamDescriptor* customSAR = desc.defineDoubleParam(kParamCustomSAR);
customSAR->setLabel("Custom SAR");
customSAR->setDefault(1.0);
customSAR->setDisplayRange(0., 3.);
customSAR->setRange(0., 10.);
customSAR->setHint("Choose a custom value to override the file SAR (Storage Aspect Ratio). Maximum value: 10.");
customSAR->setParent(videoGroup);
OFX::IntParamDescriptor* streamIndex = desc.defineIntParam(kParamVideoStreamIndex);
streamIndex->setLabel(kParamVideoStreamIndexLabel);
streamIndex->setDefault(0);
streamIndex->setDisplayRange(0., 16.);
streamIndex->setRange(0., 100.);
streamIndex->setHint("Choose a custom value to decode the video stream you want. Maximum value: 100.");
streamIndex->setParent(videoGroup);
OFX::GroupParamDescriptor* videoDetailedGroup = desc.defineGroupParam(kParamVideoDetailedGroup);
videoDetailedGroup->setLabel("Detailed");
videoDetailedGroup->setAsTab();
videoDetailedGroup->setParent(videoGroup);
avtranscoder::OptionArrayMap videoDetailedGroupOptions = avtranscoder::getAvailableOptionsPerVideoCodec();
common::addOptionsToGroup(desc, videoDetailedGroup, videoDetailedGroupOptions, common::kPrefixVideo);
/// METADATA PARAMETERS
AVCodecContext* metaDataContext = avcodec_alloc_context3(NULL);
avtranscoder::OptionArray metaDataOptions;
avtranscoder::loadOptions(metaDataOptions, metaDataContext, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_METADATA);
common::addOptionsToGroup(desc, metaGroup, metaDataOptions, common::kPrefixMetaData);
av_free(metaDataContext);
OFX::StringParamDescriptor* metaDataWrapper = desc.defineStringParam(kParamMetaDataWrapper);
metaDataWrapper->setLabel(kParamMetaDataWrapperLabel);
metaDataWrapper->setEnabled(false);
metaDataWrapper->setStringType(OFX::eStringTypeMultiLine);
metaDataWrapper->setParent(metaGroup);
OFX::StringParamDescriptor* metaDataVideo = desc.defineStringParam(kParamMetaDataVideo);
metaDataVideo->setLabel(kParamMetaDataVideoLabel);
metaDataVideo->setEnabled(false);
metaDataVideo->setStringType(OFX::eStringTypeMultiLine);
metaDataVideo->setParent(metaGroup);
OFX::StringParamDescriptor* metaDataAudio = desc.defineStringParam(kParamMetaDataAudio);
metaDataAudio->setLabel(kParamMetaDataAudioLabel);
//.........这里部分代码省略.........
示例12: describeInContext
//.........这里部分代码省略.........
groupLensDistortion->setOpen(true);
{
OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputRadialCoef1);
param->setLabel("Radial Coef1");
param->setDisplayRange(0, 10);
param->setAnimates(true);
param->setEvaluateOnChange(false);
param->setEnabled(false);
param->setAnimates(false);
param->setParent(*groupLensDistortion);
}
{
OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputRadialCoef2);
param->setLabel("Radial Coef2");
param->setDisplayRange(0, 10);
param->setAnimates(true);
param->setEvaluateOnChange(false);
param->setEnabled(false);
param->setAnimates(false);
param->setParent(*groupLensDistortion);
}
{
OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputRadialCoef3);
param->setLabel("Radial Coef3");
param->setDisplayRange(0, 10);
param->setAnimates(true);
param->setEvaluateOnChange(false);
param->setEnabled(false);
param->setAnimates(false);
param->setParent(*groupLensDistortion);
}
{
OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputTangentialCoef1);
param->setLabel("Tangential Coef1");
param->setDisplayRange(0, 10);
param->setAnimates(true);
param->setEvaluateOnChange(false);
param->setEnabled(false);
param->setAnimates(false);
param->setParent(*groupLensDistortion);
}
{
OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputTangentialCoef2);
param->setLabel("Tangential Coef2");
param->setDisplayRange(0, 10);
param->setAnimates(true);
param->setEvaluateOnChange(false);
param->setEnabled(false);
param->setAnimates(false);
param->setParent(*groupLensDistortion);
param->setLayoutHint(OFX::eLayoutHintDivider);
}
}
{
OFX::PushButtonParamDescriptor *param = desc.definePushButtonParam(kParamOutputClear);
param->setLabel("Clear");
param->setHint("clear");
param->setEnabled(false);
param->setParent(*groupOutput);
}
}
//Debug Group
{
OFX::GroupParamDescriptor *groupDebug = desc.defineGroupParam(kParamGroupDebug);
groupDebug->setLabel("Debug");
groupDebug->setAsTab();
{
OFX::BooleanParamDescriptor *param = desc.defineBooleanParam(kParamDebugEnable);
param->setLabel("Enable Debug");
param->setHint("Would you want to export undistorted images?");
param->setParent(*groupDebug);
}
{
OFX::StringParamDescriptor *param = desc.defineStringParam(kParamDebugRejectedImgFolder);
param->setLabel("Rejected Frames");
param->setHint("Folder to export delete images during the calibration refinement loop.");
param->setStringType(OFX::eStringTypeDirectoryPath);
param->setFilePathExists(true);
param->setParent(*groupDebug);
}
{
OFX::StringParamDescriptor *param = desc.defineStringParam(kParamDebugSelectedImgFolder);
param->setLabel("Selected Frames");
param->setHint("Folder to export debug images.");
param->setStringType(OFX::eStringTypeDirectoryPath);
param->setFilePathExists(true);
param->setParent(*groupDebug);
}
}
}
示例13: describeInContext
//.........这里部分代码省略.........
descriptor->appendOption(kParamDescriptorAlpha);
descriptor->appendOption(kParamDescriptorLuma);
descriptor->appendOption(kParamDescriptorColorDifference);
descriptor->appendOption(kParamDescriptorDepth);
descriptor->appendOption(kParamDescriptorCompositeVideo);
descriptor->appendOption(kParamDescriptorRGB);
descriptor->appendOption(kParamDescriptorRGBA);
descriptor->appendOption(kParamDescriptorABGR);
descriptor->appendOption(kParamDescriptorCbYCrY);
descriptor->appendOption(kParamDescriptorCbYACrYA);
descriptor->appendOption(kParamDescriptorCbYCr);
descriptor->appendOption(kParamDescriptorCbYCrA);
descriptor->appendOption(kParamDescriptorUserDefined2Comp);
descriptor->appendOption(kParamDescriptorUserDefined3Comp);
descriptor->appendOption(kParamDescriptorUserDefined4Comp);
descriptor->appendOption(kParamDescriptorUserDefined5Comp);
descriptor->appendOption(kParamDescriptorUserDefined6Comp);
descriptor->appendOption(kParamDescriptorUserDefined7Comp);
descriptor->appendOption(kParamDescriptorUserDefined8Comp);
descriptor->appendOption(kParamDescriptorUndefinedDescriptor);
descriptor->appendOption(kParamDescriptorAuto);
descriptor->setDefault(9); // rgb
OFX::ChoiceParamDescriptor* transfer = desc.defineChoiceParam(kParamTransfer);
transfer->setLabel(kParamTransferLabel);
transfer->setHint(kParamTransferHint);
transfer->appendOption(kParamCharacteristicUserDefined);
transfer->appendOption(kParamCharacteristicPrintingDensity);
transfer->appendOption(kParamCharacteristicLinear);
transfer->appendOption(kParamCharacteristicLogarithmic);
transfer->appendOption(kParamCharacteristicUnspecifiedVideo);
transfer->appendOption(kParamCharacteristicSMPTE274M);
transfer->appendOption(kParamCharacteristicITUR709);
transfer->appendOption(kParamCharacteristicITUR601);
transfer->appendOption(kParamCharacteristicITUR602);
transfer->appendOption(kParamCharacteristicNTSCCompositeVideo);
transfer->appendOption(kParamCharacteristicPALCompositeVideo);
transfer->appendOption(kParamCharacteristicZLinear);
transfer->appendOption(kParamCharacteristicZHomogeneous);
transfer->appendOption(kParamCharacteristicUndefinedCharacteristic);
transfer->setDefault(2); // Linear
OFX::ChoiceParamDescriptor* colorimetric = desc.defineChoiceParam(kParamColorimetric);
colorimetric->setLabel(kParamColorimetricLabel);
colorimetric->setHint(kParamColorimetricHint);
colorimetric->appendOption(kParamCharacteristicUserDefined);
colorimetric->appendOption(kParamCharacteristicPrintingDensity);
colorimetric->appendOption(kParamCharacteristicLinear);
colorimetric->appendOption(kParamCharacteristicLogarithmic);
colorimetric->appendOption(kParamCharacteristicUnspecifiedVideo);
colorimetric->appendOption(kParamCharacteristicSMPTE274M);
colorimetric->appendOption(kParamCharacteristicITUR709);
colorimetric->appendOption(kParamCharacteristicITUR601);
colorimetric->appendOption(kParamCharacteristicITUR602);
colorimetric->appendOption(kParamCharacteristicNTSCCompositeVideo);
colorimetric->appendOption(kParamCharacteristicPALCompositeVideo);
colorimetric->appendOption(kParamCharacteristicZLinear);
colorimetric->appendOption(kParamCharacteristicZHomogeneous);
colorimetric->appendOption(kParamCharacteristicUndefinedCharacteristic);
colorimetric->setDefault(2); // Linear
OFX::ChoiceParamDescriptor* packed = desc.defineChoiceParam(kParamPacked);
packed->setLabel(kParamPackedLabel);
packed->setHint(kParamPackedHint);
packed->appendOption(kParamPackedPacked);
packed->appendOption(kParamPackedMethodA);
packed->appendOption(kParamPackedMethodB);
packed->setDefault(1);
OFX::BooleanParamDescriptor* swapEndian = desc.defineBooleanParam(kParamSwapEndian);
swapEndian->setLabel(kParamSwapEndianLabel);
swapEndian->setHint(kParamSwapEndianHint);
swapEndian->setDefault(true);
OFX::ChoiceParamDescriptor* encoding = desc.defineChoiceParam(kParamEncoding);
encoding->setLabel(kParamEncodingLabel);
encoding->setHint(kParamEncodingHint);
encoding->appendOption(kParamEncodingNone);
encoding->appendOption(kParamEncodingRle);
encoding->setDefault(0);
OFX::ChoiceParamDescriptor* orientation = desc.defineChoiceParam(kParamOrientation);
orientation->setLabel(kParamOrientationLabel);
orientation->setHint(kParamOrientationHint);
orientation->appendOption(kParamOrientationLeftToRightTopToBottom);
orientation->appendOption(kParamOrientationRightToLeftTopToBottom);
orientation->appendOption(kParamOrientationLeftToRightBottomToTop);
orientation->appendOption(kParamOrientationRightToLeftBottomToTop);
orientation->appendOption(kParamOrientationTopToBottomLeftToRight);
orientation->appendOption(kParamOrientationTopToBottomRightToLeft);
orientation->appendOption(kParamOrientationBottomToTopLeftToRight);
orientation->appendOption(kParamOrientationBottomToTopRightToLeft);
orientation->appendOption(kParamOrientationUndefinedOrientation);
orientation->setDefault(0);
OFX::StringParamDescriptor* project = desc.defineStringParam(kParamProject);
project->setDefault("");
OFX::StringParamDescriptor* copyright = desc.defineStringParam(kParamCopyright);
copyright->setDefault("");
}
示例14: 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 );
}
示例15:
void
GenericOCIO::describeInContextContext(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum /*context*/, OFX::PageParamDescriptor *page)
{
#ifdef OFX_IO_USING_OCIO
OFX::GroupParamDescriptor* group = desc.defineGroupParam(kOCIOParamContext);
group->setHint(kOCIOParamContextHint);
group->setOpen(false);
{
OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamContextKey1);
param->setHint(kOCIOParamContextHint);
param->setAnimates(true);
param->setParent(*group);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
page->addChild(*param);
}
{
OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamContextValue1);
param->setHint(kOCIOParamContextHint);
param->setAnimates(true);
param->setParent(*group);
page->addChild(*param);
}
{
OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamContextKey2);
param->setHint(kOCIOParamContextHint);
param->setAnimates(true);
param->setParent(*group);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
page->addChild(*param);
}
{
OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamContextValue2);
param->setHint(kOCIOParamContextHint);
param->setAnimates(true);
param->setParent(*group);
page->addChild(*param);
}
{
OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamContextKey3);
param->setHint(kOCIOParamContextHint);
param->setAnimates(true);
param->setParent(*group);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
page->addChild(*param);
}
{
OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamContextValue3);
param->setHint(kOCIOParamContextHint);
param->setAnimates(true);
param->setParent(*group);
page->addChild(*param);
}
{
OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamContextKey4);
param->setHint(kOCIOParamContextHint);
param->setAnimates(true);
param->setParent(*group);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
page->addChild(*param);
}
{
OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamContextValue4);
param->setHint(kOCIOParamContextHint);
param->setAnimates(true);
param->setParent(*group);
page->addChild(*param);
}
page->addChild(*group);
#endif
}