From c41e1e434ab9defa35178ad8886d81b60d889e9a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 29 Jul 2012 16:59:51 +0000 Subject: code cleanup: replace MIN2/MAX2 with minf/maxf --- .../compositor/operations/COM_ProjectorLensDistortionOperation.cpp | 2 +- .../compositor/operations/COM_ScreenLensDistortionOperation.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/compositor/operations') diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp index daf517876e5..e28e77a5f5e 100644 --- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cpp @@ -95,7 +95,7 @@ void ProjectorLensDistortionOperation::updateDispersion() float result[4]; this->getInputSocketReader(1)->read(result, 0, 0, COM_PS_NEAREST); this->m_dispersion = result[0]; - this->m_kr = 0.25f * MAX2(MIN2(this->m_dispersion, 1.f), 0.f); + this->m_kr = 0.25f * maxf(minf(this->m_dispersion, 1.0f), 0.0f); this->m_kr2 = this->m_kr * 20; this->m_dispersionAvailable = true; } diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp index d431ce29554..c8052667fa0 100644 --- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp +++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp @@ -301,11 +301,11 @@ bool ScreenLensDistortionOperation::determineDependingAreaOfInterest(rcti *input void ScreenLensDistortionOperation::updateVariables(float distortion, float dispersion) { - this->m_kg = MAX2(MIN2(distortion, 1.f), -0.999f); + this->m_kg = maxf(minf(distortion, 1.0f), -0.999f); // smaller dispersion range for somewhat more control const float d = 0.25f * MAX2(MIN2(dispersion, 1.f), 0.f); - this->m_kr = MAX2(MIN2((this->m_kg + d), 1.0f), -0.999f); - this->m_kb = MAX2(MIN2((this->m_kg - d), 1.0f), -0.999f); + this->m_kr = maxf(minf((this->m_kg + d), 1.0f), -0.999f); + this->m_kb = maxf(minf((this->m_kg - d), 1.0f), -0.999f); this->m_maxk = MAX3(this->m_kr, this->m_kg, this->m_kb); this->m_sc = (this->m_data->fit && (this->m_maxk > 0.f)) ? (1.f / (1.f + 2.f * this->m_maxk)) : (1.f / (1.f + this->m_maxk)); this->m_drg = 4.f * (this->m_kg - this->m_kr); -- cgit v1.2.3