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.8 by schorsch, Sun Mar 28 20:33:14 2004 UTC vs.
Revision 3.10 by greg, Tue Sep 26 12:26:02 2006 UTC

# Line 43 | Line 43 | typedef struct {
43          RESOLU  rs;             /* picture resolution */
44   } PICTURE;
45  
46 < //extern PICTURE        *openpicture();
46 > uint16  comp = COMPRESSION_NONE;        /* TIFF compression mode */
47  
48   #define closepicture(p)         (fclose((p)->fp),free((void *)(p)))
49  
50   static gethfunc headline;
51  
52 < static int headline(char        *s, void *pp);
53 < static PICTURE * openpicture(char       *fname);
54 < static int tmap_picture(char    *fname, PICTURE *pp);
55 < static int tmap_tiff(char       *fname, TIFF    *tp);
56 < static int putimage(uint16      or, uint32      xs, uint32      ys, float       xr, float       yr,
52 > static int headline(char *s, void *pp);
53 > static PICTURE *openpicture(char *fname);
54 > static int tmap_picture(char *fname, PICTURE *pp);
55 > static int tmap_tiff(char *fname, TIFF *tp);
56 > static int putimage(uint16 or, uint32 xs, uint32 ys, float xr, float yr,
57          uint16 ru, BYTE *pd);
58  
59  
# Line 96 | Line 96 | main(
96                          if (argc-i < 2) goto userr;
97                          lddyn = atof(argv[++i]);
98                          break;
99 +                case 'z':                       /* LZW compression */
100 +                        comp = COMPRESSION_LZW;
101 +                        break;
102                  case 'p':                       /* set display primaries */
103                          if (argc-i < 9) goto userr;
104                          myprims[RED][CIEX] = atof(argv[++i]);
# Line 134 | Line 137 | main(
137          exit(rval==0 ? 0 : 1);
138   userr:
139          fprintf(stderr,
140 < "Usage: %s [-h][-s][-c][-l][-b][-g gv][-d ld][-u lm][-p xr yr xg yg xb yb xw yw] input.{tif|pic} output.tif\n",
140 > "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                          argv[0]);
142          exit(1);
143   }
# Line 208 | Line 211 | tmap_picture(                  /* tone map Radiance picture */
211   )
212   {
213          uint16  orient;
214 +        double  paspect = (pp->rs.rt & YMAJOR) ? pp->pa : 1./pp->pa;
215          int     xsiz, ysiz;
216          BYTE    *pix;
217                                          /* read and tone map picture */
# Line 221 | Line 225 | tmap_picture(                  /* tone map Radiance picture */
225          orient++;
226                                          /* put out our image */
227          if (putimage(orient, (uint32)xsiz, (uint32)ysiz,
228 <                        72., 72./pp->pa, 2, pix) != 0)
228 >                        72., 72./paspect, 2, pix) != 0)
229                  return(-1);
230                                          /* free data and we're done */
231          free((void *)pix);
# Line 269 | Line 273 | putimage(      /* write out our image */
273          uint32  ys,
274          float   xr,
275          float   yr,
276 <        uint16 ru,
276 >        uint16  ru,
277          BYTE    *pd
278   )
279   {
# Line 294 | Line 298 | putimage(      /* write out our image */
298          TIFFSetField(tifout, TIFFTAG_IMAGEWIDTH, xs);
299          TIFFSetField(tifout, TIFFTAG_IMAGELENGTH, ys);
300          TIFFSetField(tifout, TIFFTAG_RESOLUTIONUNIT, ru);
301 +        TIFFSetField(tifout, TIFFTAG_COMPRESSION, comp);
302          TIFFSetField(tifout, TIFFTAG_XRESOLUTION, xr);
303          TIFFSetField(tifout, TIFFTAG_YRESOLUTION, yr);
304          TIFFSetField(tifout, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines