コード例 #1
0
/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void TurboJpegReaderPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
                                                  OFX::EContext context )
{
	// Create the mandated output clip
	OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName );
	dstClip->addSupportedComponent( OFX::ePixelComponentRGBA );
	dstClip->addSupportedComponent( OFX::ePixelComponentRGB );
	dstClip->addSupportedComponent( OFX::ePixelComponentAlpha );
	dstClip->setSupportsTiles( kSupportTiles );
	
	describeReaderParamsInContext( desc, context );
	
	OFX::ChoiceParamDescriptor* optimization = desc.defineChoiceParam( kParamOptimization );
	optimization->setLabel( kParamOptimizationLabel );
	optimization->setHint( kParamOptimizationHint );
	optimization->appendOption( kTurboJpegOptimizationNone );
	optimization->appendOption( kTurboJpegOptimizationMMX );
	optimization->appendOption( kTurboJpegOptimizationSSE );
	optimization->appendOption( kTurboJpegOptimizationSSE2 );
	optimization->appendOption( kTurboJpegOptimizationSSE3 );
	optimization->setDefault( eTurboJpegOptimizationSSE3 );
	
	OFX::BooleanParamDescriptor* fastupsampling = desc.defineBooleanParam( kParamFastUpsampling );
	fastupsampling->setLabel( kParamFastUpsamplingLabel );
	fastupsampling->setHint( kParamFastUpsamplingHint );
	fastupsampling->setDefault( false );
}
コード例 #2
0
/**
 * @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 );
}
コード例 #3
0
ファイル: GenericOCIO.cpp プロジェクト: theomission/openfx-io
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
}
コード例 #4
0
/**
 * @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 );
}
コード例 #5
0
/**
 * @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." );
}
コード例 #6
0
/**
 * @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 );
	pIn2->setParent( groupIn );

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

	OFX::BooleanParamDescriptor* overlayIn = desc.defineBooleanParam( kParamOverlayIn );
	overlayIn->setLabel( "Overlay" );
	overlayIn->setDefault( true );
	overlayIn->setParent( groupIn );

	OFX::RGBParamDescriptor* ouverlayInColor = desc.defineRGBParam( kParamOverlayInColor );
	ouverlayInColor->setLabel( "Color" );
	ouverlayInColor->setHint( "Input point overlay color" );
	ouverlayInColor->setDefault( 1.0, 0.0, 0.0 );
	ouverlayInColor->setParent( groupIn );

	//////////////////// OUT Points ////////////////////
	OFX::GroupParamDescriptor* groupOut = desc.defineGroupParam( kParamGroupOut );
	groupOut->setLabel( "Output points" );
        groupOut->setOpen(false);

	OFX::Double2DParamDescriptor* pOut0 = desc.defineDouble2DParam( kParamPointOut + "0" );
	pOut0->setLabel( "Out 0" );
	pOut0->setHint( "Output point 0" );
	pOut0->setDefault( -0.5, -0.5 );
	pOut0->setParent( groupOut );

	OFX::Double2DParamDescriptor* pOut1 = desc.defineDouble2DParam( kParamPointOut + "1" );
	pOut1->setLabel( "Out 1" );
	pOut1->setHint( "Output point 1" );
	pOut1->setDefault( 0.5, -0.5 );
	pOut1->setParent( groupOut );

	OFX::Double2DParamDescriptor* pOut2 = desc.defineDouble2DParam( kParamPointOut + "2" );
	pOut2->setLabel( "Out 2" );
	pOut2->setHint( "Output point 2" );
	pOut2->setDefault( -0.5, 0.5 );
	pOut2->setParent( groupOut );

	OFX::Double2DParamDescriptor* pOut3 = desc.defineDouble2DParam( kParamPointOut + "3" );
	pOut3->setLabel( "Out 3" );
	pOut3->setHint( "Output point 3" );
	pOut3->setDefault( 0.5, 0.5 );
	pOut3->setParent( groupOut );

	OFX::BooleanParamDescriptor* overlayOut = desc.defineBooleanParam( kParamOverlayOut );
	overlayOut->setLabel( "Overlay" );
	overlayOut->setDefault( true );
	overlayOut->setParent( groupOut );

	OFX::RGBParamDescriptor* ouverlayOutColor = desc.defineRGBParam( kParamOverlayOutColor );
	ouverlayOutColor->setLabel( "Color" );
	ouverlayOutColor->setHint( "Output point overlay color" );
	ouverlayOutColor->setDefault( 0.0, 0.0, 1.0 );
	ouverlayOutColor->setParent( groupOut );

	//////////////////// Persp Matrix ////////////////////
	OFX::GroupParamDescriptor* groupPerspMatrix = desc.defineGroupParam( kParamGroupPerspMatrix );
	groupPerspMatrix->setLabel( "Perspective matrix" );
	groupPerspMatrix->setHint( "Transformation matrix" );

	OFX::Double3DParamDescriptor* perspMatrixRow0 = desc.defineDouble3DParam( kParamPerspMatrixRow + "0" );
	perspMatrixRow0->setLabel( "row 0" );
	perspMatrixRow0->setDefault( 1.0, 0.0, 0.0 );
	perspMatrixRow0->setParent( groupPerspMatrix );

	OFX::Double3DParamDescriptor* perspMatrixRow1 = desc.defineDouble3DParam( kParamPerspMatrixRow + "1" );
	perspMatrixRow1->setLabel( "row 1" );
	perspMatrixRow1->setDefault( 0.0, 1.0, 0.0 );
	perspMatrixRow1->setParent( groupPerspMatrix );

	OFX::Double3DParamDescriptor* perspMatrixRow2 = desc.defineDouble3DParam( kParamPerspMatrixRow + "2" );
	perspMatrixRow2->setLabel( "row 2" );
	perspMatrixRow2->setDefault( 0.0, 0.0, 1.0 );
	perspMatrixRow2->setParent( groupPerspMatrix );

	////////////////// Bilinear Matrix ////////////////////
	OFX::GroupParamDescriptor* groupBilMatrix = desc.defineGroupParam( kParamGroupBilinearMatrix );
	groupBilMatrix->setLabel( "Bilinear matrix" );
	groupBilMatrix->setHint( "Billinear transformation matrix" );

	OFX::Double2DParamDescriptor* bilMatrixRow0 = desc.defineDouble2DParam( kParamBilinearMatrixRow + "0" );
	bilMatrixRow0->setLabel( "row 0" );
	bilMatrixRow0->setDefault( 1.0, 0.0 );
	bilMatrixRow0->setParent( groupBilMatrix );

	OFX::Double2DParamDescriptor* bilMatrixRow1 = desc.defineDouble2DParam( kParamBilinearMatrixRow + "1" );
	bilMatrixRow1->setLabel( "row 1" );
	bilMatrixRow1->setDefault( 0.0, 1.0 );
	bilMatrixRow1->setParent( groupBilMatrix );

	OFX::Double2DParamDescriptor* bilMatrixRow2 = desc.defineDouble2DParam( kParamBilinearMatrixRow + "2" );
	bilMatrixRow2->setLabel( "row 2" );
	bilMatrixRow2->setDefault( 0.0, 0.0 );
	bilMatrixRow2->setParent( groupBilMatrix );

	OFX::Double2DParamDescriptor* bilMatrixRow3 = desc.defineDouble2DParam( kParamBilinearMatrixRow + "3" );
	bilMatrixRow3->setLabel( "row 3" );
	bilMatrixRow3->setDefault( 0.0, 0.0 );
	bilMatrixRow3->setParent( groupBilMatrix );

}
コード例 #7
0
ファイル: GenericOCIO.cpp プロジェクト: theomission/openfx-io
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
}
コード例 #8
0
/**
 * @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 );
}
コード例 #9
0
/**
 * @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
}
コード例 #10
0
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);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
    }

    {
      OFX::IntParamDescriptor *param = desc.defineIntParam(kParamCalibGridSize);
      param->setLabel("Max Calibration Grid Size");
      param->setHint("Define the number of cells per edge.");
      param->setRange(0, kOfxFlagInfiniteMax);
      param->setDisplayRange(0, 100);
      param->setDefault(10);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
    }

    {
      OFX::IntParamDescriptor *param = desc.defineIntParam(kParamMinInputFrames);
      param->setLabel("Min Input Frames");
      param->setHint("Minimal number of frames to limit the calibration refinement loop.");
      param->setRange(0, kOfxFlagInfiniteMax);
      param->setDisplayRange(0, 1000);
      param->setDefault(10);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
    }

    {
      OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamMaxTotalAvgErr);
      param->setLabel("Max Total Average Error");
      param->setHint("Maximal limit of the total average error");
      param->setRange(0, 1);
      param->setDisplayRange(0, 1);
      param->setDefault(0.1);
      param->setAnimates(false);
      param->setParent(*groupCalibration);
    }
    
    {
      OFX::PushButtonParamDescriptor *param = desc.definePushButtonParam(kParamCalibrate);
      param->setLabel("Calibrate");
      param->setHint("calibrate");
      param->setParent(*groupCalibration);
    }

  }

  //Output Group
  {
    OFX::GroupParamDescriptor *groupOutput = desc.defineGroupParam(kParamGroupOutput);
    groupOutput->setLabel("Output");
    groupOutput->setAsTab();
    
    {
      OFX::BooleanParamDescriptor *param = desc.defineBooleanParam(kParamOutputIsCalibrated);
      param->setLabel("Is calibrated");
      param->setHint("Is calibrated");
      param->setParent(*groupOutput);
    }
    
    {
      OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputAvgReprojErr);
      param->setLabel("Average Reprojection Error");
      param->setDisplayRange(0, 10);
      param->setEvaluateOnChange(false);
      param->setEnabled(false);
      param->setAnimates(true);
      param->setParent(*groupOutput);
      param->setLayoutHint(OFX::eLayoutHintDivider);
    }
    
    {
      OFX::GroupParamDescriptor *groupCamera = desc.defineGroupParam(kParamOutputCameraGroup);
      groupCamera->setLabel("Intrinsics Camera Parameters");
      groupCamera->setParent(*groupOutput);
      groupCamera->setOpen(true);

      {
        OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputFocalLenght);
        param->setLabel("Focal Length");
        param->setDisplayRange(1, 100);
        param->setAnimates(true);
        param->setEvaluateOnChange(false);
        param->setEnabled(false);
        param->setAnimates(false);
        param->setParent(*groupCamera);
      }

      {
        OFX::Double2DParamDescriptor *param = desc.defineDouble2DParam(kParamOutputPrincipalPointOffset);
        param->setLabel("Principal Point");
        param->setAnimates(true);
        param->setEvaluateOnChange(false);
        param->setEnabled(false);
        param->setAnimates(false);
        param->setParent(*groupCamera);
      }
    }
    
    {    
      OFX::GroupParamDescriptor *groupLensDistortion = desc.defineGroupParam(kParamOutputLensDistortionGroup);
      groupLensDistortion->setLabel("Lens Distortion Coefficients");
      groupLensDistortion->setParent(*groupOutput);
      groupLensDistortion->setOpen(true);
        
      {
        OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputRadialCoef1);
        param->setLabel("Radial Coef1");
        param->setDisplayRange(0, 10);
        param->setAnimates(true);
        param->setEvaluateOnChange(false);
        param->setEnabled(false);
        param->setAnimates(false);
        param->setParent(*groupLensDistortion);
      }

      {
        OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputRadialCoef2);
        param->setLabel("Radial Coef2");
        param->setDisplayRange(0, 10);
        param->setAnimates(true);
        param->setEvaluateOnChange(false);
        param->setEnabled(false);
        param->setAnimates(false);
        param->setParent(*groupLensDistortion);
      }

      {
        OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputRadialCoef3);
        param->setLabel("Radial Coef3");
        param->setDisplayRange(0, 10);
        param->setAnimates(true);
        param->setEvaluateOnChange(false);
        param->setEnabled(false);
        param->setAnimates(false);
        param->setParent(*groupLensDistortion);
      }

      {
        OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputTangentialCoef1);
        param->setLabel("Tangential Coef1");
        param->setDisplayRange(0, 10);
        param->setAnimates(true);
        param->setEvaluateOnChange(false);
        param->setEnabled(false);
        param->setAnimates(false);
        param->setParent(*groupLensDistortion);
      }

      {
        OFX::DoubleParamDescriptor *param = desc.defineDoubleParam(kParamOutputTangentialCoef2);
        param->setLabel("Tangential Coef2");
        param->setDisplayRange(0, 10);
        param->setAnimates(true);
        param->setEvaluateOnChange(false);
        param->setEnabled(false);
        param->setAnimates(false);
        param->setParent(*groupLensDistortion);
        param->setLayoutHint(OFX::eLayoutHintDivider);
      }
    }
    
    {
      OFX::PushButtonParamDescriptor *param = desc.definePushButtonParam(kParamOutputClear);
      param->setLabel("Clear");
      param->setHint("clear");
      param->setEnabled(false);
      param->setParent(*groupOutput);
    }
  }
  
  //Debug Group
  {
    OFX::GroupParamDescriptor *groupDebug = desc.defineGroupParam(kParamGroupDebug);
    groupDebug->setLabel("Debug");
    groupDebug->setAsTab();

    {
      OFX::BooleanParamDescriptor *param = desc.defineBooleanParam(kParamDebugEnable);
      param->setLabel("Enable Debug");
      param->setHint("Would you want to export undistorted images?");
      param->setParent(*groupDebug);
    }

    {
      OFX::StringParamDescriptor *param = desc.defineStringParam(kParamDebugRejectedImgFolder);
      param->setLabel("Rejected Frames");
      param->setHint("Folder to export delete images during the calibration refinement loop.");
      param->setStringType(OFX::eStringTypeDirectoryPath);
      param->setFilePathExists(true);
      param->setParent(*groupDebug);
    }

    {
      OFX::StringParamDescriptor *param = desc.defineStringParam(kParamDebugSelectedImgFolder);
      param->setLabel("Selected Frames");
      param->setHint("Folder to export debug images.");
      param->setStringType(OFX::eStringTypeDirectoryPath);
      param->setFilePathExists(true);
      param->setParent(*groupDebug);
    }
  }
}
コード例 #11
0
/**
 * @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.");
		saturationMultiplier->setRange(1, 1000);
		saturationMultiplier->setDisplayRange(0,5);
		saturationMultiplier->setDefault(1);
		saturationMultiplier->setParent(groupHSL);
		
		OFX::BooleanParamDescriptor* boolL = desc.defineBooleanParam(kBoolLightness);
		boolL->setHint("Activate Lightness channel");
		boolL->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
		boolL->setDefault(true);
		boolL->setParent(groupHSL);
		//Lightness multiplier
		OFX::DoubleParamDescriptor* lightnessMultiplier = desc.defineDoubleParam(kMultiplierLightness);
		lightnessMultiplier->setLabel(kMultiplierLabel);
		lightnessMultiplier->setHint("Determinate curve from selection precision.");
		lightnessMultiplier->setRange(1, 1000);
		lightnessMultiplier->setDisplayRange(0,5);
		lightnessMultiplier->setDefault(1);
		lightnessMultiplier->setParent(groupHSL);
		
		//Close RGB group (group states by default on screen)
		groupRGB->setOpen(true);
		groupHSL->setOpen(true);
	}
	
	//Histogram overlay group
	{
		OFX::GroupParamDescriptor *groupHistogramOverlay = desc.defineGroupParam(kGroupHistogramOverlay);
		groupHistogramOverlay->setLabel(kGroupHistogramOverlayLabel);
		groupHistogramOverlay->setOpen(true);
//		groupHistogramOverlay->setAsTab();

		//Histogram display settings
		OFX::ChoiceParamDescriptor* gammaType = desc.defineChoiceParam(kHistoDisplayListParamLabel);
		gammaType->setLabel(kHistoDisplayListParamLabel);
		gammaType->setEvaluateOnChange(false); // don't need to recompute on change
		gammaType->setHint("Histogram display \n -global : normalize all of channels \n -by channel : keep proportions between channels");
		gammaType->appendOption(kHistoDisplayListParamOpt2);
		gammaType->appendOption(kHistoDisplayListParamOpt1);
		gammaType->setParent(groupHistogramOverlay);	

		//nbOfstep (advanced group)
		OFX::IntParamDescriptor* nbStepRange = desc.defineIntParam(knbStepRange);
		nbStepRange->setLabel(knbStepRangeLabel);
		nbStepRange->setHint("Determinate histogram overlay precision.");
		nbStepRange->setRange(1, 1000);
		nbStepRange->setDisplayRange(1, 600.0 );
		nbStepRange->setDefault(255);
		nbStepRange->setEvaluateOnChange(false); // don't need to recompute on change
		nbStepRange->setParent(groupHistogramOverlay);

		//selection multiplier (advanced group)
		OFX::DoubleParamDescriptor* selectionMultiplier = desc.defineDoubleParam(kselectionMultiplier);
		selectionMultiplier->setLabel(kselectionMultiplierLabel);
		selectionMultiplier->setHint("With high values, small selection are more visible.");
		selectionMultiplier->setRange(0.001,1000.0);
		selectionMultiplier->setDisplayRange(0.0, 100.0 );
		selectionMultiplier->setDefault(2.0);
		selectionMultiplier->setEvaluateOnChange(false); // don't need to recompute on change
		selectionMultiplier->setParent(groupHistogramOverlay);

		//Refresh histograms overlay Button
		OFX::PushButtonParamDescriptor* refreshOverlayButton = desc.definePushButtonParam(kButtonRefreshOverlay);
		refreshOverlayButton->setLabel(kButtonRefreshOverlayLabel);
		refreshOverlayButton->setHint("Refresh histogram overlay.");
		refreshOverlayButton->setParent(groupHistogramOverlay);
	}
	
	//Selection group
	{
		OFX::GroupParamDescriptor *groupSelection = desc.defineGroupParam(kGroupSelection);
		groupSelection->setLabel(kGroupSelectionLabel);
		groupSelection->setOpen(false);
//		groupSelection->setAsTab();
		//display selection
		OFX::BooleanParamDescriptor* boolDisplaySelection = desc.defineBooleanParam(kBoolSelection);
		boolDisplaySelection->setDefault(true);
		boolDisplaySelection->setEvaluateOnChange(false);// don't need to recompute on change
		boolDisplaySelection->setHint("Display the selected zone on screen.");
		boolDisplaySelection->setParent(groupSelection);
		//clear selection
		OFX::PushButtonParamDescriptor* resetSelectionButton = desc.definePushButtonParam(kButtonResetSelection);
		resetSelectionButton->setLabel(kButtonResetSelectionLabel);
		resetSelectionButton->setHint("Reset user's selection.");
		resetSelectionButton->setParent(groupSelection);
		//selection mode
		OFX::ChoiceParamDescriptor* selectionMode = desc.defineChoiceParam(kSelectionModeListParamLabel);
		selectionMode->setLabel(kSelectionModeListParamLabel);
		selectionMode->setHint( "Selection mode \n - unique : reset past selection before selection \n - additive : add pixels to current selection \n -subtractive : remote pixel from current selection");
		selectionMode->appendOption(kSelectionModeListParamOpt2);
		selectionMode->appendOption(kSelectionModeListParamOpt1);
		selectionMode->appendOption(kSelectionModeListParamOpt3);
		selectionMode->setParent(groupSelection);
	}
}
コード例 #12
0
ファイル: WriteOIIO.cpp プロジェクト: sumitneup/openfx-io
/** @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);
}
コード例 #13
0
/**
 * @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);
    xMax->setDefault(0);
    xMax->setParent(*cropRegion);

    OFX::IntParamDescriptor* yMax = desc.defineIntParam(kParamYMax);
    yMax->setLabel("Y max");
    //	yMax->setRange( 0, std::numeric_limits<int>::max() );
    yMax->setDisplayRange(0, 3000);
    yMax->setDefault(0);
    yMax->setParent(*cropRegion);
}
コード例 #14
0
/**
 * @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 );
}
コード例 #15
0
/**
 * @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." );

	OFX::BooleanParamDescriptor* centerOverlay = desc.defineBooleanParam( kParamCenterOverlay );
	centerOverlay->setLabel( "Display distortion center" );
	centerOverlay->setDefault( false );
	centerOverlay->setEvaluateOnChange( false );
	centerOverlay->setHint( "Active distortion center point overlay." );

	OFX::ChoiceParamDescriptor* centerType = desc.defineChoiceParam( kParamCenterType );
	centerType->setLabel( "Center type" );
	#ifdef TUTTLE_PRODUCTION
	centerType->setIsSecret( true );
	#endif
	centerType->appendOption( kParamCenterTypeSource );
	centerType->appendOption( kParamCenterTypeRoW );
	centerType->setDefault( 0 );
	centerType->setHint( "Centered on source or output image." );

	OFX::DoubleParamDescriptor* preScale = desc.defineDoubleParam( kParamPreScale );
	preScale->setLabel( "Pre-scale" );
	//    preScale->setDoubleType( eDoubleTypeNormalisedXY );
	preScale->setDefault( 1.0 );
	preScale->setRange( 0.00001, std::numeric_limits<double>::max() );
	preScale->setDisplayRange( 0.0, 2.5 );
	preScale->setHint( "If the transformation of optics is high, you may need to change the scale of the result to be globally closer to the source image or preserve a good resolution." );

	OFX::DoubleParamDescriptor* postScale = desc.defineDoubleParam( kParamPostScale );
	postScale->setLabel( "Post-scale" );
	//    scale->setDoubleType( eDoubleTypeNormalisedXY );
	postScale->setDefault( 1.0 );
	postScale->setRange( 0.00001, std::numeric_limits<double>::max() );
	postScale->setDisplayRange( 0.0, 2.5 );
	postScale->setHint( "If the transformation of optics is high, you may need to change the scale of the result to be globally closer to the source image or preserve a good resolution." );

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

	OFX::ChoiceParamDescriptor* resizeRod = desc.defineChoiceParam( kParamResizeRod );
	resizeRod->setLabel( "Resize RoD" );
	resizeRod->appendOption( kParamResizeRodNo );
	resizeRod->appendOption( kParamResizeRodSourceRef );
	resizeRod->appendOption( kParamResizeRodMin );
	resizeRod->appendOption( kParamResizeRodMax );
	resizeRod->appendOption( kParamResizeRodManual );
	resizeRod->setDefault( 0 );
	resizeRod->setHint( "Resize output RoD" );

	OFX::DoubleParamDescriptor* scaleRod = desc.defineDoubleParam( kParamResizeRodManualScale );
	scaleRod->setLabel( "Scale RoD" );
	//    scaleRod->setDoubleType( eDoubleTypeNormalisedXY );
	//    scaleRod->setIsSecret( true );
	//    scaleRod->setEnabled( false );
	scaleRod->setDefault( 1.0 );
	scaleRod->setRange( 0.0, std::numeric_limits<double>::max() );
	scaleRod->setDisplayRange( 0, 2.5 );
	scaleRod->setHint( "Adjust the output RoD." );

	OFX::GroupParamDescriptor* displayOptions = desc.defineGroupParam( kParamDisplayOptions );
	displayOptions->setLabel( "Display options" );
	displayOptions->setHint( "Display options (change nothing on the image)" );

	OFX::BooleanParamDescriptor* displayGrid = desc.defineBooleanParam( kParamGridOverlay );
	displayGrid->setLabel( "Display grid" );
	displayGrid->setParent( *displayOptions );
	displayGrid->setDefault( false );
	displayGrid->setEvaluateOnChange( false );
	displayGrid->setHint( "Display the grid" );

	OFX::Double2DParamDescriptor* gridCenter = desc.defineDouble2DParam( kParamGridCenter );
	gridCenter->setLabel( "Grid center" );
	gridCenter->setDoubleType( OFX::eDoubleTypePlain );
	gridCenter->setParent( *displayOptions );
	gridCenter->setDefault( 0.0, 0.0 );
	gridCenter->setDisplayRange( -1.0, -1.0, 1.0, 1.0 );
	gridCenter->setEvaluateOnChange( false );
	gridCenter->setHint( "Allows you to shift the center of the  display grid." );

	OFX::BooleanParamDescriptor* gridCenterOverlay = desc.defineBooleanParam( kParamGridCenterOverlay );
	gridCenterOverlay->setLabel( "Display grid center" );
	gridCenterOverlay->setParent( *displayOptions );
	gridCenterOverlay->setDefault( false );
	gridCenterOverlay->setEvaluateOnChange( false );
	gridCenterOverlay->setHint( "Active grid center point overlay." );

	OFX::Double2DParamDescriptor* gridScale = desc.defineDouble2DParam( kParamGridScale );
	gridScale->setLabel( "Grid scale" );
	gridScale->setDoubleType( OFX::eDoubleTypePlain );
	gridScale->setParent( *displayOptions );
	gridScale->setDefault( 1.0, 1.0 );
	gridScale->setDisplayRange( -10.0, -10.0, 10.0, 10.0 );
	gridScale->setEvaluateOnChange( false );
	gridScale->setHint( "Allows you to scale the display grid." );

	OFX::GroupParamDescriptor* debugOptions = desc.defineGroupParam( kParamDebugOptions );
	debugOptions->setLabel( "Debug options" );
	debugOptions->setHint( "Debug options" );
	debugOptions->setParent( *displayOptions );
	#ifdef TUTTLE_PRODUCTION
	debugOptions->setIsSecret( true );
	#endif

	OFX::BooleanParamDescriptor* debugDisplayRoi = desc.defineBooleanParam( kParamDebugDisplayRoi );
	debugDisplayRoi->setLabel( "Display RoI" );
	#ifdef TUTTLE_PRODUCTION
	debugDisplayRoi->setIsSecret( true );
	#endif
	debugDisplayRoi->setParent( *debugOptions );
	debugDisplayRoi->setDefault( false );
	debugDisplayRoi->setEvaluateOnChange( false );
	debugDisplayRoi->setHint( "Display RoI" );

	OFX::PushButtonParamDescriptor* helpButton = desc.definePushButtonParam( kParamHelp );
	helpButton->setLabel( "Help" );
}
コード例 #16
0
/**
 * @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);
		redMultiplier->setParent(groupRGB);
		
		
		OFX::BooleanParamDescriptor* boolG = desc.defineBooleanParam(kBoolGreen);
		boolG->setDefault(false);						//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(false);						   //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(false);
		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(false);
		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.");
		saturationMultiplier->setRange(1, 1000);
		saturationMultiplier->setDisplayRange(0,5);
		saturationMultiplier->setDefault(1);
		saturationMultiplier->setParent(groupHSL);
		
		OFX::BooleanParamDescriptor* boolL = desc.defineBooleanParam(kBoolLightness);
		boolL->setHint("Activate Lightness channel");
		boolL->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
		boolL->setDefault(false);
		boolL->setParent(groupHSL);
		//Lightness multiplier
		OFX::DoubleParamDescriptor* lightnessMultiplier = desc.defineDoubleParam(kMultiplierLightness);
		lightnessMultiplier->setLabel(kMultiplierLabel);
		lightnessMultiplier->setHint("Determinate curve from selection precision.");
		lightnessMultiplier->setRange(1, 1000);
		lightnessMultiplier->setDisplayRange(0,5);
		lightnessMultiplier->setDefault(1);
		lightnessMultiplier->setParent(groupHSL);
		
		//Clean Button (RGB)
		OFX::PushButtonParamDescriptor* resetButtonRGB = desc.definePushButtonParam(kButtonResetRGB);
		resetButtonRGB->setLabel(kButtonResetRGBLabel);
		resetButtonRGB->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
		resetButtonRGB->setHint("Reset the selected RGB curves. \n Warning : the curves may not be refreshed click on overlay to refresh.");
		resetButtonRGB->setParent(groupRGB);
		
		//Selection To Curves Button (RGB)
		OFX::PushButtonParamDescriptor* selectionToCurveButtonRGB = desc.definePushButtonParam(kButtonSelectionToCurveRGB);
		selectionToCurveButtonRGB->setLabel(kButtonSelectionToCurveRGBLabel);
		selectionToCurveButtonRGB->setHint("Load selected RGB curves with selection data. \n Warning : the curves may not be refreshed click on overlay to refresh.");
		selectionToCurveButtonRGB->setParent(groupRGB);
		
		//Append selection to curves button (RGB)
		OFX::PushButtonParamDescriptor* appendSelectionToCurveRGB = desc.definePushButtonParam(kButtonAppendSelectionToCurveRGB);
		appendSelectionToCurveRGB->setLabel(kButtonAppendSelectionToCurveRGBLabel);				//add label
		appendSelectionToCurveRGB->setHint("Append current selection to selected RGB channels");//help
		appendSelectionToCurveRGB->setParent(groupRGB);											//add to RGB group
		
		//Clean Button (HSL)
		OFX::PushButtonParamDescriptor* resetButtonHSL = desc.definePushButtonParam(kButtonResetHSL);
		resetButtonHSL->setLabel(kButtonResetHSLLabel);
		resetButtonHSL->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished
		resetButtonHSL->setHint("Reset the selected HSL curves \n Warning : the curves may not be refreshed click on overlay to refresh.");
		resetButtonHSL->setParent(groupHSL);
		
		//Selection To Curves Button (HSL)
		OFX::PushButtonParamDescriptor* selectionToCurveButtonHSL = desc.definePushButtonParam(kButtonSelectionToCurveHSL);
		selectionToCurveButtonHSL->setLabel(kButtonSelectionToCurveHSLLabel);
		selectionToCurveButtonHSL->setHint("Load selected HSL curves with selection data. \n Warning : the curves may not be refreshed click on overlay to refresh.");
		selectionToCurveButtonHSL->setParent(groupHSL);
		
		//Append selection to curves button (HSL)
		OFX::PushButtonParamDescriptor* appendSelectionToCurveHSL = desc.definePushButtonParam(kButtonAppendSelectionToCurveHSL);
		appendSelectionToCurveHSL->setLabel(kButtonAppendSelectionToCurveHSLLabel);				//add label
		appendSelectionToCurveHSL->setHint("Append current selection to selected HSL channels");//help
		appendSelectionToCurveHSL->setParent(groupHSL);											//add to HSL group
		
		
		//Close RGB group (group states by default on screen)
		groupRGB->setOpen(false);
		groupHSL->setOpen(true);
	}
	
	//Selection group
	{
		OFX::GroupParamDescriptor *groupSelection = desc.defineGroupParam(kGroupSelection);
		groupSelection->setLabel(kGroupSelectionLabel);
		groupSelection->setOpen(false);
		groupSelection->setAsTab();
		//display selection
		OFX::BooleanParamDescriptor* boolDisplaySelection = desc.defineBooleanParam(kBoolSelection);
		boolDisplaySelection->setDefault(true);
		boolDisplaySelection->setEvaluateOnChange(false);// don't need to recompute on change
		boolDisplaySelection->setHint("Display the selected zone on screen.");
		boolDisplaySelection->setParent(groupSelection);
		//clear selection
		OFX::PushButtonParamDescriptor* resetSelectionButton = desc.definePushButtonParam(kButtonResetSelection);
		resetSelectionButton->setLabel(kButtonResetSelectionLabel);
		resetSelectionButton->setHint("Reset user's selection.");
		resetSelectionButton->setParent(groupSelection);
		//selection mode
		OFX::ChoiceParamDescriptor* selectionMode = desc.defineChoiceParam(kSelectionModeListParamLabel);
		selectionMode->setLabel(kSelectionModeListParamLabel);
		selectionMode->setHint( "Selection mode \n - unique : reset past selection before selection \n - additive : add pixels to current selection \n -subtractive : remote pixel from current selection");
		selectionMode->appendOption(kSelectionModeListParamOpt2);
		selectionMode->appendOption(kSelectionModeListParamOpt1);
		selectionMode->appendOption(kSelectionModeListParamOpt3);
		selectionMode->setParent(groupSelection);
		//Precision of selection to curve
		OFX::IntParamDescriptor* precisionSelectionToCurve = desc.defineIntParam(kprecisionCurveFromSelection);
		precisionSelectionToCurve->setLabel(kprecisionCurveFromSelectionLabel);
		precisionSelectionToCurve->setHint("Determinate curve from selection precision.");
		precisionSelectionToCurve->setRange(1, 1000);
		precisionSelectionToCurve->setDisplayRange(1, 300.0 );
		precisionSelectionToCurve->setDefault(curveFromSelection);
		precisionSelectionToCurve->setEvaluateOnChange(false); // don't need to recompute on change
		precisionSelectionToCurve->setParent(groupSelection);
	}
	
	//Histogram overlay group
	{
		OFX::GroupParamDescriptor *groupHistogramOverlay = desc.defineGroupParam(kGroupHistogramOverlay);
		groupHistogramOverlay->setLabel(kGroupHistogramOverlayLabel);
		groupHistogramOverlay->setOpen(true);
		groupHistogramOverlay->setAsTab();

		//Histogram display settings
		OFX::ChoiceParamDescriptor* gammaType = desc.defineChoiceParam(kHistoDisplayListParamLabel);
		gammaType->setLabel(kHistoDisplayListParamLabel);
		gammaType->setEvaluateOnChange(false); // don't need to recompute on change
		gammaType->setHint("Histogram display \n -global : normalize all of channels \n -by channel : keep proportions between channels");
		gammaType->appendOption(kHistoDisplayListParamOpt2);
		gammaType->appendOption(kHistoDisplayListParamOpt1);
		gammaType->setParent(groupHistogramOverlay);	

		//Clean all Button
		OFX::PushButtonParamDescriptor* resetButtonAll = desc.definePushButtonParam(kButtonResetAll);
		resetButtonAll->setLabel(kButtonResetAllLabel);
		resetButtonAll->setHint("Reset all curves. \n Waring : the curves may not be refreshed click on overlay to refresh.");
		resetButtonAll->setParent(groupHistogramOverlay);
	}
	
	///Advanced group
	{
		OFX::GroupParamDescriptor *groupAdvanced = desc.defineGroupParam(kGroupAdvanced);
		groupAdvanced->setLabel(kGroupAdvancedLabel);
		groupAdvanced->setOpen(false);
		groupAdvanced->setAsTab();
		
		//nbOfstep (advanced group)
		OFX::IntParamDescriptor* nbStepRange = desc.defineIntParam(knbStepRange);
		nbStepRange->setLabel(knbStepRangeLabel);
		nbStepRange->setHint("Determinate histogram overlay precision.");
		nbStepRange->setRange(1, 1000);
		nbStepRange->setDisplayRange(1, 600.0 );
		nbStepRange->setDefault(255);
		nbStepRange->setEvaluateOnChange(false); // don't need to recompute on change
		nbStepRange->setParent(groupAdvanced);
		//selection multiplier (advanced group)
		OFX::DoubleParamDescriptor* selectionMultiplier = desc.defineDoubleParam(kselectionMultiplier);
		selectionMultiplier->setLabel(kselectionMultiplierLabel);
		selectionMultiplier->setHint("With high values, small selection are more visible.");
		selectionMultiplier->setRange(0.001,1000.0);
		selectionMultiplier->setDisplayRange(0.0, 100.0 );
		selectionMultiplier->setDefault(2.0);
		selectionMultiplier->setEvaluateOnChange(false); // don't need to recompute on change
		selectionMultiplier->setParent(groupAdvanced);

		//Refresh histograms overlay Button
		OFX::PushButtonParamDescriptor* refreshOverlayButton = desc.definePushButtonParam(kButtonRefreshOverlay);
		refreshOverlayButton->setLabel(kButtonRefreshOverlayLabel);
		refreshOverlayButton->setHint("Refresh histogram overlay.");
		refreshOverlayButton->setParent(groupAdvanced);
		
		//clamp values to 0 and 1
		OFX::BooleanParamDescriptor* clampCurveValues = desc.defineBooleanParam(kBoolClampValues);
		clampCurveValues->setHint("Clamp curve value : values superior to 1 or inferior to 0 will be clamp in process.");
		clampCurveValues->setDefault(true);
		clampCurveValues->setParent(groupAdvanced);
	}
	//Output settings
	OFX::ChoiceParamDescriptor* outputType = desc.defineChoiceParam(kOutputListParamLabel);
	outputType->setLabel(kOutputListParamLabel);
	outputType->setHint( "Output type \n Alpha channel or Black and White");
	outputType->appendOption(kOutputListParamOpt1);
	outputType->appendOption(kOutputListParamOpt2);
	outputType->setLayoutHint( OFX::eLayoutHintNoNewLine ); //line is not finished

	//Reverse mask
	OFX::BooleanParamDescriptor* boolReverseMask = desc.defineBooleanParam(kBoolReverseMask);
	boolReverseMask->setDefault(false);
	boolReverseMask->setHint("Revert alpha mask");
}
コード例 #17
0
/**
 * @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);

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

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

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

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

    /* ----------------------- OUTPUT PARAMETERS -------------------------- */

    OFX::GroupParamDescriptor* outGroup = desc.defineGroupParam(kColorSpaceOut);
    outGroup->setLabel("Output configuration");

    OFX::ChoiceParamDescriptor* outReferenceSpace = desc.defineChoiceParam(kColorSpaceReferenceSpaceOut);
    outReferenceSpace->setLabel("Reference Space");
    outReferenceSpace->setParent(outGroup);

    OFX::GroupParamDescriptor* outCustom = desc.defineGroupParam(kColorSpaceCustomizedOut);
    outCustom->setLabel("Custom");
    outCustom->setOpen(false);
    outCustom->setParent(outGroup);

    OFX::ChoiceParamDescriptor* outGradationLaw = desc.defineChoiceParam(kColorSpaceGradationLawOut);
    outGradationLaw->setLabel("Gradation Law");
    outGradationLaw->setParent(outCustom);

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

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

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

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

    OFX::ChoiceParamDescriptor* outLayout = desc.defineChoiceParam(kColorSpaceLayoutOut);
    outLayout->setLabel("Layout");
    outLayout->setParent(outCustom);

    OFX::ChoiceParamDescriptor* outTempColor = desc.defineChoiceParam(kColorSpaceTempColorOut);
    outTempColor->setLabel("Color Temperature");
    outTempColor->setHint("Select the color temperature.");
    outTempColor->setParent(outCustom);

    OFX::GroupParamDescriptor* outPrimaries = desc.defineGroupParam(kColorSpacePrimariesOut);
    outPrimaries->setLabel("Primaries color");
    outPrimaries->setOpen(false);
    outPrimaries->setParent(outCustom);

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

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

    OFX::DoubleParamDescriptor* outXg = desc.defineDoubleParam(kColorSpaceXgOut);
    outXg->setLabel("X green");
    outXg->setDefault(1.0);
    outXg->setRange(0.0, 1.0);
    outXg->setDisplayRange(0.0, 1.0);
    outXg->setHint("Adjust the X green primary color.");
    outXg->setParent(outPrimaries);

    OFX::DoubleParamDescriptor* outYg = desc.defineDoubleParam(kColorSpaceYgOut);
    outYg->setLabel("Y green");
    outYg->setDefault(1.0);
    outYg->setRange(0.0, 1.0);
    outYg->setDisplayRange(0.0, 1.0);
    outYg->setHint("Adjust the Y green primary color.");
    outYg->setParent(outPrimaries);

    OFX::DoubleParamDescriptor* outXb = desc.defineDoubleParam(kColorSpaceXbOut);
    outXb->setLabel("X blue");
    outXb->setDefault(1.0);
    outXb->setRange(0.0, 1.0);
    outXb->setDisplayRange(0.0, 1.0);
    outXb->setHint("Adjust the X blue primary color.");
    outXb->setParent(outPrimaries);

    OFX::DoubleParamDescriptor* outYb = desc.defineDoubleParam(kColorSpaceYbOut);
    outYb->setLabel("Y blue");
    outYb->setDefault(1.0);
    outYb->setRange(0.0, 1.0);
    outYb->setDisplayRange(0.0, 1.0);
    outYb->setHint("Adjust the Y blue primary color.");
    outYb->setParent(outPrimaries);

    /* -------------- ENUMS FILLING ----------------*/

    ttlc::ColorSpaceMaps csMaps;
    ttlc::ColorSpaceMap mapReferenceSpace = csMaps.getMapReferenceSpaces();
    ttlc::ColorSpaceMap mapGradationLaw = csMaps.getMapGradationLaw();
    ttlc::ColorSpaceMap mapLayout = csMaps.getMapLayout();
    ttlc::ColorSpaceMap mapColourTemp = csMaps.getMapColourTemp();
    ttlc::ColorSpaceMap::iterator it;
    ttlc::ColorSpacePair highest;

    /* Reference Space */
    highest = *mapReferenceSpace.rbegin(); // last element
    it = mapReferenceSpace.begin();
    do
    {
        inReferenceSpace->appendOption((*it).second);
        outReferenceSpace->appendOption((*it).second);

    } while(mapReferenceSpace.value_comp()(*it++, highest));

    it = mapReferenceSpace.begin();
    inReferenceSpace->setDefault((*it).first);
    outReferenceSpace->setDefault((*it).first);

    /* Gradation */
    highest = *mapGradationLaw.rbegin();
    it = mapGradationLaw.begin();
    do
    {
        inGradationLaw->appendOption((*it).second);
        outGradationLaw->appendOption((*it).second);

    } while(mapGradationLaw.value_comp()(*it++, highest));

    it = mapGradationLaw.begin();
    inGradationLaw->setDefault((*it).first);
    outGradationLaw->setDefault((*it).first);

    /* Layout */
    highest = *mapLayout.rbegin();
    it = mapLayout.begin();
    do
    {
        inLayout->appendOption((*it).second);
        outLayout->appendOption((*it).second);

    } while(mapLayout.value_comp()(*it++, highest));

    it = mapLayout.begin();
    inLayout->setDefault((*it).first);
    outLayout->setDefault((*it).first);

    /* Colour temperature */
    highest = *mapColourTemp.rbegin();
    it = mapColourTemp.begin();
    do
    {
        inTempColor->appendOption((*it).second);
        outTempColor->appendOption((*it).second);

    } while(mapColourTemp.value_comp()(*it++, highest));

    it = mapColourTemp.begin();
    inTempColor->setDefault((*it).first);
    outTempColor->setDefault((*it).first);
}
コード例 #18
0
/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void EXRReaderPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc,
						OFX::EContext               context )
{
	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* outRedIs = desc.defineChoiceParam( kParamOutputRedIs );
	outRedIs->appendOption( "0" );
	outRedIs->appendOption( "1" );
	outRedIs->appendOption( "2" );
	outRedIs->appendOption( "3" );
	outRedIs->setLabel( "Red is" );
	outRedIs->setDefault( 0 );
	outRedIs->setHint(
		"Read-only information to get index of red component in the file.");

	OFX::ChoiceParamDescriptor* outGreenIs = desc.defineChoiceParam( kParamOutputGreenIs );
	outGreenIs->appendOption( "0" );
	outGreenIs->appendOption( "1" );
	outGreenIs->appendOption( "2" );
	outGreenIs->appendOption( "3" );
	outGreenIs->setLabel( "Green is" );
	outGreenIs->setDefault( 0 );
	outGreenIs->setHint(
		"Read-only information to get index of green component in the file.");

	OFX::ChoiceParamDescriptor* outBlueIs = desc.defineChoiceParam( kParamOutputBlueIs );
	outBlueIs->appendOption( "0" );
	outBlueIs->appendOption( "1" );
	outBlueIs->appendOption( "2" );
	outBlueIs->appendOption( "3" );
	outBlueIs->setLabel( "Blue is" );
	outBlueIs->setDefault( 0 );
	outBlueIs->setHint(
		"Read-only information to get index of blue component in the file.");

	OFX::ChoiceParamDescriptor* outAlphaIs = desc.defineChoiceParam( kParamOutputAlphaIs );
	outAlphaIs->appendOption( "0" );
	outAlphaIs->appendOption( "1" );
	outAlphaIs->appendOption( "2" );
	outAlphaIs->appendOption( "3" );
	outAlphaIs->setLabel( "Alpha is" );
	outAlphaIs->setDefault( 0 );
	outAlphaIs->setHint(
		"Read-only information to get index of alpha component in the file.");

	OFX::ChoiceParamDescriptor* outputData = desc.defineChoiceParam( kParamOutputData );
	outputData->appendOption( "display" );
	outputData->appendOption( "data" );
	outputData->setLabel( "Output Data" );
	outputData->setDefault( 0 );

	OFX::ChoiceParamDescriptor* fileBitDepth = desc.defineChoiceParam( kParamFileBitDepth );
	fileBitDepth->setLabel( "File Bit Depth" );
	fileBitDepth->appendOption( kTuttlePluginBitDepth16f );
	fileBitDepth->appendOption( kTuttlePluginBitDepth32 );
	fileBitDepth->appendOption( kTuttlePluginBitDepth32f );
	fileBitDepth->appendOption( kTuttlePluginBitDepthNone );
	fileBitDepth->setDefault( eTuttlePluginFileBitDepthNone );
	fileBitDepth->setHint(
		"Read-only information about the image bit depth stored in the file.\n"
		"Data type is per channel in EXR. So we read the type of the first channel.");

	OFX::ChoiceParamDescriptor* compression = desc.defineChoiceParam( kParamCompression );
	compression->setLabel( "Compression" );
	compression->appendOption( kParamCompressionNone, kParamCompressionHintNone );
	compression->appendOption( kParamCompressionRLE, kParamCompressionHintRLE );
	compression->appendOption( kParamCompressionZIPS, kParamCompressionHintZIPS );
	compression->appendOption( kParamCompressionZIP, kParamCompressionHintZIP );
	compression->appendOption( kParamCompressionPIZ, kParamCompressionHintPIZ );
	compression->appendOption( kParamCompressionPXR24, kParamCompressionHintPXR24 );
	compression->appendOption( kParamCompressionB44, kParamCompressionHintB44 );
	compression->appendOption( kParamCompressionB44A, kParamCompressionHintB44A );
	compression->setDefault( eParamCompression_None );
	compression->setHint(
		"Read-only information about the image compression stored in the file.");
}
コード例 #19
0
/**
 * @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
                                      : "---");
    outputComponent->appendOption(OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentRGBA)
                                      ? kParamOutputComponentRGBA
                                      : "---");
    outputComponent->setDefault(0);
    outputComponent->setIsSecret(OFX::getImageEffectHostDescription()->_supportedComponents.size() == 1);
}
コード例 #20
0
/**
 * @brief Function called to describe the plugin controls and features.
 * @param[in, out]   desc       Effect descriptor
 * @param[in]        context    Application context
 */
void DPXWriterPluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::EContext context)
{
    OFX::ClipDescriptor* srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
    srcClip->addSupportedComponent(OFX::ePixelComponentRGBA);
    srcClip->addSupportedComponent(OFX::ePixelComponentRGB);
    srcClip->addSupportedComponent(OFX::ePixelComponentAlpha);
    srcClip->setSupportsTiles(kSupportTiles);

    OFX::ClipDescriptor* dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
    dstClip->addSupportedComponent(OFX::ePixelComponentRGBA);
    dstClip->addSupportedComponent(OFX::ePixelComponentRGB);
    dstClip->addSupportedComponent(OFX::ePixelComponentAlpha);
    dstClip->setSupportsTiles(kSupportTiles);

    // Controls

    describeWriterParamsInContext(desc, context);

    OFX::ChoiceParamDescriptor* bitDepth =
        static_cast<OFX::ChoiceParamDescriptor*>(desc.getParamDescriptor(kTuttlePluginBitDepth));
    bitDepth->resetOptions();
    bitDepth->appendOption(kTuttlePluginBitDepth8);
    bitDepth->appendOption(kTuttlePluginBitDepth10);
    bitDepth->appendOption(kTuttlePluginBitDepth12);
    bitDepth->appendOption(kTuttlePluginBitDepth16);
    bitDepth->appendOption(kTuttlePluginBitDepth32);
    bitDepth->appendOption(kTuttlePluginBitDepth64);
    bitDepth->setDefault(eTuttlePluginBitDepth10);

    OFX::ChoiceParamDescriptor* descriptor =
        static_cast<OFX::ChoiceParamDescriptor*>(desc.getParamDescriptor(kTuttlePluginChannel));
    descriptor->resetOptions();
    descriptor->appendOption(kParamDescriptorUserDefinedDescriptor);
    descriptor->appendOption(kParamDescriptorRed);
    descriptor->appendOption(kParamDescriptorGreen);
    descriptor->appendOption(kParamDescriptorBlue);
    descriptor->appendOption(kParamDescriptorAlpha);
    descriptor->appendOption(kParamDescriptorLuma);
    descriptor->appendOption(kParamDescriptorColorDifference);
    descriptor->appendOption(kParamDescriptorDepth);
    descriptor->appendOption(kParamDescriptorCompositeVideo);
    descriptor->appendOption(kParamDescriptorRGB);
    descriptor->appendOption(kParamDescriptorRGBA);
    descriptor->appendOption(kParamDescriptorABGR);
    descriptor->appendOption(kParamDescriptorCbYCrY);
    descriptor->appendOption(kParamDescriptorCbYACrYA);
    descriptor->appendOption(kParamDescriptorCbYCr);
    descriptor->appendOption(kParamDescriptorCbYCrA);
    descriptor->appendOption(kParamDescriptorUserDefined2Comp);
    descriptor->appendOption(kParamDescriptorUserDefined3Comp);
    descriptor->appendOption(kParamDescriptorUserDefined4Comp);
    descriptor->appendOption(kParamDescriptorUserDefined5Comp);
    descriptor->appendOption(kParamDescriptorUserDefined6Comp);
    descriptor->appendOption(kParamDescriptorUserDefined7Comp);
    descriptor->appendOption(kParamDescriptorUserDefined8Comp);
    descriptor->appendOption(kParamDescriptorUndefinedDescriptor);
    descriptor->appendOption(kParamDescriptorAuto);
    descriptor->setDefault(9); // rgb

    OFX::ChoiceParamDescriptor* transfer = desc.defineChoiceParam(kParamTransfer);
    transfer->setLabel(kParamTransferLabel);
    transfer->setHint(kParamTransferHint);
    transfer->appendOption(kParamCharacteristicUserDefined);
    transfer->appendOption(kParamCharacteristicPrintingDensity);
    transfer->appendOption(kParamCharacteristicLinear);
    transfer->appendOption(kParamCharacteristicLogarithmic);
    transfer->appendOption(kParamCharacteristicUnspecifiedVideo);
    transfer->appendOption(kParamCharacteristicSMPTE274M);
    transfer->appendOption(kParamCharacteristicITUR709);
    transfer->appendOption(kParamCharacteristicITUR601);
    transfer->appendOption(kParamCharacteristicITUR602);
    transfer->appendOption(kParamCharacteristicNTSCCompositeVideo);
    transfer->appendOption(kParamCharacteristicPALCompositeVideo);
    transfer->appendOption(kParamCharacteristicZLinear);
    transfer->appendOption(kParamCharacteristicZHomogeneous);
    transfer->appendOption(kParamCharacteristicUndefinedCharacteristic);
    transfer->setDefault(2); // Linear

    OFX::ChoiceParamDescriptor* colorimetric = desc.defineChoiceParam(kParamColorimetric);
    colorimetric->setLabel(kParamColorimetricLabel);
    colorimetric->setHint(kParamColorimetricHint);
    colorimetric->appendOption(kParamCharacteristicUserDefined);
    colorimetric->appendOption(kParamCharacteristicPrintingDensity);
    colorimetric->appendOption(kParamCharacteristicLinear);
    colorimetric->appendOption(kParamCharacteristicLogarithmic);
    colorimetric->appendOption(kParamCharacteristicUnspecifiedVideo);
    colorimetric->appendOption(kParamCharacteristicSMPTE274M);
    colorimetric->appendOption(kParamCharacteristicITUR709);
    colorimetric->appendOption(kParamCharacteristicITUR601);
    colorimetric->appendOption(kParamCharacteristicITUR602);
    colorimetric->appendOption(kParamCharacteristicNTSCCompositeVideo);
    colorimetric->appendOption(kParamCharacteristicPALCompositeVideo);
    colorimetric->appendOption(kParamCharacteristicZLinear);
    colorimetric->appendOption(kParamCharacteristicZHomogeneous);
    colorimetric->appendOption(kParamCharacteristicUndefinedCharacteristic);
    colorimetric->setDefault(2); // Linear

    OFX::ChoiceParamDescriptor* packed = desc.defineChoiceParam(kParamPacked);
    packed->setLabel(kParamPackedLabel);
    packed->setHint(kParamPackedHint);
    packed->appendOption(kParamPackedPacked);
    packed->appendOption(kParamPackedMethodA);
    packed->appendOption(kParamPackedMethodB);
    packed->setDefault(1);

    OFX::BooleanParamDescriptor* swapEndian = desc.defineBooleanParam(kParamSwapEndian);
    swapEndian->setLabel(kParamSwapEndianLabel);
    swapEndian->setHint(kParamSwapEndianHint);
    swapEndian->setDefault(true);

    OFX::ChoiceParamDescriptor* encoding = desc.defineChoiceParam(kParamEncoding);
    encoding->setLabel(kParamEncodingLabel);
    encoding->setHint(kParamEncodingHint);
    encoding->appendOption(kParamEncodingNone);
    encoding->appendOption(kParamEncodingRle);
    encoding->setDefault(0);

    OFX::ChoiceParamDescriptor* orientation = desc.defineChoiceParam(kParamOrientation);
    orientation->setLabel(kParamOrientationLabel);
    orientation->setHint(kParamOrientationHint);
    orientation->appendOption(kParamOrientationLeftToRightTopToBottom);
    orientation->appendOption(kParamOrientationRightToLeftTopToBottom);
    orientation->appendOption(kParamOrientationLeftToRightBottomToTop);
    orientation->appendOption(kParamOrientationRightToLeftBottomToTop);
    orientation->appendOption(kParamOrientationTopToBottomLeftToRight);
    orientation->appendOption(kParamOrientationTopToBottomRightToLeft);
    orientation->appendOption(kParamOrientationBottomToTopLeftToRight);
    orientation->appendOption(kParamOrientationBottomToTopRightToLeft);
    orientation->appendOption(kParamOrientationUndefinedOrientation);
    orientation->setDefault(0);

    OFX::StringParamDescriptor* project = desc.defineStringParam(kParamProject);
    project->setDefault("");
    OFX::StringParamDescriptor* copyright = desc.defineStringParam(kParamCopyright);
    copyright->setDefault("");
}
コード例 #21
0
ファイル: GenericWriter.cpp プロジェクト: sumitneup/openfx-io
/**
 * @brief Override this to describe in context the writer.
 * You should call the base-class version at the end like this:
 * GenericWriterPluginFactory<YOUR_FACTORY>::describeInContext(desc,context);
 **/
PageParamDescriptor*
GenericWriterDescribeInContextBegin(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum context, bool isVideoStreamPlugin, bool supportsRGBA, bool supportsRGB, bool supportsAlpha, const char* inputSpaceNameDefault, const char* outputSpaceNameDefault)
{
    // create the mandated source clip
    ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
    if (supportsRGBA) {
        srcClip->addSupportedComponent(ePixelComponentRGBA);
    }
    if (supportsRGB) {
        srcClip->addSupportedComponent(ePixelComponentRGB);
    }
    if (supportsAlpha) {
        srcClip->addSupportedComponent(ePixelComponentAlpha);
    }
    srcClip->setSupportsTiles(false);

    // create the mandated output clip
    ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
    if (supportsRGBA) {
        dstClip->addSupportedComponent(ePixelComponentRGBA);
    }
    if (supportsRGB) {
        dstClip->addSupportedComponent(ePixelComponentRGB);
    }
    if (supportsAlpha) {
        dstClip->addSupportedComponent(ePixelComponentAlpha);
    }
    dstClip->setSupportsTiles(false);//< we don't support tiles in output!

    // make some pages and to things in
    PageParamDescriptor *page = desc.definePageParam("Controls");

    //////////Output file
    OFX::StringParamDescriptor* fileParam = desc.defineStringParam(kWriterFileParamName);
    fileParam->setLabels(kWriterFileParamLabel, kWriterFileParamLabel, kWriterFileParamLabel);
    fileParam->setStringType(OFX::eStringTypeFilePath);
    fileParam->setFilePathExists(false);
    fileParam->setHint(kWriterFileParamHint);
    // in the Writer context, the script name should be "filename", for consistency with the reader nodes @see kOfxImageEffectContextReader
    fileParam->setScriptName(kWriterFileParamName);
    fileParam->setAnimates(!isVideoStreamPlugin);
    desc.addClipPreferencesSlaveParam(*fileParam);

    page->addChild(*fileParam);

    // insert OCIO parameters
    GenericOCIO::describeInContext(desc, context, page, inputSpaceNameDefault, outputSpaceNameDefault);

    ///////////Frame range choosal
    OFX::ChoiceParamDescriptor* frameRangeChoiceParam = desc.defineChoiceParam(kWriterFrameRangeChoiceParamName);
    frameRangeChoiceParam->setLabels(kWriterFrameRangeChoiceParamLabel, kWriterFrameRangeChoiceParamLabel, kWriterFrameRangeChoiceParamLabel);
    frameRangeChoiceParam->setHint(kWriterFrameRangeChoiceParamHint);
    frameRangeChoiceParam->appendOption(kWriterFrameRangeChoiceParamOptionUnion, kWriterFrameRangeChoiceParamOptionUnionHint);
    frameRangeChoiceParam->appendOption(kWriterFrameRangeChoiceParamOptionBounds, kWriterFrameRangeChoiceParamOptionBoundsHint);
    frameRangeChoiceParam->appendOption(kWriterFrameRangeChoiceParamOptionManual, kWriterFrameRangeChoiceParamOptionManualHint);
    frameRangeChoiceParam->setAnimates(true);
    frameRangeChoiceParam->setDefault(0);
    page->addChild(*frameRangeChoiceParam);
    
    /////////////First frame
    OFX::IntParamDescriptor* firstFrameParam = desc.defineIntParam(kWriterFirstFrameParamName);
    firstFrameParam->setLabels(kWriterFirstFrameParamLabel, kWriterFirstFrameParamLabel, kWriterFirstFrameParamLabel);
    firstFrameParam->setIsSecret(true);
    firstFrameParam->setAnimates(true);
    page->addChild(*firstFrameParam);

    ////////////Last frame
    OFX::IntParamDescriptor* lastFrameParam = desc.defineIntParam(kWriterLastFrameParamName);
    lastFrameParam->setLabels(kWriterLastFrameParamLabel, kWriterLastFrameParamLabel, kWriterLastFrameParamLabel);
    lastFrameParam->setIsSecret(true);
    lastFrameParam->setAnimates(true);
    page->addChild(*lastFrameParam);


    return page;
}