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-06-15 19:55:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-06-15 19:55:37 +0400
commit927fc897cf8d7e6c18571dee2b79b596b5aaffa7 (patch)
treedbe493cf8e69ec25bc6b83c43c5630cf96fc401e /source/blender/nodes
parent2ca89f7add1949295ac58de6697534d44508bca3 (diff)
minor optimizations for dilate
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_dilate.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_dilate.c b/source/blender/nodes/composite/nodes/node_composite_dilate.c
index ec7aaccdbe2..2f139831cc9 100644
--- a/source/blender/nodes/composite/nodes/node_composite_dilate.c
+++ b/source/blender/nodes/composite/nodes/node_composite_dilate.c
@@ -52,28 +52,28 @@ static void morpho_dilate(CompBuf *cbuf)
for (y = 0; y < cbuf->y; y++) {
for (x = 0; x < cbuf->x - 1; x++) {
p = rectf + cbuf->x * y + x;
- *p = MAX2(*p, *(p + 1));
+ *p = maxf(*p, *(p + 1));
}
}
for (y = 0; y < cbuf->y; y++) {
for (x = cbuf->x - 1; x >= 1; x--) {
p = rectf + cbuf->x * y + x;
- *p = MAX2(*p, *(p - 1));
+ *p = maxf(*p, *(p - 1));
}
}
for (x = 0; x < cbuf->x; x++) {
for (y = 0; y < cbuf->y - 1; y++) {
p = rectf + cbuf->x * y + x;
- *p = MAX2(*p, *(p + cbuf->x));
+ *p = maxf(*p, *(p + cbuf->x));
}
}
for (x = 0; x < cbuf->x; x++) {
for (y = cbuf->y - 1; y >= 1; y--) {
p = rectf + cbuf->x * y + x;
- *p = MAX2(*p, *(p - cbuf->x));
+ *p = maxf(*p, *(p - cbuf->x));
}
}
}
@@ -86,28 +86,28 @@ static void morpho_erode(CompBuf *cbuf)
for (y = 0; y < cbuf->y; y++) {
for (x = 0; x < cbuf->x - 1; x++) {
p = rectf + cbuf->x * y + x;
- *p = MIN2(*p, *(p + 1));
+ *p = minf(*p, *(p + 1));
}
}
for (y = 0; y < cbuf->y; y++) {
for (x = cbuf->x - 1; x >= 1; x--) {
p = rectf + cbuf->x * y + x;
- *p = MIN2(*p, *(p - 1));
+ *p = minf(*p, *(p - 1));
}
}
for (x = 0; x < cbuf->x; x++) {
for (y = 0; y < cbuf->y - 1; y++) {
p = rectf + cbuf->x * y + x;
- *p = MIN2(*p, *(p + cbuf->x));
+ *p = minf(*p, *(p + cbuf->x));
}
}
for (x = 0; x < cbuf->x; x++) {
for (y = cbuf->y - 1; y >= 1; y--) {
p = rectf + cbuf->x * y + x;
- *p = MIN2(*p, *(p - cbuf->x));
+ *p = minf(*p, *(p - cbuf->x));
}
}
@@ -122,8 +122,7 @@ static void node_composit_exec_dilateerode(void *UNUSED(data), bNode *node, bNod
/* input no image? then only color operation */
if (in[0]->data == NULL) {
- out[0]->vec[0] = out[0]->vec[1] = out[0]->vec[2] = 0.0f;
- out[0]->vec[3] = 0.0f;
+ zero_v4(out[0]->vec);
}
else {
/* make output size of input image */