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

Comparing ray/src/px/ra_bn.c (file contents):
Revision 1.7 by greg, Thu Apr 18 14:35:35 1991 UTC vs.
Revision 1.8 by greg, Wed Aug 7 08:36:29 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 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   char  errmsg[128];
# Line 45 | Line 47 | char  *argv[];
47                          case 'r':
48                                  reverse = !reverse;
49                                  break;
50 +                        case 'e':
51 +                                if (argv[i+1][0] != '+' && argv[i+1][0] != '-')
52 +                                        goto userr;
53 +                                bradj = atoi(argv[++i]);
54 +                                break;
55                          default:
56                                  goto userr;
57                          }
# Line 97 | Line 104 | char  *argv[];
104          }
105          quiterr(NULL);
106   userr:
107 <        fprintf(stderr, "Usage: %s [-g gamma] {input|-} output\n", progname);
101 <        fprintf(stderr, "   or: %s -r [-g gamma] input [output|-]\n",
107 >        fprintf(stderr, "Usage: %s [-g gamma][-e +/-stops] {input|-} output\n",
108                          progname);
109 +        fprintf(stderr, "   or: %s -r [-g gamma][-e +/-stops] input [output|-]\n",
110 +                        progname);
111          exit(1);
112   }
113  
# Line 177 | Line 185 | ra2bn()                                        /* convert radiance to barneyscan */
185          for (j = 0; j < ymax; j++) {
186                  if (freadcolrs(inl, xmax, rafp) < 0)
187                          quiterr("error reading RADIANCE file");
188 +                if (bradj)
189 +                        shiftcolrs(inl, xmax, bradj);
190                  colrs_gambs(inl, xmax);
191                  for (i = 0; i < xmax; i++) {
192                          putc(inl[i][RED], bnfp[0]);
# Line 207 | Line 217 | bn2ra()                                        /* convert barneyscan to radiance */
217                  if (feof(bnfp[0]) || feof(bnfp[1]) || feof(bnfp[2]))
218                          quiterr("error reading barney file");
219                  gambs_colrs(outline, xmax);
220 +                if (bradj)
221 +                        shiftcolrs(outline, xmax, bradj);
222                  if (fwritecolrs(outline, xmax, rafp) < 0)
223                          quiterr("error writing RADIANCE file");
224          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines