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

Comparing ray/src/px/ra_hexbit.c (file contents):
Revision 3.1 by gwlarson, Wed Jul 8 18:01:00 1998 UTC vs.
Revision 3.5 by greg, Tue Apr 17 17:42:28 2018 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Create a 4x1 hex bitmap from a Radiance picture.
6   */
7  
8   #include  <stdio.h>
9 + #include  <time.h>
10 +
11 + #include  "platform.h"
12   #include  "color.h"
13 + #include  "rtio.h"
14   #include  "resolu.h"
15  
15 extern char  *malloc();
16
16   char  *progname;
18
17   int  xmax, ymax;
20
18   double  thresh = 0.5;           /* threshold value */
22
19   COLR    threshclr;
20  
21   #define abovethresh(c)  ((c)[EXP]>threshclr[EXP] || \
22                          ((c)[EXP]==threshclr[EXP] && (c)[GRN]>threshclr[GRN]))
23  
24 + static void quiterr(char *err);
25 + static void ra2hex(void);
26  
27 < main(argc, argv)
28 < int  argc;
29 < char  *argv[];
27 >
28 > int
29 > main(
30 >        int  argc,
31 >        char  *argv[]
32 > )
33   {
34          int  i;
35          
# Line 60 | Line 61 | char  *argv[];
61          }
62                                  /* assign threshold color */
63          setcolr(threshclr, thresh, thresh, thresh);
64 +                                /* binary input */
65 +        SET_FILE_BINARY(stdin);
66                                  /* get our header */
67          if (checkheader(stdin, COLRFMT, NULL) < 0 ||
68                          fgetresolu(&xmax, &ymax, stdin) < 0)
# Line 74 | Line 77 | userr:
77   }
78  
79  
80 < quiterr(err)            /* print message and exit */
81 < char  *err;
80 > static void
81 > quiterr(                /* print message and exit */
82 >        char  *err
83 > )
84   {
85          if (err != NULL) {
86                  fprintf(stderr, "%s: %s\n", progname, err);
# Line 85 | Line 90 | char  *err;
90   }
91  
92  
93 < ra2hex()                /* convert Radiance scanlines to 4x1 bit hex */
93 > static void
94 > ra2hex(void)            /* convert Radiance scanlines to 4x1 bit hex */
95   {
96          static char     cmap[] = "0123456789ABCDEF";
97          COLR    *scanin;
# Line 115 | Line 121 | ra2hex()               /* convert Radiance scanlines to 4x1 bit hex
121                          quiterr("error writing hex bit file");
122          }
123                                                  /* free scanline */
124 <        free((char *)scanin);
124 >        free((void *)scanin);
125   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines