From 1dec23d33a86c0412852ef510fc5b5b619284697 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Jun 2012 15:05:42 +0000 Subject: add rgb_to_luma_y(), was being done inline in many places. --- source/blender/compositor/operations/COM_GlareThresholdOperation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/compositor/operations/COM_GlareThresholdOperation.cpp') diff --git a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp index 4ca5f575cfe..ea76e7551ad 100644 --- a/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp +++ b/source/blender/compositor/operations/COM_GlareThresholdOperation.cpp @@ -37,7 +37,7 @@ void GlareThresholdOperation::initExecution() void GlareThresholdOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { this->inputProgram->read(color, x, y, sampler, inputBuffers); - if ((0.212671f * color[0] + 0.71516f * color[1] + 0.072169f * color[2]) >= threshold) { + 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); -- cgit v1.2.3