ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/ra_tiff.c
(Generate patch)

Comparing ray/src/px/ra_tiff.c (file contents):
Revision 2.28 by schorsch, Sun Mar 28 20:33:14 2004 UTC vs.
Revision 2.31 by greg, Tue Jun 7 16:54:23 2005 UTC

# Line 275 | Line 275 | initfromtif(void)              /* initialize conversion from TIFF
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,
# Line 569 | Line 569 | initfromrad(void)                      /* initialize input from a Radianc
569                                          SAMPLEFORMAT_IEEEFP);
570                          cvts.tf = Color2RfGfBf;
571                          SET(C_RFLT);
572 +                        CLR(C_GAMUT);
573                  } else
574                          cvts.tf = Colr2RGB;
575                  break;
# Line 655 | Line 656 | Luv2Color(                     /* read/convert/write Luv->COLOR scanline
656          if (CHK(C_RFLT|C_TWRD|C_TFLT|C_GRY) != (C_RFLT|C_TFLT))
657                  quiterr("internal error 1 in Luv2Color");
658  
659 +        if (cvts.pconf != PLANARCONFIG_CONTIG)
660 +                quiterr("cannot handle separate 32-bit color planes");
661 +
662          if (TIFFReadScanline(cvts.tif, cvts.t.p, y, 0) < 0)
663                  quiterr("error reading TIFF input");
664                                          /* also works for float RGB */
# Line 693 | Line 697 | RRGGBB2Color(                  /* read/convert/write RGB16->COLOR sca
697          if (CHK(C_RFLT|C_TWRD|C_TFLT|C_GRY) != (C_TWRD|C_RFLT))
698                  quiterr("internal error 1 in RRGGBB2Color");
699  
700 +        if (cvts.pconf != PLANARCONFIG_CONTIG)
701 +                quiterr("cannot handle separate 16-bit color planes");
702 +
703          if (TIFFReadScanline(cvts.tif, cvts.t.p, y, 0) < 0)
704                  quiterr("error reading TIFF input");
705          
# Line 709 | Line 716 | RRGGBB2Color(                  /* read/convert/write RGB16->COLOR sca
716                  if (CHK(C_CXFM))
717                          colortrans(cvts.r.colors[x], cvts.cmat,
718                                          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);
719          }
720          if (cvts.bradj) {
721                  d = pow(2.,(double)cvts.bradj);
# Line 970 | Line 974 | Color2RRGGBB(                  /* read/convert/write COLOR->RGB16 sca
974          if (freadscan(cvts.r.colors, cvts.xmax, cvts.rfp) < 0)
975                  quiterr("error reading Radiance picture");
976  
977 <        for (x = cvts.xmax; x--; )
977 >        for (x = cvts.xmax; x--; ) {
978 >            if (CHK(C_CXFM)) {
979 >                        colortrans(cvts.r.colors[x], cvts.cmat,
980 >                                        cvts.r.colors[x]);
981 >                if (CHK(C_GAMUT))
982 >                        clipgamut(cvts.r.colors[x], bright(cvts.r.colors[x]),
983 >                                        CGAMUT_LOWER, cblack, cwhite);
984 >            }
985              for (i = 3; i--; ) {
986                  register float  f = m*colval(cvts.r.colors[x],i);
987                  if (f <= 0)
# Line 983 | Line 994 | Color2RRGGBB(                  /* read/convert/write COLOR->RGB16 sca
994                  else
995                          cvts.t.wp[3*x + i] = (int)((float)(1L<<16)*f);
996              }
997 +        }
998  
999          if (TIFFWriteScanline(cvts.tif, cvts.t.p, y, 0) < 0)
1000                  quiterr("error writing TIFF output");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines