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

Comparing ray/src/px/normtiff.c (file contents):
Revision 3.3 by gwlarson, Tue Oct 27 08:54:37 1998 UTC vs.
Revision 3.6 by schorsch, Sun Jul 27 22:12:03 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Tone map SGILOG TIFF or Radiance picture and output 24-bit RGB TIFF
6   */
7  
11 #undef NOPROTO
12 #define NOPROTO 1
13
8   #include <stdio.h>
9   #include <math.h>
10 + #include <time.h>
11   #include "tiffio.h"
12   #include "color.h"
13   #include "tonemap.h"
# Line 47 | Line 42 | typedef struct {
42  
43   extern PICTURE  *openpicture();
44  
45 < #define closepicture(p)         (fclose((p)->fp),free((char *)(p)))
45 > #define closepicture(p)         (fclose((p)->fp),free((void *)(p)))
46  
47  
48   main(argc, argv)
# Line 175 | Line 170 | char   *fname;
170                  return(NULL);           /* serious error -- should exit? */
171          pp->fp = fp; pp->fmt[0] = '\0'; pp->pa = 1.;
172                                          /* load header */
173 <        if (getheader(fp, headline, pp) < 0) {
173 >        if (getheader(fp, headline, (char *)pp) < 0) {
174                  closepicture(pp);
175                  return(NULL);
176          }
# Line 204 | Line 199 | register PICTURE       *pp;
199                  return(-1);
200                                          /* figure out TIFF orientation */
201          for (orient = 8; --orient; )
202 <                if (ortab[orient] == pp->rs.or)
202 >                if (ortab[orient] == pp->rs.rt)
203                          break;
204          orient++;
205                                          /* put out our image */
# Line 212 | Line 207 | register PICTURE       *pp;
207                          72., 72./pp->pa, 2, pix) != 0)
208                  return(-1);
209                                          /* free data and we're done */
210 <        free((char *)pix);
210 >        free((void *)pix);
211          return(0);
212   }
213  
# Line 227 | Line 222 | TIFF   *tp;
222          BYTE    *pix;
223                                          /* check to make sure it's SGILOG */
224          TIFFGetFieldDefaulted(tp, TIFFTAG_PHOTOMETRIC, &phot);
225 <        if (phot != PHOTOMETRIC_LOGLUV && phot != PHOTOMETRIC_LOGL) {
231 <                if (!(flags & TM_F_NOSTDERR)) {
232 <                        fputs(fname, stderr);
233 <                        fputs(": TIFF must be in SGILOG format\n", stderr);
234 <                }
235 <                return(-1);
236 <        }
237 <        if (phot == PHOTOMETRIC_LOGL)
225 >        if ((phot == PHOTOMETRIC_LOGL) | (phot == PHOTOMETRIC_MINISBLACK))
226                  flags |= TM_F_BW;
227                                          /* read and tone map TIFF */
228          if (tmMapTIFF(&pix, &xsiz, &ysiz, flags,
# Line 250 | Line 238 | TIFF   *tp;
238                          xres, yres, resunit, pix) != 0)
239                  return(-1);
240                                          /* free data and we're done */
241 <        free((char *)pix);
241 >        free((void *)pix);
242          return(0);
243   }
244  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines