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.9 by greg, Tue Jun 14 22:23:31 2005 UTC vs.
Revision 3.12 by greg, Sat Dec 4 00:24:43 2010 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 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 211 | Line 213 | tmap_picture(                  /* tone map Radiance picture */
213   )
214   {
215          uint16  orient;
216 +        double  paspect = (pp->rs.rt & YMAJOR) ? pp->pa : 1./pp->pa;
217          int     xsiz, ysiz;
218          BYTE    *pix;
219                                          /* read and tone map picture */
# Line 224 | Line 227 | tmap_picture(                  /* tone map Radiance picture */
227          orient++;
228                                          /* put out our image */
229          if (putimage(orient, (uint32)xsiz, (uint32)ysiz,
230 <                        72., 72./pp->pa, 2, pix) != 0)
230 >                        72., 72./paspect, 2, pix) != 0)
231                  return(-1);
232                                          /* free data and we're done */
233          free((void *)pix);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines