/** * @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); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void ImageStatisticsPluginFactory::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 ); OFX::ChoiceParamDescriptor* coordSystem = desc.defineChoiceParam( kParamCoordinateSystem ); coordSystem->setLabel( "Coordinate system" ); coordSystem->appendOption( kParamCoordinateSystemNormalized ); coordSystem->appendOption( kParamCoordinateSystemCanonical ); coordSystem->setDefault( 0 ); OFX::Double2DParamDescriptor* rectCenter = desc.defineDouble2DParam( kParamRectCenter ); rectCenter->setLabel( "Center" ); rectCenter->setDoubleType( OFX::eDoubleTypePlain ); // rectCenter->setDoubleType( OFX::eDoubleTypeNormalisedXYAbsolute ); rectCenter->setDefault( 0.5, 0.5 ); OFX::Double2DParamDescriptor* rectSize = desc.defineDouble2DParam( kParamRectSize ); rectSize->setLabel( "Size" ); rectSize->setDoubleType( OFX::eDoubleTypePlain ); // rectSize->setDoubleType( OFX::eDoubleTypeNormalisedXYAbsolute ); rectSize->setDefault( 0.5, 0.5 ); OFX::ChoiceParamDescriptor* chooseOutput = desc.defineChoiceParam( kParamChooseOutput ); chooseOutput->setLabel( "Choose output" ); chooseOutput->appendOption( kParamChooseOutputSource ); chooseOutput->appendOption( kParamChooseOutputAverage ); chooseOutput->appendOption( kParamChooseOutputChannelMin ); chooseOutput->appendOption( kParamChooseOutputChannelMax ); chooseOutput->appendOption( kParamChooseOutputLuminosityMin ); chooseOutput->appendOption( kParamChooseOutputLuminosityMax ); chooseOutput->setDefault( 0 ); OFX::GroupParamDescriptor* outputGroup = desc.defineGroupParam( kParamOutputGroup ); outputGroup->setLabel( "Output" ); // ----------------------------------------------------------------------------- OFX::GroupParamDescriptor* rgbaGroup = desc.defineGroupParam( kParamOutputGroupRGBA ); rgbaGroup->setLabel( "RGBA" ); rgbaGroup->setParent( outputGroup ); OFX::RGBAParamDescriptor* outputAverage = desc.defineRGBAParam( kParamOutputAverage ); outputAverage->setLabel( "Average" ); outputAverage->setParent( rgbaGroup ); outputAverage->setEvaluateOnChange( false ); OFX::RGBAParamDescriptor* outputChannelMin = desc.defineRGBAParam( kParamOutputChannelMin ); outputChannelMin->setLabel( "Channels' min" ); outputChannelMin->setHint( "Minimum value per channel" ); outputChannelMin->setParent( rgbaGroup ); outputChannelMin->setEvaluateOnChange( false ); OFX::RGBAParamDescriptor* outputChannelMax = desc.defineRGBAParam( kParamOutputChannelMax ); outputChannelMax->setLabel( "Channels' max" ); outputChannelMax->setParent( rgbaGroup ); outputChannelMax->setEvaluateOnChange( false ); OFX::RGBAParamDescriptor* outputLuminosityMin = desc.defineRGBAParam( kParamOutputLuminosityMin ); outputLuminosityMin->setLabel( "Luminosity min" ); outputLuminosityMin->setParent( rgbaGroup ); outputLuminosityMin->setEvaluateOnChange( false ); OFX::RGBAParamDescriptor* outputLuminosityMax = desc.defineRGBAParam( kParamOutputLuminosityMax ); outputLuminosityMax->setLabel( "Luminosity max" ); outputLuminosityMax->setParent( rgbaGroup ); outputLuminosityMax->setEvaluateOnChange( false ); OFX::RGBAParamDescriptor* outputKurtosis = desc.defineRGBAParam( kParamOutputKurtosis ); outputKurtosis->setLabel( "Kurtosis" ); outputKurtosis->setParent( rgbaGroup ); outputKurtosis->setEvaluateOnChange( false ); OFX::RGBAParamDescriptor* outputSkewness = desc.defineRGBAParam( kParamOutputSkewness ); outputSkewness->setLabel( "Skewness" ); outputSkewness->setParent( rgbaGroup ); outputSkewness->setEvaluateOnChange( false ); // ----------------------------------------------------------------------------- OFX::GroupParamDescriptor* hslGroup = desc.defineGroupParam( kParamOutputGroupHSL ); hslGroup->setLabel( "HSL" ); hslGroup->setParent( outputGroup ); OFX::Double3DParamDescriptor* outputAverageHSL = desc.defineDouble3DParam( kParamOutputAverageHSL ); outputAverageHSL->setLabel( "Average" ); outputAverageHSL->setDoubleType( OFX::eDoubleTypePlain ); outputAverageHSL->setDimensionLabels( "h", "s", "l" ); outputAverageHSL->setParent( hslGroup ); outputAverageHSL->setEvaluateOnChange( false ); OFX::Double3DParamDescriptor* outputChannelMinHSL = desc.defineDouble3DParam( kParamOutputChannelMinHSL ); outputChannelMinHSL->setLabel( "Channels' min" ); outputChannelMinHSL->setHint( "Minimum value per channel" ); outputChannelMinHSL->setDoubleType( OFX::eDoubleTypePlain ); outputChannelMinHSL->setDimensionLabels( "h", "s", "l" ); outputChannelMinHSL->setParent( hslGroup ); outputChannelMinHSL->setEvaluateOnChange( false ); OFX::Double3DParamDescriptor* outputChannelMaxHSL = desc.defineDouble3DParam( kParamOutputChannelMaxHSL ); outputChannelMaxHSL->setLabel( "Channels' max" ); outputChannelMaxHSL->setDoubleType( OFX::eDoubleTypePlain ); outputChannelMaxHSL->setDimensionLabels( "h", "s", "l" ); outputChannelMaxHSL->setParent( hslGroup ); outputChannelMaxHSL->setEvaluateOnChange( false ); OFX::Double3DParamDescriptor* outputLuminosityMinHSL = desc.defineDouble3DParam( kParamOutputLuminosityMinHSL ); outputLuminosityMinHSL->setLabel( "Luminosity min" ); outputLuminosityMinHSL->setDoubleType( OFX::eDoubleTypePlain ); outputLuminosityMinHSL->setDimensionLabels( "h", "s", "l" ); outputLuminosityMinHSL->setParent( hslGroup ); outputLuminosityMinHSL->setEvaluateOnChange( false ); OFX::Double3DParamDescriptor* outputLuminosityMaxHSL = desc.defineDouble3DParam( kParamOutputLuminosityMaxHSL ); outputLuminosityMaxHSL->setLabel( "Luminosity max" ); outputLuminosityMaxHSL->setDoubleType( OFX::eDoubleTypePlain ); outputLuminosityMaxHSL->setDimensionLabels( "h", "s", "l" ); outputLuminosityMaxHSL->setParent( hslGroup ); outputLuminosityMaxHSL->setEvaluateOnChange( false ); OFX::Double3DParamDescriptor* outputKurtosisHSL = desc.defineDouble3DParam( kParamOutputKurtosisHSL ); outputKurtosisHSL->setLabel( "Kurtosis" ); outputKurtosisHSL->setDoubleType( OFX::eDoubleTypePlain ); outputKurtosisHSL->setDimensionLabels( "h", "s", "l" ); outputKurtosisHSL->setParent( hslGroup ); outputKurtosisHSL->setEvaluateOnChange( false ); OFX::Double3DParamDescriptor* outputSkewnessHSL = desc.defineDouble3DParam( kParamOutputSkewnessHSL ); outputSkewnessHSL->setLabel( "Skewness" ); outputSkewnessHSL->setDoubleType( OFX::eDoubleTypePlain ); outputSkewnessHSL->setDimensionLabels( "h", "s", "l" ); outputSkewnessHSL->setParent( hslGroup ); outputSkewnessHSL->setEvaluateOnChange( false ); }