diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 00:04:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-13 00:04:55 +0400 |
commit | e1241030db424ce10e9fee04076ff7e209eac98c (patch) | |
tree | ac8e1a81a81fa130e166366c6b93587e77e4188f /source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp | |
parent | 7fec7070d7fcf7bde53768e555b40b57ef4a7552 (diff) |
yse BLI_math for the compositor in more places.
Diffstat (limited to 'source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp index a7e443838a9..e30cbfeff7e 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp @@ -99,19 +99,12 @@ void GaussianXBlurOperation::executePixel(float *color, int x, int y, MemoryBuff int bufferindex = ((minx - bufferstartx)*4)+((miny-bufferstarty)*4*bufferwidth); for (int nx = minx ; nx < maxx ; nx +=step) { index = (nx-x)+this->rad; - float multiplyer = gausstab[index]; - tempColor[0] += multiplyer * buffer[bufferindex]; - tempColor[1] += multiplyer * buffer[bufferindex+1]; - tempColor[2] += multiplyer * buffer[bufferindex+2]; - tempColor[3] += multiplyer * buffer[bufferindex+3]; + const float multiplyer = gausstab[index]; + madd_v4_v4fl(tempColor, &buffer[bufferindex], multiplyer); overallmultiplyer += multiplyer; - bufferindex +=offsetadd; + bufferindex += offsetadd; } - float divider = 1.0f / overallmultiplyer; - color[0] = tempColor[0] * divider; - color[1] = tempColor[1] * divider; - color[2] = tempColor[2] * divider; - color[3] = tempColor[3] * divider; + mul_v4_v4fl(color, tempColor, 1.0f / overallmultiplyer); } void GaussianXBlurOperation::deinitExecution() |