--- ray/src/px/ra_tiff.c 2005/03/22 04:51:56 2.29 +++ ray/src/px/ra_tiff.c 2005/06/07 16:54:23 2.31 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ra_tiff.c,v 2.29 2005/03/22 04:51:56 greg Exp $"; +static const char RCSid[] = "$Id: ra_tiff.c,v 2.31 2005/06/07 16:54:23 greg Exp $"; #endif /* * Program to convert between RADIANCE and TIFF files. @@ -656,6 +656,9 @@ Luv2Color( /* read/convert/write Luv->COLOR scanline if (CHK(C_RFLT|C_TWRD|C_TFLT|C_GRY) != (C_RFLT|C_TFLT)) quiterr("internal error 1 in Luv2Color"); + if (cvts.pconf != PLANARCONFIG_CONTIG) + quiterr("cannot handle separate 32-bit color planes"); + if (TIFFReadScanline(cvts.tif, cvts.t.p, y, 0) < 0) quiterr("error reading TIFF input"); /* also works for float RGB */ @@ -694,6 +697,9 @@ RRGGBB2Color( /* read/convert/write RGB16->COLOR sca if (CHK(C_RFLT|C_TWRD|C_TFLT|C_GRY) != (C_TWRD|C_RFLT)) quiterr("internal error 1 in RRGGBB2Color"); + if (cvts.pconf != PLANARCONFIG_CONTIG) + quiterr("cannot handle separate 16-bit color planes"); + if (TIFFReadScanline(cvts.tif, cvts.t.p, y, 0) < 0) quiterr("error reading TIFF input"); @@ -973,7 +979,7 @@ Color2RRGGBB( /* read/convert/write COLOR->RGB16 sca colortrans(cvts.r.colors[x], cvts.cmat, cvts.r.colors[x]); if (CHK(C_GAMUT)) - clipgamut(cvts.r.colors[x], cvts.t.fp[3*x + 1], + clipgamut(cvts.r.colors[x], bright(cvts.r.colors[x]), CGAMUT_LOWER, cblack, cwhite); } for (i = 3; i--; ) {