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-08-10 18:07:24 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-10 18:07:24 +0400
commit94a3945cf9de0913b75f83b26e2e62b3bc1b0c07 (patch)
tree89aeabd20d883137b69815d9580f3bc108531a7e /source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp
parente8772477894a6fd8c09488b488fdcc1af432da1b (diff)
code cleanup: compositor - define size for executePixel function output float array
Diffstat (limited to 'source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp29
1 files changed, 10 insertions, 19 deletions
diff --git a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp
index 90bda5c8d2c..657126d458c 100644
--- a/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp
+++ b/source/blender/compositor/operations/COM_ConvolutionEdgeFilterOperation.cpp
@@ -28,9 +28,9 @@ ConvolutionEdgeFilterOperation::ConvolutionEdgeFilterOperation() : ConvolutionFi
/* pass */
}
-void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, void *data)
+void ConvolutionEdgeFilterOperation::executePixel(float output[4], int x, int y, void *data)
{
- float in1[4], in2[4], res1[4], res2[4];
+ float in1[4], in2[4], res1[4] = {0.0}, res2[4] = {0.0};
int x1 = x - 1;
int x2 = x;
@@ -48,16 +48,7 @@ void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, vo
float value[4];
this->m_inputValueOperation->read(value, x2, y2, NULL);
float mval = 1.0f - value[0];
-
- res1[0] = 0.0f;
- res1[1] = 0.0f;
- res1[2] = 0.0f;
- res1[3] = 0.0f;
- res2[0] = 0.0f;
- res2[1] = 0.0f;
- res2[2] = 0.0f;
- res2[3] = 0.0f;
-
+
this->m_inputOperation->read(in1, x1, y1, NULL);
madd_v3_v3fl(res1, in1, this->m_filter[0]);
madd_v3_v3fl(res2, in1, this->m_filter[0]);
@@ -94,13 +85,13 @@ void ConvolutionEdgeFilterOperation::executePixel(float *color, int x, int y, vo
madd_v3_v3fl(res1, in1, this->m_filter[8]);
madd_v3_v3fl(res2, in1, this->m_filter[8]);
- color[0] = sqrt(res1[0] * res1[0] + res2[0] * res2[0]);
- color[1] = sqrt(res1[1] * res1[1] + res2[1] * res2[1]);
- color[2] = sqrt(res1[2] * res1[2] + res2[2] * res2[2]);
+ output[0] = sqrt(res1[0] * res1[0] + res2[0] * res2[0]);
+ output[1] = sqrt(res1[1] * res1[1] + res2[1] * res2[1]);
+ output[2] = sqrt(res1[2] * res1[2] + res2[2] * res2[2]);
- color[0] = color[0] * value[0] + in2[0] * mval;
- color[1] = color[1] * value[0] + in2[1] * mval;
- color[2] = color[2] * value[0] + in2[2] * mval;
+ output[0] = output[0] * value[0] + in2[0] * mval;
+ output[1] = output[1] * value[0] + in2[1] * mval;
+ output[2] = output[2] * value[0] + in2[2] * mval;
- color[3] = in2[3];
+ output[3] = in2[3];
}