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-24 06:25:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-24 06:25:00 +0400
commit2da6039e63afa783d8c3c784ac5743dc876e7236 (patch)
treef0808cc6e8e8bfedc652f96f2dd2a05953b9dbf2 /source/blender/compositor/operations/COM_KeyingDespillOperation.cpp
parent9055ec3e0ae16b28dd95236ddfffbe5f8250e9fe (diff)
rename axis_primary_v3() to max_axis_v3() to avoid confusion with axis_dominant_v3(). also add min_axis_v3().
Diffstat (limited to 'source/blender/compositor/operations/COM_KeyingDespillOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_KeyingDespillOperation.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingDespillOperation.cpp b/source/blender/compositor/operations/COM_KeyingDespillOperation.cpp
index 73bc5fb2701..01f5c032730 100644
--- a/source/blender/compositor/operations/COM_KeyingDespillOperation.cpp
+++ b/source/blender/compositor/operations/COM_KeyingDespillOperation.cpp
@@ -61,7 +61,7 @@ void KeyingDespillOperation::executePixel(float output[4], float x, float y, Pix
this->m_pixelReader->read(pixelColor, x, y, sampler);
this->m_screenReader->read(screenColor, x, y, sampler);
- const int screen_primary_channel = axis_primary_v3(screenColor);
+ const int screen_primary_channel = max_axis_v3(screenColor);
const int other_1 = (screen_primary_channel + 1) % 3;
const int other_2 = (screen_primary_channel + 2) % 3;
@@ -75,7 +75,8 @@ void KeyingDespillOperation::executePixel(float output[4], float x, float y, Pix
copy_v4_v4(output, pixelColor);
- if (this->m_despillFactor * amount > 0) {
- output[screen_primary_channel] = pixelColor[screen_primary_channel] - this->m_despillFactor * amount;
+ const float amount_despill = this->m_despillFactor * amount;
+ if (amount_despill > 0.0f) {
+ output[screen_primary_channel] = pixelColor[screen_primary_channel] - amount_despill;
}
}