当前位置: 首页>>代码示例>>C++>>正文


C++ DoubleParamDescriptor::setLabel方法代码示例

本文整理汇总了C++中ofx::DoubleParamDescriptor::setLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ DoubleParamDescriptor::setLabel方法的具体用法?C++ DoubleParamDescriptor::setLabel怎么用?C++ DoubleParamDescriptor::setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ofx::DoubleParamDescriptor的用法示例。


在下文中一共展示了DoubleParamDescriptor::setLabel方法的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 TimeShiftPluginFactory::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 );

	// Create the mandated output clip
	OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
	dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
	dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
	dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );

	switch( context )
	{
		case OFX::eContextRetimer:
		{
			OFX::DoubleParamDescriptor* retimerParam = desc.defineDoubleParam( kOfxImageEffectRetimerParamName );
			retimerParam->setLabel( "Source Time" );
			retimerParam->setDefault( 0.0 );
			break;
		}
		default:
		{
			OFX::DoubleParamDescriptor* offset = desc.defineDoubleParam( kParamOffset );
			offset->setLabel( "Offset" );
			offset->setDefault( 0.0 );
			offset->setDisplayRange( -10, 10 );
			break;
		}
	}
}
开发者ID:Finaler,项目名称:TuttleOFX,代码行数:38,代码来源:TimeShiftPluginFactory.cpp

示例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." );

}
开发者ID:tuttleSandbox,项目名称:TuttleOFX,代码行数:62,代码来源:TextPluginFactory.cpp

示例3: describeInContext

/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void ConvolutionPluginFactory::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::Int2DParamDescriptor* size = desc.defineInt2DParam( kParamSize );
	size->setLabel( "Size" );
	size->setDefault( 3, 3 );
	//	size->setIncrement( 2, 2 );
	size->setRange( 3, 3, kParamSizeMax, kParamSizeMax );

	OFX::ChoiceParamDescriptor* border = desc.defineChoiceParam( kParamBorder );
	border->setLabel( "Border" );
	border->appendOption( kParamBorderMirror );
	border->appendOption( kParamBorderConstant );
	border->appendOption( kParamBorderBlack );
	border->appendOption( kParamBorderPadded );
	
	for( unsigned int y = 0; y < kParamSizeMax; ++y )
	{
		for( unsigned int x = 0; x < kParamSizeMax; ++x )
		{
			const std::string name( getCoefName( y, x ) );
			OFX::DoubleParamDescriptor* coef = desc.defineDoubleParam( name );
			coef->setLabel( name );
			coef->setDisplayRange( -10.0, 10.0 );
			coef->setDefault( 0.0 );
		}
	}
}
开发者ID:Achammem,项目名称:TuttleOFX,代码行数:46,代码来源:ConvolutionPluginFactory.cpp

示例4: describeInContext

/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void AVReaderPluginFactory::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);

    // Groups
    OFX::GroupParamDescriptor* formatGroup = desc.defineGroupParam(kParamFormatGroup);
    OFX::GroupParamDescriptor* videoGroup = desc.defineGroupParam(kParamVideoGroup);
    OFX::GroupParamDescriptor* metaGroup = desc.defineGroupParam(kParamMetaGroup);

    formatGroup->setLabel("Format");
    videoGroup->setLabel("Video");
    metaGroup->setLabel("Metadata");

    formatGroup->setAsTab();
    videoGroup->setAsTab();
    metaGroup->setAsTab();

    /// FORMAT PARAMETERS
    avtranscoder::FormatContext formatContext(AV_OPT_FLAG_DECODING_PARAM);
    avtranscoder::OptionArray formatOptions = formatContext.getOptions();
    common::addOptionsToGroup(desc, formatGroup, formatOptions, common::kPrefixFormat);

    OFX::GroupParamDescriptor* formatDetailedGroup = desc.defineGroupParam(kParamFormatDetailedGroup);
    formatDetailedGroup->setLabel("Detailed");
    formatDetailedGroup->setAsTab();
    formatDetailedGroup->setParent(formatGroup);

    avtranscoder::OptionArrayMap formatDetailedGroupOptions = avtranscoder::getAvailableOptionsPerOutputFormat();
    common::addOptionsToGroup(desc, formatDetailedGroup, formatDetailedGroupOptions, common::kPrefixFormat);

    /// VIDEO PARAMETERS
    AVCodecContext* videoContext = avcodec_alloc_context3(NULL);
    avtranscoder::OptionArray videoOptions;
    avtranscoder::loadOptions(videoOptions, videoContext, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM);
    common::addOptionsToGroup(desc, videoGroup, videoOptions, common::kPrefixVideo);
    av_free(videoContext);

    OFX::BooleanParamDescriptor* useCustomSAR = desc.defineBooleanParam(kParamUseCustomSAR);
    useCustomSAR->setLabel("Override SAR");
    useCustomSAR->setDefault(false);
    useCustomSAR->setHint("Override the file SAR (Storage Aspect Ratio) with a custom SAR value.");
    useCustomSAR->setParent(videoGroup);

    OFX::DoubleParamDescriptor* customSAR = desc.defineDoubleParam(kParamCustomSAR);
    customSAR->setLabel("Custom SAR");
    customSAR->setDefault(1.0);
    customSAR->setDisplayRange(0., 3.);
    customSAR->setRange(0., 10.);
    customSAR->setHint("Choose a custom value to override the file SAR (Storage Aspect Ratio). Maximum value: 10.");
    customSAR->setParent(videoGroup);

    OFX::IntParamDescriptor* streamIndex = desc.defineIntParam(kParamVideoStreamIndex);
    streamIndex->setLabel(kParamVideoStreamIndexLabel);
    streamIndex->setDefault(0);
    streamIndex->setDisplayRange(0., 16.);
    streamIndex->setRange(0., 100.);
    streamIndex->setHint("Choose a custom value to decode the video stream you want. Maximum value: 100.");
    streamIndex->setParent(videoGroup);

    OFX::GroupParamDescriptor* videoDetailedGroup = desc.defineGroupParam(kParamVideoDetailedGroup);
    videoDetailedGroup->setLabel("Detailed");
    videoDetailedGroup->setAsTab();
    videoDetailedGroup->setParent(videoGroup);

    avtranscoder::OptionArrayMap videoDetailedGroupOptions = avtranscoder::getAvailableOptionsPerVideoCodec();
    common::addOptionsToGroup(desc, videoDetailedGroup, videoDetailedGroupOptions, common::kPrefixVideo);

    /// METADATA PARAMETERS
    AVCodecContext* metaDataContext = avcodec_alloc_context3(NULL);
    avtranscoder::OptionArray metaDataOptions;
    avtranscoder::loadOptions(metaDataOptions, metaDataContext, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_METADATA);
    common::addOptionsToGroup(desc, metaGroup, metaDataOptions, common::kPrefixMetaData);
    av_free(metaDataContext);

    OFX::StringParamDescriptor* metaDataWrapper = desc.defineStringParam(kParamMetaDataWrapper);
    metaDataWrapper->setLabel(kParamMetaDataWrapperLabel);
    metaDataWrapper->setEnabled(false);
    metaDataWrapper->setStringType(OFX::eStringTypeMultiLine);
    metaDataWrapper->setParent(metaGroup);

    OFX::StringParamDescriptor* metaDataVideo = desc.defineStringParam(kParamMetaDataVideo);
    metaDataVideo->setLabel(kParamMetaDataVideoLabel);
    metaDataVideo->setEnabled(false);
    metaDataVideo->setStringType(OFX::eStringTypeMultiLine);
    metaDataVideo->setParent(metaGroup);

    OFX::StringParamDescriptor* metaDataAudio = desc.defineStringParam(kParamMetaDataAudio);
    metaDataAudio->setLabel(kParamMetaDataAudioLabel);
//.........这里部分代码省略.........
开发者ID:aoblet,项目名称:TuttleOFX,代码行数:101,代码来源:AVReaderPluginFactory.cpp

示例5: describeInContext

/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void CropPluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::EContext context)
{
    OFX::ClipDescriptor* srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);

    srcClip->addSupportedComponent(OFX::ePixelComponentRGBA);
    srcClip->addSupportedComponent(OFX::ePixelComponentRGB);
    srcClip->addSupportedComponent(OFX::ePixelComponentAlpha);
    srcClip->setSupportsTiles(kSupportTiles);

    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(kParamModeCrop);
    mode->appendOption(kParamModeFillColor);
    //	mode->appendOption( kParamModeResize ); // good idea or not?
    mode->setDefault(eParamModeCrop);

    OFX::RGBAParamDescriptor* fillColor = desc.defineRGBAParam(kParamFillColor);
    fillColor->setLabel("Color");
    fillColor->setHint("Color to fill bands");
    fillColor->setDefault(0.0, 0.0, 0.0, 1.0);

    OFX::ChoiceParamDescriptor* axis = desc.defineChoiceParam(kParamAxis);
    axis->setLabel("Axis");
    axis->appendOption(kParamAxisXY);
    axis->appendOption(kParamAxisX);
    axis->appendOption(kParamAxisY);
    axis->setDefault(eParamAxisY);
    axis->setEvaluateOnChange(false);

    OFX::ChoiceParamDescriptor* symmetric = desc.defineChoiceParam(kParamSymmetric);
    symmetric->setLabel("Symmetric");
    symmetric->appendOption(kParamSymmetricNone);
    symmetric->appendOption(kParamSymmetricXY);
    symmetric->appendOption(kParamSymmetricX);
    symmetric->appendOption(kParamSymmetricY);
    symmetric->setHint("Is the crop region symmetric around image center?");
    symmetric->setDefault(true);
    symmetric->setEvaluateOnChange(false);

    OFX::BooleanParamDescriptor* fixedRatio = desc.defineBooleanParam(kParamFixedRatio);
    fixedRatio->setLabel("Fixed ratio");
    fixedRatio->setHint("Constrain the cropped region to this ratio.");
    fixedRatio->setDefault(true);
    fixedRatio->setEvaluateOnChange(false);

    OFX::ChoiceParamDescriptor* preset = desc.defineChoiceParam(kParamPreset);
    preset->setLabel("Preset");
    preset->appendOption(kParamPreset_custom);
    preset->appendOption(kParamPreset_1_33);
    preset->appendOption(kParamPreset_1_77);
    preset->appendOption(kParamPreset_1_85);
    preset->appendOption(kParamPreset_2_35);
    preset->appendOption(kParamPreset_2_40);
    preset->setDefault(0);
    preset->setEvaluateOnChange(false);

    OFX::DoubleParamDescriptor* ratio = desc.defineDoubleParam(kParamRatio);
    ratio->setLabel("Ratio");
    ratio->setRange(0, std::numeric_limits<double>::max());
    ratio->setDisplayRange(0, 3);
    ratio->setDefault(2.0);
    ratio->setHint("Ratio X/Y of the cropped region.");

    OFX::BooleanParamDescriptor* overlay = desc.defineBooleanParam(kParamOverlay);
    overlay->setLabel("Overlay");
    overlay->setHint("Display overlay rectangle");
    overlay->setDefault(false);
    overlay->setEvaluateOnChange(false);

    OFX::GroupParamDescriptor* cropRegion = desc.defineGroupParam(kParamGroupCropRegion);

    OFX::IntParamDescriptor* xMin = desc.defineIntParam(kParamXMin);
    xMin->setLabel("X min");
    //	xMin->setRange( 0, std::numeric_limits<int>::max() );
    xMin->setDisplayRange(0, 3000);
    xMin->setDefault(0);
    xMin->setParent(*cropRegion);

    OFX::IntParamDescriptor* yMin = desc.defineIntParam(kParamYMin);
    yMin->setLabel("Y min");
    //	yMin->setRange( 0, std::numeric_limits<int>::max() );
    yMin->setDisplayRange(0, 3000);
    yMin->setDefault(0);
    yMin->setParent(*cropRegion);

    OFX::IntParamDescriptor* xMax = desc.defineIntParam(kParamXMax);
    xMax->setLabel("X max");
    //	xMax->setRange( 0, std::numeric_limits<int>::max() );
    xMax->setDisplayRange(0, 3000);
//.........这里部分代码省略.........
开发者ID:aoblet,项目名称:TuttleOFX,代码行数:101,代码来源:CropPluginFactory.cpp

示例6: 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 );
}
开发者ID:Achammem,项目名称:TuttleOFX,代码行数:77,代码来源:PushPixelPluginFactory.cpp

示例7: describeInContext

/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void ColorTransferPluginFactory::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( 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( true );

	OFX::ClipDescriptor* srcRefClip = desc.defineClip( kClipSrcRef );
	srcRefClip->addSupportedComponent( OFX::ePixelComponentRGBA );
	srcRefClip->addSupportedComponent( OFX::ePixelComponentRGB );
	// srcRefClip->addSupportedComponent( OFX::ePixelComponentAlpha );
	srcRefClip->setSupportsTiles( false );
	srcRefClip->setOptional( true );

	OFX::ClipDescriptor* dstRefClip = desc.defineClip( kClipDstRef );
	dstRefClip->addSupportedComponent( OFX::ePixelComponentRGBA );
	dstRefClip->addSupportedComponent( OFX::ePixelComponentRGB );
//	dstRefClip->addSupportedComponent( OFX::ePixelComponentAlpha );
	dstRefClip->setSupportsTiles( false );

	OFX::ChoiceParamDescriptor* colorspace = desc.defineChoiceParam( kParamColorspace );
	colorspace->setLabel( "Transformation colorspace" );
	colorspace->setHint( "Select colorspace in which to apply the transformation" );
	colorspace->appendOption( kParamColorspaceNone, "without colorspace transformation" );
	colorspace->appendOption( kParamColorspaceLMS, "apply correction in LMS colorspace" );
	colorspace->appendOption( kParamColorspaceLab, "apply correction in L(alpha)(beta) colorspace" );
	colorspace->setDefault( eColorspaceLab );
	
	OFX::DoubleParamDescriptor* averageCoef = desc.defineDoubleParam( kParamAverageCoef );
	averageCoef->setLabel( "Average color coef" );
	averageCoef->setDisplayRange( 0.0, 1.0 );
	averageCoef->setDefault( 0.8 );
	averageCoef->setHint(
			"Percentage of correction of the average color.\n"
			"It is often advantageous to reduce this ratio, "
			"especially if the two images are very different. "
			"Typical values are between 0.5 and 0.8."
		);

	OFX::DoubleParamDescriptor* dynamicCoef = desc.defineDoubleParam( kParamDynamicCoef );
	dynamicCoef->setLabel( "Dynamic coef" );
	dynamicCoef->setDisplayRange( 0.0, 1.0 );
	dynamicCoef->setDefault( 1.0 );
	dynamicCoef->setHint(
			"Percentage of correction of the standard deviation."
		);

//	// output region
//	OFX::Double2DParamDescriptor* regionA = desc.defineDouble2DParam( kParamRegionA );
//	regionA->setLabel( "Region" );
//	regionA->setDefault( -0.5, -0.5 );
//	regionA->setIsSecret( true ); ///< @todo
//	OFX::Double2DParamDescriptor* regionB = desc.defineDouble2DParam( kParamRegionB );
//	regionB->setLabel( "" );
//	regionB->setDefault( 0.5, 0.5 );
//	regionB->setIsSecret( true ); ///< @todo
//
//	// same region
//	OFX::BooleanParamDescriptor* sameRegion = desc.defineBooleanParam( kParamSameRegion );
//	sameRegion->setDefault( true );
//	sameRegion->setIsSecret( true ); ///< @todo
//
//	// input region
//	OFX::Double2DParamDescriptor* inputRegionA = desc.defineDouble2DParam( kParamInputRegionA );
//	inputRegionA->setLabel( "Input region" );
//	inputRegionA->setDefault( -0.5, -0.5 );
//	inputRegionA->setIsSecret( true ); ///< @todo
//	OFX::Double2DParamDescriptor* inputRegionB = desc.defineDouble2DParam( kParamInputRegionB );
//	inputRegionB->setLabel( "" );
//	inputRegionB->setDefault( 0.5, 0.5 );
//	inputRegionB->setIsSecret( true ); ///< @todo
}
开发者ID:Achammem,项目名称:TuttleOFX,代码行数:86,代码来源:ColorTransferPluginFactory.cpp

示例8: 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." );

}
开发者ID:morphimac,项目名称:TuttleOFX,代码行数:87,代码来源:TextPluginFactory.cpp

示例9: describeInContext

void LensCalibrationPluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::ContextEnum context)
{
  //Input Clip
  OFX::ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
  srcClip->addSupportedComponent(OFX::ePixelComponentRGBA);
  srcClip->setTemporalClipAccess(false);
  srcClip->setSupportsTiles(false);
  srcClip->setIsMask(false);
  srcClip->setOptional(false);
  
  //Output clip
  OFX::ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
  dstClip->addSupportedComponent(OFX::ePixelComponentRGBA);
  dstClip->setSupportsTiles(false);
  
  //Calibration Group
  {
    OFX::GroupParamDescriptor *groupCalibration = desc.defineGroupParam(kParamGroupCalibration);
    groupCalibration->setLabel("Calibration");
    groupCalibration->setAsTab();

    {
      OFX::Int2DParamDescriptor *param = desc.defineInt2DParam(kParamImageSize);
      param->setLabel("Image Size");
      param->setHint("Input image size used to calibrate the optics. Obviously, all images should have the same size.");
      param->setDefault(0, 0);
      param->setDisplayRange(0, 0, 10000, 10000);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
      param->setEnabled(false); // should not be edited by the user
    }

    {
      OFX::BooleanParamDescriptor *param = desc.defineBooleanParam(kParamInputImageIsGray);
      param->setLabel("Input image is gray");
      param->setHint("Input image is gray");
      param->setParent(*groupCalibration);
    }
    
    {
      OFX::ChoiceParamDescriptor *param = desc.defineChoiceParam(kParamPatternType);
      param->setLabel("Pattern Type");
      param->setHint("Type of pattern to detect");
      param->appendOptions(kStringParamPatternType);
      param->setDefault(eParamPatternTypeChessboard);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
    }

    {
      OFX::Int2DParamDescriptor *param = desc.defineInt2DParam(kParamPatternSize);
      param->setLabel("Pattern Size");
      param->setHint("Number of inner corners per one of board dimension Width Height");
      param->setDefault(10, 7);
      param->setRange(2, 2, kOfxFlagInfiniteMax, kOfxFlagInfiniteMax);
      param->setDisplayRange(2, 2, 15, 15);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
    }
    
    {
      OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamSquareSize);
      param->setLabel("Square Size");
      param->setHint("Define the size of the grid's square cells (mm)");
      param->setDisplayRange(0, 100);
      param->setDefault(1);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
      param->setLayoutHint(OFX::eLayoutHintDivider);
    }

    {
      OFX::IntParamDescriptor *param = desc.defineIntParam(kParamNbRadialCoef);
      param->setLabel("Nb Radial Coef");
      param->setHint("Number of radial coefficient.");
      param->setRange(0, 6);
      param->setDisplayRange(0, 6);
      param->setDefault(3);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
    }

    {
      OFX::IntParamDescriptor *param = desc.defineIntParam(kParamMaxFrames);
      param->setLabel("Max Frames");
      param->setHint("Maximal number of frames to extract from the video file.");
      param->setRange(0, kOfxFlagInfiniteMax);
      param->setDisplayRange(0, 1000);
      param->setDefault(0);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
    }

    {
      OFX::IntParamDescriptor *param = desc.defineIntParam(kParamMaxCalibFrames);
      param->setLabel("Max Calibration Frames");
      param->setHint("Maximal number of frames to use to calibrate from the selected frames.");
      param->setRange(0, kOfxFlagInfiniteMax);
      param->setDisplayRange(0, 1000);
      param->setDefault(100);
//.........这里部分代码省略.........
开发者ID:poparteu,项目名称:ofxMVG,代码行数:101,代码来源:LensCalibrationPluginFactory.cpp

示例10: 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
                                      : "---");
//.........这里部分代码省略.........
开发者ID:aoblet,项目名称:TuttleOFX,代码行数:101,代码来源:SobelPluginFactory.cpp

示例11: describeInContext

/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void ColorTransformPluginFactory::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::DoubleParamDescriptor* paramHueShift = desc.defineDoubleParam( kParamHueShift );
	paramHueShift->setLabel( "Hue Shift" );
	paramHueShift->setDefault( 0.0 );
	paramHueShift->setDisplayRange( 0.0, 1.0 );
	
	OFX::DoubleParamDescriptor* paramSaturation = desc.defineDoubleParam( kParamSaturation );
	paramSaturation->setLabel( "Saturation" );
	paramSaturation->setDefault( 0.0 );
	paramSaturation->setDisplayRange( 0.0, 1.0 );
	
	
	OFX::DoubleParamDescriptor* paramBrightnessRGB = desc.defineDoubleParam( kParamBrightnessRGB );
	paramBrightnessRGB->setLabel( "Global Brightness RGB" );
	paramBrightnessRGB->setHint( "Global manipulation of RGB brightness." );
	paramBrightnessRGB->setDefault( 1.0 );
	paramBrightnessRGB->setDisplayRange( 0.0, 1.0 );
	
	OFX::RGBAParamDescriptor* paramBrightness = desc.defineRGBAParam( kParamBrightness );
	paramBrightness->setLabel( "Brightness" );
	paramBrightness->setDefault( 1.0, 1.0, 1.0, 1.0 );
	
	
	OFX::DoubleParamDescriptor* paramPivotRGB = desc.defineDoubleParam( kParamPivotRGB );
	paramPivotRGB->setLabel( "Global Pivot RGB" );
	paramPivotRGB->setHint( "Global manipulation of RGB pivot." );
	paramPivotRGB->setDefault( 0.0 );
	paramPivotRGB->setDisplayRange( 0.0, 1.0 );
	
	OFX::RGBAParamDescriptor* paramPivot = desc.defineRGBAParam( kParamPivot );
	paramPivot->setLabel( "Pivot" );
	paramPivot->setDefault( 0.0, 0.0, 0.0, 0.0 );
	
	
	OFX::DoubleParamDescriptor* paramContrastRGB = desc.defineDoubleParam( kParamContrastRGB );
	paramContrastRGB->setLabel( "Global Contrast RGB" );
	paramContrastRGB->setHint( "Global manipulation of RGB contrast." );
	paramContrastRGB->setDefault( 1.0 );
	paramContrastRGB->setDisplayRange( 0.0, 1.0 );
	
	OFX::RGBAParamDescriptor* paramContrast = desc.defineRGBAParam( kParamContrast );
	paramContrast->setLabel( "Contrast" );
	paramContrast->setDefault( 1.0, 1.0, 1.0, 1.0 );
	
	OFX::DoubleParamDescriptor* paramOffsetRGB = desc.defineDoubleParam( kParamOffsetRGB );
	paramOffsetRGB->setLabel( "Global Offset RGB" );
	paramOffsetRGB->setHint( "Global manipulation of RGB offset." );
	paramOffsetRGB->setDefault( 0.0 );
	paramOffsetRGB->setDisplayRange( 0.0, 1.0 );
	
	OFX::RGBAParamDescriptor* paramOffset = desc.defineRGBAParam( kParamOffset );
	paramOffset->setLabel( "Offset" );
	paramOffset->setDefault( 0.0, 0.0, 0.0, 0.0 );
}
开发者ID:antdricot,项目名称:TuttleOFX,代码行数:75,代码来源:ColorTransformPluginFactory.cpp

示例12: 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." );

//.........这里部分代码省略.........
开发者ID:tuttleSandbox,项目名称:TuttleOFX,代码行数:101,代码来源:LensDistortPluginFactory.cpp

示例13: 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);
//.........这里部分代码省略.........
开发者ID:Achammem,项目名称:TuttleOFX,代码行数:101,代码来源:HistogramKeyerPluginFactory.cpp

示例14: 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 );
//.........这里部分代码省略.........
开发者ID:antdricot,项目名称:TuttleOFX,代码行数:101,代码来源:GeneratorPluginFactory.hpp

示例15: describeInContext

/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void ColorSpacePluginFactory::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);

    /* ----------------------- INPUT PARAMETERS -------------------------- */

    OFX::GroupParamDescriptor* inGroup = desc.defineGroupParam(kColorSpaceIn);
    inGroup->setLabel("Input configuration");

    OFX::ChoiceParamDescriptor* inReferenceSpace = desc.defineChoiceParam(kColorSpaceReferenceSpaceIn);
    inReferenceSpace->setLabel("Reference Space");
    inReferenceSpace->setParent(inGroup);

    OFX::GroupParamDescriptor* inCustom = desc.defineGroupParam(kColorSpaceCustomizedIn);
    inCustom->setLabel("Custom");
    inCustom->setOpen(false);
    inCustom->setParent(inGroup);

    OFX::ChoiceParamDescriptor* inGradationLaw = desc.defineChoiceParam(kColorSpaceGradationLawIn);
    inGradationLaw->setLabel("Gradation Law");
    inGradationLaw->setParent(inCustom);

    OFX::DoubleParamDescriptor* inGammaValue = desc.defineDoubleParam(kColorSpaceInGammaValue);
    inGammaValue->setLabel("Gamma");
    inGammaValue->setDefault(1.0);
    inGammaValue->setRange(0.0, std::numeric_limits<double>::max());
    inGammaValue->setDisplayRange(0.0, 5.0);
    inGammaValue->setHint("Adjust the Gamma.");
    inGammaValue->setParent(inCustom);

    OFX::DoubleParamDescriptor* inBlackPoint = desc.defineDoubleParam(kColorSpaceInBlackPoint);
    inBlackPoint->setLabel("Black Point");
    inBlackPoint->setDefault(0.0);
    inBlackPoint->setRange(0.0, 1.0);
    inBlackPoint->setDisplayRange(0.0, 1.0);
    inBlackPoint->setHint("Adjust the Black Point.");
    inBlackPoint->setParent(inCustom);

    OFX::DoubleParamDescriptor* inWhitePoint = desc.defineDoubleParam(kColorSpaceInWhitePoint);
    inWhitePoint->setLabel("White Point");
    inWhitePoint->setDefault(1.0);
    inWhitePoint->setRange(0.0, 1.0);
    inWhitePoint->setDisplayRange(0.0, 1.0);
    inWhitePoint->setHint("Adjust the White Point.");
    inWhitePoint->setParent(inCustom);

    OFX::DoubleParamDescriptor* inGammaSensito = desc.defineDoubleParam(kColorSpaceInGammaSensito);
    inGammaSensito->setLabel("Gamma Sensito");
    inGammaSensito->setDefault(1.0);
    inGammaSensito->setRange(0.0, std::numeric_limits<double>::max());
    inGammaSensito->setDisplayRange(0.0, 5.0);
    inGammaSensito->setHint("Adjust the Gamma Sensito.");
    inGammaSensito->setParent(inCustom);

    OFX::ChoiceParamDescriptor* inLayout = desc.defineChoiceParam(kColorSpaceLayoutIn);
    inLayout->setLabel("Layout");
    inLayout->setParent(inCustom);

    OFX::ChoiceParamDescriptor* inTempColor = desc.defineChoiceParam(kColorSpaceTempColorIn);
    inTempColor->setLabel("Color Temperature");
    inTempColor->setHint("Select the color temperature.");
    inTempColor->setParent(inCustom);

    OFX::GroupParamDescriptor* inPrimaries = desc.defineGroupParam(kColorSpacePrimariesIn);
    inPrimaries->setLabel("Primaries color");
    inPrimaries->setOpen(false);
    inPrimaries->setParent(inCustom);

    OFX::DoubleParamDescriptor* inXr = desc.defineDoubleParam(kColorSpaceXrIn);
    inXr->setLabel("X red");
    inXr->setDefault(1.0);
    inXr->setRange(0.0, 1.0);
    inXr->setDisplayRange(0.0, 1.0);
    inXr->setHint("Adjust the X red primary color.");
    inXr->setParent(inPrimaries);

    OFX::DoubleParamDescriptor* inYr = desc.defineDoubleParam(kColorSpaceYrIn);
    inYr->setLabel("Y red");
    inYr->setDefault(1.0);
    inYr->setRange(0.0, 1.0);
    inYr->setDisplayRange(0.0, 1.0);
    inYr->setHint("Adjust the Y red primary color.");
    inYr->setParent(inPrimaries);

//.........这里部分代码省略.........
开发者ID:aoblet,项目名称:TuttleOFX,代码行数:101,代码来源:ColorSpacePluginFactory.cpp


注:本文中的ofx::DoubleParamDescriptor::setLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。