278 |
|
break; |
279 |
|
case PHOTOMETRIC_MINISBLACK: |
280 |
|
SET(C_GRY|C_GAMMA|C_GAMUT); |
281 |
+ |
setcolrgam(cvts.gamcor); |
282 |
|
cvts.pconf = PLANARCONFIG_CONTIG; |
283 |
|
if (!TIFFGetField(cvts.tif, TIFFTAG_SAMPLESPERPIXEL, &hi) || |
284 |
|
hi != 1) |
360 |
|
SET(C_XYZE); |
361 |
|
else |
362 |
|
quiterr("unrecognized input picture format"); |
363 |
< |
return; |
363 |
> |
return(1); |
364 |
|
} |
365 |
|
if (isexpos(s)) { |
366 |
|
cvts.stonits /= exposval(s); |
367 |
< |
return; |
367 |
> |
return(1); |
368 |
|
} |
369 |
|
if (isaspect(s)) { |
370 |
|
cvts.pixrat *= aspectval(s); |
371 |
< |
return; |
371 |
> |
return(1); |
372 |
|
} |
373 |
|
if (isprims(s)) { |
374 |
|
primsval(cvts.prims, s); |
375 |
|
SET(C_PRIM); |
376 |
< |
return; |
376 |
> |
return(1); |
377 |
|
} |
378 |
+ |
return(0); |
379 |
|
} |
380 |
|
|
381 |
|
|
516 |
|
quiterr("error reading TIFF input"); |
517 |
|
|
518 |
|
for (x = cvts.xmax; x--; ) { |
519 |
< |
cvts.r.colors[x][RED] = cvts.t.fp[3*x]; |
520 |
< |
cvts.r.colors[x][GRN] = cvts.t.fp[3*x + 1]; |
521 |
< |
cvts.r.colors[x][BLU] = cvts.t.fp[3*x + 2]; |
519 |
> |
colval(cvts.r.colors[x],CIEX) = cvts.t.fp[3*x]; |
520 |
> |
colval(cvts.r.colors[x],CIEY) = cvts.t.fp[3*x + 1]; |
521 |
> |
colval(cvts.r.colors[x],CIEZ) = cvts.t.fp[3*x + 2]; |
522 |
|
if (CHK(C_CXFM)) |
523 |
|
colortrans(cvts.r.colors[x], cvts.cmat, |
524 |
|
cvts.r.colors[x]); |
550 |
|
quiterr("error reading TIFF input"); |
551 |
|
|
552 |
|
for (x = cvts.xmax; x--; ) |
553 |
< |
cvts.r.colors[x][RED] = |
554 |
< |
cvts.r.colors[x][GRN] = |
555 |
< |
cvts.r.colors[x][BLU] = cvts.t.fp[x] > 0. ? cvts.t.fp[x] : 0.; |
553 |
> |
colval(cvts.r.colors[x],RED) = |
554 |
> |
colval(cvts.r.colors[x],GRN) = |
555 |
> |
colval(cvts.r.colors[x],BLU) = |
556 |
> |
cvts.t.fp[x] > 0. ? cvts.t.fp[x] : 0.; |
557 |
|
|
558 |
|
if (fwritescan(cvts.r.colors, cvts.xmax, cvts.rfp) < 0) |
559 |
|
quiterr("error writing Radiance picture"); |
582 |
|
if (TIFFReadScanline(cvts.tif, cvts.t.p, y, 0) < 0) |
583 |
|
goto readerr; |
584 |
|
if (TIFFReadScanline(cvts.tif, |
585 |
< |
(tidata_t)(cvts.t.bp + cvts.xmax), y, 1) < 0) |
585 |
> |
(tdata_t)(cvts.t.bp + cvts.xmax), y, 1) < 0) |
586 |
|
goto readerr; |
587 |
|
if (TIFFReadScanline(cvts.tif, |
588 |
< |
(tidata_t)(cvts.t.bp + 2*cvts.xmax), y, 2) < 0) |
588 |
> |
(tdata_t)(cvts.t.bp + 2*cvts.xmax), y, 2) < 0) |
589 |
|
goto readerr; |
590 |
|
for (x = cvts.xmax; x--; ) { |
591 |
|
cvts.r.colrs[x][RED] = cvts.t.bp[x]; |
649 |
|
double m = pow(2.,(double)cvts.bradj); |
650 |
|
register int x; |
651 |
|
|
652 |
< |
if (CHK(C_RFLT|C_TFLT) != (C_RFLT|C_TFLT) | !CHK(C_GRY)) |
652 |
> |
if (CHK(C_RFLT|C_TFLT|C_GRY) != (C_RFLT|C_TFLT|C_GRY)) |
653 |
|
quiterr("internal error 1 in Color2L"); |
654 |
|
|
655 |
|
if (freadscan(cvts.r.colors, cvts.xmax, cvts.rfp) < 0) |
687 |
|
} |
688 |
|
|
689 |
|
for (x = cvts.xmax; x--; ) { |
690 |
< |
cvts.t.fp[3*x] = colval(cvts.r.colors[x],RED); |
691 |
< |
cvts.t.fp[3*x+1] = colval(cvts.r.colors[x],GRN); |
692 |
< |
cvts.t.fp[3*x+2] = colval(cvts.r.colors[x],BLU); |
690 |
> |
cvts.t.fp[3*x] = colval(cvts.r.colors[x],CIEX); |
691 |
> |
cvts.t.fp[3*x+1] = colval(cvts.r.colors[x],CIEY); |
692 |
> |
cvts.t.fp[3*x+2] = colval(cvts.r.colors[x],CIEZ); |
693 |
|
} |
694 |
|
|
695 |
|
if (TIFFWriteScanline(cvts.tif, cvts.t.p, y, 0) < 0) |