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


C++ ChoiceParamDescriptor::setHint方法代码示例

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


在下文中一共展示了ChoiceParamDescriptor::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 );
}
开发者ID:Finaler,项目名称:TuttleOFX,代码行数:32,代码来源:TurboJpegReaderPluginFactory.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 ThinningPluginFactory::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* border = desc.defineChoiceParam( kParamBorder );
	border->setLabel( "Gradient border" );
	border->setHint( "Border method for gradient computation." );
	border->appendOption( kParamBorderBlack );
	border->appendOption( kParamBorderPadded );
//	border->appendOption( kParamBorderMirror );
//	border->appendOption( kParamBorderConstant );
	border->setDefault( 1 );
}
开发者ID:Achammem,项目名称:TuttleOFX,代码行数:30,代码来源:ThinningPluginFactory.cpp

示例3: catch

void
GenericOCIO::describeInContextOutput(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum /*context*/, OFX::PageParamDescriptor *page, const char* outputSpaceNameDefault, const char* outputSpaceLabel)
{
#ifdef OFX_IO_USING_OCIO
    gHostIsNatron = (OFX::getImageEffectHostDescription()->isNatron);

    char* file = std::getenv("OCIO");
    OCIO::ConstConfigRcPtr config;
    if (file != NULL) {
        //Add choices
        try {
            config = OCIO::Config::CreateFromFile(file);
            gWasOCIOEnvVarFound = true;
        } catch (OCIO::Exception &e) {
        }
    }
    std::string outputSpaceName;
    if (config) {
        outputSpaceName = canonicalizeColorSpace(config, colorSpaceName(config, outputSpaceNameDefault));
    }

    ///////////Output Color-space
    {
        OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamOutputSpace);
        param->setLabel(outputSpaceLabel);
        param->setHint(kOCIOParamOutputSpaceHint);
        param->setAnimates(true);
        if (config) {
            param->setDefault(outputSpaceName);
        } else {
            param->setEnabled(false);
        }
        page->addChild(*param);
    }
#ifdef OFX_OCIO_CHOICE
    {
        OFX::ChoiceParamDescriptor* param = desc.defineChoiceParam(kOCIOParamOutputSpaceChoice);
        param->setLabel(outputSpaceLabel);
        param->setHint(kOCIOParamOutputSpaceHint);
        param->setCascading(OFX::getImageEffectHostDescription()->supportsCascadingChoices);
        if (config) {
            buildChoiceMenu(config, param, OFX::getImageEffectHostDescription()->supportsCascadingChoices, outputSpaceName);
        } else {
            param->setEnabled(false);
            //param->setIsSecret(true); // done in the plugin constructor
        }
        param->setAnimates(true);
        param->setEvaluateOnChange(false); // evaluate only when the StringParam is changed
        param->setIsPersistant(false); // don't save/serialize
        page->addChild(*param);
    }
#endif
#endif
}
开发者ID:theomission,项目名称:openfx-io,代码行数:54,代码来源:GenericOCIO.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 ColorWheelPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
                                                  OFX::EContext context )
{
	describeGeneratorParamsInContext( desc, context );

    OFX::ChoiceParamDescriptor* mode = desc.defineChoiceParam( kColorWheelMode );
    mode->setLabel( "Type" );
    mode->setHint( "Select mode for the color wheel." );
    mode->appendOption( kColorWheelModeWhite );
    mode->appendOption( kColorWheelModeBlack );
    mode->appendOption( kColorWheelModeRainbow );
    mode->setDefault( 0 );
}
开发者ID:Achammem,项目名称:TuttleOFX,代码行数:18,代码来源:ColorWheelPluginFactory.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 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." );
}
开发者ID:DIT-Tools,项目名称:TuttleOFX,代码行数:21,代码来源:RampPluginFactory.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 PinningPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
                                              OFX::EContext context )
{
	OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
	srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
	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::ePixelComponentAlpha );
	dstClip->setSupportsTiles( kSupportTiles );

	//////////////////// Options ////////////////////
	OFX::ChoiceParamDescriptor* method = desc.defineChoiceParam( kParamMethod );
	method->setLabel( "Method" );
	method->appendOption( kParamMethodAffine );
	method->appendOption( kParamMethodPerspective );
	method->appendOption( kParamMethodBilinear );
	method->setDefault( 1 );
	method->setHint( "Interpolation method" );

	OFX::ChoiceParamDescriptor* interpolation = desc.defineChoiceParam( kParamInterpolation );
	interpolation->setLabel( "Interpolation" );
	interpolation->appendOption( kParamInterpolationNearest );
	interpolation->appendOption( kParamInterpolationBilinear );
	interpolation->setDefault( 1 );
	interpolation->setHint( "Interpolation method" );

        OFX::PushButtonParamDescriptor* setToCornersIn = desc.definePushButtonParam( kParamSetToCornersIn);
        setToCornersIn->setLabel( "Set In" );
        setToCornersIn->setHint("Set to corners in points");

        OFX::PushButtonParamDescriptor* setToCornersOut = desc.definePushButtonParam( kParamSetToCornersOut);
        setToCornersOut->setLabel( "Set Out" );
        setToCornersOut->setHint("Set to corners out points");

	OFX::BooleanParamDescriptor* overlay = desc.defineBooleanParam( kParamOverlay );
	overlay->setLabel( "Overlay" );
	overlay->setDefault( true );

        OFX::BooleanParamDescriptor* inverse = desc.defineBooleanParam( kParamInverse );
        inverse->setLabel( "Inverse" );
        inverse->setDefault( false );
/*
        //TODO-vince///////////
        //////////////////// Transform Centre Point ////////////////////
        OFX::GroupParamDescriptor* groupCentre = desc.defineGroupParam( kParamGroupCentre );
        groupCentre->setLabel( "Centre point" );
        groupCentre->setOpen(false);

        OFX::ChoiceParamDescriptor* manipulatorMode = desc.defineChoiceParam( kParamManipulatorMode );
        manipulatorMode->appendOption( kParamManipulatorModeTranslate );
        manipulatorMode->appendOption( kParamManipulatorModeRotate );
        manipulatorMode->appendOption( kParamManipulatorModeScale );

        OFX::Double2DParamDescriptor* pCentre = desc.defineDouble2DParam( kParamPointCentre);
        pCentre->setLabel( "Centre point" );
        pCentre->setHint( "Transform Centre point" );
        pCentre->setDefault( 0.0, 0.0 );
        pCentre->setParent( groupCentre );

        OFX::BooleanParamDescriptor* overlayCentre = desc.defineBooleanParam( kParamOverlayCentre );
        overlayCentre->setLabel( "Overlay" );
        overlayCentre->setDefault( true );
        overlayCentre->setParent( groupCentre );

        OFX::RGBParamDescriptor* ouverlayCentreColor = desc.defineRGBParam( kParamOverlayCentreColor );
        ouverlayCentreColor->setLabel( "Color" );
        ouverlayCentreColor->setHint( "Centre point overlay color" );
        ouverlayCentreColor->setDefault( 0.0, 1.0, 0.0 );
        ouverlayCentreColor->setParent( groupCentre );
*/
	//////////////////// IN Points ////////////////////
	OFX::GroupParamDescriptor* groupIn = desc.defineGroupParam( kParamGroupIn );
	groupIn->setLabel( "Input points" );
        groupIn->setOpen(false);

	OFX::Double2DParamDescriptor* pIn0 = desc.defineDouble2DParam( kParamPointIn + "0" );
	pIn0->setLabel( "In 0" );
	pIn0->setHint( "Input point 0" );
        pIn0->setDefault( -0.5, -0.5 );
        pIn0->setParent( groupIn );

	OFX::Double2DParamDescriptor* pIn1 = desc.defineDouble2DParam( kParamPointIn + "1" );
	pIn1->setLabel( "In 1" );
	pIn1->setHint( "Input point 1" );
	pIn1->setDefault( 0.5, -0.5 );
	pIn1->setParent( groupIn );

	OFX::Double2DParamDescriptor* pIn2 = desc.defineDouble2DParam( kParamPointIn + "2" );
	pIn2->setLabel( "In 2" );
	pIn2->setHint( "Input point 2" );
	pIn2->setDefault( -0.5, 0.5 );
//.........这里部分代码省略.........
开发者ID:morphimac,项目名称:TuttleOFX,代码行数:101,代码来源:PinningPluginFactory.cpp

示例7: s

void
GenericOCIO::describeInContextInput(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum /*context*/, OFX::PageParamDescriptor *page, const char* inputSpaceNameDefault, const char* inputSpaceLabel)
{
#ifdef OFX_IO_USING_OCIO
    gHostIsNatron = (OFX::getImageEffectHostDescription()->isNatron);

    char* file = std::getenv("OCIO");
    OCIO::ConstConfigRcPtr config;
    if (file != NULL) {
        //Add choices
        try {
            config = OCIO::Config::CreateFromFile(file);
            gWasOCIOEnvVarFound = true;
        } catch (OCIO::Exception &e) {
        }
    }
    std::string inputSpaceName, outputSpaceName;
    if (config) {
        inputSpaceName = canonicalizeColorSpace(config, colorSpaceName(config, inputSpaceNameDefault));
    }

    ////////// OCIO config file
    {
        OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamConfigFile);
        param->setLabel(kOCIOParamConfigFileLabel);
        param->setHint(kOCIOParamConfigFileHint);
        param->setStringType(OFX::eStringTypeFilePath);
        param->setFilePathExists(true);
        param->setAnimates(false);
        desc.addClipPreferencesSlaveParam(*param);
        // the OCIO config can only be set in a portable fashion using the environment variable.
        // Nuke, for example, doesn't support changing the entries in a ChoiceParam outside of describeInContext.
        // disable it, and set the default from the env variable.
        assert(OFX::getImageEffectHostDescription());
        param->setEnabled(true);
        if (file == NULL) {
            param->setDefault("WARNING: Open an OCIO config file, or set the OCIO environnement variable");
        } else if (config) {
            param->setDefault(file);
        } else {
            std::string s("ERROR: Invalid OCIO configuration '");
            s += file;
            s += '\'';
            param->setDefault(s);
        }
        page->addChild(*param);
    }

    ///////////Input Color-space
    {
        OFX::StringParamDescriptor* param = desc.defineStringParam(kOCIOParamInputSpace);
        param->setLabel(inputSpaceLabel);
        param->setHint(kOCIOParamInputSpaceHint);
        param->setAnimates(true);
        if (config) {
            param->setDefault(inputSpaceName);
        } else {
            param->setEnabled(false);
        }
        page->addChild(*param);
    }

#ifdef OFX_OCIO_CHOICE
    {
        OFX::ChoiceParamDescriptor* param = desc.defineChoiceParam(kOCIOParamInputSpaceChoice);
        param->setLabel(inputSpaceLabel);
        param->setHint(kOCIOParamInputSpaceHint);
        param->setCascading(OFX::getImageEffectHostDescription()->supportsCascadingChoices);
        if (config) {
            buildChoiceMenu(config, param, OFX::getImageEffectHostDescription()->supportsCascadingChoices, inputSpaceName);
        } else {
            param->setEnabled(false);
            //param->setIsSecret(true); // done in the plugin constructor
        }
        param->setAnimates(true);
        param->setEvaluateOnChange(false); // evaluate only when the StringParam is changed
        param->setIsPersistant(false); // don't save/serialize
        page->addChild(*param);
    }
#endif
#endif
}
开发者ID:theomission,项目名称:openfx-io,代码行数:82,代码来源:GenericOCIO.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 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

示例9: 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

示例10: 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

示例11: describeInContext

/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void HistogramPluginFactory::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);
	
    // RGB / HSL
	{
		//Group Param (RGB & HSL)
		OFX::GroupParamDescriptor *groupRGB = desc.defineGroupParam(kGroupRGB);
		groupRGB->setLabel(kGroupRGBLabel);
		OFX::GroupParamDescriptor *groupHSL = desc.defineGroupParam(kGroupHSL);
		groupHSL->setLabel(kGroupHSLLabel);

		//Channels checkboxes (RGB)
		OFX::BooleanParamDescriptor* boolR = desc.defineBooleanParam(kBoolRed);
		boolR->setDefault(true);							//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);
		redMultiplier->setParent(groupRGB);
		
		OFX::BooleanParamDescriptor* boolG = desc.defineBooleanParam(kBoolGreen);
		boolG->setDefault(true);						//green channel is not selected by default
		boolG->setHint("Activate Green channel");
		boolG->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
		boolG->setParent(groupRGB);
		//green multiplier
		OFX::DoubleParamDescriptor* greenMultiplier = desc.defineDoubleParam(kMultiplierGreen);
		greenMultiplier->setLabel(kMultiplierLabel);
		greenMultiplier->setHint("Determinate curve from selection precision.");
		greenMultiplier->setRange(1, 1000);
		greenMultiplier->setDisplayRange(0,5);
		greenMultiplier->setDefault(1);
		greenMultiplier->setParent(groupRGB);
		
		OFX::BooleanParamDescriptor* boolB = desc.defineBooleanParam(kBoolBlue);
		boolB->setHint("Activate Blue channel");
		boolB->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
		boolB->setDefault(true);						   //blue channel is not selected by default
		boolB->setParent(groupRGB);
		//blue multiplier
		OFX::DoubleParamDescriptor* blueMultiplier = desc.defineDoubleParam(kMultiplierBlue);
		blueMultiplier->setLabel(kMultiplierLabel);
		blueMultiplier->setHint("Determinate curve from selection precision.");
		blueMultiplier->setRange(1, 1000);
		blueMultiplier->setDisplayRange(0,5);
		blueMultiplier->setDefault(1);
		blueMultiplier->setParent(groupRGB);
		
		//Channels check box (HSL)
		OFX::BooleanParamDescriptor* boolH = desc.defineBooleanParam(kBoolHue);
		boolH->setDefault(true);
		boolH->setHint("Activate Hue channel");
		boolH->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
		boolH->setParent(groupHSL);
		//Hue multiplier
		OFX::DoubleParamDescriptor* hueMultiplier = desc.defineDoubleParam(kMultiplierHue);
		hueMultiplier->setLabel(kMultiplierLabel);
		hueMultiplier->setHint("Determinate curve from selection precision.");
		hueMultiplier->setRange(1, 1000);
		hueMultiplier->setDisplayRange(0,5);
		hueMultiplier->setDefault(1);
		hueMultiplier->setParent(groupHSL);
		
		OFX::BooleanParamDescriptor* boolS = desc.defineBooleanParam(kBoolSaturation);
		boolS->setDefault(true);
		boolS->setHint("Activate Saturation channel");
		boolS->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
		boolS->setParent(groupHSL);
		//Saturation multiplier
		OFX::DoubleParamDescriptor* saturationMultiplier = desc.defineDoubleParam(kMultiplierSaturation);
		saturationMultiplier->setLabel(kMultiplierLabel);
		saturationMultiplier->setHint("Determinate curve from selection precision.");
//.........这里部分代码省略.........
开发者ID:EfestoLab,项目名称:TuttleOFX,代码行数:101,代码来源:HistogramPluginFactory.cpp

示例12: describeInContext

/** @brief The describe in context function, passed a plugin descriptor and a context */
void WriteOIIOPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, ContextEnum context)
{    
    // make some pages and to things in
    PageParamDescriptor *page = GenericWriterDescribeInContextBegin(desc, context,isVideoStreamPlugin(), /*supportsRGBA =*/true, /*supportsRGB=*/false, /*supportsAlpha=*/false, "reference", "reference");

    OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam(kParamBitDepthName);
    bitDepth->setLabels(kParamBitDepthLabel, kParamBitDepthLabel, kParamBitDepthLabel);
    bitDepth->appendOption(kParamBitDepthAuto, kParamBitDepthAutoLabel);
    bitDepth->appendOption(kParamBitDepth8, kParamBitDepth8Label);
    bitDepth->appendOption(kParamBitDepth10, kParamBitDepth10Label);
    bitDepth->appendOption(kParamBitDepth12, kParamBitDepth12Label);
    bitDepth->appendOption(kParamBitDepth16, kParamBitDepth16Label);
    bitDepth->appendOption(kParamBitDepth16f, kParamBitDepth16fLabel);
    bitDepth->appendOption(kParamBitDepth32, kParamBitDepth32Label);
    bitDepth->appendOption(kParamBitDepth32f, kParamBitDepth32fLabel);
    bitDepth->appendOption(kParamBitDepth64, kParamBitDepth64Label);
    bitDepth->appendOption(kParamBitDepth64f, kParamBitDepth64fLabel);
    bitDepth->setDefault(eTuttlePluginBitDepthAuto);
    page->addChild(*bitDepth);

    OFX::BooleanParamDescriptor* premult = desc.defineBooleanParam(kParamPremultipliedName);
    premult->setLabels(kParamPremultipliedLabel, kParamPremultipliedLabel, kParamPremultipliedLabel);
    premult->setDefault(false);
    page->addChild(*premult);

    OFX::IntParamDescriptor* quality = desc.defineIntParam(kParamOutputQualityName);
    quality->setLabels(kParamOutputQualityLabel, kParamOutputQualityLabel, kParamOutputQualityLabel);
    quality->setRange(0, 100);
    quality->setDisplayRange(0, 100);
    quality->setDefault(80);
    page->addChild(*quality);

    OFX::ChoiceParamDescriptor* orientation = desc.defineChoiceParam(kParamOutputOrientationName);
    orientation->setLabels(kParamOutputOrientationLabel, kParamOutputOrientationLabel, kParamOutputOrientationLabel);
    orientation->appendOption(kParamOutputOrientationNormal);
    orientation->appendOption(kParamOutputOrientationFlop);
    orientation->appendOption(kParamOutputOrientationR180);
    orientation->appendOption(kParamOutputOrientationFlip);
    orientation->appendOption(kParamOutputOrientationTransposed);
    orientation->appendOption(kParamOutputOrientationR90Clockwise);
    orientation->appendOption(kParamOutputOrientationTransverse);
    orientation->appendOption(kParamOutputOrientationR90CounterClockwise);
    orientation->setDefault(0);
    page->addChild(*orientation);

    OFX::ChoiceParamDescriptor* compression = desc.defineChoiceParam(kParamOutputCompressionName);
    compression->setLabels(kParamOutputCompressionLabel, kParamOutputCompressionLabel, kParamOutputCompressionLabel);
    compression->setHint(kParamOutputCompressionHint);
    compression->appendOption(kParamOutputCompressionAuto, kParamOutputCompressionAutoLabel);
    compression->appendOption(kParamOutputCompressionNone, kParamOutputCompressionNoneLabel);
    compression->appendOption(kParamOutputCompressionZip, kParamOutputCompressionZipLabel);
    compression->appendOption(kParamOutputCompressionZips, kParamOutputCompressionZipsLabel);
    compression->appendOption(kParamOutputCompressionRle, kParamOutputCompressionRleLabel);
    compression->appendOption(kParamOutputCompressionPiz, kParamOutputCompressionPizLabel);
    compression->appendOption(kParamOutputCompressionPxr24, kParamOutputCompressionPxr24Label);
    compression->appendOption(kParamOutputCompressionB44, kParamOutputCompressionB44Label);
    compression->appendOption(kParamOutputCompressionB44a, kParamOutputCompressionB44aLabel);
    compression->appendOption(kParamOutputCompressionLZW, kParamOutputCompressionLZWLabel);
    compression->appendOption(kParamOutputCompressionCCITTRLE, kParamOutputCompressionCCITTRLELabel);
    compression->appendOption(kParamOutputCompressionPACKBITS, kParamOutputCompressionPACKBITSLabel);
    compression->setDefault(eParamCompressionAuto);
    page->addChild(*compression);

    GenericWriterDescribeInContextEnd(desc, context, page);
}
开发者ID:sumitneup,项目名称:openfx-io,代码行数:66,代码来源:WriteOIIO.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 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

示例14: describeInContext

/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void TurboJpegWriterPluginFactory::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 );
	
	// Controls
	describeWriterParamsInContext( desc, context );
	
	OFX::ChoiceParamDescriptor* channel = static_cast<OFX::ChoiceParamDescriptor*>( desc.getParamDescriptor( kTuttlePluginChannel ) );
	channel->resetOptions();
	channel->appendOption( kTuttlePluginChannelRGB );
	channel->setDefault( 0 );
	channel->setEnabled( false );
	
	OFX::ChoiceParamDescriptor* bitDepth = static_cast<OFX::ChoiceParamDescriptor*>( desc.getParamDescriptor( kTuttlePluginBitDepth ) );
	bitDepth->resetOptions();
	bitDepth->appendOption( kTuttlePluginBitDepth8 );
	bitDepth->setDefault( eTuttlePluginBitDepth8 );
	bitDepth->setEnabled( false );
	
	OFX::BooleanParamDescriptor* premult = static_cast<OFX::BooleanParamDescriptor*>( desc.getParamDescriptor( kParamPremultiplied ) );
	premult->setDefault( true );
	
	OFX::IntParamDescriptor* quality = desc.defineIntParam( kParamQuality );
	quality->setLabel( "Quality" );
	quality->setRange( 0, 100 );
	quality->setDisplayRange( 0, 100 );
	quality->setDefault( 80 );

	
	OFX::ChoiceParamDescriptor* subsampling = desc.defineChoiceParam( kParamSubsampling );
	subsampling->setLabel( kParamSubsamplingLabel );
	subsampling->setHint( kParamSubsamplingHint );
	subsampling->appendOption( kTurboJpegSubsampling444 );
	subsampling->appendOption( kTurboJpegSubsampling422 );
	subsampling->appendOption( kTurboJpegSubsampling420 );
	subsampling->appendOption( kTurboJpegSubsamplingGray );
	subsampling->appendOption( kTurboJpegSubsampling440 );
	subsampling->setDefault( eTurboJpegSubsampling420 );
	
	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 );
}
开发者ID:Achammem,项目名称:TuttleOFX,代码行数:66,代码来源:TurboJpegWriterPluginFactory.cpp

示例15: 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


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