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

Comparing ray/src/px/ra_pr.c (file contents):
Revision 1.10 by greg, Thu Apr 18 14:35:38 1991 UTC vs.
Revision 1.11 by greg, Wed Aug 7 08:36:31 1991 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 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 41 | Line 41 | extern double  atof(), pow();
41  
42   double  gamma = 2.0;                    /* gamma correction */
43  
44 + int  bradj = 0;                         /* brightness adjustment */
45 +
46   pic     *inpic, *outpic;
47  
48   char  *progname;
# Line 78 | Line 80 | char  *argv[];
80                          case 'b':
81                                  greyscale = !greyscale;
82                                  break;
83 +                        case 'e':
84 +                                if (argv[i+1][0] != '+' && argv[i+1][0] != '-')
85 +                                        goto userr;
86 +                                bradj = atoi(argv[++i]);
87 +                                break;
88                          case 'r':
89                                  reverse = !reverse;
90                                  break;
# Line 120 | Line 127 | char  *argv[];
127                                          /* convert file */
128                  pr2ra(&head);
129          } else {
130 <                if (i > argc-1 || i < argc-2)
130 >                if (i < argc-2 || (!greyscale && i > argc-1))
131                          goto userr;
132                  if ((inpic = openinput(argv[i], &head)) == NULL) {
133                          sprintf(errmsg, "can't open input \"%s\"", argv[i]);
# Line 140 | Line 147 | char  *argv[];
147          quiterr(NULL);
148   userr:
149          fprintf(stderr,
150 <        "Usage: %s [-d][-c ncolors][-b][-g gamma] input [output]\n",
150 >        "Usage: %s [-d][-c ncolors][-b][-g gamma][-e +/-stops] input [output]\n",
151                          progname);
152 <        fprintf(stderr, "   Or: %s -r [-g gamma] [input [output]]\n",
152 >        fprintf(stderr, "   Or: %s -r [-g gamma][-e +/-stops] [input [output]]\n",
153                          progname);
154          exit(1);
155   }
# Line 252 | Line 259 | struct rasterfile  *h;
259                                  pow((cmap[0][i]+.5)/256.,gamma),
260                                  pow((cmap[1][i]+.5)/256.,gamma),
261                                  pow((cmap[2][i]+.5)/256.,gamma));
262 +        if (bradj)
263 +                shiftcolrs(ctab, 256, bradj);
264                                          /* convert file */
265          for (i = 0; i < ymax; i++) {
266                  for (j = 0; j < xmax; j++) {
# Line 292 | Line 301 | register rgbpixel  *l3;
301                  quiterr("read error in picreadline3");
302          inpic->nexty = y+1;
303                                                          /* convert scanline */
304 <        normcolrs(inl, xmax, 0);
304 >        normcolrs(inl, xmax, bradj);
305          for (i = 0; i < xmax; i++) {
306                  l3[i].r = inl[i][RED];
307                  l3[i].g = inl[i][GRN];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines