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.29 by greg, Tue Mar 22 04:51:56 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 709 | Line 710 | RRGGBB2Color(                  /* read/convert/write RGB16->COLOR sca
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);
# Line 970 | Line 968 | Color2RRGGBB(                  /* read/convert/write COLOR->RGB16 sca
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)
# Line 983 | Line 988 | Color2RRGGBB(                  /* read/convert/write COLOR->RGB16 sca
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");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines