diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 18:07:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 18:07:24 +0400 |
commit | 94a3945cf9de0913b75f83b26e2e62b3bc1b0c07 (patch) | |
tree | 89aeabd20d883137b69815d9580f3bc108531a7e /source/blender/compositor/operations/COM_GlareThresholdOperation.cpp | |
parent | e8772477894a6fd8c09488b488fdcc1af432da1b (diff) |
code cleanup: compositor - define size for executePixel function output float array
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); } } |