本文整理汇总了C++中ofx::ImageEffectDescriptor::defineBooleanParam方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageEffectDescriptor::defineBooleanParam方法的具体用法?C++ ImageEffectDescriptor::defineBooleanParam怎么用?C++ ImageEffectDescriptor::defineBooleanParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::ImageEffectDescriptor
的用法示例。
在下文中一共展示了ImageEffectDescriptor::defineBooleanParam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void TurboJpegReaderPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
describeReaderParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* optimization = desc.defineChoiceParam( kParamOptimization );
optimization->setLabel( kParamOptimizationLabel );
optimization->setHint( kParamOptimizationHint );
optimization->appendOption( kTurboJpegOptimizationNone );
optimization->appendOption( kTurboJpegOptimizationMMX );
optimization->appendOption( kTurboJpegOptimizationSSE );
optimization->appendOption( kTurboJpegOptimizationSSE2 );
optimization->appendOption( kTurboJpegOptimizationSSE3 );
optimization->setDefault( eTurboJpegOptimizationSSE3 );
OFX::BooleanParamDescriptor* fastupsampling = desc.defineBooleanParam( kParamFastUpsampling );
fastupsampling->setLabel( kParamFastUpsamplingLabel );
fastupsampling->setHint( kParamFastUpsamplingHint );
fastupsampling->setDefault( false );
}
示例2: describeWriterParamsInContext
void describeWriterParamsInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::StringParamDescriptor* filename = desc.defineStringParam( kTuttlePluginFilename );
filename->setLabel( kTuttlePluginFilenameLabel );
filename->setStringType( OFX::eStringTypeFilePath );
filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
desc.addClipPreferencesSlaveParam( *filename );
OFX::ChoiceParamDescriptor* channel = desc.defineChoiceParam( kTuttlePluginChannel );
channel->setLabel( kTuttlePluginChannelLabel );
channel->appendOption( kTuttlePluginChannelAuto );
channel->appendOption( kTuttlePluginChannelGray );
channel->appendOption( kTuttlePluginChannelRGB );
channel->appendOption( kTuttlePluginChannelRGBA );
channel->setDefault( 0 );
OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kTuttlePluginBitDepth );
bitDepth->setLabel( kTuttlePluginBitDepthLabel );
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
bitDepth->setDefault( 0 );
OFX::BooleanParamDescriptor* premult = desc.defineBooleanParam( kParamPremultiplied );
premult->setLabel( kParamPremultipliedLabel );
premult->setDefault( false );
OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender );
render->setLabels( "Render", "Render", "Render step" );
render->setHint("Force render (writing)");
OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways );
renderAlways->setLabel( "Render always" );
// renderAlways->setDefault( false );
renderAlways->setDefault( true ); // because tuttle is not declared as a background renderer
OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender );
forceNewRender->setLabel( "Force new render" );
forceNewRender->setEnabled( false );
forceNewRender->setIsSecret( true );
forceNewRender->setIsPersistant( false );
forceNewRender->setAnimates( false );
forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
forceNewRender->setEvaluateOnChange( true );
forceNewRender->setDefault( 0 );
}
示例3: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void TextPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::StringParamDescriptor* text = desc.defineStringParam( kText );
text->setLabel( "Text" );
text->setStringType( OFX::eStringTypeMultiLine );
OFX::StringParamDescriptor* font = desc.defineStringParam( kFont );
font->setLabel( "Font file" );
font->setStringType( OFX::eStringTypeFilePath );
font->setDefault( "/usr/share/fonts/truetype/msttcorefonts/arial.ttf" );
OFX::IntParamDescriptor* size = desc.defineIntParam( kSize );
size->setLabel( "Size" );
size->setDefault( 18 );
size->setRange( 0, std::numeric_limits<int>::max() );
size->setDisplayRange( 0, 60 );
OFX::DoubleParamDescriptor* ratio = desc.defineDoubleParam( kRatio );
ratio->setLabel( "Ratio" );
ratio->setRange( 0.0, std::numeric_limits<double>::max() );
ratio->setDisplayRange( 0.0, 2.0 );
ratio->setDefault( 1.0 );
OFX::RGBAParamDescriptor* color = desc.defineRGBAParam( kColor );
color->setLabel( "Color" );
color->setDefault( 1.0, 1.0, 1.0, 1.0 );
OFX::Double2DParamDescriptor* position = desc.defineDouble2DParam( kPosition );
position->setLabel( "Position" );
position->setDefault( 0.0, 0.0 );
OFX::DoubleParamDescriptor* letterSpacing = desc.defineDoubleParam( kLetterSpacing );
letterSpacing->setLabel( "Letter spacing" );
letterSpacing->setDisplayRange( -10.0, 10.0 );
letterSpacing->setDefault( 0.0 );
OFX::BooleanParamDescriptor* verticalFlip = desc.defineBooleanParam( kVerticalFlip );
verticalFlip->setLabel( "Vertical flip" );
verticalFlip->setDefault( false );
verticalFlip->setAnimates( false );
verticalFlip->setHint( "Some hosts use inverted images, so you can correct this problem using this flag." );
}
示例4: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void OpenImageIOWriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
// Controls
OFX::StringParamDescriptor* filename = desc.defineStringParam( kParamWriterFilename );
filename->setLabel( "Filename" );
filename->setStringType( OFX::eStringTypeFilePath );
filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
desc.addClipPreferencesSlaveParam( *filename );
OFX::ChoiceParamDescriptor* components = desc.defineChoiceParam( kParamOutputComponents );
components->setLabel( "Components" );
components->appendOption( kParamOutputComponentsRGBA );
components->appendOption( kParamOutputComponentsRGB );
components->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
components->setDefault( 0 );
OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kParamWriterBitDepth );
bitDepth->setLabel( "Bit depth" );
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
bitDepth->appendOption( kTuttlePluginBitDepth32f );
bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
bitDepth->setDefault( 1 );
OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender );
render->setLabels( "Render", "Render", "Render step" );
render->setHint( "Force render (writing)" );
OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways );
renderAlways->setLabel( "Render always" );
renderAlways->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
renderAlways->setDefault( false );
OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender );
forceNewRender->setLabel( "Force new render" );
forceNewRender->setIsSecret( true );
forceNewRender->setIsPersistant( false );
forceNewRender->setAnimates( false );
forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
forceNewRender->setEvaluateOnChange( true );
forceNewRender->setDefault( 0 );
}
示例5: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void RampPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
describeGeneratorParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* direction = desc.defineChoiceParam( kRampDirection );
direction->appendOption( "horizontal", "Horizontal" );
direction->appendOption( "vertical", "Vertical" );
direction->setLabel( "Ramp Direction" );
direction->setHint( "Select the ramp direction." );
OFX::BooleanParamDescriptor* color = desc.defineBooleanParam( kRampColor );
color->setDefault( false );
color->setLabel( "Color Ramp" );
color->setHint( "Enable the R/G/B/Gray ramp." );
}
示例6: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void DPXWriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
// Controls
OFX::StringParamDescriptor* filename = desc.defineStringParam( kParamWriterFilename );
filename->setLabel( "Filename" );
filename->setStringType( OFX::eStringTypeFilePath );
filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
desc.addClipPreferencesSlaveParam( *filename );
OFX::ChoiceParamDescriptor* componentsType = desc.defineChoiceParam( kParamComponentsType );
componentsType->setLabel( "Components type" );
componentsType->appendOption( "rgb" );
componentsType->appendOption( "rgba" );
componentsType->appendOption( "abgr" );
componentsType->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
componentsType->setDefault( 1 );
OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kParamWriterBitDepth );
bitDepth->setLabel( "Bit depth" );
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth10 );
bitDepth->appendOption( kTuttlePluginBitDepth12 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
bitDepth->setDefault( 3 );
OFX::BooleanParamDescriptor* compressed = desc.defineBooleanParam( kParamCompressed );
compressed->setLabel( "Remove unused bits (bit streaming)" );
compressed->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
compressed->setDefault( false );
describeWriterParamsInContext( desc, context );
}
示例7: ofxsPremultDescribeParams
void
CImgFilterPluginHelperBase::describeInContextEnd(OFX::ImageEffectDescriptor &desc,
OFX::ContextEnum /*context*/,
OFX::PageParamDescriptor* page)
{
ofxsPremultDescribeParams(desc, page);
ofxsMaskMixDescribeParams(desc, page);
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kParamPremultChanged);
param->setDefault(false);
param->setIsSecret(true);
param->setAnimates(false);
param->setEvaluateOnChange(false);
if (page) {
page->addChild(*param);
}
}
}
示例8:
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void Jpeg2000WriterPluginFactory::describeInContext( OFX::ImageEffectDescriptor &desc,
OFX::EContext context )
{
OFX::ClipDescriptor *srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor *dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
describeWriterParamsInContext( desc, context );
OFX::ChoiceParamDescriptor* bitDepth = static_cast<OFX::ChoiceParamDescriptor*>( desc.getParamDescriptor( kTuttlePluginBitDepth ) );
bitDepth->resetOptions();
bitDepth->appendOption( kTuttlePluginBitDepth8 );
bitDepth->appendOption( kTuttlePluginBitDepth12 );
bitDepth->appendOption( kTuttlePluginBitDepth16 );
#ifndef TUTTLE_PRODUCTION
bitDepth->appendOption( kTuttlePluginBitDepth32 );
#endif
bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
bitDepth->setDefault( eTuttlePluginBitDepth8 );
OFX::BooleanParamDescriptor* lossless = desc.defineBooleanParam( kParamLossless );
lossless->setLabel( "lossless" );
lossless->setHint("When no cinema profile is selected, set compression to lossless.");
lossless->setDefault( false );
OFX::ChoiceParamDescriptor* cineProfil = desc.defineChoiceParam( kParamCinemaProfil );
cineProfil->appendOption( kParamCinemaProfilNoDigit );
cineProfil->appendOption( kParamCinemaProfil2k24fps );
cineProfil->appendOption( kParamCinemaProfil2k48fps );
cineProfil->appendOption( kParamCinemaProfil4k24fps );
cineProfil->setDefault( 0 );
}
示例9: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void ComponentPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::ChoiceParamDescriptor* outTo = desc.defineChoiceParam( kParamTo );
outTo->setLabel( kParamToLabel );
outTo->appendOption( kConvertToGray );
outTo->appendOption( kConvertToRGB );
outTo->appendOption( kConvertToRGBA );
outTo->setDefault( eConvertToRGBA );
OFX::ChoiceParamDescriptor* outGray = desc.defineChoiceParam( kParamToGray );
outGray->setLabel( kParamToGrayLabel );
outGray->appendOption( kConvertToGrayMean );
outGray->appendOption( kConvertToGrayRec601 );
outGray->appendOption( kConvertToGrayRec709 );
outGray->appendOption( kConvertToGraySelectRed );
outGray->appendOption( kConvertToGraySelectGreen );
outGray->appendOption( kConvertToGraySelectBlue );
outGray->appendOption( kConvertToGraySelectAlpha );
outGray->setDefault( 3 ); // terry::color::components::eConvertToGrayRec709
OFX::BooleanParamDescriptor* outPremult = desc.defineBooleanParam( kParamPremutliplied );
outPremult->setLabel( kParamPremutlipliedLabel );
outPremult->setDefault( false );
}
示例10: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void HistogramKeyerPluginFactory::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 );
//global display
OFX::BooleanParamDescriptor* boolGLOBAL = desc.defineBooleanParam(kGlobalDisplay);
boolGLOBAL->setHint("Display global overlay on screen.");
boolGLOBAL->setDefault(true);
// if parametric parameters are supported
if( OFX::getImageEffectHostDescription()->supportsParametricParameter )
{
OFX::ParametricParamDescriptor* curvesRGB = desc.defineParametricParam( kParamRGBColorSelection );
OFX::ParametricParamDescriptor* curvesHSL = desc.defineParametricParam( kParamHSLColorSelection );
//Group Param (RGB & HSL)
OFX::GroupParamDescriptor *groupRGB = desc.defineGroupParam(kGroupRGB);
groupRGB->setLabel(kGroupRGBLabel);
OFX::GroupParamDescriptor *groupHSL = desc.defineGroupParam(kGroupHSL);
groupHSL->setLabel(kGroupHSLLabel);
//define the graphic aspect
curvesRGB->setRange( 0.0, 1.0 ); //set range on RGB curve
curvesHSL->setRange( 0.0, 1.0 ); //set range on HSL curve
curvesRGB->setDimension(nbCurvesRGB); //3 curves on RGB
curvesHSL->setDimension(nbCurvesHSL); //3 curves on HSL
//Add curves RGB
curvesRGB->setDimensionLabel( kParamColorSelectionRed, 0 ); // 0 on RGB is red
curvesRGB->setDimensionLabel( kParamColorSelectionGreen, 1 ); // 1 on RGB is green
curvesRGB->setDimensionLabel( kParamColorSelectionBlue, 2 ); // 2 on RGB is blue
//Add curves HSL
curvesHSL->setDimensionLabel( kParamColorSelectionHue, 0 ); // 0 on HSL is hue
curvesHSL->setDimensionLabel( kParamColorSelectionSaturation, 1 ); // 1 on HSL is saturation
curvesHSL->setDimensionLabel( kParamColorSelectionLightness, 2 ); // 2 on HSK is lightness
//define curves color RGB
curvesRGB->setHint( "Color selection" );
static const OfxRGBColourD red = {1,0,0}; //set red color to red curve
static const OfxRGBColourD green = {0,1,0}; //set green color to green curve
static const OfxRGBColourD blue = {0,0,1}; //set blue color to blue curve
curvesRGB->setUIColour( 0, red );
curvesRGB->setUIColour( 1, green );
curvesRGB->setUIColour( 2, blue );
//define curves color HSL
curvesHSL->setHint( "Color selection" );
curvesHSL->setUIColour( 0, red ); //set red color on hue curve
curvesHSL->setUIColour( 1, green ); //set green color on saturation curve
curvesHSL->setUIColour( 2, blue ); //set lightness color on saturation curve
curvesRGB->setInteractDescriptor( new OFX::DefaultParamInteractWrap<RGBParamOverlayDescriptor>() ); //attach parametric curve to RGBOverlay
curvesHSL->setInteractDescriptor( new OFX::DefaultParamInteractWrap<HSLParamOverlayDescriptor>() ); //attach parametric curve to HSLOverlay
//add curves to their groups
curvesRGB->setParent(groupRGB); //add RGB curves to RGB group
curvesHSL->setParent(groupHSL); //add HSL curves to HSL group
//Set each curves to initial value
curvesRGB->setIdentity();
curvesHSL->setIdentity();
//add 2 control points (0,1) and (1,1) for each channel
for(unsigned int i=0; i< nbCurvesRGB; ++i)
{
//curvesRGB->addControlPoint( i, 0.0, 0.0, 1.0, false );
curvesRGB->addControlPoint( i, 0.0, 1.0, 1.0, false );
}
for(unsigned int i=0; i< nbCurvesHSL; ++i)
{
//curvesHSL->addControlPoint( i, 0.0, 0.0, 1.0, false );
curvesHSL->addControlPoint( i, 0.0, 1.0, 1.0, false );
}
//Channels checkboxes (RGB)
OFX::BooleanParamDescriptor* boolR = desc.defineBooleanParam(kBoolRed);
boolR->setDefault(false); //red channel is not selected by default
boolR->setHint("Activate Red channel");
boolR->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
boolR->setParent(groupRGB);
//red multiplier
OFX::DoubleParamDescriptor* redMultiplier = desc.defineDoubleParam(kMultiplierRed);
redMultiplier->setLabel(kMultiplierLabel);
redMultiplier->setHint("Determinate curve from selection precision.");
redMultiplier->setRange(1, 1000);
redMultiplier->setDisplayRange(0,5);
redMultiplier->setDefault(1);
//.........这里部分代码省略.........
示例11: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void PrintPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::ChoiceParamDescriptor* mode = desc.defineChoiceParam( kParamMode );
mode->setLabel( "Mode" );
mode->appendOption( kParamModeImage );
mode->appendOption( kParamModeRegion );
mode->appendOption( kParamModePixel );
OFX::Int2DParamDescriptor* pixel = desc.defineInt2DParam( kParamPixel );
pixel->setLabel( "Pixel" );
pixel->setDisplayRange( 0, 0, 2000, 2000 );
OFX::Int2DParamDescriptor* regionMin = desc.defineInt2DParam( kParamRegionMin );
regionMin->setLabel( "Region min" );
regionMin->setDisplayRange( 0, 0, 2000, 2000 );
OFX::Int2DParamDescriptor* regionMax = desc.defineInt2DParam( kParamRegionMax );
regionMax->setLabel( "Region max" );
regionMax->setDefault( 1,1 );
regionMax->setDisplayRange( 0, 0, 2000, 2000 );
OFX::IntParamDescriptor* outputColumns = desc.defineIntParam( kParamColumns );
outputColumns->setDefault(80);
outputColumns->setDisplayRange(1,500);
OFX::ChoiceParamDescriptor* colorType = desc.defineChoiceParam( kParamColor );
colorType->appendOption( kParamColorMono );
colorType->appendOption( kParamColorGray );
colorType->appendOption( kParamColor8 );
colorType->appendOption( kParamColor16 );
colorType->appendOption( kParamColorFullGray );
colorType->appendOption( kParamColorFull8 );
colorType->appendOption( kParamColorFull16 );
colorType->setLabel( "Color type for the output." );
OFX::ChoiceParamDescriptor* output = desc.defineChoiceParam( kParamOutput );
output->setLabel( "Output" );
output->appendOption( kParamOutputAscii );
output->appendOption( kParamOutputNumeric );
OFX::BooleanParamDescriptor* flip = desc.defineBooleanParam( kParamFlip );
flip->setLabel( "Flip" );
OFX::BooleanParamDescriptor* openGlWindow = desc.defineBooleanParam( kParamOutputOpenGL );
openGlWindow->setLabel( "Show in OpenGL Window." );
}
示例12: 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 );
}
示例13: 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 );
}
示例14: describeInContext
void InvertPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum context)
{
// Source clip only in the filter context
// create the mandated source clip
ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
srcClip->addSupportedComponent(ePixelComponentRGBA);
srcClip->addSupportedComponent(ePixelComponentRGB);
srcClip->addSupportedComponent(ePixelComponentAlpha);
srcClip->setTemporalClipAccess(false);
srcClip->setSupportsTiles(true);
srcClip->setIsMask(false);
// create the mandated output clip
ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
dstClip->addSupportedComponent(ePixelComponentRGBA);
dstClip->addSupportedComponent(ePixelComponentRGB);
dstClip->addSupportedComponent(ePixelComponentAlpha);
dstClip->setSupportsTiles(true);
if (context == eContextGeneral || context == eContextPaint) {
ClipDescriptor *maskClip = context == eContextGeneral ? desc.defineClip("Mask") : desc.defineClip("Brush");
maskClip->addSupportedComponent(ePixelComponentAlpha);
maskClip->setTemporalClipAccess(false);
if (context == eContextGeneral) {
maskClip->setOptional(true);
}
maskClip->setSupportsTiles(true);
maskClip->setIsMask(true);
}
// make some pages and to things in
PageParamDescriptor *page = desc.definePageParam("Controls");
OFX::BooleanParamDescriptor* processR = desc.defineBooleanParam(kParamProcessR);
processR->setLabels(kParamProcessRLabel, kParamProcessRLabel, kParamProcessRLabel);
processR->setHint(kParamProcessRHint);
processR->setDefault(true);
processR->setLayoutHint(eLayoutHintNoNewLine);
page->addChild(*processR);
OFX::BooleanParamDescriptor* processG = desc.defineBooleanParam(kParamProcessG);
processG->setLabels(kParamProcessGLabel, kParamProcessGLabel, kParamProcessGLabel);
processG->setHint(kParamProcessGHint);
processG->setDefault(true);
processG->setLayoutHint(eLayoutHintNoNewLine);
page->addChild(*processG);
OFX::BooleanParamDescriptor* processB = desc.defineBooleanParam( kParamProcessB );
processB->setLabels(kParamProcessBLabel, kParamProcessBLabel, kParamProcessBLabel);
processB->setHint(kParamProcessBHint);
processB->setDefault(true);
processB->setLayoutHint(eLayoutHintNoNewLine);
page->addChild(*processB);
OFX::BooleanParamDescriptor* processA = desc.defineBooleanParam( kParamProcessA );
processA->setLabels(kParamProcessALabel, kParamProcessALabel, kParamProcessALabel);
processA->setHint(kParamProcessAHint);
processA->setDefault(true);
page->addChild(*processA);
ofxsMaskMixDescribeParams(desc, page);
}
示例15: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void ResizePluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::EContext context)
{
OFX::ClipDescriptor* srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
srcClip->addSupportedComponent(OFX::ePixelComponentRGBA);
srcClip->addSupportedComponent(OFX::ePixelComponentRGB);
srcClip->addSupportedComponent(OFX::ePixelComponentAlpha);
srcClip->setSupportsTiles(kSupportTiles);
// Create the mandated output clip
OFX::ClipDescriptor* dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
dstClip->addSupportedComponent(OFX::ePixelComponentRGBA);
dstClip->addSupportedComponent(OFX::ePixelComponentRGB);
dstClip->addSupportedComponent(OFX::ePixelComponentAlpha);
dstClip->setSupportsTiles(kSupportTiles);
OFX::ChoiceParamDescriptor* method = desc.defineChoiceParam(kParamMode);
method->setLabel("Mode");
method->appendOption(kParamModeFormat);
method->appendOption(kParamModeSize);
method->appendOption(kParamModeScale);
method->setDefault(eParamModeFormat);
OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam(kParamFormat);
format->setLabel("Format");
format->appendOption(kParamFormatPCVideo, kParamFormatPCVideoLabel);
format->appendOption(kParamFormatNTSC, kParamFormatNTSCLabel);
format->appendOption(kParamFormatPAL, kParamFormatPALLabel);
format->appendOption(kParamFormatHD, kParamFormatHDLabel);
format->appendOption(kParamFormatNTSC169, kParamFormatNTSC169Label);
format->appendOption(kParamFormatPAL169, kParamFormatPAL169Label);
format->appendOption(kParamFormat1kSuper35, kParamFormat1kSuper35Label);
format->appendOption(kParamFormat1kCinemascope, kParamFormat1kCinemascopeLabel);
format->appendOption(kParamFormat2kSuper35, kParamFormat2kSuper35Label);
format->appendOption(kParamFormat2kCinemascope, kParamFormat2kCinemascopeLabel);
format->appendOption(kParamFormat4kSuper35, kParamFormat4kSuper35Label);
format->appendOption(kParamFormat4kCinemascope, kParamFormat4kCinemascopeLabel);
format->appendOption(kParamFormatSquare256, kParamFormatSquare256Label);
format->appendOption(kParamFormatSquare512, kParamFormatSquare512Label);
format->appendOption(kParamFormatSquare1k, kParamFormatSquare1kLabel);
format->appendOption(kParamFormatSquare2k, kParamFormatSquare2kLabel);
format->setDefault(eParamFormat2kCinemascope);
OFX::Double2DParamDescriptor* scale = desc.defineDouble2DParam(kParamScale);
scale->setLabel("Scale");
scale->setDefault(1.0, 1.0);
scale->setRange(0.01, 0.01, std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
scale->setDisplayRange(0.1, 0.1, 2.5, 2.5);
scale->setHint("Scale the input image [0, 0, width*scale, height*scale].");
OFX::BooleanParamDescriptor* keepRatio = desc.defineBooleanParam(kParamSizeKeepRatio);
keepRatio->setLabel("Keep ratio");
keepRatio->setDefault(false);
keepRatio->setHint("Keep input image ratio.");
OFX::Int2DParamDescriptor* size = desc.defineInt2DParam(kParamSize);
size->setLabel("Size");
size->setDefault(200, 200);
size->setRange(1, 1, std::numeric_limits<int>::max(), std::numeric_limits<int>::max());
size->setHint("Set the output size (width, height).");
OFX::ChoiceParamDescriptor* direction = desc.defineChoiceParam(kParamSizeOrientation);
direction->setLabel("Orientation");
direction->appendOption(kParamSizeOrientationX);
direction->appendOption(kParamSizeOrientationY);
direction->setDefault(eParamSizeOrientationX);
OFX::IntParamDescriptor* width = desc.defineIntParam(kParamSizeWidth);
width->setLabel("Width");
width->setDefault(200);
width->setRange(1, std::numeric_limits<int>::max());
width->setDisplayRange(0, 3000);
width->setHint("Set the width in pixels and keep the input image ratio.");
OFX::IntParamDescriptor* height = desc.defineIntParam(kParamSizeHeight);
height->setLabel("Height");
height->setDefault(200);
height->setRange(1, std::numeric_limits<int>::max());
height->setDisplayRange(0, 3000);
height->setHint("Set the height in pixels and keep the input image ratio.");
#if(TUTTLE_EXPERIMENTAL)
OFX::BooleanParamDescriptor* center = desc.defineBooleanParam(kParamCenter);
center->setLabel("Center resizing");
center->setDefault(false);
center->setHint("Resize around the center point.");
OFX::Double2DParamDescriptor* centerPoint = desc.defineDouble2DParam(kParamCenterPoint);
centerPoint->setDefault(100, 100);
centerPoint->setLabel("Center point at");
centerPoint->setHint("Position of the center point.");
#endif
// sampler parameters //
describeSamplerParamsInContext(desc, context);
}