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.2 by greg, Mon Nov 11 14:01:34 1991 UTC vs.
Revision 2.3 by greg, Mon Sep 21 12:15:13 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 + #ifdef MSDOS
13 + #include  <fcntl.h>
14 + #endif
15  
16   #include  "color.h"
17   #include  "resolu.h"
18  
19 + extern char  *malloc();
20 +
21   int  bradj = 0;                         /* brightness adjustment */
22  
23   int  doflat = 1;                        /* produce flat file */
# Line 25 | Line 30 | int  argc;
30   char  *argv[];
31   {
32          int  i;
33 <        
33 > #ifdef MSDOS
34 >        extern int  _fmode;
35 >        _fmode = O_BINARY;
36 >        setmode(fileno(stdin), O_BINARY);
37 >        setmode(fileno(stdout), O_BINARY);
38 > #endif
39          progname = argv[0];
40  
41          for (i = 1; i < argc; i++)
# Line 81 | Line 91 | transfer()             /* transfer Radiance picture */
91   {
92          extern double   pow();
93          int     order;
94 <        int     xmax, ymax;
94 >        int     xmax, ymax;
95          COLR    *scanin;
96          register int    x;
97          int     y;
# Line 89 | Line 99 | transfer()             /* transfer Radiance picture */
99          if (checkheader(stdin, COLRFMT, stdout) < 0 ||
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);
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));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines