diff options
Diffstat (limited to 'source/blender/compositor/operations/COM_GlareThresholdOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_GlareThresholdOperation.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp index bb4e224c720..1c7d2659c39 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp @@ -42,19 +42,19 @@ void GlareThresholdOperation::initExecution() this->m_inputProgram = this->getInputSocketReader(0); } -void GlareThresholdOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void GlareThresholdOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { const float threshold = this->m_settings->threshold; - this->m_inputProgram->read(color, x, y, sampler); - if (rgb_to_luma_y(color) >= threshold) { - color[0] -= threshold, color[1] -= threshold, color[2] -= threshold; - color[0] = MAX2(color[0], 0.0f); - color[1] = MAX2(color[1], 0.0f); - color[2] = MAX2(color[2], 0.0f); + this->m_inputProgram->read(output, x, y, sampler); + if (rgb_to_luma_y(output) >= threshold) { + output[0] -= threshold, output[1] -= threshold, output[2] -= threshold; + output[0] = max(output[0], 0.0f); + output[1] = max(output[1], 0.0f); + output[2] = max(output[2], 0.0f); } else { - zero_v3(color); + zero_v3(output); } } |