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

Comparing ray/src/px/ra_pr24.c (file contents):
Revision 1.6 by greg, Mon Apr 29 11:14:10 1991 UTC vs.
Revision 1.7 by greg, Wed Aug 7 08:36:33 1991 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1990 Regents of the University of California */
1 > /* Copyright (c) 1991 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 18 | Line 18 | extern double  atof(), pow();
18  
19   double  gamma = 2.0;                    /* gamma correction */
20  
21 + int  bradj = 0;                         /* brightness adjustment */
22 +
23   char  *progname;
24  
25   int  xmax, ymax;
# Line 39 | Line 41 | char  *argv[];
41                          case 'g':
42                                  gamma = atof(argv[++i]);
43                                  break;
44 +                        case 'e':
45 +                                if (argv[i+1][0] != '+' && argv[i+1][0] != '-')
46 +                                        goto userr;
47 +                                bradj = atoi(argv[++i]);
48 +                                break;
49                          case 'r':
50                                  reverse = !reverse;
51                                  break;
# Line 101 | Line 108 | char  *argv[];
108          }
109          exit(0);
110   userr:
111 <        fprintf(stderr, "Usage: %s [-r][-g gamma] [input [output]]\n",
111 >        fprintf(stderr, "Usage: %s [-r][-g gamma][-e +/-stops] [input [output]]\n",
112                          progname);
113          exit(1);
114   }
# Line 143 | Line 150 | int    rf;
150                  if (feof(stdin) || ferror(stdin))
151                          quiterr("error reading rasterfile");
152                  gambs_colrs(scanout, xmax);
153 +                if (bradj)
154 +                        shiftcolrs(scanout, xmax, bradj);
155                  if (fwritecolrs(scanout, xmax, stdout) < 0)
156                          quiterr("error writing Radiance picture");
157          }
# Line 164 | Line 173 | ra2pr()                        /* convert Radiance scanlines to 24-bit rast
173          for (y = ymax-1; y >= 0; y--) {
174                  if (freadcolrs(scanin, xmax, stdin) < 0)
175                          quiterr("error reading Radiance picture");
176 +                if (bradj)
177 +                        shiftcolrs(scanin, xmax, bradj);
178                  colrs_gambs(scanin, xmax);
179                  for (x = 0; x < xmax; x++) {
180                          putc(scanin[x][BLU], stdout);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines