本文整理汇总了C++中ofx::DoubleParamDescriptor::setDoubleType方法的典型用法代码示例。如果您正苦于以下问题:C++ DoubleParamDescriptor::setDoubleType方法的具体用法?C++ DoubleParamDescriptor::setDoubleType怎么用?C++ DoubleParamDescriptor::setDoubleType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::DoubleParamDescriptor
的用法示例。
在下文中一共展示了DoubleParamDescriptor::setDoubleType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 PushPixelPluginFactory::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::ePixelComponentAlpha );
dstClip->setSupportsTiles( kSupportTiles );
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
// no tiles on src clip, because it depends on the mask content so we can't
// define the maximal bounding box needed...
srcClip->setSupportsTiles( false );
OFX::ClipDescriptor* maskClip = desc.defineClip( kClipMask );
maskClip->addSupportedComponent( OFX::ePixelComponentRGBA );
maskClip->addSupportedComponent( OFX::ePixelComponentAlpha );
maskClip->setIsMask( true );
maskClip->setOptional( true );
maskClip->setSupportsTiles( true );
OFX::ChoiceParamDescriptor* output = desc.defineChoiceParam( kParamOutput );
output->setLabel( "Output" );
output->appendOption( kParamOutputMotionVectors );
output->appendOption( kParamOutputPushPixel );
output->setDefault( 1 );
OFX::DoubleParamDescriptor* size = desc.defineDoubleParam( kParamSize );
size->setLabel( "Size" );
size->setHint( "Size of the gradient window." );
size->setRange( 0.0, std::numeric_limits<double>::max() );
size->setDisplayRange( 1.0, 10.0 );
size->setDefault( 2.0 );
OFX::BooleanParamDescriptor* normalizedKernel = desc.defineBooleanParam( kParamNormalizedKernel );
normalizedKernel->setLabel( "Normalized kernel" );
normalizedKernel->setHint( "Use a normalized kernel to compute the gradient." );
normalizedKernel->setDefault( true );
//#ifndef TUTTLE_PRODUCTION
normalizedKernel->setIsSecret( true );
//#endif
OFX::DoubleParamDescriptor* intensity = desc.defineDoubleParam( kParamIntensity );
intensity->setLabel( "Intensity" );
intensity->setHint( "Scale motion vectors." );
intensity->setDisplayRange( 0.0, 2.0 );
intensity->setDefault( 0.75 );
OFX::DoubleParamDescriptor* angle = desc.defineDoubleParam( kParamAngle );
angle->setLabel( "Angle" );
angle->setHint( "Rotation on the gradient." );
angle->setDisplayRange(-180, 180);
angle->setDoubleType( OFX::eDoubleTypeAngle );
angle->setDefault( 0.0 );
OFX::ChoiceParamDescriptor* interpolation = desc.defineChoiceParam( kParamInterpolation );
interpolation->setLabel( "Interpolation" );
interpolation->setHint( "Interpolation method." );
interpolation->appendOption( kParamInterpolationNearest );
interpolation->appendOption( kParamInterpolationBilinear );
interpolation->setDefault( 1 );
OFX::ChoiceParamDescriptor* border = desc.defineChoiceParam( kParamBorder );
border->setLabel( "Gradient border" );
border->setHint( "Border method for gradient computation." );
border->appendOption( kParamBorderMirror );
border->appendOption( kParamBorderConstant );
border->appendOption( kParamBorderBlack );
border->appendOption( kParamBorderPadded );
}