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.10 by greg, Tue Sep 26 12:26:02 2006 UTC vs.
Revision 3.13 by greg, Fri May 20 02:06:39 2011 UTC

# Line 10 | Line 10 | static const char      RCSid[] = "$Id$";
10   #include <time.h>
11   #include <string.h>
12  
13 + #include "platform.h"
14   #include "tiffio.h"
15   #include "color.h"
16   #include "tonemap.h"
# Line 54 | Line 55 | static PICTURE *openpicture(char *fname);
55   static int tmap_picture(char *fname, PICTURE *pp);
56   static int tmap_tiff(char *fname, TIFF *tp);
57   static int putimage(uint16 or, uint32 xs, uint32 ys, float xr, float yr,
58 <        uint16 ru, BYTE *pd);
58 >        uint16 ru, uby8 *pd);
59  
60  
61   int
# Line 137 | Line 138 | main(
138          exit(rval==0 ? 0 : 1);
139   userr:
140          fprintf(stderr,
141 < "Usage: %s [-h][-s][-c][-l][-b][-g gv][-d ld][-u lm][-z][-p xr yr xg yg xb yb xw yw] input.{tif|pic} output.tif\n",
141 > "Usage: %s [-h][-s][-c][-l][-b][-g gv][-d ld][-u lm][-z][-p xr yr xg yg xb yb xw yw] input.{tif|hdr} output.tif\n",
142                          argv[0]);
143          exit(1);
144   }
# Line 184 | Line 185 | openpicture(                   /* open/check Radiance picture file */
185                                          /* else try opening it */
186          if ((fp = fopen(fname, "r")) == NULL)
187                  return(NULL);
188 +        SET_FILE_BINARY(fp);
189                                          /* allocate struct */
190          if ((pp = (PICTURE *)malloc(sizeof(PICTURE))) == NULL)
191                  return(NULL);           /* serious error -- should exit? */
# Line 213 | Line 215 | tmap_picture(                  /* tone map Radiance picture */
215          uint16  orient;
216          double  paspect = (pp->rs.rt & YMAJOR) ? pp->pa : 1./pp->pa;
217          int     xsiz, ysiz;
218 <        BYTE    *pix;
218 >        uby8    *pix;
219                                          /* read and tone map picture */
220          if (tmMapPicture(&pix, &xsiz, &ysiz, flags,
221                          rgbp, gamv, lddyn, ldmax, fname, pp->fp) != TM_E_OK)
# Line 242 | Line 244 | tmap_tiff(                     /* tone map SGILOG TIFF */
244          float   xres, yres;
245          uint16  orient, resunit, phot;
246          int     xsiz, ysiz;
247 <        BYTE    *pix;
247 >        uby8    *pix;
248                                          /* check to make sure it's SGILOG */
249          TIFFGetFieldDefaulted(tp, TIFFTAG_PHOTOMETRIC, &phot);
250          if ((phot == PHOTOMETRIC_LOGL) | (phot == PHOTOMETRIC_MINISBLACK))
# Line 274 | Line 276 | putimage(      /* write out our image */
276          float   xr,
277          float   yr,
278          uint16  ru,
279 <        BYTE    *pd
279 >        uby8    *pd
280   )
281   {
282          register int    y;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines