/** * @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 ); }
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() ) ); } }
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 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 ); }
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 ); }
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 }
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." ); }