diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-22 11:49:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-22 11:49:44 +0400 |
commit | 226c86ae58cdf292fd415db05c05fba46375738d (patch) | |
tree | 3f002f89da94cc0428529f469175c311d0341561 /source/blender/compositor | |
parent | ec3399efa6882ea5a8fe023092c0918ee7b135d9 (diff) |
use an inline function for rgb -> bw conversion.
Diffstat (limited to 'source/blender/compositor')
3 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp b/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp index 8ef7605c21a..fe6be55e237 100644 --- a/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp +++ b/source/blender/compositor/operations/COM_CalculateMeanOperation.cpp @@ -97,7 +97,7 @@ void CalculateMeanOperation::calculateMean(MemoryBuffer *tile) { case 1: { - sum += buffer[offset] * 0.35f + buffer[offset + 1] * 0.45f + buffer[offset + 2] * 0.2f; + sum += rgb_to_bw(&buffer[offset]); break; } case 2: diff --git a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp index 75f4ac88d0a..811975c5e13 100644 --- a/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp +++ b/source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp @@ -56,7 +56,7 @@ void *CalculateStandardDeviationOperation::initializeTileData(rcti *rect, Memory { case 1: { - float value = buffer[offset] * 0.35f + buffer[offset + 1] * 0.45f + buffer[offset + 2] * 0.2f; + float value = rgb_to_bw(&buffer[offset]); sum += (value - mean) * (value - mean); break; } diff --git a/source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp b/source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp index c66cb8df9be..0e2c1e29a1d 100644 --- a/source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp +++ b/source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp @@ -38,7 +38,7 @@ void ConvertColorToBWOperation::executePixel(float *outputValue, float x, float { float inputColor[4]; inputOperation->read(&inputColor[0], x, y, sampler, inputBuffers); - outputValue[0] = inputColor[0] * 0.35f + inputColor[1] * 0.45f + inputColor[2] * 0.2f; + outputValue[0] = rgb_to_bw(inputColor); } void ConvertColorToBWOperation::deinitExecution() |