コード例 #1
0
ファイル: GenericWriter.cpp プロジェクト: sumitneup/openfx-io
/**
 * @brief Override this to describe in context the writer.
 * You should call the base-class version at the end like this:
 * GenericWriterPluginFactory<YOUR_FACTORY>::describeInContext(desc,context);
 **/
PageParamDescriptor*
GenericWriterDescribeInContextBegin(OFX::ImageEffectDescriptor &desc, OFX::ContextEnum context, bool isVideoStreamPlugin, bool supportsRGBA, bool supportsRGB, bool supportsAlpha, const char* inputSpaceNameDefault, const char* outputSpaceNameDefault)
{
    // create the mandated source clip
    ClipDescriptor *srcClip = desc.defineClip(kOfxImageEffectSimpleSourceClipName);
    if (supportsRGBA) {
        srcClip->addSupportedComponent(ePixelComponentRGBA);
    }
    if (supportsRGB) {
        srcClip->addSupportedComponent(ePixelComponentRGB);
    }
    if (supportsAlpha) {
        srcClip->addSupportedComponent(ePixelComponentAlpha);
    }
    srcClip->setSupportsTiles(false);

    // create the mandated output clip
    ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName);
    if (supportsRGBA) {
        dstClip->addSupportedComponent(ePixelComponentRGBA);
    }
    if (supportsRGB) {
        dstClip->addSupportedComponent(ePixelComponentRGB);
    }
    if (supportsAlpha) {
        dstClip->addSupportedComponent(ePixelComponentAlpha);
    }
    dstClip->setSupportsTiles(false);//< we don't support tiles in output!

    // make some pages and to things in
    PageParamDescriptor *page = desc.definePageParam("Controls");

    //////////Output file
    OFX::StringParamDescriptor* fileParam = desc.defineStringParam(kWriterFileParamName);
    fileParam->setLabels(kWriterFileParamLabel, kWriterFileParamLabel, kWriterFileParamLabel);
    fileParam->setStringType(OFX::eStringTypeFilePath);
    fileParam->setFilePathExists(false);
    fileParam->setHint(kWriterFileParamHint);
    // in the Writer context, the script name should be "filename", for consistency with the reader nodes @see kOfxImageEffectContextReader
    fileParam->setScriptName(kWriterFileParamName);
    fileParam->setAnimates(!isVideoStreamPlugin);
    desc.addClipPreferencesSlaveParam(*fileParam);

    page->addChild(*fileParam);

    // insert OCIO parameters
    GenericOCIO::describeInContext(desc, context, page, inputSpaceNameDefault, outputSpaceNameDefault);

    ///////////Frame range choosal
    OFX::ChoiceParamDescriptor* frameRangeChoiceParam = desc.defineChoiceParam(kWriterFrameRangeChoiceParamName);
    frameRangeChoiceParam->setLabels(kWriterFrameRangeChoiceParamLabel, kWriterFrameRangeChoiceParamLabel, kWriterFrameRangeChoiceParamLabel);
    frameRangeChoiceParam->setHint(kWriterFrameRangeChoiceParamHint);
    frameRangeChoiceParam->appendOption(kWriterFrameRangeChoiceParamOptionUnion, kWriterFrameRangeChoiceParamOptionUnionHint);
    frameRangeChoiceParam->appendOption(kWriterFrameRangeChoiceParamOptionBounds, kWriterFrameRangeChoiceParamOptionBoundsHint);
    frameRangeChoiceParam->appendOption(kWriterFrameRangeChoiceParamOptionManual, kWriterFrameRangeChoiceParamOptionManualHint);
    frameRangeChoiceParam->setAnimates(true);
    frameRangeChoiceParam->setDefault(0);
    page->addChild(*frameRangeChoiceParam);
    
    /////////////First frame
    OFX::IntParamDescriptor* firstFrameParam = desc.defineIntParam(kWriterFirstFrameParamName);
    firstFrameParam->setLabels(kWriterFirstFrameParamLabel, kWriterFirstFrameParamLabel, kWriterFirstFrameParamLabel);
    firstFrameParam->setIsSecret(true);
    firstFrameParam->setAnimates(true);
    page->addChild(*firstFrameParam);

    ////////////Last frame
    OFX::IntParamDescriptor* lastFrameParam = desc.defineIntParam(kWriterLastFrameParamName);
    lastFrameParam->setLabels(kWriterLastFrameParamLabel, kWriterLastFrameParamLabel, kWriterLastFrameParamLabel);
    lastFrameParam->setIsSecret(true);
    lastFrameParam->setAnimates(true);
    page->addChild(*lastFrameParam);


    return page;
}
コード例 #2
0
/**
 * @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" );
}
コード例 #3
0
ファイル: WriteOIIO.cpp プロジェクト: sumitneup/openfx-io
/** @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);
}