/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void LocalMaximaPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) { OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); 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* border = desc.defineChoiceParam( kParamBorder ); border->setLabel( "Border" ); // border->setHint( "Border method." ); border->appendOption( kParamBorderBlack ); // border->appendOption( kParamBorderPadded ); border->setDefault( 0 ); OFX::ChoiceParamDescriptor* outputComponent = desc.defineChoiceParam( kParamOutputComponent ); outputComponent->setLabel( "Output component" ); outputComponent->appendOption( OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentRGBA) ? kParamOutputComponentRGBA : "---" ); outputComponent->appendOption( OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentRGB) ? kParamOutputComponentRGB : "---" ); outputComponent->appendOption( OFX::getImageEffectHostDescription()->supportsPixelComponent(OFX::ePixelComponentAlpha) ? kParamOutputComponentAlpha : "---" ); outputComponent->setIsSecret( OFX::getImageEffectHostDescription()->_supportedComponents.size() == 1 ); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void OpenImageIOWriterPluginFactory::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 OFX::StringParamDescriptor* filename = desc.defineStringParam( kParamWriterFilename ); filename->setLabel( "Filename" ); filename->setStringType( OFX::eStringTypeFilePath ); filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); desc.addClipPreferencesSlaveParam( *filename ); OFX::ChoiceParamDescriptor* components = desc.defineChoiceParam( kParamOutputComponents ); components->setLabel( "Components" ); components->appendOption( kParamOutputComponentsRGBA ); components->appendOption( kParamOutputComponentsRGB ); components->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); components->setDefault( 0 ); OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kParamWriterBitDepth ); bitDepth->setLabel( "Bit depth" ); bitDepth->appendOption( kTuttlePluginBitDepth8 ); bitDepth->appendOption( kTuttlePluginBitDepth16 ); bitDepth->appendOption( kTuttlePluginBitDepth32f ); bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); bitDepth->setDefault( 1 ); OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender ); render->setLabels( "Render", "Render", "Render step" ); render->setHint( "Force render (writing)" ); OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways ); renderAlways->setLabel( "Render always" ); renderAlways->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); renderAlways->setDefault( false ); OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender ); forceNewRender->setLabel( "Force new render" ); forceNewRender->setIsSecret( true ); forceNewRender->setIsPersistant( false ); forceNewRender->setAnimates( false ); forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); forceNewRender->setEvaluateOnChange( true ); forceNewRender->setDefault( 0 ); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void SeExprPluginFactory::describeInContext(OFX::ImageEffectDescriptor& desc, OFX::EContext context) { describeGeneratorParamsInContext(desc, context); OFX::ChoiceParamDescriptor* chooseInput = desc.defineChoiceParam(kParamChooseInput); chooseInput->appendOption(kParamChooseInputCode); chooseInput->appendOption(kParamChooseInputFile); chooseInput->setDefault(eParamChooseInputCode); OFX::StringParamDescriptor* code = desc.defineStringParam(kParamSeExprCode); code->setLabel("SeExpr code"); code->setHint("Write your SeExpr code."); code->setStringType(OFX::eStringTypeMultiLine); code->setDefault("cfbm([10*u,10*v,.5])"); OFX::StringParamDescriptor* file = desc.defineStringParam(kTuttlePluginFilename); file->setLabel(kTuttlePluginFilenameLabel); file->setHint("SeExpr source code file."); file->setStringType(OFX::eStringTypeFilePath); OFX::Double2DParamDescriptor* textureOffset = desc.defineDouble2DParam(kParamTextureOffset); textureOffset->setLabel("Texture Offset (u, v)"); textureOffset->setHint("Set the u,v offset texture parameters."); textureOffset->setDisplayRange(-100, -100, 100, 100); textureOffset->setDefault(0.0, 0.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 ); }
/** * @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 ); }
void describeWriterParamsInContext( 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* channel = desc.defineChoiceParam( kTuttlePluginChannel ); channel->setLabel( kTuttlePluginChannelLabel ); channel->appendOption( kTuttlePluginChannelAuto ); channel->appendOption( kTuttlePluginChannelGray ); channel->appendOption( kTuttlePluginChannelRGB ); channel->appendOption( kTuttlePluginChannelRGBA ); channel->setDefault( 0 ); OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kTuttlePluginBitDepth ); bitDepth->setLabel( kTuttlePluginBitDepthLabel ); bitDepth->appendOption( kTuttlePluginBitDepth8 ); bitDepth->appendOption( kTuttlePluginBitDepth16 ); bitDepth->setDefault( 0 ); OFX::BooleanParamDescriptor* premult = desc.defineBooleanParam( kParamPremultiplied ); premult->setLabel( kParamPremultipliedLabel ); premult->setDefault( false ); OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender ); render->setLabels( "Render", "Render", "Render step" ); render->setHint("Force render (writing)"); OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways ); renderAlways->setLabel( "Render always" ); // renderAlways->setDefault( false ); renderAlways->setDefault( true ); // because tuttle is not declared as a background renderer OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender ); forceNewRender->setLabel( "Force new render" ); forceNewRender->setEnabled( false ); forceNewRender->setIsSecret( true ); forceNewRender->setIsPersistant( false ); forceNewRender->setAnimates( false ); forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); forceNewRender->setEvaluateOnChange( true ); forceNewRender->setDefault( 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 OFX::StringParamDescriptor* filename = desc.defineStringParam( kParamWriterFilename ); filename->setLabel( "Filename" ); filename->setStringType( OFX::eStringTypeFilePath ); filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); desc.addClipPreferencesSlaveParam( *filename ); OFX::ChoiceParamDescriptor* componentsType = desc.defineChoiceParam( kParamComponentsType ); componentsType->setLabel( "Components type" ); componentsType->appendOption( "rgb" ); componentsType->appendOption( "rgba" ); componentsType->appendOption( "abgr" ); componentsType->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); componentsType->setDefault( 1 ); OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kParamWriterBitDepth ); bitDepth->setLabel( "Bit depth" ); bitDepth->appendOption( kTuttlePluginBitDepth8 ); bitDepth->appendOption( kTuttlePluginBitDepth10 ); bitDepth->appendOption( kTuttlePluginBitDepth12 ); bitDepth->appendOption( kTuttlePluginBitDepth16 ); bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); bitDepth->setDefault( 3 ); OFX::BooleanParamDescriptor* compressed = desc.defineBooleanParam( kParamCompressed ); compressed->setLabel( "Remove unused bits (bit streaming)" ); compressed->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); compressed->setDefault( false ); describeWriterParamsInContext( desc, context ); }
/** * @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 ); 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 ); 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 ); 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 ); }
void OFX::shutterDescribeInContext(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum /*context*/, OFX::PageParamDescriptor* page) { // shutter { DoubleParamDescriptor* param = desc.defineDoubleParam(kParamShutter); param->setLabel(kParamShutterLabel); param->setHint(kParamShutterHint); param->setDefault(0.5); param->setRange(0., 2.); param->setIncrement(0.01); param->setDisplayRange(0., 2.); if (page) { page->addChild(*param); } } // shutteroffset { ChoiceParamDescriptor* param = desc.defineChoiceParam(kParamShutterOffset); param->setLabel(kParamShutterOffsetLabel); param->setHint(kParamShutterOffsetHint); assert(param->getNOptions() == eShutterOffsetCentered); param->appendOption(kParamShutterOffsetOptionCentered, kParamShutterOffsetOptionCenteredHint); assert(param->getNOptions() == eShutterOffsetStart); param->appendOption(kParamShutterOffsetOptionStart, kParamShutterOffsetOptionStartHint); assert(param->getNOptions() == eShutterOffsetEnd); param->appendOption(kParamShutterOffsetOptionEnd, kParamShutterOffsetOptionEndHint); assert(param->getNOptions() == eShutterOffsetCustom); param->appendOption(kParamShutterOffsetOptionCustom, kParamShutterOffsetOptionCustomHint); param->setAnimates(true); param->setDefault(eShutterOffsetStart); if (page) { page->addChild(*param); } } // shuttercustomoffset { DoubleParamDescriptor* param = desc.defineDoubleParam(kParamShutterCustomOffset); param->setLabel(kParamShutterCustomOffsetLabel); param->setHint(kParamShutterCustomOffsetHint); param->setDefault(0.); param->setRange(-1., 1.); param->setIncrement(0.1); param->setDisplayRange(-1., 1.); if (page) { page->addChild(*param); } } } // shutterDescribeInContext
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 }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void ColorBarsPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) { describeGeneratorParamsInContext( desc, context ); OFX::ChoiceParamDescriptor* levels = desc.defineChoiceParam( kColorBarsLevels ); levels->setLabel( "Levels" ); levels->appendOption( kColorBarsLevels100 ); levels->appendOption( kColorBarsLevels75 ); levels->setDefault( eColorBarsLevels75 ); }
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() ) ); } }
/** * @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 ); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void ComponentPluginFactory::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* outTo = desc.defineChoiceParam( kParamTo ); outTo->setLabel( kParamToLabel ); outTo->appendOption( kConvertToGray ); outTo->appendOption( kConvertToRGB ); outTo->appendOption( kConvertToRGBA ); outTo->setDefault( eConvertToRGBA ); OFX::ChoiceParamDescriptor* outGray = desc.defineChoiceParam( kParamToGray ); outGray->setLabel( kParamToGrayLabel ); outGray->appendOption( kConvertToGrayMean ); outGray->appendOption( kConvertToGrayRec601 ); outGray->appendOption( kConvertToGrayRec709 ); outGray->appendOption( kConvertToGraySelectRed ); outGray->appendOption( kConvertToGraySelectGreen ); outGray->appendOption( kConvertToGraySelectBlue ); outGray->appendOption( kConvertToGraySelectAlpha ); outGray->setDefault( 3 ); // terry::color::components::eConvertToGrayRec709 OFX::BooleanParamDescriptor* outPremult = desc.defineBooleanParam( kParamPremutliplied ); outPremult->setLabel( kParamPremutlipliedLabel ); outPremult->setDefault( false ); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void PngWriterPluginFactory::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::StringParamDescriptor* filename = desc.defineStringParam( kParamWriterFilename ); filename->setLabel( "Filename" ); filename->setStringType( OFX::eStringTypeFilePath ); filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); desc.addClipPreferencesSlaveParam( *filename ); OFX::ChoiceParamDescriptor* components = desc.defineChoiceParam( kParamOutputComponents ); components->setLabel( "Components" ); components->appendOption( kParamOutputComponentsRGBA ); components->appendOption( kParamOutputComponentsRGB ); components->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); components->setDefault( 0 ); OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kParamWriterBitDepth ); bitDepth->setLabel( "Bit depth" ); bitDepth->appendOption( kTuttlePluginBitDepth8 ); bitDepth->appendOption( kTuttlePluginBitDepth16 ); bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); bitDepth->setDefault( 1 ); describeWriterParamsInContext( desc, context ); }
/** * @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." ); }
void ParamMathPluginFactory::describe(OFX::ImageEffectDescriptor& desc) { desc.setLabels("TuttleMathParam", "MathParam", "Math Param"); desc.setPluginGrouping("tuttle/param"); OFX::ChoiceParamDescriptor* op = desc.defineChoiceParam("operation"); op->appendOption("Multiply"); op->appendOption("Divide"); op->appendOption("Addition"); op->appendOption("Subtraction"); op->appendOption("Modulo"); op->setDefault(0); OFX::Descriptor<ParamType>* a = desc.define<ParamType>("a"); OFX::Descriptor<ParamType>* b = desc.define<ParamType>("b"); OFX::Descriptor<ParamType>* output = desc.define<ParamType>("Output"); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void DiffPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) { OFX::ClipDescriptor* srcClipA = desc.defineClip( kDiffSourceA ); assert( srcClipA ); srcClipA->addSupportedComponent( OFX::ePixelComponentRGBA ); srcClipA->addSupportedComponent( OFX::ePixelComponentAlpha ); srcClipA->setSupportsTiles( kSupportTiles ); srcClipA->setOptional( false ); OFX::ClipDescriptor* srcClipB = desc.defineClip( kDiffSourceB ); assert( srcClipB ); srcClipB->addSupportedComponent( OFX::ePixelComponentRGBA ); srcClipB->addSupportedComponent( OFX::ePixelComponentAlpha ); srcClipB->setSupportsTiles( kSupportTiles ); srcClipB->setOptional( false ); // Create the mandated output clip OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); assert( dstClip ); dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); dstClip->setSupportsTiles( kSupportTiles ); OFX::ChoiceParamDescriptor* diffFunction = desc.defineChoiceParam( kMeasureFunction ); assert( diffFunction ); diffFunction->setLabel( "Quality mesure function" ); diffFunction->appendOption( "PSNR (Peak Signal to Noise Ratio)" ); // diffFunction->appendOption( "MSE (Mean Square Error)" ); // diffFunction->appendOption( "SSIM (Structural SIMilarity)" ); diffFunction->setDefault( 0 ); OFX::RGBAParamDescriptor* outputQualityMesure = desc.defineRGBAParam( kOutputQualityMesure ); assert( outputQualityMesure ); outputQualityMesure->setLabel( "Quality" ); outputQualityMesure->setEvaluateOnChange( false ); // OFX::PushButtonParamDescriptor* helpButton = desc.definePushButtonParam( kHelpButton ); // assert( helpButton ); // helpButton->setLabel( "Help" ); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void ConvolutionPluginFactory::describeInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) { OFX::ClipDescriptor* srcClip = desc.defineClip( kOfxImageEffectSimpleSourceClipName ); srcClip->addSupportedComponent( OFX::ePixelComponentRGBA ); srcClip->addSupportedComponent( OFX::ePixelComponentRGB ); srcClip->addSupportedComponent( OFX::ePixelComponentAlpha ); srcClip->setSupportsTiles( kSupportTiles ); // Create the mandated output clip OFX::ClipDescriptor* dstClip = desc.defineClip( kOfxImageEffectOutputClipName ); dstClip->addSupportedComponent( OFX::ePixelComponentRGBA ); dstClip->addSupportedComponent( OFX::ePixelComponentRGB ); dstClip->addSupportedComponent( OFX::ePixelComponentAlpha ); dstClip->setSupportsTiles( kSupportTiles ); OFX::Int2DParamDescriptor* size = desc.defineInt2DParam( kParamSize ); size->setLabel( "Size" ); size->setDefault( 3, 3 ); // size->setIncrement( 2, 2 ); size->setRange( 3, 3, kParamSizeMax, kParamSizeMax ); OFX::ChoiceParamDescriptor* border = desc.defineChoiceParam( kParamBorder ); border->setLabel( "Border" ); border->appendOption( kParamBorderMirror ); border->appendOption( kParamBorderConstant ); border->appendOption( kParamBorderBlack ); border->appendOption( kParamBorderPadded ); for( unsigned int y = 0; y < kParamSizeMax; ++y ) { for( unsigned int x = 0; x < kParamSizeMax; ++x ) { const std::string name( getCoefName( y, x ) ); OFX::DoubleParamDescriptor* coef = desc.defineDoubleParam( name ); coef->setLabel( name ); coef->setDisplayRange( -10.0, 10.0 ); coef->setDefault( 0.0 ); } } }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void Jpeg2000WriterPluginFactory::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 ); describeWriterParamsInContext( desc, context ); OFX::ChoiceParamDescriptor* bitDepth = static_cast<OFX::ChoiceParamDescriptor*>( desc.getParamDescriptor( kTuttlePluginBitDepth ) ); bitDepth->resetOptions(); bitDepth->appendOption( kTuttlePluginBitDepth8 ); bitDepth->appendOption( kTuttlePluginBitDepth12 ); bitDepth->appendOption( kTuttlePluginBitDepth16 ); #ifndef TUTTLE_PRODUCTION bitDepth->appendOption( kTuttlePluginBitDepth32 ); #endif bitDepth->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); bitDepth->setDefault( eTuttlePluginBitDepth8 ); OFX::BooleanParamDescriptor* lossless = desc.defineBooleanParam( kParamLossless ); lossless->setLabel( "lossless" ); lossless->setHint("When no cinema profile is selected, set compression to lossless."); lossless->setDefault( false ); OFX::ChoiceParamDescriptor* cineProfil = desc.defineChoiceParam( kParamCinemaProfil ); cineProfil->appendOption( kParamCinemaProfilNoDigit ); cineProfil->appendOption( kParamCinemaProfil2k24fps ); cineProfil->appendOption( kParamCinemaProfil2k48fps ); cineProfil->appendOption( kParamCinemaProfil4k24fps ); cineProfil->setDefault( 0 ); }
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 }
/** * @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(""); }
/** * @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 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 ); // 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::BooleanParamDescriptor* bop = desc.defineBooleanParam( kParamFillMode ); bop->setLabels( kParamFillModeLabel, kParamFillModeLabel, kParamFillModeLabel ); bop->setScriptName( "BandsOperations" ); bop->setHint( "Fill bands with black color or repeat last pixel and reset Rod." ); bop->setDefault( true ); OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam( kParamPresets ); format->setLabels( kParamPresetsLabel, kParamPresetsLabel, kParamPresetsLabel ); format->setScriptName( "formats" ); format->appendOption( "1.33 (4/3) bands" ); format->appendOption( "1.77 (16/9e) bands" ); format->appendOption( "1.85 bands" ); format->appendOption( "2.35 (Cinemascope) bands" ); format->appendOption( "2.40 bands" ); format->setDefault( 0 ); OFX::BooleanParamDescriptor* shape = desc.defineBooleanParam( kParamDisplayRect ); shape->setLabels( kParamDisplayRectLabel, kParamDisplayRectLabel, kParamDisplayRectLabel ); shape->setDefault( false ); OFX::BooleanParamDescriptor* anamorphic = desc.defineBooleanParam( kParamAnamorphic ); anamorphic->setLabels( kParamAnamorphicLabel, kParamAnamorphicLabel, "Anamorphic (stretch)" ); anamorphic->setDefault( false ); anamorphic->setIsSecret( true ); OFX::GroupParamDescriptor* bandsGroup = desc.defineGroupParam( "Bands sizes" ); OFX::IntParamDescriptor* upBand = desc.defineIntParam( kParamUp ); upBand->setLabels( kParamUpLabel, kParamUpLabel, kParamUpLabel ); upBand->setParent( *bandsGroup ); OFX::IntParamDescriptor* downBand = desc.defineIntParam( kParamDown ); downBand->setLabels( kParamDownLabel, kParamDownLabel, kParamDownLabel ); downBand->setParent( *bandsGroup ); OFX::IntParamDescriptor* leftBand = desc.defineIntParam( kParamLeft ); leftBand->setLabels( kParamLeftLabel, kParamLeftLabel, kParamLeftLabel ); leftBand->setParent( *bandsGroup ); OFX::IntParamDescriptor* rightBand = desc.defineIntParam( kParamRight ); rightBand->setLabels( kParamRightLabel, kParamRightLabel, kParamRightLabel ); rightBand->setParent( *bandsGroup ); OFX::PushButtonParamDescriptor* helpButton = desc.definePushButtonParam( kCropHelpButton ); helpButton->setScriptName( "&Help" ); }
/** * @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 ); }
/** * @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."); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void NormalizePluginFactory::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* mode = desc.defineChoiceParam( kParamMode ); mode->setLabel( "Input" ); mode->appendOption( kParamModeAnalyse ); mode->appendOption( kParamModeCustom ); OFX::ChoiceParamDescriptor* analyse = desc.defineChoiceParam( kParamAnalyseMode ); analyse->setLabel( "Analyse" ); analyse->appendOption( kParamAnalysePerChannel ); analyse->appendOption( kParamAnalyseLuminosity ); analyse->appendOption( kParamAnalyseR ); analyse->appendOption( kParamAnalyseG ); analyse->appendOption( kParamAnalyseB ); analyse->appendOption( kParamAnalyseA ); OFX::PushButtonParamDescriptor* analyseNow = desc.definePushButtonParam( kParamAnalyseNow ); analyseNow->setLabel( "Analyse" ); OFX::GroupParamDescriptor* srcGroup = desc.defineGroupParam( kParamSrcGroup ); srcGroup->setLabel( "Source" ); OFX::RGBAParamDescriptor* srcMinColor = desc.defineRGBAParam( kParamSrcCustomColorMin ); srcMinColor->setLabel( "Min" ); srcMinColor->setDefault( 0.0, 0.0, 0.0, 0.0 ); srcMinColor->setParent( srcGroup ); OFX::RGBAParamDescriptor* srcMaxColor = desc.defineRGBAParam( kParamSrcCustomColorMax ); srcMaxColor->setLabel( "Max" ); srcMaxColor->setDefault( 1.0, 1.0, 1.0, 1.0 ); srcMaxColor->setParent( srcGroup ); OFX::GroupParamDescriptor* dstGroup = desc.defineGroupParam( kParamDstGroup ); dstGroup->setLabel( "Destination" ); OFX::RGBAParamDescriptor* dstMinColor = desc.defineRGBAParam( kParamDstCustomColorMin ); dstMinColor->setLabel( "Min" ); dstMinColor->setDefault( 0.0, 0.0, 0.0, 0.0 ); dstMinColor->setParent( dstGroup ); OFX::RGBAParamDescriptor* dstMaxColor = desc.defineRGBAParam( kParamDstCustomColorMax ); dstMaxColor->setLabel( "Max" ); dstMaxColor->setDefault( 1.0, 1.0, 1.0, 1.0 ); dstMaxColor->setParent( dstGroup ); OFX::GroupParamDescriptor* processGroup = desc.defineGroupParam( kParamProcessGroup ); processGroup->setLabel( "Process" ); OFX::BooleanParamDescriptor* processR = desc.defineBooleanParam( kParamProcessR ); processR->setLabel( "R" ); processR->setDefault( true ); processR->setParent( processGroup ); OFX::BooleanParamDescriptor* processG = desc.defineBooleanParam( kParamProcessG ); processG->setLabel( "G" ); processG->setDefault( true ); processG->setParent( processGroup ); OFX::BooleanParamDescriptor* processB = desc.defineBooleanParam( kParamProcessB ); processB->setLabel( "B" ); processB->setDefault( true ); processB->setParent( processGroup ); OFX::BooleanParamDescriptor* processA = desc.defineBooleanParam( kParamProcessA ); processA->setLabel( "A" ); processA->setDefault( true ); processA->setParent( processGroup ); }
/** * @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 ); }
void describeWriterParamsInContext( OFX::ImageEffectDescriptor& desc, OFX::EContext context ) { OFX::StringParamDescriptor* filename = desc.defineStringParam( kTuttlePluginFilename ); filename->setLabel( kTuttlePluginFilenameLabel ); filename->setStringType( OFX::eStringTypeFilePath ); filename->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); // the file doesn't need to exist, the writer will create it! filename->setFilePathExists(false); desc.addClipPreferencesSlaveParam( *filename ); OFX::ChoiceParamDescriptor* channel = desc.defineChoiceParam( kTuttlePluginChannel ); channel->setLabel( kTuttlePluginChannelLabel ); channel->appendOption( kTuttlePluginChannelAuto ); channel->appendOption( kTuttlePluginChannelGray ); channel->appendOption( kTuttlePluginChannelRGB ); channel->appendOption( kTuttlePluginChannelRGBA ); channel->setDefault( 0 ); OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam( kTuttlePluginBitDepth ); bitDepth->setLabel( kTuttlePluginBitDepthLabel ); bitDepth->appendOption( kTuttlePluginBitDepth8 ); bitDepth->appendOption( kTuttlePluginBitDepth16 ); bitDepth->setDefault( 0 ); OFX::BooleanParamDescriptor* premult = desc.defineBooleanParam( kParamPremultiplied ); premult->setLabel( "Premultiplied" ); premult->setDefault( false ); OFX::ChoiceParamDescriptor* existingFile = desc.defineChoiceParam( kParamWriterExistingFile ); existingFile->setLabel( "Existing File" ); existingFile->appendOption( kParamWriterExistingFile_overwrite ); existingFile->appendOption( kParamWriterExistingFile_error ); if( OFX::getImageEffectHostDescription()->hostName == "TuttleOfx" ) { // Only Tuttle is able to do that, because we disable the computation // using the IsIdentity Action. This is not in the OpenFX standard. existingFile->appendOption( kParamWriterExistingFile_skip ); } //existingFile->appendOption( kParamWriterExistingFile_reader ); // TODO: not implemented yet. existingFile->setDefault( eParamWriterExistingFile_overwrite ); OFX::BooleanParamDescriptor* copyToOutput = desc.defineBooleanParam( kParamWriterCopyToOutput ); copyToOutput->setLabel( "Copy buffer to output" ); copyToOutput->setHint( "This is only useful if you connect nodes to the output clip of the writer." ); copyToOutput->setDefault( false ); OFX::PushButtonParamDescriptor* render = desc.definePushButtonParam( kParamWriterRender ); render->setLabels( "Render", "Render", "Render step" ); render->setHint("Force render (writing)"); OFX::BooleanParamDescriptor* renderAlways = desc.defineBooleanParam( kParamWriterRenderAlways ); renderAlways->setLabel( "Render always" ); renderAlways->setHint( "This is only useful as a workaround for GUI applications." ); renderAlways->setDefault( true ); // because tuttle is not declared as a background renderer OFX::IntParamDescriptor* forceNewRender = desc.defineIntParam( kParamWriterForceNewRender ); forceNewRender->setLabel( "Force new render" ); forceNewRender->setHint( "This is only useful as a workaround for GUI applications." ); forceNewRender->setEnabled( false ); forceNewRender->setIsSecret( true ); forceNewRender->setIsPersistant( false ); forceNewRender->setAnimates( false ); forceNewRender->setCacheInvalidation( OFX::eCacheInvalidateValueAll ); forceNewRender->setEvaluateOnChange( true ); forceNewRender->setDefault( 0 ); }
/** * @brief Function called to describe the plugin controls and features. * @param[in, out] desc Effect descriptor * @param[in] context Application context */ void ResizePluginFactory::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* method = desc.defineChoiceParam(kParamMode); method->setLabel("Mode"); method->appendOption(kParamModeFormat); method->appendOption(kParamModeSize); method->appendOption(kParamModeScale); method->setDefault(eParamModeFormat); OFX::ChoiceParamDescriptor* format = desc.defineChoiceParam(kParamFormat); format->setLabel("Format"); format->appendOption(kParamFormatPCVideo, kParamFormatPCVideoLabel); format->appendOption(kParamFormatNTSC, kParamFormatNTSCLabel); format->appendOption(kParamFormatPAL, kParamFormatPALLabel); format->appendOption(kParamFormatHD, kParamFormatHDLabel); format->appendOption(kParamFormatNTSC169, kParamFormatNTSC169Label); format->appendOption(kParamFormatPAL169, kParamFormatPAL169Label); format->appendOption(kParamFormat1kSuper35, kParamFormat1kSuper35Label); format->appendOption(kParamFormat1kCinemascope, kParamFormat1kCinemascopeLabel); format->appendOption(kParamFormat2kSuper35, kParamFormat2kSuper35Label); format->appendOption(kParamFormat2kCinemascope, kParamFormat2kCinemascopeLabel); format->appendOption(kParamFormat4kSuper35, kParamFormat4kSuper35Label); format->appendOption(kParamFormat4kCinemascope, kParamFormat4kCinemascopeLabel); format->appendOption(kParamFormatSquare256, kParamFormatSquare256Label); format->appendOption(kParamFormatSquare512, kParamFormatSquare512Label); format->appendOption(kParamFormatSquare1k, kParamFormatSquare1kLabel); format->appendOption(kParamFormatSquare2k, kParamFormatSquare2kLabel); format->setDefault(eParamFormat2kCinemascope); OFX::Double2DParamDescriptor* scale = desc.defineDouble2DParam(kParamScale); scale->setLabel("Scale"); scale->setDefault(1.0, 1.0); scale->setRange(0.01, 0.01, std::numeric_limits<double>::max(), std::numeric_limits<double>::max()); scale->setDisplayRange(0.1, 0.1, 2.5, 2.5); scale->setHint("Scale the input image [0, 0, width*scale, height*scale]."); OFX::BooleanParamDescriptor* keepRatio = desc.defineBooleanParam(kParamSizeKeepRatio); keepRatio->setLabel("Keep ratio"); keepRatio->setDefault(false); keepRatio->setHint("Keep 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::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 keep the input image 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 keep the input image ratio."); #if(TUTTLE_EXPERIMENTAL) OFX::BooleanParamDescriptor* center = desc.defineBooleanParam(kParamCenter); center->setLabel("Center resizing"); center->setDefault(false); center->setHint("Resize around the center point."); OFX::Double2DParamDescriptor* centerPoint = desc.defineDouble2DParam(kParamCenterPoint); centerPoint->setDefault(100, 100); centerPoint->setLabel("Center point at"); centerPoint->setHint("Position of the center point."); #endif // sampler parameters // describeSamplerParamsInContext(desc, context); }