From e469e4875f97d04fc788cab533495d9408e9b038 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 20 Mar 2006 16:53:13 +0000 Subject: Cineon/DPX export didn't survive when Blender gave it negative colors. Was missing test for it before turning it into unsigned short. --- source/blender/imbuf/intern/cineon/cineon_dpx.c | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'source/blender/imbuf/intern/cineon') diff --git a/source/blender/imbuf/intern/cineon/cineon_dpx.c b/source/blender/imbuf/intern/cineon/cineon_dpx.c index d3cf74f60a9..020449897a5 100644 --- a/source/blender/imbuf/intern/cineon/cineon_dpx.c +++ b/source/blender/imbuf/intern/cineon/cineon_dpx.c @@ -135,22 +135,22 @@ static int imb_save_dpx_cineon(ImBuf *buf, char *filename, int use_cineon, int f /*note that image is flipped when sent to logImageSetRowBytes (see last passed parameter).*/ for (j = 0; j < height; ++j) { - fline = &buf->rect_float[width*j*4]; - for (i=0; i=1) fpix2[0] = 1; - if (fpix2[1]>=1) fpix2[1] = 1; - if (fpix2[2]>=1) fpix2[2] = 1; - - pixel[0] = (unsigned short)(fpix2[0] * 65535.0f); /*float-float math is faster*/ - pixel[1] = (unsigned short)(fpix2[1] * 65535.0f); - pixel[2] = (unsigned short)(fpix2[2] * 65535.0f); - } + fline = &buf->rect_float[width*j*4]; + for (i=0; i=1.0f) fpix2[0] = 1.0f; else if (fpix2[0]<0.0f) fpix2[0]= 0.0f; + if (fpix2[1]>=1.0f) fpix2[1] = 1.0f; else if (fpix2[1]<0.0f) fpix2[1]= 0.0f; + if (fpix2[2]>=1.0f) fpix2[2] = 1.0f; else if (fpix2[2]<0.0f) fpix2[2]= 0.0f; + + pixel[0] = (unsigned short)(fpix2[0] * 65535.0f); /*float-float math is faster*/ + pixel[1] = (unsigned short)(fpix2[1] * 65535.0f); + pixel[2] = (unsigned short)(fpix2[2] * 65535.0f); + } logImageSetRowBytes(logImage, (const unsigned short*)line, height-1-j); } logImageClose(logImage); -- cgit v1.2.3