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.22 by greg, Tue Jul 1 22:44:02 2003 UTC vs.
Revision 2.27 by schorsch, Fri Jan 2 12:47:01 2004 UTC

# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10   #include  <stdio.h>
11   #include  <math.h>
12   #include  <ctype.h>
13 + #include  <time.h>
14 + #include  <string.h>
15 +
16   #include  "tiffio.h"
17   #include  "color.h"
18   #include  "resolu.h"
# Line 93 | Line 96 | char           OWNSTR[] = "OWNER=";
96  
97   char  *progname;
98  
99 + static gethfunc headline;
100  
101 +
102   main(argc, argv)
103   int  argc;
104   char  *argv[];
# Line 160 | Line 165 | doneopts:
165                  if (i != argc-2)
166                          goto userr;
167                                                  /* consistency checks */
168 <                if (CHK(C_GRY))
168 >                if (CHK(C_GRY)) {
169                          if (cvts.phot == PHOTOMETRIC_RGB)
170                                  cvts.phot = PHOTOMETRIC_MINISBLACK;
171                          else {
172                                  cvts.phot = PHOTOMETRIC_LOGL;
173                                  cvts.comp = COMPRESSION_SGILOG;
174                          }
175 +                }
176                  if (CHK(C_TWRD|C_TFLT) == (C_TWRD|C_TFLT))
177                          goto userr;
178  
# Line 206 | Line 212 | allocbufs()                    /* allocate scanline buffers */
212                          (CHK(C_GRY) ? 1 : 3);
213          cvts.r.p = (char *)malloc(rsiz*cvts.xmax);
214          cvts.t.p = (char *)malloc(tsiz*cvts.xmax);
215 <        if (cvts.r.p == NULL | cvts.t.p == NULL)
215 >        if ((cvts.r.p == NULL) | (cvts.t.p == NULL))
216                  quiterr("no memory to allocate scanline buffers");
217   }
218  
# Line 409 | Line 415 | char  *av[];
415   }
416  
417  
418 < int
419 < headline(s)                     /* process Radiance input header line */
420 < char    *s;
418 > static int
419 > headline(                       /* process Radiance input header line */
420 >        char    *s,
421 >        void    *p
422 > )
423   {
424          static int      tmstrlen = 0;
425          static int      ownstrlen = 0;
# Line 541 | Line 549 | initfromrad()                  /* initialize input from a Radiance pi
549                          cvts.tf = Color2RRGGBB;
550                          SET(C_RFLT);
551                  } else if (CHK(C_TFLT)) {
552 +                        TIFFSetField(cvts.tif, TIFFTAG_SAMPLEFORMAT,
553 +                                        SAMPLEFORMAT_IEEEFP);
554                          cvts.tf = Color2RfGfBf;
555                          SET(C_RFLT);
556                  } else
# Line 553 | Line 563 | initfromrad()                  /* initialize input from a Radiance pi
563                          cvts.tf = Color2GGry;
564                          SET(C_RFLT);
565                  } else if (CHK(C_TFLT)) {
566 +                        TIFFSetField(cvts.tif, TIFFTAG_SAMPLEFORMAT,
567 +                                        SAMPLEFORMAT_IEEEFP);
568                          cvts.tf = Color2Gryf;
569                          SET(C_RFLT);
570                  } else
# Line 654 | Line 666 | void
666   RRGGBB2Color(y)                 /* read/convert/write RGB16->COLOR scanline */
667   uint32  y;
668   {
669 <        int     dogamma = cvts.gamcor < 0.99 | cvts.gamcor > 1.01;
669 >        int     dogamma = (cvts.gamcor < 0.99) | (cvts.gamcor > 1.01);
670          register double d;
671          register int    x;
672  
# Line 801 | Line 813 | void
813   GGry2Color(y)                   /* read/convert/write G16->COLOR scanline */
814   uint32  y;
815   {
816 <        int     dogamma = cvts.gamcor < 0.99 | cvts.gamcor > 1.01;
816 >        int     dogamma = (cvts.gamcor < 0.99) | (cvts.gamcor > 1.01);
817          double  m;
818          register double d;
819          register int    x;
# Line 831 | Line 843 | void
843   Color2GGry(y)                   /* read/convert/write COLOR->G16 scanline */
844   uint32  y;
845   {
846 <        int     dogamma = cvts.gamcor < 0.99 | cvts.gamcor > 1.01;
846 >        int     dogamma = (cvts.gamcor < 0.99) | (cvts.gamcor > 1.01);
847          float   m = pow(2.,(double)cvts.bradj);
848          register int    x;
849  
# Line 920 | Line 932 | void
932   Color2RRGGBB(y)                 /* read/convert/write COLOR->RGB16 scanline */
933   uint32  y;
934   {
935 <        int     dogamma = cvts.gamcor < 0.99 | cvts.gamcor > 1.01;
935 >        int     dogamma = (cvts.gamcor < 0.99) | (cvts.gamcor > 1.01);
936          float   m = pow(2.,(double)cvts.bradj);
937          register int    x, i;
938  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines