diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-22 14:50:17 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-22 14:50:17 +0300 |
commit | 5d2b3a966eb2bce71c1effb4c79cf0f23c1d5bf5 (patch) | |
tree | 3d16bf1c7727eb29739863bf788200199bf9200a /source/blender/compositor | |
parent | 4e6f86942cd4f99e73e81e3cc7fa00aa16932986 (diff) | |
parent | 69b5165902d3e433af5b3ece633903162cbc292a (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/compositor')
-rw-r--r-- | source/blender/compositor/operations/COM_KeyingOperation.cpp | 17 |
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, |