Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-06-22 11:49:44 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-22 11:49:44 +0400
commit226c86ae58cdf292fd415db05c05fba46375738d (patch)
tree3f002f89da94cc0428529f469175c311d0341561 /source/blender/compositor/operations
parentec3399efa6882ea5a8fe023092c0918ee7b135d9 (diff)
use an inline function for rgb -> bw conversion.
Diffstat (limited to 'source/blender/compositor/operations')
-rw-r--r--source/blender/compositor/operations/COM_CalculateMeanOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_CalculateStandardDeviationOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_ConvertColorToBWOperation.cpp2
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()