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_VariableSizeBokehBlurOperation.cpp | |
parent | fea0e60227825ea917e59348f1be10bd9caeabb4 (diff) |
use define for bokeh blur size, also define size of determineResolution args.
Diffstat (limited to 'source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp index f7712f675f2..a3245507994 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp @@ -139,8 +139,9 @@ void VariableSizeBokehBlurOperation::executePixel(float *color, int x, int y, vo if (size > this->m_threshold) { float dx = nx - x; if (size > fabsf(dx) && size > fabsf(dy)) { - float uv[2] = {256.0f + (dx / size) * 255.0f, - 256.0f + (dy / size) * 255.0f}; + float uv[2] = { + (float)(COM_BLUR_BOKEH_PIXELS / 2) + (dx / size) * (float)((COM_BLUR_BOKEH_PIXELS / 2) - 1), + (float)(COM_BLUR_BOKEH_PIXELS / 2) + (dy / size) * (float)((COM_BLUR_BOKEH_PIXELS / 2) - 1)}; inputBokehBuffer->readNoCheck(bokeh, uv[0], uv[1]); madd_v4_v4v4(color_accum, bokeh, &inputProgramFloatBuffer[offsetNxNy]); add_v4_v4(multiplier_accum, bokeh); @@ -216,9 +217,9 @@ bool VariableSizeBokehBlurOperation::determineDependingAreaOfInterest(rcti *inpu newInput.xmin = input->xmin - this->m_maxBlur + 2; newInput.ymax = input->ymax + this->m_maxBlur - 2; newInput.ymin = input->ymin - this->m_maxBlur - 2; - bokehInput.xmax = 512; + bokehInput.xmax = COM_BLUR_BOKEH_PIXELS; bokehInput.xmin = 0; - bokehInput.ymax = 512; + bokehInput.ymax = COM_BLUR_BOKEH_PIXELS; bokehInput.ymin = 0; @@ -336,7 +337,7 @@ void InverseSearchRadiusOperation::deinitExecution() this->m_inputRadius = NULL; } -void InverseSearchRadiusOperation::determineResolution(unsigned int resolution[], unsigned int preferredResolution[]) +void InverseSearchRadiusOperation::determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) { NodeOperation::determineResolution(resolution, preferredResolution); resolution[0] = resolution[0] / DIVIDER; |