本文整理汇总了C++中ofx::ChoiceParamDescriptor::setLabels方法的典型用法代码示例。如果您正苦于以下问题:C++ ChoiceParamDescriptor::setLabels方法的具体用法?C++ ChoiceParamDescriptor::setLabels怎么用?C++ ChoiceParamDescriptor::setLabels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::ChoiceParamDescriptor
的用法示例。
在下文中一共展示了ChoiceParamDescriptor::setLabels方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/**
* @brief Override this to describe in context the writer.
* You should call the base-class version at the end like this:
* GenericWriterPluginFactory<YOUR_FACTORY>::describeInContext(desc,context);
**/
PageParamDescriptor*
GenericWriterDescribeInContextBegin(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum context, bool isVideoStreamPlugin, bool supportsRGBA, bool supportsRGB, bool supportsAlpha, const char* inputSpaceNameDefault, const char* outputSpaceNameDefault)
{
// create the mandated source clip
ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
if (supportsRGBA) {
srcClip->addSupportedComponent(ePixelComponentRGBA);
}
if (supportsRGB) {
srcClip->addSupportedComponent(ePixelComponentRGB);
}
if (supportsAlpha) {
srcClip->addSupportedComponent(ePixelComponentAlpha);
}
srcClip->setSupportsTiles(false);
// create the mandated output clip
ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
if (supportsRGBA) {
dstClip->addSupportedComponent(ePixelComponentRGBA);
}
if (supportsRGB) {
dstClip->addSupportedComponent(ePixelComponentRGB);
}
if (supportsAlpha) {
dstClip->addSupportedComponent(ePixelComponentAlpha);
}
dstClip->setSupportsTiles(false);//< we don't support tiles in output!
// make some pages and to things in
PageParamDescriptor *page = desc.definePageParam("Controls");
//////////Output file
OFX::StringParamDescriptor* fileParam = desc.defineStringParam(kWriterFileParamName);
fileParam->setLabels(kWriterFileParamLabel, kWriterFileParamLabel, kWriterFileParamLabel);
fileParam->setStringType(OFX::eStringTypeFilePath);
fileParam->setFilePathExists(false);
fileParam->setHint(kWriterFileParamHint);
// in the Writer context, the script name should be "filename", for consistency with the reader nodes @see kOfxImageEffectContextReader
fileParam->setScriptName(kWriterFileParamName);
fileParam->setAnimates(!isVideoStreamPlugin);
desc.addClipPreferencesSlaveParam(*fileParam);
page->addChild(*fileParam);
// insert OCIO parameters
GenericOCIO::describeInContext(desc, context, page, inputSpaceNameDefault, outputSpaceNameDefault);
///////////Frame range choosal
OFX::ChoiceParamDescriptor* frameRangeChoiceParam = desc.defineChoiceParam(kWriterFrameRangeChoiceParamName);
frameRangeChoiceParam->setLabels(kWriterFrameRangeChoiceParamLabel, kWriterFrameRangeChoiceParamLabel, kWriterFrameRangeChoiceParamLabel);
frameRangeChoiceParam->setHint(kWriterFrameRangeChoiceParamHint);
frameRangeChoiceParam->appendOption(kWriterFrameRangeChoiceParamOptionUnion, kWriterFrameRangeChoiceParamOptionUnionHint);
frameRangeChoiceParam->appendOption(kWriterFrameRangeChoiceParamOptionBounds, kWriterFrameRangeChoiceParamOptionBoundsHint);
frameRangeChoiceParam->appendOption(kWriterFrameRangeChoiceParamOptionManual, kWriterFrameRangeChoiceParamOptionManualHint);
frameRangeChoiceParam->setAnimates(true);
frameRangeChoiceParam->setDefault(0);
page->addChild(*frameRangeChoiceParam);
/////////////First frame
OFX::IntParamDescriptor* firstFrameParam = desc.defineIntParam(kWriterFirstFrameParamName);
firstFrameParam->setLabels(kWriterFirstFrameParamLabel, kWriterFirstFrameParamLabel, kWriterFirstFrameParamLabel);
firstFrameParam->setIsSecret(true);
firstFrameParam->setAnimates(true);
page->addChild(*firstFrameParam);
////////////Last frame
OFX::IntParamDescriptor* lastFrameParam = desc.defineIntParam(kWriterLastFrameParamName);
lastFrameParam->setLabels(kWriterLastFrameParamLabel, kWriterLastFrameParamLabel, kWriterLastFrameParamLabel);
lastFrameParam->setIsSecret(true);
lastFrameParam->setAnimates(true);
page->addChild(*lastFrameParam);
return page;
}
示例2: 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" );
}
示例3: describeInContext
/** @brief The describe in context function, passed a plugin descriptor and a context */
void WriteOIIOPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, ContextEnum context)
{
// make some pages and to things in
PageParamDescriptor *page = GenericWriterDescribeInContextBegin(desc, context,isVideoStreamPlugin(), /*supportsRGBA =*/true, /*supportsRGB=*/false, /*supportsAlpha=*/false, "reference", "reference");
OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam(kParamBitDepthName);
bitDepth->setLabels(kParamBitDepthLabel, kParamBitDepthLabel, kParamBitDepthLabel);
bitDepth->appendOption(kParamBitDepthAuto, kParamBitDepthAutoLabel);
bitDepth->appendOption(kParamBitDepth8, kParamBitDepth8Label);
bitDepth->appendOption(kParamBitDepth10, kParamBitDepth10Label);
bitDepth->appendOption(kParamBitDepth12, kParamBitDepth12Label);
bitDepth->appendOption(kParamBitDepth16, kParamBitDepth16Label);
bitDepth->appendOption(kParamBitDepth16f, kParamBitDepth16fLabel);
bitDepth->appendOption(kParamBitDepth32, kParamBitDepth32Label);
bitDepth->appendOption(kParamBitDepth32f, kParamBitDepth32fLabel);
bitDepth->appendOption(kParamBitDepth64, kParamBitDepth64Label);
bitDepth->appendOption(kParamBitDepth64f, kParamBitDepth64fLabel);
bitDepth->setDefault(eTuttlePluginBitDepthAuto);
page->addChild(*bitDepth);
OFX::BooleanParamDescriptor* premult = desc.defineBooleanParam(kParamPremultipliedName);
premult->setLabels(kParamPremultipliedLabel, kParamPremultipliedLabel, kParamPremultipliedLabel);
premult->setDefault(false);
page->addChild(*premult);
OFX::IntParamDescriptor* quality = desc.defineIntParam(kParamOutputQualityName);
quality->setLabels(kParamOutputQualityLabel, kParamOutputQualityLabel, kParamOutputQualityLabel);
quality->setRange(0, 100);
quality->setDisplayRange(0, 100);
quality->setDefault(80);
page->addChild(*quality);
OFX::ChoiceParamDescriptor* orientation = desc.defineChoiceParam(kParamOutputOrientationName);
orientation->setLabels(kParamOutputOrientationLabel, kParamOutputOrientationLabel, kParamOutputOrientationLabel);
orientation->appendOption(kParamOutputOrientationNormal);
orientation->appendOption(kParamOutputOrientationFlop);
orientation->appendOption(kParamOutputOrientationR180);
orientation->appendOption(kParamOutputOrientationFlip);
orientation->appendOption(kParamOutputOrientationTransposed);
orientation->appendOption(kParamOutputOrientationR90Clockwise);
orientation->appendOption(kParamOutputOrientationTransverse);
orientation->appendOption(kParamOutputOrientationR90CounterClockwise);
orientation->setDefault(0);
page->addChild(*orientation);
OFX::ChoiceParamDescriptor* compression = desc.defineChoiceParam(kParamOutputCompressionName);
compression->setLabels(kParamOutputCompressionLabel, kParamOutputCompressionLabel, kParamOutputCompressionLabel);
compression->setHint(kParamOutputCompressionHint);
compression->appendOption(kParamOutputCompressionAuto, kParamOutputCompressionAutoLabel);
compression->appendOption(kParamOutputCompressionNone, kParamOutputCompressionNoneLabel);
compression->appendOption(kParamOutputCompressionZip, kParamOutputCompressionZipLabel);
compression->appendOption(kParamOutputCompressionZips, kParamOutputCompressionZipsLabel);
compression->appendOption(kParamOutputCompressionRle, kParamOutputCompressionRleLabel);
compression->appendOption(kParamOutputCompressionPiz, kParamOutputCompressionPizLabel);
compression->appendOption(kParamOutputCompressionPxr24, kParamOutputCompressionPxr24Label);
compression->appendOption(kParamOutputCompressionB44, kParamOutputCompressionB44Label);
compression->appendOption(kParamOutputCompressionB44a, kParamOutputCompressionB44aLabel);
compression->appendOption(kParamOutputCompressionLZW, kParamOutputCompressionLZWLabel);
compression->appendOption(kParamOutputCompressionCCITTRLE, kParamOutputCompressionCCITTRLELabel);
compression->appendOption(kParamOutputCompressionPACKBITS, kParamOutputCompressionPACKBITSLabel);
compression->setDefault(eParamCompressionAuto);
page->addChild(*compression);
GenericWriterDescribeInContextEnd(desc, context, page);
}