本文整理汇总了C++中ofx::BooleanParamDescriptor::setHint方法的典型用法代码示例。如果您正苦于以下问题:C++ BooleanParamDescriptor::setHint方法的具体用法?C++ BooleanParamDescriptor::setHint怎么用?C++ BooleanParamDescriptor::setHint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofx::BooleanParamDescriptor
的用法示例。
在下文中一共展示了BooleanParamDescriptor::setHint方法的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: 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 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." );
}
示例4:
/**
* @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 );
}
示例5:
OFX::PageParamDescriptor*
CImgFilterPluginHelperBase::describeInContextBegin(bool sourceIsOptional,
OFX::ImageEffectDescriptor &desc,
OFX::ContextEnum context,
bool supportsRGBA,
bool supportsRGB,
bool supportsXY,
bool supportsAlpha,
bool supportsTiles,
bool processRGB,
bool processAlpha,
bool processIsSecret)
{
#ifdef OFX_EXTENSIONS_NATRON
desc.setChannelSelector(OFX::ePixelComponentNone); // we have our own channel selector
#endif
OFX::ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
if (supportsRGBA) {
srcClip->addSupportedComponent(OFX::ePixelComponentRGBA);
}
if (supportsRGB) {
srcClip->addSupportedComponent(OFX::ePixelComponentRGB);
}
if (supportsXY) {
srcClip->addSupportedComponent(OFX::ePixelComponentXY);
}
if (supportsAlpha) {
srcClip->addSupportedComponent(OFX::ePixelComponentAlpha);
}
srcClip->setTemporalClipAccess(false);
srcClip->setSupportsTiles(supportsTiles);
srcClip->setIsMask(false);
if (context == OFX::eContextGeneral && sourceIsOptional) {
srcClip->setOptional(sourceIsOptional);
}
OFX::ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
if (supportsRGBA) {
dstClip->addSupportedComponent(OFX::ePixelComponentRGBA);
}
if (supportsRGB) {
dstClip->addSupportedComponent(OFX::ePixelComponentRGB);
}
if (supportsXY) {
dstClip->addSupportedComponent(OFX::ePixelComponentXY);
}
if (supportsAlpha) {
dstClip->addSupportedComponent(OFX::ePixelComponentAlpha);
}
dstClip->setSupportsTiles(supportsTiles);
OFX::ClipDescriptor *maskClip = (context == OFX::eContextPaint) ? desc.defineClip("Brush") : desc.defineClip("Mask");
maskClip->addSupportedComponent(OFX::ePixelComponentAlpha);
maskClip->setTemporalClipAccess(false);
if (context != OFX::eContextPaint) {
maskClip->setOptional(true);
}
maskClip->setSupportsTiles(supportsTiles);
maskClip->setIsMask(true);
// create the params
OFX::PageParamDescriptor *page = desc.definePageParam("Controls");
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kNatronOfxParamProcessR);
param->setLabel(kNatronOfxParamProcessRLabel);
param->setHint(kNatronOfxParamProcessRHint);
param->setDefault(processRGB);
param->setIsSecret(processIsSecret);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
if (page) {
page->addChild(*param);
}
}
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kNatronOfxParamProcessG);
param->setLabel(kNatronOfxParamProcessGLabel);
param->setHint(kNatronOfxParamProcessGHint);
param->setDefault(processRGB);
param->setIsSecret(processIsSecret);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
if (page) {
page->addChild(*param);
}
}
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kNatronOfxParamProcessB);
param->setLabel(kNatronOfxParamProcessBLabel);
param->setHint(kNatronOfxParamProcessBHint);
param->setDefault(processRGB);
param->setIsSecret(processIsSecret);
param->setLayoutHint(OFX::eLayoutHintNoNewLine);
if (page) {
page->addChild(*param);
}
}
{
OFX::BooleanParamDescriptor* param = desc.defineBooleanParam(kNatronOfxParamProcessA);
//.........这里部分代码省略.........
示例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 );
// 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 );
}
示例7: 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);
}
示例8: 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);
}
示例9: 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 );
}
示例10: 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 );
srcClip->setOptional(true);
// 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( kParamText );
text->setLabel( "Text" );
text->setStringType( OFX::eStringTypeMultiLine );
OFX::BooleanParamDescriptor* isExpression = desc.defineBooleanParam( kParamIsExpression );
isExpression->setLabel( "Expression" );
isExpression->setHint( "If you check this parameter the text must be a python code.\n"
"The final result must be in a variable with the name of the parameter.\n"
"Example:\n"
"from math import *\n"
//+ kParamText +
"text = 'At frame '+str(time)+', value is ' + str( sin(time) )\n" );
isExpression->setDefault( false );
OFX::StringParamDescriptor* font = desc.defineStringParam( kParamFont );
font->setLabel( "Font file" );
font->setStringType( OFX::eStringTypeFilePath );
font->setDefault( "/usr/share/fonts/truetype/msttcorefonts/arial.ttf" );
OFX::IntParamDescriptor* size = desc.defineIntParam( kParamSize );
size->setLabel( "Size" );
size->setDefault( 18 );
size->setRange( 0, std::numeric_limits<int>::max() );
size->setDisplayRange( 0, 60 );
OFX::DoubleParamDescriptor* ratio = desc.defineDoubleParam( kParamRatio );
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( kParamColor );
color->setLabel( "Color" );
color->setDefault( 1.0, 1.0, 1.0, 1.0 );
OFX::Double2DParamDescriptor* position = desc.defineDouble2DParam( kParamPosition );
position->setLabel( "Position" );
position->setDefault( 0.0, 0.0 );
OFX::DoubleParamDescriptor* letterSpacing = desc.defineDoubleParam( kParamLetterSpacing );
letterSpacing->setLabel( "Letter spacing" );
letterSpacing->setDisplayRange( -10.0, 10.0 );
letterSpacing->setDefault( 0.0 );
OFX::ChoiceParamDescriptor* vAlign = desc.defineChoiceParam( kParamVAlign );
vAlign->setLabel( "Vertically align" );
vAlign->appendOption( kParamVAlignTop );
vAlign->appendOption( kParamVAlignCenter );
vAlign->appendOption( kParamVAlignBottom );
vAlign->setDefault( eParamVAlignCenter );
OFX::ChoiceParamDescriptor* hAlign = desc.defineChoiceParam( kParamHAlign );
hAlign->setLabel( "Horizontally align" );
hAlign->appendOption( kParamHAlignLeft );
hAlign->appendOption( kParamHAlignCenter );
hAlign->appendOption( kParamHAlignRight );
hAlign->setDefault( eParamHAlignCenter );
OFX::BooleanParamDescriptor* verticalFlip = desc.defineBooleanParam( kParamVerticalFlip );
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." );
}
示例11: describeGeneratorParamsInContext
void describeGeneratorParamsInContext( OFX::ImageEffectDescriptor& desc,
OFX::EContext context )
{
/* to activate this
// Create the mandated optional input clip
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( kSupportTiles );
srcClip->setOptional(true);
*/
// 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* explicitConversion = desc.defineChoiceParam( kParamGeneratorExplicitConversion );
explicitConversion->setLabel( "Explicit conversion" );
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() ) );
}
OFX::ChoiceParamDescriptor* method = desc.defineChoiceParam( kParamMode );
method->setLabel ( "Mode" );
method->appendOption( kParamModeFormat );
method->appendOption( kParamModeSize );
method->setDefault ( eParamModeFormat );
OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam( kParamFormat );
format->setLabel( "Format" );
format->appendOption( kParamFormatPCVideo );
format->appendOption( kParamFormatNTSC );
format->appendOption( kParamFormatPAL );
format->appendOption( kParamFormatHD );
format->appendOption( kParamFormatNTSC169 );
format->appendOption( kParamFormatPAL169 );
format->appendOption( kParamFormat1kSuper35 );
format->appendOption( kParamFormat1kCinemascope );
format->appendOption( kParamFormat2kSuper35 );
format->appendOption( kParamFormat2kCinemascope );
format->appendOption( kParamFormat4kSuper35 );
format->appendOption( kParamFormat4kCinemascope );
format->appendOption( kParamFormatSquare256 );
format->appendOption( kParamFormatSquare512 );
format->appendOption( kParamFormatSquare1k );
format->appendOption( kParamFormatSquare2k );
format->setDefault( eParamFormat2kCinemascope );
OFX::BooleanParamDescriptor* specificRatio = desc.defineBooleanParam( kParamSizeSpecificRatio );
specificRatio->setLabel( "Specific ratio" );
specificRatio->setDefault( false );
specificRatio->setHint( "Specific 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::DoubleParamDescriptor* ratioValue = desc.defineDoubleParam( kParamSizeRatioValue );
ratioValue->setLabel( "Ratio Value" );
ratioValue->setDefault( 1.0 );
ratioValue->setRange( 1, std::numeric_limits<int>::max() );
ratioValue->setDisplayRange( 0, 50 );
ratioValue->setHint( "Set the ratio." );
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 specify the ratio." );
OFX::IntParamDescriptor* height = desc.defineIntParam( kParamSizeHeight );
height->setLabel( "Height" );
height->setDefault( 200 );
//.........这里部分代码省略.........
示例12: 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
describeWriterParamsInContext(desc, context);
OFX::ChoiceParamDescriptor* bitDepth =
static_cast<OFX::ChoiceParamDescriptor*>(desc.getParamDescriptor(kTuttlePluginBitDepth));
bitDepth->resetOptions();
bitDepth->appendOption(kTuttlePluginBitDepth8);
bitDepth->appendOption(kTuttlePluginBitDepth10);
bitDepth->appendOption(kTuttlePluginBitDepth12);
bitDepth->appendOption(kTuttlePluginBitDepth16);
bitDepth->appendOption(kTuttlePluginBitDepth32);
bitDepth->appendOption(kTuttlePluginBitDepth64);
bitDepth->setDefault(eTuttlePluginBitDepth10);
OFX::ChoiceParamDescriptor* descriptor =
static_cast<OFX::ChoiceParamDescriptor*>(desc.getParamDescriptor(kTuttlePluginChannel));
descriptor->resetOptions();
descriptor->appendOption(kParamDescriptorUserDefinedDescriptor);
descriptor->appendOption(kParamDescriptorRed);
descriptor->appendOption(kParamDescriptorGreen);
descriptor->appendOption(kParamDescriptorBlue);
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);
//.........这里部分代码省略.........
示例13: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void SobelPluginFactory::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->setSupportsTiles(kSupportTiles);
OFX::Double2DParamDescriptor* size = desc.defineDouble2DParam(kParamSize);
size->setLabel("Size");
size->setDefault(1.0, 1.0);
size->setRange(0.0, 0.0, std::numeric_limits<double>::max(), std::numeric_limits<double>::max());
size->setDisplayRange(0, 0, 10, 10);
size->setDoubleType(OFX::eDoubleTypeScale);
OFX::GroupParamDescriptor* advanced = desc.defineGroupParam(kParamGroupAdvanced);
advanced->setLabel("Advanced");
OFX::BooleanParamDescriptor* unidimensional = desc.defineBooleanParam(kParamUnidimensional);
unidimensional->setLabel("Unidimensional");
unidimensional->setHint("Instead of using a square convolution matrix, use 1D kernels.");
unidimensional->setDefault(false);
unidimensional->setParent(advanced);
OFX::BooleanParamDescriptor* reverseKernel = desc.defineBooleanParam(kParamReverseKernel);
reverseKernel->setLabel("Reverse");
reverseKernel->setHint("Reverse the kernel (convolution or correlation).");
reverseKernel->setDefault(false);
reverseKernel->setParent(advanced);
OFX::BooleanParamDescriptor* normalizedKernel = desc.defineBooleanParam(kParamNormalizedKernel);
normalizedKernel->setLabel("Normalized kernel");
normalizedKernel->setHint("Use a normalized kernel to compute the gradient.");
normalizedKernel->setDefault(true);
normalizedKernel->setParent(advanced);
OFX::DoubleParamDescriptor* kernelEpsilon = desc.defineDoubleParam(kParamKernelEpsilon);
kernelEpsilon->setLabel("Kernel espilon value");
kernelEpsilon->setHint("Threshold at which we no longer consider the values of the function.");
kernelEpsilon->setDefault(0.01);
kernelEpsilon->setRange(std::numeric_limits<double>::epsilon(), 1);
kernelEpsilon->setDisplayRange(0, 0.01);
kernelEpsilon->setParent(advanced);
OFX::ChoiceParamDescriptor* pass = desc.defineChoiceParam(kParamPass);
pass->setLabel("Pass");
pass->setHint("The sobel filter is computed using a 2D separable filter. So it consists in 2 passes.\n"
"By default we compute the 2 passes, but with this option you can separate each pass.");
pass->appendOption(kParamPassFull);
pass->appendOption(kParamPass1);
pass->appendOption(kParamPass2);
pass->setDefault(0);
pass->setParent(advanced);
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);
OFX::BooleanParamDescriptor* computeNorm = desc.defineBooleanParam(kParamComputeGradientNorm);
computeNorm->setLabel("Compute norm");
computeNorm->setHint("To disable the norm computation, if you don't need it.");
computeNorm->setDefault(true);
OFX::BooleanParamDescriptor* normManhattan = desc.defineBooleanParam(kParamGradientNormManhattan);
normManhattan->setLabel("Use the manhattan norm");
normManhattan->setHint("Use manhattan norm instead of standard one.");
normManhattan->setDefault(false);
OFX::BooleanParamDescriptor* computeGradientDirection = desc.defineBooleanParam(kParamComputeGradientDirection);
computeGradientDirection->setLabel("Gradient direction");
computeGradientDirection->setHint("To disable the gradient direction computation, if you don't need it.");
computeGradientDirection->setDefault(false);
OFX::BooleanParamDescriptor* gradientDirectionAbs = desc.defineBooleanParam(kParamGradientDirectionAbs);
gradientDirectionAbs->setLabel("Angle between 0 and PI");
gradientDirectionAbs->setHint("Limit gradient direction between 0 and PI.");
gradientDirectionAbs->setDefault(true);
OFX::PushButtonParamDescriptor* infosButton = desc.definePushButtonParam(kParamInfos);
infosButton->setLabel("Infos");
OFX::ChoiceParamDescriptor* outputComponent = desc.defineChoiceParam(kParamOutputComponent);
outputComponent->setLabel("Output component");
outputComponent->appendOption(OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentRGB)
? kParamOutputComponentRGB
: "---");
//.........这里部分代码省略.........
示例14: describeInContext
/**
* @brief Function called to describe the plugin controls and features.
* @param[in, out] desc Effect descriptor
* @param[in] context Application context
*/
void LensDistortPluginFactory::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( true );
// create the mandated source clip
OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcClip->setSupportsTiles( true );
// declare an optional clip reference for RoD
OFX::ClipDescriptor* srcRefClip = desc.defineClip( kClipOptionalSourceRef );
srcRefClip->addSupportedComponent( OFX::ePixelComponentRGBA );
srcRefClip->addSupportedComponent( OFX::ePixelComponentAlpha );
srcRefClip->setSupportsTiles( true );
srcRefClip->setOptional( true );
srcRefClip->setLabel( "ref" );
OFX::BooleanParamDescriptor* reverse = desc.defineBooleanParam( kParamReverse );
reverse->setLabel( "Reverse" );
reverse->setDefault( false );
reverse->setHint( "Invert the effect.\n"
"Distort becomes undistort, and vice versa." );
// Controls
OFX::BooleanParamDescriptor* displaySource = desc.defineBooleanParam( kParamDisplaySource );
displaySource->setLabel( "displaySource" );
displaySource->setDefault( false );
displaySource->setHint( "Display the image source (usefull to parameter the distortion with lines overlays on the source image)." );
OFX::ChoiceParamDescriptor* lensType = desc.defineChoiceParam( kParamLensType );
lensType->setLabel( "Lens type" );
lensType->appendOption( kParamLensTypeStandard );
#ifndef TUTTLE_PRODUCTION
lensType->appendOption( kParamLensTypeFishEye ); // not implemented yet...
lensType->appendOption( kParamLensTypeAdvanced ); // not implemented yet...
lensType->setIsSecret( true );
#endif
lensType->setDefault( 0 );
OFX::DoubleParamDescriptor* coef1 = desc.defineDoubleParam( kParamCoef1 );
coef1->setScriptName( "Main" );
coef1->setDefault( 0.1 );
coef1->setDisplayRange( -1.0, 1.0 );
coef1->setHint( "Main distortion coeffecient\n"
">0 : Barrel distortion\n"
"<0 : Pincushion distortion\n"
);
OFX::DoubleParamDescriptor* coef2 = desc.defineDoubleParam( kParamCoef2 );
coef2->setLabel( "Secondary" );
coef2->setDefault( 0.0 );
coef2->setDisplayRange( -1.0, 1.0 );
coef2->setHint( "Secondary distortion coeffecient (usefull for fisheyes only)\n"
">0 : Barrel distortion\n"
"<0 : Pincushion distortion\n"
);
#ifdef TUTTLE_PRODUCTION
coef2->setIsSecret( true );
#endif
OFX::DoubleParamDescriptor* squeeze = desc.defineDoubleParam( kParamSqueeze );
squeeze->setLabel( "Squeeze" );
#ifdef TUTTLE_PRODUCTION
squeeze->setIsSecret( true );
#endif
// squeeze->setDoubleType( eDoubleTypeNormalisedX );
squeeze->setDefault( 1.0 );
squeeze->setRange( 0.00001, 1.0 );
squeeze->setDisplayRange( 0.01, 1.0 );
squeeze->setHint( "Squeeze distortion coeffecient (usefull for bad quality lens...)" );
OFX::Double2DParamDescriptor* asymmetric = desc.defineDouble2DParam( kParamAsymmetric );
asymmetric->setLabel( "Asymmetric" );
#ifdef TUTTLE_PRODUCTION
asymmetric->setIsSecret( true );
#endif
// asymmetric->setDoubleType( eDoubleTypeNormalisedXY );
asymmetric->setDefault( 0.0, 0.0 );
asymmetric->setRange( 0.0, 0.0, 1.0, 1.0 );
asymmetric->setDisplayRange( 0.0, 0.0, 1.0, 1.0 );
asymmetric->setHint( "asymmetric distortion coeffecient (usefull for bad quality lens...)" );
OFX::Double2DParamDescriptor* center = desc.defineDouble2DParam( kParamCenter );
center->setLabel( "Center" );
center->setDoubleType( OFX::eDoubleTypePlain );
center->setDefault( 0.0, 0.0 );
center->setDisplayRange( -1.0, -1.0, 1.0, 1.0 );
center->setHint( "Center parameter allows you to shift the center of distortion." );
//.........这里部分代码省略.........
示例15: 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);
//.........这里部分代码省略.........