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.15 by greg, Mon Nov 11 14:01:40 1991 UTC

# Line 15 | Line 15 | static char SCCSid[] = "$SunId$ LBL";
15  
16   #include  "color.h"
17  
18 + #include  "resolu.h"
19 +
20   #include  "random.h"
21  
22   #include  "targa.h"
# Line 34 | Line 36 | extern char    *ecalloc(), *emalloc();
36  
37   extern double  atof(), pow();
38  
39 < double  gamma = 2.0;                    /* gamma correction */
39 > double  gamma = 2.2;                    /* gamma correction */
40  
41 + int  bradj = 0;                         /* brightness adjustment */
42 +
43   char  *progname;
44  
45   char  msg[128];
# Line 67 | Line 71 | char  *argv[];
71                          case '3':
72                                  head.dataBits = 24;
73                                  break;
74 +                        case 'e':
75 +                                if (argv[i+1][0] != '+' && argv[i+1][0] != '-')
76 +                                        goto userr;
77 +                                bradj = atoi(argv[++i]);
78 +                                break;
79                          default:
80                                  goto userr;
81                          }
# Line 98 | Line 107 | char  *argv[];
107                  printargs(i, argv, stdout);
108                  fputformat(COLRFMT, stdout);
109                  putchar('\n');
110 <                fputresolu(YMAJOR|YDECR, head.x, head.y, stdout);
110 >                fprtresolu(head.x, head.y, stdout);
111                                          /* convert file */
112                  tg2ra(&head);
113          } else {
114                  if (checkheader(stdin, COLRFMT, NULL) < 0 ||
115 <                        fgetresolu(&head.x, &head.y, stdin) != (YMAJOR|YDECR))
115 >                                fgetresolu(&head.x, &head.y, stdin) < 0)
116                          quiterr("bad picture file");
117                                          /* assign header */
118                  head.textSize = 0;
# Line 119 | Line 128 | char  *argv[];
128          }
129          exit(0);
130   userr:
131 <        fprintf(stderr, "Usage: %s [-2|-3|-r][-g gamma] [input [output]]\n",
131 >        fprintf(stderr, "Usage: %s [-2|-3|-r][-g gamma][-e +/-stops] [input [output]]\n",
132                          progname);
133          exit(1);
134   }
# Line 267 | Line 276 | struct hdStruct  *hp;
276                          }
277                  }
278                  gambs_colrs(scanline, hp->x);
279 +                if (bradj)
280 +                        shiftcolrs(scanline, hp->x, bradj);
281                  if (fwritecolrs(scanline, hp->x, stdout) < 0)
282                          quiterr("error writing RADIANCE file");
283          }
# Line 288 | Line 299 | struct hdStruct  *hp;
299          for (j = hp->y-1; j >= 0; j--) {
300                  if (freadcolrs(inl, hp->x, stdin) < 0)
301                          quiterr("error reading RADIANCE file");
302 +                if (bradj)
303 +                        shiftcolrs(inl, hp->x, bradj);
304                  colrs_gambs(inl, hp->x);
305                  if (hp->dataBits == 16) {
306                          register unsigned short  *dp;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines