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

Comparing ray/src/px/ra_rgbe.c (file contents):
Revision 1.1 by greg, Fri Aug 23 17:37:14 1991 UTC vs.
Revision 2.4 by greg, Fri Oct 2 16:26:39 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 9 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9   */
10  
11   #include  <stdio.h>
12 <
12 > #include  <math.h>
13   #include  "color.h"
14 + #include  "resolu.h"
15  
16 + #ifdef MSDOS
17 + #include  <fcntl.h>
18 + #endif
19 +
20 + extern char  *malloc();
21 +
22   int  bradj = 0;                         /* brightness adjustment */
23  
24   int  doflat = 1;                        /* produce flat file */
# Line 24 | Line 31 | int  argc;
31   char  *argv[];
32   {
33          int  i;
34 <        
34 > #ifdef MSDOS
35 >        extern int  _fmode;
36 >        _fmode = O_BINARY;
37 >        setmode(fileno(stdin), O_BINARY);
38 >        setmode(fileno(stdout), O_BINARY);
39 > #endif
40          progname = argv[0];
41  
42          for (i = 1; i < argc; i++)
# Line 78 | Line 90 | char  *err;
90  
91   transfer()              /* transfer Radiance picture */
92   {
93 <        extern double   pow();
94 <        int     xmax, ymax;
93 >        int     order;
94 >        int     xmax, ymax;
95          COLR    *scanin;
96          register int    x;
97          int     y;
98                                  /* get header info. */
99          if (checkheader(stdin, COLRFMT, stdout) < 0 ||
100 <                        fgetresolu(&xmax, &ymax, stdin) != (YMAJOR|YDECR))
100 >                        (order = fgetresolu(&xmax, &ymax, stdin)) < 0)
101                  quiterr("bad picture format");
102 +        fputs(progname, stdout);
103          if (bradj)
104 <                fputexpos(pow(2.0, (double)bradj), stdout);
105 <        if (!doflat) {
104 >                printf(" -e %+d", bradj);
105 >        if (doflat)
106 >                fputs("\n", stdout);
107 >        else {
108 >                fputs(" -r\n", stdout);
109                  fputformat(COLRFMT, stdout);
110 <                printf("%s -r\n\n", progname);
111 <        } else
112 <                printf("%s\n\n", progname);
113 <        fputresolu(YMAJOR|YDECR, xmax, ymax, stdout);
110 >        }
111 >        if (bradj)
112 >                fputexpos(pow(2.0, (double)bradj), stdout);
113 >        fputs("\n", stdout);
114 >        fputresolu(order, xmax, ymax, stdout);
115                                                  /* allocate scanline */
116          scanin = (COLR *)malloc(xmax*sizeof(COLR));
117          if (scanin == NULL)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines