Fix for bug #11005: hue-sat-value node was doing unnecessary
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 8 May 2008 19:57:10 +0000 (19:57 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 8 May 2008 19:57:10 +0000 (19:57 +0000)
clamping, which not only is suboptimal for working with hdr
images, it was also doing the clamping incorrect.

source/blender/nodes/intern/CMP_nodes/CMP_hueSatVal.c
source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c

index eeddb4ce756527a9907d9ffa11a4cd5260b31c5f..92614d1cc6ab160acd2d34a47105f3badb1fe8e9 100644 (file)
@@ -52,9 +52,7 @@ static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac)
                hsv[0]+= (nhs->hue - 0.5f);
                if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
                hsv[1]*= nhs->sat;
-               if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0;
                hsv[2]*= nhs->val;
-               if(hsv[2]>1.0) hsv[2]= 1.0; else if(hsv[2]<0.0) hsv[2]= 0.0;
                hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
                
                out[0]= mfac*in[0] + *fac*col[0];
index 8c07a2d1dc869667e28ba49514b48423d92efc17..67dfc6190802936c645fc5e85a5d817588bc3611 100644 (file)
@@ -54,9 +54,7 @@ static void do_hue_sat_fac(bNode *node, float *out, float *hue, float *sat, floa
                hsv[0]+= (*hue - 0.5f);
                if(hsv[0]>1.0) hsv[0]-=1.0; else if(hsv[0]<0.0) hsv[0]+= 1.0;
                hsv[1]*= *sat;
-               if(hsv[1]>1.0) hsv[1]= 1.0; else if(hsv[1]<0.0) hsv[1]= 0.0;
                hsv[2]*= *val;
-               if(hsv[2]>1.0) hsv[2]= 1.0; else if(hsv[2]<0.0) hsv[2]= 0.0;
                hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
                
                out[0]= mfac*in[0] + *fac*col[0];