本文整理汇总了C++中ofx::ChoiceParamDescriptor::setLayoutHint方法的典型用法代码示例。如果您正苦于以下问题:C++ ChoiceParamDescriptor::setLayoutHint方法的具体用法?C++ ChoiceParamDescriptor::setLayoutHint怎么用?C++ ChoiceParamDescriptor::setLayoutHint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::ChoiceParamDescriptor
的用法示例。
在下文中一共展示了ChoiceParamDescriptor::setLayoutHint方法的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 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);
//.........这里部分代码省略.........