void InvertPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum context) { // Source clip only in the filter context // create the mandated source clip ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName); srcClip->addSupportedComponent(ePixelComponentRGBA); srcClip->addSupportedComponent(ePixelComponentRGB); srcClip->addSupportedComponent(ePixelComponentAlpha); srcClip->setTemporalClipAccess(false); srcClip->setSupportsTiles(true); srcClip->setIsMask(false); // create the mandated output clip ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName); dstClip->addSupportedComponent(ePixelComponentRGBA); dstClip->addSupportedComponent(ePixelComponentRGB); dstClip->addSupportedComponent(ePixelComponentAlpha); dstClip->setSupportsTiles(true); if (context == eContextGeneral || context == eContextPaint) { ClipDescriptor *maskClip = context == eContextGeneral ? desc.defineClip("Mask") : desc.defineClip("Brush"); maskClip->addSupportedComponent(ePixelComponentAlpha); maskClip->setTemporalClipAccess(false); if (context == eContextGeneral) { maskClip->setOptional(true); } maskClip->setSupportsTiles(true); maskClip->setIsMask(true); } // make some pages and to things in PageParamDescriptor *page = desc.definePageParam("Controls"); OFX::BooleanParamDescriptor* processR = desc.defineBooleanParam(kParamProcessR); processR->setLabels(kParamProcessRLabel, kParamProcessRLabel, kParamProcessRLabel); processR->setHint(kParamProcessRHint); processR->setDefault(true); processR->setLayoutHint(eLayoutHintNoNewLine); page->addChild(*processR); OFX::BooleanParamDescriptor* processG = desc.defineBooleanParam(kParamProcessG); processG->setLabels(kParamProcessGLabel, kParamProcessGLabel, kParamProcessGLabel); processG->setHint(kParamProcessGHint); processG->setDefault(true); processG->setLayoutHint(eLayoutHintNoNewLine); page->addChild(*processG); OFX::BooleanParamDescriptor* processB = desc.defineBooleanParam( kParamProcessB ); processB->setLabels(kParamProcessBLabel, kParamProcessBLabel, kParamProcessBLabel); processB->setHint(kParamProcessBHint); processB->setDefault(true); processB->setLayoutHint(eLayoutHintNoNewLine); page->addChild(*processB); OFX::BooleanParamDescriptor* processA = desc.defineBooleanParam( kParamProcessA ); processA->setLabels(kParamProcessALabel, kParamProcessALabel, kParamProcessALabel); processA->setHint(kParamProcessAHint); processA->setDefault(true); page->addChild(*processA); ofxsMaskMixDescribeParams(desc, page); }
/** * @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 The describe in context function, passed a plugin descriptor and a context */ void WriteOIIOPluginFactory::describeInContext(OFX::ImageEffectDescriptor &desc, ContextEnum context) { // make some pages and to things in PageParamDescriptor *page = GenericWriterDescribeInContextBegin(desc, context,isVideoStreamPlugin(), /*supportsRGBA =*/true, /*supportsRGB=*/false, /*supportsAlpha=*/false, "reference", "reference"); OFX::ChoiceParamDescriptor* bitDepth = desc.defineChoiceParam(kParamBitDepthName); bitDepth->setLabels(kParamBitDepthLabel, kParamBitDepthLabel, kParamBitDepthLabel); bitDepth->appendOption(kParamBitDepthAuto, kParamBitDepthAutoLabel); bitDepth->appendOption(kParamBitDepth8, kParamBitDepth8Label); bitDepth->appendOption(kParamBitDepth10, kParamBitDepth10Label); bitDepth->appendOption(kParamBitDepth12, kParamBitDepth12Label); bitDepth->appendOption(kParamBitDepth16, kParamBitDepth16Label); bitDepth->appendOption(kParamBitDepth16f, kParamBitDepth16fLabel); bitDepth->appendOption(kParamBitDepth32, kParamBitDepth32Label); bitDepth->appendOption(kParamBitDepth32f, kParamBitDepth32fLabel); bitDepth->appendOption(kParamBitDepth64, kParamBitDepth64Label); bitDepth->appendOption(kParamBitDepth64f, kParamBitDepth64fLabel); bitDepth->setDefault(eTuttlePluginBitDepthAuto); page->addChild(*bitDepth); OFX::BooleanParamDescriptor* premult = desc.defineBooleanParam(kParamPremultipliedName); premult->setLabels(kParamPremultipliedLabel, kParamPremultipliedLabel, kParamPremultipliedLabel); premult->setDefault(false); page->addChild(*premult); OFX::IntParamDescriptor* quality = desc.defineIntParam(kParamOutputQualityName); quality->setLabels(kParamOutputQualityLabel, kParamOutputQualityLabel, kParamOutputQualityLabel); quality->setRange(0, 100); quality->setDisplayRange(0, 100); quality->setDefault(80); page->addChild(*quality); OFX::ChoiceParamDescriptor* orientation = desc.defineChoiceParam(kParamOutputOrientationName); orientation->setLabels(kParamOutputOrientationLabel, kParamOutputOrientationLabel, kParamOutputOrientationLabel); orientation->appendOption(kParamOutputOrientationNormal); orientation->appendOption(kParamOutputOrientationFlop); orientation->appendOption(kParamOutputOrientationR180); orientation->appendOption(kParamOutputOrientationFlip); orientation->appendOption(kParamOutputOrientationTransposed); orientation->appendOption(kParamOutputOrientationR90Clockwise); orientation->appendOption(kParamOutputOrientationTransverse); orientation->appendOption(kParamOutputOrientationR90CounterClockwise); orientation->setDefault(0); page->addChild(*orientation); OFX::ChoiceParamDescriptor* compression = desc.defineChoiceParam(kParamOutputCompressionName); compression->setLabels(kParamOutputCompressionLabel, kParamOutputCompressionLabel, kParamOutputCompressionLabel); compression->setHint(kParamOutputCompressionHint); compression->appendOption(kParamOutputCompressionAuto, kParamOutputCompressionAutoLabel); compression->appendOption(kParamOutputCompressionNone, kParamOutputCompressionNoneLabel); compression->appendOption(kParamOutputCompressionZip, kParamOutputCompressionZipLabel); compression->appendOption(kParamOutputCompressionZips, kParamOutputCompressionZipsLabel); compression->appendOption(kParamOutputCompressionRle, kParamOutputCompressionRleLabel); compression->appendOption(kParamOutputCompressionPiz, kParamOutputCompressionPizLabel); compression->appendOption(kParamOutputCompressionPxr24, kParamOutputCompressionPxr24Label); compression->appendOption(kParamOutputCompressionB44, kParamOutputCompressionB44Label); compression->appendOption(kParamOutputCompressionB44a, kParamOutputCompressionB44aLabel); compression->appendOption(kParamOutputCompressionLZW, kParamOutputCompressionLZWLabel); compression->appendOption(kParamOutputCompressionCCITTRLE, kParamOutputCompressionCCITTRLELabel); compression->appendOption(kParamOutputCompressionPACKBITS, kParamOutputCompressionPACKBITSLabel); compression->setDefault(eParamCompressionAuto); page->addChild(*compression); GenericWriterDescribeInContextEnd(desc, context, page); }