コード例 #1
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
}
コード例 #2
0
void describeReaderParamsInContext( OFX::ImageEffectDescriptor& desc,
				    OFX::EContext               context )
{
	OFX::StringParamDescriptor* filename = desc.defineStringParam( kTuttlePluginFilename );
	filename->setLabel( kTuttlePluginFilenameLabel );
	filename->setStringType( OFX::eStringTypeFilePath );
	filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
	desc.addClipPreferencesSlaveParam( *filename );

	OFX::ChoiceParamDescriptor* component = desc.defineChoiceParam( kTuttlePluginChannel );
	component->appendOption( kTuttlePluginChannelAuto );
	component->appendOption( kTuttlePluginChannelGray );
	component->appendOption( kTuttlePluginChannelRGB );
	component->appendOption( kTuttlePluginChannelRGBA );

	component->setLabel( kTuttlePluginChannelLabel );
	component->setDefault( eParamReaderChannelAuto );


	OFX::ChoiceParamDescriptor* explicitConversion = desc.defineChoiceParam( kTuttlePluginBitDepth );
	explicitConversion->setLabel( kTuttlePluginBitDepthLabel );
	explicitConversion->appendOption( kTuttlePluginBitDepthAuto );
	explicitConversion->appendOption( kTuttlePluginBitDepth8 );
	explicitConversion->appendOption( kTuttlePluginBitDepth16 );
	explicitConversion->appendOption( kTuttlePluginBitDepth32f );
	explicitConversion->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
	explicitConversion->setAnimates( false );
	desc.addClipPreferencesSlaveParam( *explicitConversion );

	if( OFX::getImageEffectHostDescription()->supportsMultipleClipDepths )
	{
		explicitConversion->setDefault( 0 );
	}
	else
	{
		explicitConversion->setIsSecret( true );
		explicitConversion->setDefault( static_cast<int>( OFX::getImageEffectHostDescription()->getPixelDepth() ) );
	}
}
コード例 #3
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
}
コード例 #4
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);
    }
  }
}
コード例 #5
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;
}
コード例 #6
0
void describeGeneratorParamsInContext( OFX::ImageEffectDescriptor& desc,
				       OFX::EContext               context )
{
/* to activate this
	// Create the mandated optional input clip
	OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName );
	srcClip->addSupportedComponent( OFX::ePixelComponentRGBA );
	srcClip->addSupportedComponent( OFX::ePixelComponentRGB );
	srcClip->addSupportedComponent( OFX::ePixelComponentAlpha );
	srcClip->setSupportsTiles( kSupportTiles );
	srcClip->setOptional(true);
*/

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

	OFX::ChoiceParamDescriptor* explicitConversion = desc.defineChoiceParam( kParamGeneratorExplicitConversion );
	explicitConversion->setLabel( "Explicit conversion" );
	explicitConversion->appendOption( kTuttlePluginBitDepthAuto );
	explicitConversion->appendOption( kTuttlePluginBitDepth8 );
	explicitConversion->appendOption( kTuttlePluginBitDepth16 );
	explicitConversion->appendOption( kTuttlePluginBitDepth32f );
	explicitConversion->setCacheInvalidation( OFX::eCacheInvalidateValueAll );
	explicitConversion->setAnimates( false );
	desc.addClipPreferencesSlaveParam( *explicitConversion );

	if( OFX::getImageEffectHostDescription()->supportsMultipleClipDepths )
	{
		explicitConversion->setDefault( 0 );
	}
	else
	{
		explicitConversion->setIsSecret( true );
		explicitConversion->setDefault( static_cast<int>( OFX::getImageEffectHostDescription()->getPixelDepth() ) );
	}

	OFX::ChoiceParamDescriptor* method = desc.defineChoiceParam( kParamMode );
	method->setLabel    ( "Mode" );
	method->appendOption( kParamModeFormat );
	method->appendOption( kParamModeSize );
	method->setDefault  ( eParamModeFormat );

	OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam( kParamFormat );
	format->setLabel( "Format" );
	format->appendOption( kParamFormatPCVideo );
	format->appendOption( kParamFormatNTSC );
	format->appendOption( kParamFormatPAL );
	format->appendOption( kParamFormatHD );
	format->appendOption( kParamFormatNTSC169 );
	format->appendOption( kParamFormatPAL169 );
	format->appendOption( kParamFormat1kSuper35 );
	format->appendOption( kParamFormat1kCinemascope );
	format->appendOption( kParamFormat2kSuper35 );
	format->appendOption( kParamFormat2kCinemascope );
	format->appendOption( kParamFormat4kSuper35 );
	format->appendOption( kParamFormat4kCinemascope );
	format->appendOption( kParamFormatSquare256 );
	format->appendOption( kParamFormatSquare512 );
	format->appendOption( kParamFormatSquare1k );
	format->appendOption( kParamFormatSquare2k );
	format->setDefault( eParamFormat2kCinemascope );

	OFX::BooleanParamDescriptor* specificRatio = desc.defineBooleanParam( kParamSizeSpecificRatio );
	specificRatio->setLabel( "Specific ratio" );
	specificRatio->setDefault( false );
	specificRatio->setHint( "Specific input image ratio." );

	OFX::Int2DParamDescriptor* size = desc.defineInt2DParam( kParamSize );
	size->setLabel( "Size" );
	size->setDefault( 200, 200 );
	size->setRange( 1, 1, std::numeric_limits<int>::max(), std::numeric_limits<int>::max() );
	size->setHint( "Set the output size (width, height)." );

	OFX::ChoiceParamDescriptor* direction = desc.defineChoiceParam( kParamSizeOrientation );
	direction->setLabel( "Orientation" );
	direction->appendOption( kParamSizeOrientationX );
	direction->appendOption( kParamSizeOrientationY );
	direction->setDefault( eParamSizeOrientationX );

	OFX::DoubleParamDescriptor* ratioValue = desc.defineDoubleParam( kParamSizeRatioValue );
	ratioValue->setLabel( "Ratio Value" );
	ratioValue->setDefault( 1.0 );
	ratioValue->setRange( 1, std::numeric_limits<int>::max() );
	ratioValue->setDisplayRange( 0, 50 );
	ratioValue->setHint( "Set the ratio." );

	OFX::IntParamDescriptor* width = desc.defineIntParam( kParamSizeWidth );
	width->setLabel( "Width" );
	width->setDefault( 200 );
	width->setRange( 1, std::numeric_limits<int>::max() );
	width->setDisplayRange( 0, 3000 );
	width->setHint( "Set the width in pixels and specify the ratio." );

	OFX::IntParamDescriptor* height = desc.defineIntParam( kParamSizeHeight );
	height->setLabel( "Height" );
	height->setDefault( 200 );
	height->setRange( 1, std::numeric_limits<int>::max() );
	height->setDisplayRange( 0, 3000 );
	height->setHint( "Set the height in pixels and specify the ratio." );

}