Cineon/DPX export didn't survive when Blender gave it negative colors.

Was missing test for it before turning it into unsigned short.
This commit is contained in:
Ton Roosendaal 2006-03-20 16:53:13 +00:00
parent 99dbcaa2f1
commit e469e4875f

@ -143,9 +143,9 @@ static int imb_save_dpx_cineon(ImBuf *buf, char *filename, int use_cineon, int f
fpix = &fline[i*4];
memcpy(fpix2, fpix, sizeof(float)*3);
if (fpix2[0]>=1) fpix2[0] = 1;
if (fpix2[1]>=1) fpix2[1] = 1;
if (fpix2[2]>=1) fpix2[2] = 1;
if (fpix2[0]>=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);