275 |
|
cpcolormat(cvts.cmat, xyz2rgbmat); |
276 |
|
SET(C_CXFM|C_GAMUT); |
277 |
|
} else if (cvts.comp == COMPRESSION_SGILOG) |
278 |
< |
SET(C_GAMUT); |
278 |
> |
SET(C_GAMUT); /* may be outside XYZ gamut */ |
279 |
|
if (cvts.pconf != PLANARCONFIG_CONTIG) |
280 |
|
quiterr("cannot handle separate Luv planes"); |
281 |
|
TIFFSetField(cvts.tif, TIFFTAG_SGILOGDATAFMT, |
569 |
|
SAMPLEFORMAT_IEEEFP); |
570 |
|
cvts.tf = Color2RfGfBf; |
571 |
|
SET(C_RFLT); |
572 |
+ |
CLR(C_GAMUT); |
573 |
|
} else |
574 |
|
cvts.tf = Colr2RGB; |
575 |
|
break; |
710 |
|
if (CHK(C_CXFM)) |
711 |
|
colortrans(cvts.r.colors[x], cvts.cmat, |
712 |
|
cvts.r.colors[x]); |
712 |
– |
if (CHK(C_GAMUT)) |
713 |
– |
clipgamut(cvts.r.colors[x], cvts.t.fp[3*x + 1], |
714 |
– |
CGAMUT_LOWER, cblack, cwhite); |
713 |
|
} |
714 |
|
if (cvts.bradj) { |
715 |
|
d = pow(2.,(double)cvts.bradj); |
968 |
|
if (freadscan(cvts.r.colors, cvts.xmax, cvts.rfp) < 0) |
969 |
|
quiterr("error reading Radiance picture"); |
970 |
|
|
971 |
< |
for (x = cvts.xmax; x--; ) |
971 |
> |
for (x = cvts.xmax; x--; ) { |
972 |
> |
if (CHK(C_CXFM)) { |
973 |
> |
colortrans(cvts.r.colors[x], cvts.cmat, |
974 |
> |
cvts.r.colors[x]); |
975 |
> |
if (CHK(C_GAMUT)) |
976 |
> |
clipgamut(cvts.r.colors[x], cvts.t.fp[3*x + 1], |
977 |
> |
CGAMUT_LOWER, cblack, cwhite); |
978 |
> |
} |
979 |
|
for (i = 3; i--; ) { |
980 |
|
register float f = m*colval(cvts.r.colors[x],i); |
981 |
|
if (f <= 0) |
988 |
|
else |
989 |
|
cvts.t.wp[3*x + i] = (int)((float)(1L<<16)*f); |
990 |
|
} |
991 |
+ |
} |
992 |
|
|
993 |
|
if (TIFFWriteScanline(cvts.tif, cvts.t.p, y, 0) < 0) |
994 |
|
quiterr("error writing TIFF output"); |