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

Comparing ray/src/px/ra_t16.c (file contents):
Revision 1.12 by greg, Fri May 17 08:41:52 1991 UTC vs.
Revision 1.13 by greg, Wed Aug 7 08:36:35 1991 UTC

# Line 36 | Line 36 | extern double  atof(), pow();
36  
37   double  gamma = 2.0;                    /* gamma correction */
38  
39 + int  bradj = 0;                         /* brightness adjustment */
40 +
41   char  *progname;
42  
43   char  msg[128];
# Line 67 | Line 69 | char  *argv[];
69                          case '3':
70                                  head.dataBits = 24;
71                                  break;
72 +                        case 'e':
73 +                                if (argv[i+1][0] != '+' && argv[i+1][0] != '-')
74 +                                        goto userr;
75 +                                bradj = atoi(argv[++i]);
76 +                                break;
77                          default:
78                                  goto userr;
79                          }
# Line 119 | Line 126 | char  *argv[];
126          }
127          exit(0);
128   userr:
129 <        fprintf(stderr, "Usage: %s [-2|-3|-r][-g gamma] [input [output]]\n",
129 >        fprintf(stderr, "Usage: %s [-2|-3|-r][-g gamma][-e +/-stops] [input [output]]\n",
130                          progname);
131          exit(1);
132   }
# Line 267 | Line 274 | struct hdStruct  *hp;
274                          }
275                  }
276                  gambs_colrs(scanline, hp->x);
277 +                if (bradj)
278 +                        shiftcolrs(scanline, hp->x, bradj);
279                  if (fwritecolrs(scanline, hp->x, stdout) < 0)
280                          quiterr("error writing RADIANCE file");
281          }
# Line 288 | Line 297 | struct hdStruct  *hp;
297          for (j = hp->y-1; j >= 0; j--) {
298                  if (freadcolrs(inl, hp->x, stdin) < 0)
299                          quiterr("error reading RADIANCE file");
300 +                if (bradj)
301 +                        shiftcolrs(inl, hp->x, bradj);
302                  colrs_gambs(inl, hp->x);
303                  if (hp->dataBits == 16) {
304                          register unsigned short  *dp;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines