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-05-17 17:44:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-17 17:44:15 +0400
commit979f6bab9c1aba27b8d018d1481987d841f68ee1 (patch)
tree162419d475bf68326b3b5e88b25f27057fee6831 /source/blender/compositor/operations/COM_DilateErodeOperation.cpp
parentfe0d1a381003408dedcd3142a727c77806617150 (diff)
style cleanup: braces, compositor
Diffstat (limited to 'source/blender/compositor/operations/COM_DilateErodeOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_DilateErodeOperation.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
index df3bf996c96..c34d8976719 100644
--- a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
+++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
@@ -36,10 +36,12 @@ void DilateErodeOperation::initExecution() {
this->inputProgram = this->getInputSocketReader(0);
if (this->distance < 0.0f) {
this->scope = - this->distance + this->inset;
- } else {
+ }
+ else {
if (this->inset*2 > this->distance) {
this->scope = max(this->inset*2 - this->distance, this->distance);
- } else {
+ }
+ else {
this->scope = distance;
}
}
@@ -87,7 +89,8 @@ void DilateErodeOperation::executePixel(float* color, int x, int y, MemoryBuffer
}
}
pixelvalue = -sqrtf(mindist);
- } else {
+ }
+ else {
for (int yi = miny ; yi<maxy;yi++) {
offset = ((yi-rect->ymin)*bufferWidth+(minx-rect->xmin))*4;
for (int xi = minx ; xi<maxx;xi++) {
@@ -109,21 +112,26 @@ void DilateErodeOperation::executePixel(float* color, int x, int y, MemoryBuffer
if (delta >= 0.0f) {
if (delta >= inset) {
color[0] = 1.0f;
- } else {
+ }
+ else {
color[0] = delta/inset;
}
- } else {
+ }
+ else {
color[0] = 0.0f;
}
- } else {
+ }
+ else {
const float delta = -distance+pixelvalue;
if (delta < 0.0f) {
if (delta < -inset) {
color[0] = 1.0f;
- } else {
+ }
+ else {
color[0] = (-delta)/inset;
}
- } else {
+ }
+ else {
color[0] = 0.0f;
}
}