Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_SetAlphaOperation.cpp
| Show All 33 Lines | void SetAlphaOperation::initExecution() | ||||
| this->m_inputAlpha = getInputSocketReader(1); | this->m_inputAlpha = getInputSocketReader(1); | ||||
| } | } | ||||
| void SetAlphaOperation::executePixelSampled(float output[4], | void SetAlphaOperation::executePixelSampled(float output[4], | ||||
| float x, | float x, | ||||
| float y, | float y, | ||||
| PixelSampler sampler) | PixelSampler sampler) | ||||
| { | { | ||||
| float alphaInput[4]; | float color_input[4]; | ||||
| float alpha_input[4]; | |||||
| this->m_inputColor->readSampled(output, x, y, sampler); | this->m_inputColor->readSampled(color_input, x, y, sampler); | ||||
| this->m_inputAlpha->readSampled(alphaInput, x, y, sampler); | this->m_inputAlpha->readSampled(alpha_input, x, y, sampler); | ||||
| output[3] = alphaInput[0]; | mul_v4_v4fl(output, color_input, alpha_input[0]); | ||||
| } | } | ||||
| void SetAlphaOperation::deinitExecution() | void SetAlphaOperation::deinitExecution() | ||||
| { | { | ||||
| this->m_inputColor = nullptr; | this->m_inputColor = nullptr; | ||||
| this->m_inputAlpha = nullptr; | this->m_inputAlpha = nullptr; | ||||
| } | } | ||||