From e1914a9c87523d46f255c226c7d6e2e4027c2446 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Fri, 20 Jan 2012 09:23:46 -0500 Subject: [PATCH] Clamp min to 0 in colorclip (for wavelet et al) --- cuburn/code/filtering.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cuburn/code/filtering.py b/cuburn/code/filtering.py index c9f7082..32ab149 100644 --- a/cuburn/code/filtering.py +++ b/cuburn/code/filtering.py @@ -25,6 +25,10 @@ void colorclip(float4 *pixbuf, float gamma, float vibrance, float highpow, return; } + pix.x = fmaxf(0.0f, pix.x); + pix.y = fmaxf(0.0f, pix.y); + pix.z = fmaxf(0.0f, pix.z); + float4 opix = pix; float alpha = powf(pix.w, gamma);