From 9c8f1e2ef487483bc374feaed9ff709e07638623 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Mar 2011 17:12:59 +0000 Subject: imbuf, mathutils & readfile: floats were being implicitly promoted to doubles, adjust to use floats. --- source/blender/imbuf/intern/divers.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/imbuf/intern/divers.c') diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index ff98ac60166..6b35d7df397 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -109,7 +109,7 @@ void IMB_rect_from_float(struct ImBuf *ibuf) /* quick method to convert floatbuf to byte */ float *tof = (float *)ibuf->rect_float; // int do_dither = ibuf->dither != 0.f; - float dither= ibuf->dither / 255.0; + float dither= ibuf->dither / 255.0f; float srgb[4]; int i, channels= ibuf->channels; short profile= ibuf->profile; @@ -141,7 +141,7 @@ void IMB_rect_from_float(struct ImBuf *ibuf) else if (channels == 4) { if (dither != 0.f) { for (i = ibuf->x * ibuf->y; i > 0; i--, to+=4, tof+=4) { - const float d = (BLI_frand()-0.5)*dither; + const float d = (BLI_frand()-0.5f)*dither; srgb[0]= d + linearrgb_to_srgb(tof[0]); srgb[1]= d + linearrgb_to_srgb(tof[1]); @@ -170,7 +170,7 @@ void IMB_rect_from_float(struct ImBuf *ibuf) else { if (dither != 0.f) { for (i = ibuf->x * ibuf->y; i > 0; i--, to+=4, tof+=4) { - const float d = (BLI_frand()-0.5)*dither; + const float d = (BLI_frand()-0.5f)*dither; float col[4]; col[0]= d + tof[0]; -- cgit v1.2.3