diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 18:07:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 18:07:24 +0400 |
commit | 94a3945cf9de0913b75f83b26e2e62b3bc1b0c07 (patch) | |
tree | 89aeabd20d883137b69815d9580f3bc108531a7e /source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp | |
parent | e8772477894a6fd8c09488b488fdcc1af432da1b (diff) |
code cleanup: compositor - define size for executePixel function output float array
Diffstat (limited to 'source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp index b94486b5b4f..111dc899e1d 100644 --- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp +++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp @@ -27,7 +27,7 @@ AlphaOverMixedOperation::AlphaOverMixedOperation() : MixBaseOperation() this->m_x = 0.0f; } -void AlphaOverMixedOperation::executePixel(float outputValue[4], float x, float y, PixelSampler sampler) +void AlphaOverMixedOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { float inputColor1[4]; float inputOverColor[4]; @@ -38,20 +38,20 @@ void AlphaOverMixedOperation::executePixel(float outputValue[4], float x, float this->m_inputColor2Operation->read(inputOverColor, x, y, sampler); if (inputOverColor[3] <= 0.0f) { - copy_v4_v4(outputValue, inputColor1); + copy_v4_v4(output, inputColor1); } else if (value[0] == 1.0f && inputOverColor[3] >= 1.0f) { - copy_v4_v4(outputValue, inputOverColor); + copy_v4_v4(output, inputOverColor); } else { float addfac = 1.0f - this->m_x + inputOverColor[3] * this->m_x; float premul = value[0] * addfac; float mul = 1.0f - value[0] * inputOverColor[3]; - outputValue[0] = (mul * inputColor1[0]) + premul * inputOverColor[0]; - outputValue[1] = (mul * inputColor1[1]) + premul * inputOverColor[1]; - outputValue[2] = (mul * inputColor1[2]) + premul * inputOverColor[2]; - outputValue[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3]; + output[0] = (mul * inputColor1[0]) + premul * inputOverColor[0]; + output[1] = (mul * inputColor1[1]) + premul * inputOverColor[1]; + output[2] = (mul * inputColor1[2]) + premul * inputOverColor[2]; + output[3] = (mul * inputColor1[3]) + value[0] * inputOverColor[3]; } } |