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.13 by gregl, Wed Aug 27 11:10:45 1997 UTC vs.
Revision 2.17 by gwlarson, Tue Oct 27 09:08:27 1998 UTC

# Line 278 | Line 278 | initfromtif()          /* initialize conversion from TIFF inpu
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)
# Line 359 | Line 360 | char   *s;
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  
# Line 514 | Line 516 | uint32 y;
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]);
# Line 548 | Line 550 | uint32 y;
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");
# Line 579 | Line 582 | uint32 y;
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];
# Line 684 | Line 687 | uint32 y;
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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines