Ejemplo n.º 1
0
ImageStatisticsPlugin::ImageStatisticsPlugin( OfxImageEffectHandle handle )
	: ImageEffectGilPlugin( handle )
{
	_paramCoordinateSystem = fetchChoiceParam( kParamCoordinateSystem );
	_paramRectCenter       = fetchDouble2DParam( kParamRectCenter );
	_paramRectSize         = fetchDouble2DParam( kParamRectSize );
	_paramChooseOutput     = fetchChoiceParam( kParamChooseOutput );

	_paramOutputAverage       = fetchRGBAParam( kParamOutputAverage );
	_paramOutputVariance      = fetchRGBAParam( kParamOutputVariance );
	_paramOutputChannelMin    = fetchRGBAParam( kParamOutputChannelMin );
	_paramOutputChannelMax    = fetchRGBAParam( kParamOutputChannelMax );
	_paramOutputLuminosityMin = fetchRGBAParam( kParamOutputLuminosityMin );
	_paramOutputLuminosityMax = fetchRGBAParam( kParamOutputLuminosityMax );
	_paramOutputKurtosis      = fetchRGBAParam( kParamOutputKurtosis );
	_paramOutputSkewness      = fetchRGBAParam( kParamOutputSkewness );

	_paramOutputAverageHSL       = fetchDouble3DParam( kParamOutputAverageHSL );
	_paramOutputChannelMinHSL    = fetchDouble3DParam( kParamOutputChannelMinHSL );
	_paramOutputChannelMaxHSL    = fetchDouble3DParam( kParamOutputChannelMaxHSL );
	_paramOutputLuminosityMinHSL = fetchDouble3DParam( kParamOutputLuminosityMinHSL );
	_paramOutputLuminosityMaxHSL = fetchDouble3DParam( kParamOutputLuminosityMaxHSL );
	_paramOutputKurtosisHSL      = fetchDouble3DParam( kParamOutputKurtosisHSL );
	_paramOutputSkewnessHSL      = fetchDouble3DParam( kParamOutputSkewnessHSL );
}
Ejemplo n.º 2
0
ImageStatisticsPlugin::ImageStatisticsPlugin( OfxImageEffectHandle handle )
	: ImageEffectGilPlugin( handle )
{
	_clipMask = fetchClip( kClipMask );

	_paramRestrictToRegion = fetchBooleanParam( kParamRestrictToRegion );

	_paramCoordinateSystem = fetchChoiceParam( kParamCoordinateSystem );
	_paramRectCenter       = fetchDouble2DParam( kParamRectCenter );
	_paramRectSize         = fetchDouble2DParam( kParamRectSize );
	_paramChooseOutput     = fetchChoiceParam( kParamChooseOutput );

	_paramOutputNbPixels = fetchIntParam( kParamOutputNbPixels );
	
	_paramOutputAverage       = fetchRGBAParam( kParamOutputAverage );
	_paramOutputVariance      = fetchRGBAParam( kParamOutputVariance );
	_paramOutputChannelMin    = fetchRGBAParam( kParamOutputChannelMin );
	_paramOutputChannelMax    = fetchRGBAParam( kParamOutputChannelMax );
	_paramOutputLuminosityMin = fetchRGBAParam( kParamOutputLuminosityMin );
	_paramOutputLuminosityMax = fetchRGBAParam( kParamOutputLuminosityMax );
	_paramOutputKurtosis      = fetchRGBAParam( kParamOutputKurtosis );
	_paramOutputSkewness      = fetchRGBAParam( kParamOutputSkewness );

	_paramOutputAverageHSL       = fetchDouble3DParam( kParamOutputAverageHSL );
	_paramOutputVarianceHSL      = fetchDouble3DParam( kParamOutputVarianceHSL );
	_paramOutputChannelMinHSL    = fetchDouble3DParam( kParamOutputChannelMinHSL );
	_paramOutputChannelMaxHSL    = fetchDouble3DParam( kParamOutputChannelMaxHSL );
	_paramOutputLuminosityMinHSL = fetchDouble3DParam( kParamOutputLuminosityMinHSL );
	_paramOutputLuminosityMaxHSL = fetchDouble3DParam( kParamOutputLuminosityMaxHSL );
	_paramOutputKurtosisHSL      = fetchDouble3DParam( kParamOutputKurtosisHSL );
	_paramOutputSkewnessHSL      = fetchDouble3DParam( kParamOutputSkewnessHSL );
	
	OFX::InstanceChangedArgs args( this->timeLineGetTime() );
	changedParam( args, kParamRestrictToRegion );
}
Ejemplo n.º 3
0
ComponentPlugin::ComponentPlugin( OfxImageEffectHandle handle )
: ImageEffectGilPlugin( handle )
{
//    _clipSrcMatte = fetchClip( kClipMatte );
	_paramToComponent   = fetchChoiceParam( kParamTo );
	_paramToGrayMethod  = fetchChoiceParam( kParamToGray );
	_paramPremultiplied = fetchBooleanParam( kParamPremutliplied );
}
Ejemplo n.º 4
0
PrintPlugin::PrintPlugin( OfxImageEffectHandle handle )
: ImageEffectGilPlugin( handle )
{
	_paramMode = fetchChoiceParam( kParamMode );
	_paramOutput = fetchChoiceParam( kParamOutput );
	_paramPixel = fetchInt2DParam( kParamPixel );
	_paramRegionMin = fetchInt2DParam( kParamRegionMin );
	_paramRegionMax = fetchInt2DParam( kParamRegionMax );
	_paramFlip = fetchBooleanParam( kParamFlip );
}
Ejemplo n.º 5
0
ReaderPlugin::ReaderPlugin(OfxImageEffectHandle handle)
    : OFX::ImageEffect(handle)
    , _isSequence(false)
    , _filePattern()
{
    _clipDst = fetchClip(kOfxImageEffectOutputClipName);
    _paramFilepath = fetchStringParam(kTuttlePluginFilename);
    _isSequence = sequenceParser::browseSequence(_filePattern, _paramFilepath->getValue());
    _paramBitDepth = fetchChoiceParam(kTuttlePluginBitDepth);
    _paramChannel = fetchChoiceParam(kTuttlePluginChannel);
}
Ejemplo n.º 6
0
PrintPlugin::PrintPlugin( OfxImageEffectHandle handle )
: ImageEffectGilPlugin( handle )
{
        _paramMode          = fetchChoiceParam ( kParamMode );
        _paramOutput        = fetchChoiceParam ( kParamOutput );
        _paramColor         = fetchChoiceParam ( kParamColor );
        _paramPixel         = fetchInt2DParam  ( kParamPixel );
        _paramRegionMin     = fetchInt2DParam  ( kParamRegionMin );
        _paramRegionMax     = fetchInt2DParam  ( kParamRegionMax );
        _paramOutputColumns = fetchIntParam    ( kParamColumns );
        _paramFlip          = fetchBooleanParam( kParamFlip );
        _paramOpenGlWindow  = fetchBooleanParam( kParamOutputOpenGL );

        updateParams( );
}
Ejemplo n.º 7
0
CImgFilterPluginHelperBase::CImgFilterPluginHelperBase(OfxImageEffectHandle handle,
                                                       bool supportsComponentRemapping, // true if the number and order of components of the image passed to render() has no importance
                                                       bool supportsTiles,
                                                       bool supportsMultiResolution,
                                                       bool supportsRenderScale,
                                                       bool defaultUnpremult/* = true*/,
                                                       bool defaultProcessAlphaOnRGBA/* = false*/,
                                                       bool isFilter/* = true*/)
: ImageEffect(handle)
, _dstClip(0)
, _srcClip(0)
, _maskClip(0)
, _processR(0)
, _processG(0)
, _processB(0)
, _processA(0)
, _premult(0)
, _premultChannel(0)
, _mix(0)
, _maskApply(0)
, _maskInvert(0)
, _supportsComponentRemapping(supportsComponentRemapping)
, _supportsTiles(supportsTiles)
, _supportsMultiResolution(supportsMultiResolution)
, _supportsRenderScale(supportsRenderScale)
, _defaultUnpremult(defaultUnpremult)
, _defaultProcessAlphaOnRGBA(defaultProcessAlphaOnRGBA)
, _premultChanged(0)
{
    _dstClip = fetchClip(kOfxImageEffectOutputClipName);
    assert(_dstClip && (_dstClip->getPixelComponents() == OFX::ePixelComponentRGB ||
                        _dstClip->getPixelComponents() == OFX::ePixelComponentRGBA));
    if (isFilter) {
        _srcClip = getContext() == OFX::eContextGenerator ? NULL : fetchClip(kOfxImageEffectSimpleSourceClipName);
        assert((!_srcClip && getContext() == OFX::eContextGenerator) ||
               (_srcClip && (_srcClip->getPixelComponents() == OFX::ePixelComponentRGB ||
                             _srcClip->getPixelComponents() == OFX::ePixelComponentRGBA)));
        _maskClip = fetchClip(getContext() == OFX::eContextPaint ? "Brush" : "Mask");
        assert(!_maskClip || _maskClip->getPixelComponents() == OFX::ePixelComponentAlpha);
    }

    if (paramExists(kNatronOfxParamProcessR)) {
        _processR = fetchBooleanParam(kNatronOfxParamProcessR);
        _processG = fetchBooleanParam(kNatronOfxParamProcessG);
        _processB = fetchBooleanParam(kNatronOfxParamProcessB);
        _processA = fetchBooleanParam(kNatronOfxParamProcessA);
        assert(_processR && _processG && _processB && _processA);
    }
    _premult = fetchBooleanParam(kParamPremult);
    _premultChannel = fetchChoiceParam(kParamPremultChannel);
    assert(_premult && _premultChannel);
    _mix = fetchDoubleParam(kParamMix);
    _maskApply = paramExists(kParamMaskApply) ? fetchBooleanParam(kParamMaskApply) : 0;
    _maskInvert = fetchBooleanParam(kParamMaskInvert);
    assert(_mix && _maskInvert);
    _premultChanged = fetchBooleanParam(kParamPremultChanged);
    assert(_premultChanged);
}
Ejemplo n.º 8
0
ColorGradationPlugin::ColorGradationPlugin( OfxImageEffectHandle handle )
	: ImageEffectGilPlugin( handle )
{
	_paramIn              = fetchChoiceParam( kParamIn );
	_paramOut             = fetchChoiceParam( kParamOut );

	_paramInGamma         = fetchDoubleParam( kColorSpaceInGammaValue    );
	_paramOutGamma        = fetchDoubleParam( kColorSpaceOutGammaValue   );
	_paramInBlackPoint    = fetchDoubleParam( kColorSpaceInBlackPoint    );
	_paramOutBlackPoint   = fetchDoubleParam( kColorSpaceOutBlackPoint   );
	_paramInWhitePoint    = fetchDoubleParam( kColorSpaceInWhitePoint    );
	_paramOutWhitePoint   = fetchDoubleParam( kColorSpaceOutWhitePoint   );
	_paramInGammaSensito  = fetchDoubleParam( kColorSpaceInGammaSensito  );
	_paramOutGammaSensito = fetchDoubleParam( kColorSpaceOutGammaSensito );

	_paramProcessAlpha    = fetchBooleanParam( kParamProcessAlpha );
	updateParameters();
}
Ejemplo n.º 9
0
ReaderPlugin::ReaderPlugin( OfxImageEffectHandle handle )
	: OFX::ImageEffect( handle )
{
	_clipDst           = fetchClip( kOfxImageEffectOutputClipName );
	_paramFilepath     = fetchStringParam( kParamReaderFilename );
	_isSequence        = _filePattern.initFromDetection( _paramFilepath->getValue() );
	_paramExplicitConv = fetchChoiceParam( kParamReaderExplicitConversion );
	_paramFlip         = fetchBooleanParam( kParamReaderFlip );
}
Ejemplo n.º 10
0
MathOperatorPlugin::MathOperatorPlugin( OfxImageEffectHandle handle )
: ImageEffectGilPlugin( handle )
{
	_operator        = fetchChoiceParam( kMathOperatorOperator );
	_mathOperatorType   = fetchChoiceParam( kMathOperatorType );

	_master          = fetchDoubleParam( kMasterValue );
	_red             = fetchDoubleParam( kRedValue );
	_green           = fetchDoubleParam( kGreenValue );
	_blue            = fetchDoubleParam( kBlueValue );
	_alpha           = fetchDoubleParam( kAlphaValue );

	_redSelect       = fetchBooleanParam( kRedChannel );
	_greenSelect     = fetchBooleanParam( kGreenChannel );
	_blueSelect      = fetchBooleanParam( kBlueChannel );
	_alphaSelect     = fetchBooleanParam( kAlphaChannel );

	updateInterface();
}
Ejemplo n.º 11
0
DiffPlugin::DiffPlugin( OfxImageEffectHandle handle )
	: OFX::ImageEffect( handle )
{
	_clipSrcA = fetchClip( kDiffSourceA );
	_clipSrcB = fetchClip( kDiffSourceB );
	_clipDst  = fetchClip( kOfxImageEffectOutputClipName );

	_measureFunction = fetchChoiceParam ( kMeasureFunction );
	_qualityMesure   = fetchRGBAParam( kOutputQualityMesure );
}
Ejemplo n.º 12
0
SeExprPlugin::SeExprPlugin(OfxImageEffectHandle handle)
    : GeneratorPlugin(handle)
{
    _paramInput = fetchChoiceParam(kParamChooseInput);
    _paramCode = fetchStringParam(kParamSeExprCode);
    _paramFile = fetchStringParam(kTuttlePluginFilename);
    _paramTextureOffset = fetchDouble2DParam(kParamTextureOffset);

    changedParam(_instanceChangedArgs, kParamChooseInput);
}
Ejemplo n.º 13
0
/*
 * fecth plugin IHM parameters with plugin parameters pointer
 */
HistogramPlugin::HistogramPlugin(OfxImageEffectHandle handle)
    : ImageEffectGilPlugin(handle)
{
    _paramGlobalDisplaySelection = fetchBooleanParam(kGlobalDisplay); // global display

    _paramOverlayRSelection = fetchBooleanParam(kBoolRed);   // R (is channel selected?)
    _paramMutliplierR = fetchDoubleParam(kMultiplierRed);    // R multiplier
    _paramOverlayGSelection = fetchBooleanParam(kBoolGreen); // G (is channel selected?)
    _paramMutliplierG = fetchDoubleParam(kMultiplierGreen);  // G multiplier

    _paramOverlayBSelection = fetchBooleanParam(kBoolBlue); // B (is channel selected?)
    _paramMutliplierB = fetchDoubleParam(kMultiplierBlue);  // B multiplier

    _paramOverlayHSelection = fetchBooleanParam(kBoolHue);        // H (is channel selected?)
    _paramMutliplierH = fetchDoubleParam(kMultiplierHue);         // H multiplier
    _paramOverlaySSelection = fetchBooleanParam(kBoolSaturation); // S (is channel selected?)
    _paramMutliplierS = fetchDoubleParam(kMultiplierSaturation);  // S multiplier

    _paramOverlayLSelection = fetchBooleanParam(kBoolLightness); // L (is channel selected?)
    _paramMutliplierL = fetchDoubleParam(kMultiplierLightness);  // L multiplier

    _paramDisplayTypeSelection =
        fetchChoiceParam(kHistoDisplayListParamLabel); // histogram display list (Histogram overlay group)

    _paramDisplaySelection = fetchBooleanParam(kBoolSelection); // display selection on source clip (Selection group)
    _paramSelectionMode = fetchChoiceParam(kSelectionModeListParamLabel); // selection mode (Selection group)

    _paramSelectionMultiplierSelection = fetchDoubleParam(kselectionMultiplier); // selection multiplier (Advanced group)
    _paramRefreshOverlaySelection = fetchPushButtonParam(kButtonRefreshOverlay); // refresh overlay (Advanced group)
    _paramNbStepSelection = fetchIntParam(knbStepRange);                         // nb step range (Advanced group)

    // Reset param booleans
    _isCleaned = false;
    _isNbStepChanged = false;
    _isHistogramRefresh = false;

    // Initialize scoped pointer
    _overlayDataCount = 0;

    /// @todo: HACK to display curves default position
    OFX::InstanceChangedArgs changed(this->timeLineGetTime());
    changedClip(changed, kOfxImageEffectSimpleSourceClipName);
}
Ejemplo n.º 14
0
WriterPlugin::WriterPlugin( OfxImageEffectHandle handle )
	: ImageEffectGilPlugin( handle )
	, _oneRender( false )
	, _oneRenderAtTime( 0 )
	, _isSequence( false )
	, _filePattern()
{
	_clipSrc = fetchClip( kOfxImageEffectSimpleSourceClipName );
	_clipDst = fetchClip( kOfxImageEffectOutputClipName );
	_paramFilepath = fetchStringParam( kTuttlePluginFilename );
	_paramRenderButton = fetchPushButtonParam( kParamWriterRender );
	_paramRenderAlways = fetchBooleanParam( kParamWriterRenderAlways );
	_paramCopyToOutput = fetchBooleanParam( kParamWriterCopyToOutput );
	_paramBitDepth = fetchChoiceParam( kTuttlePluginBitDepth );
	_paramPremult = fetchBooleanParam( kParamPremultiplied );
	_paramExistingFile = fetchChoiceParam( kParamWriterExistingFile );
	_paramForceNewRender = fetchIntParam( kParamWriterForceNewRender );

	// update params
	changedParam( OFX::InstanceChangedArgs(), kTuttlePluginFilename );
}
Ejemplo n.º 15
0
WriterPlugin::WriterPlugin( OfxImageEffectHandle handle )
	: ImageEffectGilPlugin( handle )
	, _oneRender( false )
	, _oneRenderAtTime( 0 )
{
	_clipSrc             = fetchClip( kOfxImageEffectSimpleSourceClipName );
	_clipDst             = fetchClip( kOfxImageEffectOutputClipName );
	_paramFilepath       = fetchStringParam( kParamWriterFilename );
	_paramRenderButton   = fetchPushButtonParam( kParamWriterRender );
	_paramRenderAlways   = fetchBooleanParam( kParamWriterRenderAlways );
	_paramBitDepth       = fetchChoiceParam( kParamWriterBitDepth );
	_paramForceNewRender = fetchIntParam( kParamWriterForceNewRender );
	_paramFlip           = fetchBooleanParam( kParamWriterFlip );
	_isSequence          = _filePattern.initFromDetection( _paramFilepath->getValue() );
}
Ejemplo n.º 16
0
ThinningPlugin::ThinningPlugin( OfxImageEffectHandle handle )
: ImageEffectGilPlugin( handle )
{
	_paramBorder = fetchChoiceParam( kParamBorder );
}
Ejemplo n.º 17
0
ColorCubePlugin::ColorCubePlugin( OfxImageEffectHandle handle )
: GeneratorPlugin( handle )
{
    _step = fetchChoiceParam( kColorCubeStep );
}
Ejemplo n.º 18
0
RampPlugin::RampPlugin( OfxImageEffectHandle handle )
: GeneratorPlugin( handle )
{
    _direction = fetchChoiceParam( kRampDirection );
    _color = fetchBooleanParam( kRampColor );
}
Ejemplo n.º 19
0
TurboJpegReaderPlugin::TurboJpegReaderPlugin(OfxImageEffectHandle handle)
    : ReaderPlugin(handle)
{
    _optimization = fetchChoiceParam(kParamOptimization);
    _fastUpsampling = fetchBooleanParam(kParamFastUpsampling);
}