diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-23 20:21:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-23 20:21:55 +0400 |
commit | fec81d9b56075f46f6dde196ac85140872cff74e (patch) | |
tree | 6ee12fcc0b04ba3041f1b7e4d17281136375beb1 /source/blender/compositor/operations/COM_KeyingOperation.cpp | |
parent | c623ba5e4b2aa68a5717ba17500c14217bc417aa (diff) |
use min_ max_ functions in more places.
also fix minor error in MOD decimate when the modifier did nothing the reported face count would be wrong.
Diffstat (limited to 'source/blender/compositor/operations/COM_KeyingOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_KeyingOperation.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingOperation.cpp b/source/blender/compositor/operations/COM_KeyingOperation.cpp index 35138cf0b92..bc2d14d42b8 100644 --- a/source/blender/compositor/operations/COM_KeyingOperation.cpp +++ b/source/blender/compositor/operations/COM_KeyingOperation.cpp @@ -28,13 +28,13 @@ #include "BLI_listbase.h" #include "BLI_math.h" -static int get_pixel_primary_channel(float pixelColor[4]) +static int get_pixel_primary_channel(float pixel[3]) { - float max_value = MAX3(pixelColor[0], pixelColor[1], pixelColor[2]); + float max_value = max(max(pixel[0], pixel[1]), pixel[2]); - if (max_value == pixelColor[0]) + if (max_value == pixel[0]) return 0; - else if (max_value == pixelColor[1]) + else if (max_value == pixel[1]) return 1; return 2; @@ -45,8 +45,8 @@ static float get_pixel_saturation(float pixelColor[4], float screen_balance, int int other_1 = (primary_channel + 1) % 3; int other_2 = (primary_channel + 2) % 3; - int min_channel = MIN2(other_1, other_2); - int max_channel = MAX2(other_1, other_2); + int min_channel = min(other_1, other_2); + int max_channel = max(other_1, other_2); float val = screen_balance * pixelColor[min_channel] + (1.0f - screen_balance) * pixelColor[max_channel]; |