diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-15 22:42:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-15 22:42:03 +0400 |
commit | 570cc70772d78703053956ce57b20c6c4ed74c95 (patch) | |
tree | b4c5db0392384251f1b1ccefc17c959d3e742977 /source/blender/compositor/operations/COM_DisplaceOperation.cpp | |
parent | 8fd2267e56d3d0b6bb860800eb8059bcbfa0b501 (diff) |
style cleanup: compositor operations
Diffstat (limited to 'source/blender/compositor/operations/COM_DisplaceOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_DisplaceOperation.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.cpp b/source/blender/compositor/operations/COM_DisplaceOperation.cpp index 2add367f39e..be50641a125 100644 --- a/source/blender/compositor/operations/COM_DisplaceOperation.cpp +++ b/source/blender/compositor/operations/COM_DisplaceOperation.cpp @@ -23,7 +23,7 @@ #include "BLI_math.h" #include "BLI_utildefines.h" -DisplaceOperation::DisplaceOperation(): NodeOperation() +DisplaceOperation::DisplaceOperation() : NodeOperation() { this->addInputSocket(COM_DT_COLOR); this->addInputSocket(COM_DT_VECTOR); @@ -52,14 +52,14 @@ void DisplaceOperation::initExecution() /* minimum distance (in pixels) a pixel has to be displaced * in order to take effect */ -#define DISPLACE_EPSILON 0.01f +#define DISPLACE_EPSILON 0.01f void DisplaceOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data) { float inVector[4]; float inScale[4]; - float p_dx, p_dy; /* main displacement in pixel space */ + float p_dx, p_dy; /* main displacement in pixel space */ float d_dx, d_dy; float dxt, dyt; float u, v; @@ -83,17 +83,17 @@ void DisplaceOperation::executePixel(float *color, int x, int y, MemoryBuffer *i v = y - p_dy + 0.5f; /* calc derivatives */ - this->inputVectorProgram->read(inVector, x+1, y, COM_PS_NEAREST, inputBuffers); + this->inputVectorProgram->read(inVector, x + 1, y, COM_PS_NEAREST, inputBuffers); d_dx = inVector[0] * xs; - this->inputVectorProgram->read(inVector, x, y+1, COM_PS_NEAREST, inputBuffers); + this->inputVectorProgram->read(inVector, x, y + 1, COM_PS_NEAREST, inputBuffers); d_dy = inVector[0] * ys; /* clamp derivatives to minimum displacement distance in UV space */ dxt = p_dx - d_dx; dyt = p_dy - d_dy; - dxt = signf(dxt)*maxf(fabsf(dxt), DISPLACE_EPSILON)/this->getWidth(); - dyt = signf(dyt)*maxf(fabsf(dyt), DISPLACE_EPSILON)/this->getHeight(); + dxt = signf(dxt) * maxf(fabsf(dxt), DISPLACE_EPSILON) / this->getWidth(); + dyt = signf(dyt) * maxf(fabsf(dyt), DISPLACE_EPSILON) / this->getHeight(); /* EWA filtering */ this->inputColorProgram->read(color, u, v, dxt, dyt, inputBuffers); @@ -111,7 +111,7 @@ bool DisplaceOperation::determineDependingAreaOfInterest(rcti *input, ReadBuffer { rcti colorInput; rcti vectorInput; - NodeOperation *operation=NULL; + NodeOperation *operation = NULL; /* the vector buffer only needs a 2x2 buffer. The image needs whole buffer */ /* image */ |