diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-18 02:55:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-18 02:55:28 +0400 |
commit | 7862b2fa13c0437d9c17eae78e7b79a421dacf05 (patch) | |
tree | 08f9c26af3e71795d0f65803a415b5612d6b53ab /source/blender/compositor/operations/COM_BokehImageOperation.cpp | |
parent | 69b95e1a8a00c9ff146d803b8ec11183d7a68908 (diff) |
style cleanup: compositor, pointer syntax, function brace placement, line length
Diffstat (limited to 'source/blender/compositor/operations/COM_BokehImageOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_BokehImageOperation.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.cpp b/source/blender/compositor/operations/COM_BokehImageOperation.cpp index 22b73417778..4bc738052f6 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehImageOperation.cpp @@ -23,11 +23,13 @@ #include "COM_BokehImageOperation.h" #include "BLI_math.h" -BokehImageOperation::BokehImageOperation(): NodeOperation() { +BokehImageOperation::BokehImageOperation(): NodeOperation() +{ this->addOutputSocket(COM_DT_COLOR); this->deleteData = false; } -void BokehImageOperation::initExecution() { +void BokehImageOperation::initExecution() +{ this->centerX = getWidth() / 2; this->centerY = getHeight() / 2; this->center[0] = this->centerX; @@ -40,11 +42,13 @@ void BokehImageOperation::initExecution() { this->flapRadAdd-=M_PI*2; } } -void BokehImageOperation::detemineStartPointOfFlap(float r[2], int flapNumber, float distance) { +void BokehImageOperation::detemineStartPointOfFlap(float r[2], int flapNumber, float distance) +{ r[0] = sin(flapRad*flapNumber + flapRadAdd)*distance+centerX; r[1] = cos(flapRad*flapNumber + flapRadAdd)*distance+centerY; } -float BokehImageOperation::isInsideBokeh(float distance, float x, float y) { +float BokehImageOperation::isInsideBokeh(float distance, float x, float y) +{ float insideBokeh = 0.0; const float deltaX = x - centerX; const float deltaY = y - centerY; @@ -80,7 +84,8 @@ float BokehImageOperation::isInsideBokeh(float distance, float x, float y) { } return insideBokeh; } -void BokehImageOperation::executePixel(float* color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) { +void BokehImageOperation::executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) +{ float shift = this->data->lensshift; float shift2 = shift/2.0f; float distance = this->circularDistance; @@ -100,7 +105,8 @@ void BokehImageOperation::executePixel(float* color, float x, float y, PixelSamp color[3] = 1.0f; } -void BokehImageOperation::deinitExecution() { +void BokehImageOperation::deinitExecution() +{ if (deleteData) { if (data) { delete data; @@ -109,7 +115,8 @@ void BokehImageOperation::deinitExecution() { } } -void BokehImageOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) { +void BokehImageOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +{ resolution[0] = 512; resolution[1] = 512; } |