diff options
5 files changed, 12 insertions, 20 deletions
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.h b/source/blender/compositor/operations/COM_BlurBaseOperation.h index d8729ad4394..a868f0bfa04 100644 --- a/source/blender/compositor/operations/COM_BlurBaseOperation.h +++ b/source/blender/compositor/operations/COM_BlurBaseOperation.h @@ -25,6 +25,8 @@ #include "COM_NodeOperation.h" #include "COM_QualityStepHelper.h" +#define MAX_GAUSSTAB_RADIUS 30000 + class BlurBaseOperation : public NodeOperation, public QualityStepHelper { private: diff --git a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp index aaf5f92505b..af15f719cbc 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp @@ -55,8 +55,7 @@ void GaussianAlphaXBlurOperation::initExecution() if (this->m_sizeavailable) { float rad = this->m_size * this->m_data->sizex; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); @@ -69,8 +68,7 @@ void GaussianAlphaXBlurOperation::updateGauss() if (this->m_gausstab == NULL) { updateSize(); float rad = this->m_size * this->m_data->sizex; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); @@ -79,8 +77,7 @@ void GaussianAlphaXBlurOperation::updateGauss() if (this->m_distbuf_inv == NULL) { updateSize(); float rad = this->m_size * this->m_data->sizex; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_distbuf_inv = BlurBaseOperation::make_dist_fac_inverse(rad, this->m_falloff); diff --git a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp index 650805f91d5..4aee878a8c8 100644 --- a/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp @@ -55,8 +55,7 @@ void GaussianAlphaYBlurOperation::initExecution() if (this->m_sizeavailable) { float rad = this->m_size * this->m_data->sizey; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); @@ -69,8 +68,7 @@ void GaussianAlphaYBlurOperation::updateGauss() if (this->m_gausstab == NULL) { updateSize(); float rad = this->m_size * this->m_data->sizey; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); @@ -79,8 +77,7 @@ void GaussianAlphaYBlurOperation::updateGauss() if (this->m_distbuf_inv == NULL) { updateSize(); float rad = this->m_size * this->m_data->sizex; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_distbuf_inv = BlurBaseOperation::make_dist_fac_inverse(rad, this->m_falloff); diff --git a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp index af231d118a6..13b749f8b9c 100644 --- a/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp @@ -53,8 +53,7 @@ void GaussianXBlurOperation::initExecution() if (this->m_sizeavailable) { float rad = this->m_size * this->m_data->sizex; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); @@ -66,8 +65,7 @@ void GaussianXBlurOperation::updateGauss() if (this->m_gausstab == NULL) { updateSize(); float rad = this->m_size * this->m_data->sizex; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); diff --git a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp index 7bf85a953f4..0a2e8aeeba8 100644 --- a/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp +++ b/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp @@ -53,8 +53,7 @@ void GaussianYBlurOperation::initExecution() if (this->m_sizeavailable) { float rad = this->m_size * this->m_data->sizey; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); @@ -66,8 +65,7 @@ void GaussianYBlurOperation::updateGauss() if (this->m_gausstab == NULL) { updateSize(); float rad = this->m_size * this->m_data->sizey; - if (rad < 1) - rad = 1; + CLAMP(rad, 1.0f, MAX_GAUSSTAB_RADIUS); this->m_rad = rad; this->m_gausstab = BlurBaseOperation::make_gausstab(rad); |