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 2.2 by greg, Thu Dec 19 14:52:07 1991 UTC vs.
Revision 2.8 by schorsch, Thu Jun 5 19:29:34 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  ra_bn.c - program to convert between RADIANCE and barneyscan picture format.
6   *
# Line 11 | Line 8 | static char SCCSid[] = "$SunId$ LBL";
8   */
9  
10   #include  <stdio.h>
11 + #include  <time.h>
12 + #include  <math.h>
13  
14 + #include  "platform.h"
15   #include  "color.h"
16
16   #include  "resolu.h"
17  
18 < extern double  pow();
18 > double  gamcor = 2.0;                   /* gamma correction */
19  
21 double  gamma = 2.0;                    /* gamma correction */
22
20   int  bradj = 0;                         /* brightness adjustment */
21  
22   char  *progname;
# Line 37 | Line 34 | char  *argv[];
34   {
35          int  reverse = 0;
36          int  i;
37 <        
37 >        SET_DEFAULT_BINARY();
38 >        SET_FILE_BINARY(stdin);
39 >        SET_FILE_BINARY(stdout);
40          progname = argv[0];
41  
42          for (i = 1; i < argc; i++)
43                  if (argv[i][0] == '-')
44                          switch (argv[i][1]) {
45                          case 'g':
46 <                                gamma = atof(argv[++i]);
46 >                                gamcor = atof(argv[++i]);
47                                  break;
48                          case 'r':
49                                  reverse = !reverse;
# Line 60 | Line 59 | char  *argv[];
59                  else
60                          break;
61                                                  /* set gamma correction */
62 <        setcolrgam(gamma);
62 >        setcolrgam(gamcor);
63  
64          if (reverse) {
65                  if (i > argc-1 || i < argc-2)
# Line 77 | Line 76 | char  *argv[];
76                          quiterr(errmsg);
77                  }
78                                          /* put header */
79 +                newheader("RADIANCE", stdout);
80                  printargs(i, argv, rafp);
81                  fputformat(COLRFMT, rafp);
82                  putc('\n', rafp);
# Line 198 | Line 198 | ra2bn()                                        /* convert radiance to barneyscan */
198                  if (ferror(bnfp[0]) || ferror(bnfp[1]) || ferror(bnfp[2]))
199                          quiterr("error writing Barney files");
200          }
201 <        free((char *)inl);
201 >        free((void *)inl);
202   }
203  
204  
# Line 224 | Line 224 | bn2ra()                                        /* convert barneyscan to radiance */
224                  if (fwritecolrs(outline, xmax, rafp) < 0)
225                          quiterr("error writing RADIANCE file");
226          }
227 <        free((char *)outline);
227 >        free((void *)outline);
228   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines