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_MaskOperation.cpp | |
parent | e8772477894a6fd8c09488b488fdcc1af432da1b (diff) |
code cleanup: compositor - define size for executePixel function output float array
Diffstat (limited to 'source/blender/compositor/operations/COM_MaskOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_MaskOperation.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/compositor/operations/COM_MaskOperation.cpp b/source/blender/compositor/operations/COM_MaskOperation.cpp index 46d31eeabf7..a156dfc1d99 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.cpp +++ b/source/blender/compositor/operations/COM_MaskOperation.cpp @@ -127,29 +127,30 @@ void MaskOperation::determineResolution(unsigned int resolution[2], unsigned int } } -void MaskOperation::executePixel(float *color, float x, float y, PixelSampler sampler) +void MaskOperation::executePixel(float output[4], float x, float y, PixelSampler sampler) { - const float xy[2] = {x * this->m_maskWidthInv, y * this->m_maskHeightInv}; + const float xy[2] = {x * this->m_maskWidthInv, + y * this->m_maskHeightInv}; if (this->m_rasterMaskHandleTot == 1) { if (this->m_rasterMaskHandles[0]) { - color[0] = BKE_maskrasterize_handle_sample(this->m_rasterMaskHandles[0], xy); + output[0] = BKE_maskrasterize_handle_sample(this->m_rasterMaskHandles[0], xy); } else { - color[0] = 0.0f; + output[0] = 0.0f; } } else { /* incase loop below fails */ - color[0] = 0.0f; + output[0] = 0.0f; for (unsigned int i = 0; i < this->m_rasterMaskHandleTot; i++) { if (this->m_rasterMaskHandles[i]) { - color[0] += BKE_maskrasterize_handle_sample(this->m_rasterMaskHandles[i], xy); + output[0] += BKE_maskrasterize_handle_sample(this->m_rasterMaskHandles[i], xy); } } /* until we get better falloff */ - color[0] /= this->m_rasterMaskHandleTot; + output[0] /= this->m_rasterMaskHandleTot; } } |