MCPcopy Create free account
hub / github.com/NatronGitHub/openfx-misc / PLogLinPlugin

Method PLogLinPlugin

PLogLin/PLogLin.cpp:456–507  ·  view source on GitHub ↗

@brief ctor */

Source from the content-addressed store, hash-verified

454
455 /** @brief ctor */
456 PLogLinPlugin(OfxImageEffectHandle handle)
457 : ImageEffect(handle)
458 , _dstClip(NULL)
459 , _srcClip(NULL)
460 , _maskClip(NULL)
461 , _processR(NULL)
462 , _processG(NULL)
463 , _processB(NULL)
464 , _operation(NULL)
465 , _linRef(NULL)
466 , _logRef(NULL)
467 , _nGamma(NULL)
468 , _density(NULL)
469 , _premult(NULL)
470 , _premultChannel(NULL)
471 , _mix(NULL)
472 , _maskApply(NULL)
473 , _maskInvert(NULL)
474 {
475
476 _dstClip = fetchClip(kOfxImageEffectOutputClipName);
477 assert( _dstClip && (_dstClip->getPixelComponents() == ePixelComponentRGB ||
478 _dstClip->getPixelComponents() == ePixelComponentRGBA) );
479 _srcClip = getContext() == eContextGenerator ? NULL : fetchClip(kOfxImageEffectSimpleSourceClipName);
480 assert( (!_srcClip && getContext() == eContextGenerator) ||
481 ( _srcClip && (_srcClip->getPixelComponents() == ePixelComponentRGB ||
482 _srcClip->getPixelComponents() == ePixelComponentRGBA) ) );
483 _maskClip = fetchClip(getContext() == eContextPaint ? "Brush" : "Mask");
484 assert(!_maskClip || _maskClip->getPixelComponents() == ePixelComponentAlpha);
485
486 // TODO: fetch noise parameters
487
488 _premult = fetchBooleanParam(kParamPremult);
489 _premultChannel = fetchChoiceParam(kParamPremultChannel);
490 assert(_premult && _premultChannel);
491 _mix = fetchDoubleParam(kParamMix);
492 _maskApply = ( ofxsMaskIsAlwaysConnected( OFX::getImageEffectHostDescription() ) && paramExists(kParamMaskApply) ) ? fetchBooleanParam(kParamMaskApply) : 0;
493 _maskInvert = fetchBooleanParam(kParamMaskInvert);
494 assert(_mix && _maskInvert);
495
496 _processR = fetchBooleanParam(kParamProcessR);
497 _processG = fetchBooleanParam(kParamProcessG);
498 _processB = fetchBooleanParam(kParamProcessB);
499 assert(_processR && _processG && _processB);
500
501 _operation = fetchChoiceParam(kParamOperation);
502 _linRef = fetchRGBParam(kParamLinRef);
503 _logRef = fetchRGBParam(kParamLogRef);
504 _nGamma = fetchRGBParam(kParamNGamma);
505 _density = fetchRGBParam(kParamDensity);
506 assert(_operation && _linRef && _logRef && _nGamma && _density);
507 }
508
509private:
510 /* Override the render */

Callers

nothing calls this directly

Calls 1

getContextFunction · 0.85

Tested by

no test coverage detected