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

Comparing ray/src/px/ra_skel.c (file contents):
Revision 2.4 by greg, Thu Dec 17 15:50:13 1992 UTC vs.
Revision 2.8 by greg, Thu Nov 18 09:55:24 1993 UTC

# Line 19 | Line 19 | static char SCCSid[] = "$SunId$ LBL";
19   */
20  
21   #include  <stdio.h>
22 + #include  <math.h>
23   #ifdef MSDOS
24   #include  <fcntl.h>
25   #endif
# Line 27 | Line 28 | static char SCCSid[] = "$SunId$ LBL";
28  
29   extern char  *malloc();
30  
31 < double  gamma = 2.2;                    /* gamma correction */
31 > double  gamcor = 2.2;                   /* gamma correction */
32  
33   int  bradj = 0;                         /* brightness adjustment */
34  
# Line 49 | Line 50 | char  *argv[];
50                  if (argv[i][0] == '-')
51                          switch (argv[i][1]) {
52                          case 'g':               /* gamma correction */
53 <                                gamma = atof(argv[++i]);
53 >                                gamcor = atof(argv[++i]);
54                                  break;
55                          case 'e':               /* exposure adjustment */
56                                  if (argv[i+1][0] != '+' && argv[i+1][0] != '-')
# Line 73 | Line 74 | char  *argv[];
74                  exit(1);
75          }
76          if (i == argc-2 && freopen(argv[i+1], "w", stdout) == NULL) {
77 <                fprintf(stderr, "can't open output \"%s\"\n",
77 >                fprintf(stderr, "%s: can't open output \"%s\"\n",
78                                  progname, argv[i+1]);
79                  exit(1);
80          }
# Line 81 | Line 82 | char  *argv[];
82          setmode(fileno(stdin), O_BINARY);
83          setmode(fileno(stdout), O_BINARY);
84   #endif
85 <        setcolrgam(gamma);              /* set up gamma correction */
85 >        setcolrgam(gamcor);             /* set up gamma correction */
86          if (reverse) {
87                                          /* get their image resolution */
88                  read_skel_head(&xmax, &ymax);
# Line 133 | Line 134 | skel2ra()              /* convert 24-bit scanlines to Radiance pic
134                  quiterr("out of memory in skel2ra");
135                                                  /* convert image */
136          for (y = ymax-1; y >= 0; y--) {
137 <                scanout[x][RED] = getc(stdin);
138 <                scanout[x][GRN] = getc(stdin);
139 <                scanout[x][BLU] = getc(stdin);
140 <                if (feof(stdin) || ferror(stdin))
137 >                for (x = 0; x < xmax; x++) {
138 >                        scanout[x][RED] = getc(stdin);
139 >                        scanout[x][GRN] = getc(stdin);
140 >                        scanout[x][BLU] = getc(stdin);
141 >                }
142 >                if (feof(stdin) | ferror(stdin))
143                          quiterr("error reading skel image");
144                                                  /* undo gamma */
145                  gambs_colrs(scanout, xmax);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines