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-10-23 20:32:39 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-23 20:32:39 +0400
commite038a1c613009d81adda0662dbb1e4a38228909a (patch)
treebe5851f67fda72085c51abd762fb81dd521f1e05 /source/blender/compositor/operations/COM_KeyingOperation.cpp
parentfec81d9b56075f46f6dde196ac85140872cff74e (diff)
reduce float comparisons for keying operation and despill.
Diffstat (limited to 'source/blender/compositor/operations/COM_KeyingOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_KeyingOperation.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingOperation.cpp b/source/blender/compositor/operations/COM_KeyingOperation.cpp
index bc2d14d42b8..dcb15eda638 100644
--- a/source/blender/compositor/operations/COM_KeyingOperation.cpp
+++ b/source/blender/compositor/operations/COM_KeyingOperation.cpp
@@ -28,18 +28,6 @@
#include "BLI_listbase.h"
#include "BLI_math.h"
-static int get_pixel_primary_channel(float pixel[3])
-{
- float max_value = max(max(pixel[0], pixel[1]), pixel[2]);
-
- if (max_value == pixel[0])
- return 0;
- else if (max_value == pixel[1])
- return 1;
-
- return 2;
-}
-
static float get_pixel_saturation(float pixelColor[4], float screen_balance, int primary_channel)
{
int other_1 = (primary_channel + 1) % 3;
@@ -85,7 +73,7 @@ void KeyingOperation::executePixel(float output[4], float x, float y, PixelSampl
this->m_pixelReader->read(pixelColor, x, y, sampler);
this->m_screenReader->read(screenColor, x, y, sampler);
- int primary_channel = get_pixel_primary_channel(screenColor);
+ const int primary_channel = axis_primary_v3(screenColor);
if (pixelColor[primary_channel] > 1.0f) {
/* overexposure doesn't happen on screen itself and usually happens