imbuf, mathutils & readfile: floats were being implicitly promoted to doubles, adjust...
[blender.git] / source / blender / imbuf / intern / imageprocess.c
index ef787e8b7992a881f7fa8bcd9ad984b741e88a1c..fa5e951067d12ba8c3e20fab542aefc33ac80a76 100644 (file)
@@ -274,8 +274,8 @@ void bilinear_interpolation_color(struct ImBuf *in, unsigned char *outI, float *
                if (x2>in->x-1 || y2>in->y-1) row4= empty;
                else row4= (float *)in->rect_float + in->x * y2 * 4 + 4*x2;
                
-               a= u-floor(u);
-               b= v-floor(v);
+               a= u-floorf(u);
+               b= v-floorf(v);
                a_b= a*b; ma_b= (1.0f-a)*b; a_mb= a*(1.0f-b); ma_mb= (1.0f-a)*(1.0f-b);
                
                outF[0]= ma_mb*row1[0] + a_mb*row3[0] + ma_b*row2[0]+ a_b*row4[0];
@@ -297,8 +297,8 @@ void bilinear_interpolation_color(struct ImBuf *in, unsigned char *outI, float *
                if (x2>in->x-1 || y2>in->y-1) row4I= emptyI;
                else row4I= (unsigned char *)in->rect + in->x * y2 * 4 + 4*x2;
                
-               a= u-floor(u);
-               b= v-floor(v);
+               a= u-floorf(u);
+               b= v-floorf(v);
                a_b= a*b; ma_b= (1.0f-a)*b; a_mb= a*(1.0f-b); ma_mb= (1.0f-a)*(1.0f-b);
                
                /* need to add 0.5 to avoid rounding down (causes darken with the smear brush)
@@ -348,8 +348,8 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *outI, fl
                row3= (float *)in->rect_float + in->x * y1 * 4 + 4*x2;
                row4= (float *)in->rect_float + in->x * y2 * 4 + 4*x2;
                
-               a= u-floor(u);
-               b= v-floor(v);
+               a= u-floorf(u);
+               b= v-floorf(v);
                a_b= a*b; ma_b= (1.0f-a)*b; a_mb= a*(1.0f-b); ma_mb= (1.0f-a)*(1.0f-b);
                
                outF[0]= ma_mb*row1[0] + a_mb*row3[0] + ma_b*row2[0]+ a_b*row4[0];
@@ -364,8 +364,8 @@ void bilinear_interpolation_color_wrap(struct ImBuf *in, unsigned char *outI, fl
                row3I= (unsigned char *)in->rect + in->x * y1 * 4 + 4*x2;
                row4I= (unsigned char *)in->rect + in->x * y2 * 4 + 4*x2;
                
-               a= u-floor(u);
-               b= v-floor(v);
+               a= u-floorf(u);
+               b= v-floorf(v);
                a_b= a*b; ma_b= (1.0f-a)*b; a_mb= a*(1.0f-b); ma_mb= (1.0f-a)*(1.0f-b);
                
                /* need to add 0.5 to avoid rounding down (causes darken with the smear brush)