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

Comparing ray/src/px/ra_t8.c (file contents):
Revision 1.9 by greg, Thu Apr 18 14:35:45 1991 UTC vs.
Revision 1.10 by greg, Wed Aug 7 08:36:37 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 53 | Line 53 | extern double  atof(), pow();
53  
54   double  gamma = 2.0;                    /* gamma correction */
55  
56 + int  bradj = 0;                         /* brightness adjustment */
57 +
58   pic     *inpic;
59  
60   char  *progname;
# Line 95 | Line 97 | char  *argv[];
97                          case 'b':
98                                  greyscale = 1;
99                                  break;
100 +                        case 'e':
101 +                                if (argv[i+1][0] != '+' && argv[i+1][0] != '-')
102 +                                        goto userr;
103 +                                bradj = atoi(argv[++i]);
104 +                                break;
105                          case 'c':
106                                  ncolors = atoi(argv[++i]);
107                                  break;
# Line 131 | Line 138 | char  *argv[];
138                                          /* convert file */
139                  tg2ra(&head);
140          } else {
141 <                if (i > argc-1 || i < argc-2)
141 >                if (i < argc-2 || (!greyscale && i > argc-1))
142                          goto userr;
143                  if ((inpic = openinput(argv[i], &head)) == NULL) {
144                          sprintf(errmsg, "can't open input \"%s\"", argv[i]);
# Line 154 | Line 161 | char  *argv[];
161          quiterr(NULL);
162   userr:
163          fprintf(stderr,
164 <        "Usage: %s [-d][-c ncolors][-b][-g gamma] input [output]\n",
164 >        "Usage: %s [-d][-c ncolors][-b][-g gamma][-e +/-stops] input [output]\n",
165                          progname);
166 <        fprintf(stderr, "   Or: %s -r [-g gamma] [input [output]]\n",
166 >        fprintf(stderr, "   Or: %s -r [-g gamma][-e +/-stops] [input [output]]\n",
167                          progname);
168          exit(1);
169   }
# Line 340 | Line 347 | struct hdStruct  *hp;
347                                          pow((map.c4[i][3]+.5)/256.,gamma),
348                                          pow((map.c4[i][2]+.5)/256.,gamma),
349                                          pow((map.c4[i][1]+.5)/256.,gamma));
350 <
350 >        if (bradj)
351 >                shiftcolrs(ctab, 256, bradj);
352                                          /* allocate targa data */
353          tarData = taralloc(hp);
354                                          /* get data */
# Line 383 | Line 391 | register rgbpixel  *l3;
391                  quiterr("read error in picreadline3");
392          inpic->nexty = y+1;
393                                                          /* convert scanline */
394 <        normcolrs(inl, xmax, 0);
394 >        normcolrs(inl, xmax, bradj);
395          for (i = 0; i < xmax; i++) {
396                  l3[i].r = inl[i][RED];
397                  l3[i].g = inl[i][GRN];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines