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:
Diffstat (limited to 'source/blender/compositor/operations/COM_KeyingOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_KeyingOperation.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingOperation.cpp b/source/blender/compositor/operations/COM_KeyingOperation.cpp
index e2566d2f4f0..fa0ef70fca6 100644
--- a/source/blender/compositor/operations/COM_KeyingOperation.cpp
+++ b/source/blender/compositor/operations/COM_KeyingOperation.cpp
@@ -67,15 +67,16 @@ void KeyingOperation::deinitExecution()
void KeyingOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
{
- float pixelColor[4];
- float screenColor[4];
+ float pixel_color[4];
+ float screen_color[4];
- this->m_pixelReader->readSampled(pixelColor, x, y, sampler);
- this->m_screenReader->readSampled(screenColor, x, y, sampler);
+ this->m_pixelReader->readSampled(pixel_color, x, y, sampler);
+ this->m_screenReader->readSampled(screen_color, x, y, sampler);
- const int primary_channel = max_axis_v3(screenColor);
+ const int primary_channel = max_axis_v3(screen_color);
+ const float min_pixel_color = min_fff(pixel_color[0], pixel_color[1], pixel_color[2]);
- if (pixelColor[primary_channel] > 1.0f) {
+ if (min_pixel_color > 1.0f) {
/* overexposure doesn't happen on screen itself and usually happens
* on light sources in the shot, this need to be checked separately
* because saturation and falloff calculation is based on the fact
@@ -84,8 +85,8 @@ void KeyingOperation::executePixelSampled(float output[4], float x, float y, Pix
output[0] = 1.0f;
}
else {
- float saturation = get_pixel_saturation(pixelColor, this->m_screenBalance, primary_channel);
- float screen_saturation = get_pixel_saturation(screenColor, this->m_screenBalance, primary_channel);
+ float saturation = get_pixel_saturation(pixel_color, this->m_screenBalance, primary_channel);
+ float screen_saturation = get_pixel_saturation(screen_color, this->m_screenBalance, primary_channel);
if (saturation < 0) {
/* means main channel of pixel is different from screen,