diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 17:23:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-10 17:23:31 +0400 |
commit | e8772477894a6fd8c09488b488fdcc1af432da1b (patch) | |
tree | 9e26bbf5bb90d8fbf1c1b28d92cca2cc2bbb2802 /source/blender/compositor/operations/COM_BokehImageOperation.cpp | |
parent | fea0e60227825ea917e59348f1be10bd9caeabb4 (diff) |
use define for bokeh blur size, also define size of determineResolution args.
Diffstat (limited to 'source/blender/compositor/operations/COM_BokehImageOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_BokehImageOperation.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.cpp b/source/blender/compositor/operations/COM_BokehImageOperation.cpp index d7de201e9df..979d08390c1 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.cpp +++ b/source/blender/compositor/operations/COM_BokehImageOperation.cpp @@ -30,10 +30,8 @@ BokehImageOperation::BokehImageOperation() : NodeOperation() } void BokehImageOperation::initExecution() { - this->m_centerX = getWidth() / 2; - this->m_centerY = getHeight() / 2; - this->m_center[0] = this->m_centerX; - this->m_center[1] = this->m_centerY; + this->m_center[0] = getWidth() / 2; + this->m_center[1] = getHeight() / 2; this->m_inverseRounding = 1.0f - this->m_data->rounding; this->m_circularDistance = getWidth() / 2; this->m_flapRad = (float)(M_PI * 2) / this->m_data->flaps; @@ -47,14 +45,14 @@ void BokehImageOperation::initExecution() } void BokehImageOperation::detemineStartPointOfFlap(float r[2], int flapNumber, float distance) { - r[0] = sinf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_centerX; - r[1] = cosf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_centerY; + r[0] = sinf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_center[0]; + r[1] = cosf(this->m_flapRad * flapNumber + this->m_flapRadAdd) * distance + this->m_center[1]; } float BokehImageOperation::isInsideBokeh(float distance, float x, float y) { float insideBokeh = 0.0f; - const float deltaX = x - this->m_centerX; - const float deltaY = y - this->m_centerY; + const float deltaX = x - this->m_center[0]; + const float deltaY = y - this->m_center[1]; float closestPoint[2]; float lineP1[2]; float lineP2[2]; @@ -118,8 +116,8 @@ void BokehImageOperation::deinitExecution() } } -void BokehImageOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void BokehImageOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { - resolution[0] = 512; - resolution[1] = 512; + resolution[0] = COM_BLUR_BOKEH_PIXELS; + resolution[1] = COM_BLUR_BOKEH_PIXELS; } |