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

Method KeyMixPlugin

KeyMix/KeyMix.cpp:243–271  ·  view source on GitHub ↗

@brief ctor */

Source from the content-addressed store, hash-verified

241public:
242 /** @brief ctor */
243 KeyMixPlugin(OfxImageEffectHandle handle)
244 : ImageEffect(handle)
245 , _dstClip(NULL)
246 , _srcClipA(NULL)
247 , _srcClipB(NULL)
248 , _maskClip(NULL)
249 {
250
251 _dstClip = fetchClip(kOfxImageEffectOutputClipName);
252 assert( _dstClip && (!_dstClip->isConnected() || _dstClip->getPixelComponents() == ePixelComponentRGB || _dstClip->getPixelComponents() == ePixelComponentRGBA || _dstClip->getPixelComponents() == ePixelComponentAlpha) );
253 _srcClipA = fetchClip(kClipA);
254 assert( _srcClipA && (!_srcClipA->isConnected() || _srcClipA->getPixelComponents() == ePixelComponentRGB || _srcClipA->getPixelComponents() == ePixelComponentRGBA || _srcClipA->getPixelComponents() == ePixelComponentAlpha) );
255
256
257 _srcClipB = fetchClip(kClipB);
258 assert( _srcClipB && (!_srcClipB->isConnected() || _srcClipB->getPixelComponents() == ePixelComponentRGB || _srcClipB->getPixelComponents() == ePixelComponentRGBA || _srcClipB->getPixelComponents() == ePixelComponentAlpha) );
259 _maskClip = fetchClip(getContext() == eContextPaint ? "Brush" : "Mask");
260 assert(!_maskClip || !_maskClip->isConnected() || _maskClip->getPixelComponents() == ePixelComponentAlpha);
261 _mix = fetchDoubleParam(kParamMix);
262 _maskApply = ( ofxsMaskIsAlwaysConnected( OFX::getImageEffectHostDescription() ) && paramExists(kParamMaskApply) ) ? fetchBooleanParam(kParamMaskApply) : 0;
263 _maskInvert = fetchBooleanParam(kParamMaskInvert);
264 assert(_mix && _maskInvert);
265
266 _aChannels[0] = fetchBooleanParam(kParamProcessR);
267 _aChannels[1] = fetchBooleanParam(kParamProcessG);
268 _aChannels[2] = fetchBooleanParam(kParamProcessB);
269 _aChannels[3] = fetchBooleanParam(kParamProcessA);
270 assert(_aChannels[0] && _aChannels[1] && _aChannels[2] && _aChannels[3]);
271 }
272
273private:
274 // override the rod call

Callers

nothing calls this directly

Calls 2

getContextFunction · 0.85
isConnectedMethod · 0.80

Tested by

no test coverage detected