191 |
|
exit(0); |
192 |
|
userr: |
193 |
|
fprintf(stderr, |
194 |
< |
"Usage: %s [-z|-L|-l|-f|-w][-b][-e +/-stops][-g gamma] {in.pic|-} out.tif\n", |
194 |
> |
"Usage: %s [-z|-L|-l|-f|-w][-b][-e +/-stops][-g gamma] {in.hdr|-} out.tif\n", |
195 |
|
progname); |
196 |
|
fprintf(stderr, |
197 |
< |
" Or: %s -r [-x][-e +/-stops][-g gamma] in.tif [out.pic|-]\n", |
197 |
> |
" Or: %s -r [-x][-e +/-stops][-g gamma] in.tif [out.hdr|-]\n", |
198 |
|
progname); |
199 |
|
exit(1); |
200 |
|
} |
362 |
|
quiterr("unknown input image resolution"); |
363 |
|
|
364 |
|
if (!TIFFGetField(cvts.tif, TIFFTAG_STONITS, &cvts.stonits)) |
365 |
< |
cvts.stonits = 1.; |
365 |
> |
cvts.stonits = -1.; |
366 |
|
|
367 |
|
if (!TIFFGetField(cvts.tif, TIFFTAG_DATETIME, &cp)) |
368 |
|
cvts.capdate[0] = '\0'; |
380 |
|
if (cvts.pixrat < .99 || cvts.pixrat > 1.01) |
381 |
|
fputaspect(cvts.pixrat, cvts.rfp); |
382 |
|
if (CHK(C_XYZE)) { |
383 |
< |
fputexpos(pow(2.,(double)cvts.bradj)/cvts.stonits, cvts.rfp); |
383 |
> |
if (cvts.stonits > .0) |
384 |
> |
fputexpos(pow(2.,(double)cvts.bradj)/cvts.stonits, cvts.rfp); |
385 |
|
fputformat(CIEFMT, cvts.rfp); |
386 |
|
} else { |
387 |
|
if (CHK(C_PRIM)) |
388 |
|
fputprims(cvts.prims, cvts.rfp); |
389 |
< |
fputexpos(WHTEFFICACY*pow(2.,(double)cvts.bradj)/cvts.stonits, |
390 |
< |
cvts.rfp); |
389 |
> |
if (cvts.stonits > .0) |
390 |
> |
fputexpos(WHTEFFICACY*pow(2.,(double)cvts.bradj)/cvts.stonits, |
391 |
> |
cvts.rfp); |
392 |
|
fputformat(COLRFMT, cvts.rfp); |
393 |
|
} |
394 |
|
if (cvts.capdate[0]) |
658 |
|
if (CHK(C_RFLT|C_TWRD|C_TFLT|C_GRY) != (C_RFLT|C_TFLT)) |
659 |
|
quiterr("internal error 1 in Luv2Color"); |
660 |
|
|
661 |
+ |
if (cvts.pconf != PLANARCONFIG_CONTIG) |
662 |
+ |
quiterr("cannot handle separate 32-bit color planes"); |
663 |
+ |
|
664 |
|
if (TIFFReadScanline(cvts.tif, cvts.t.p, y, 0) < 0) |
665 |
|
quiterr("error reading TIFF input"); |
666 |
|
/* also works for float RGB */ |
699 |
|
if (CHK(C_RFLT|C_TWRD|C_TFLT|C_GRY) != (C_TWRD|C_RFLT)) |
700 |
|
quiterr("internal error 1 in RRGGBB2Color"); |
701 |
|
|
702 |
+ |
if (cvts.pconf != PLANARCONFIG_CONTIG) |
703 |
+ |
quiterr("cannot handle separate 16-bit color planes"); |
704 |
+ |
|
705 |
|
if (TIFFReadScanline(cvts.tif, cvts.t.p, y, 0) < 0) |
706 |
|
quiterr("error reading TIFF input"); |
707 |
|
|
981 |
|
colortrans(cvts.r.colors[x], cvts.cmat, |
982 |
|
cvts.r.colors[x]); |
983 |
|
if (CHK(C_GAMUT)) |
984 |
< |
clipgamut(cvts.r.colors[x], cvts.t.fp[3*x + 1], |
984 |
> |
clipgamut(cvts.r.colors[x], bright(cvts.r.colors[x]), |
985 |
|
CGAMUT_LOWER, cblack, cwhite); |
986 |
|
} |
987 |
|
for (i = 3; i--; ) { |