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.6 by greg, Sat Dec 28 18:05:14 2019 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>
8 > #include  "platform.h"
9   #include  "color.h"
10 + #include  "rtio.h"
11   #include  "resolu.h"
12  
15 extern char  *malloc();
16
13   char  *progname;
18
14   int  xmax, ymax;
20
15   double  thresh = 0.5;           /* threshold value */
22
16   COLR    threshclr;
17  
18   #define abovethresh(c)  ((c)[EXP]>threshclr[EXP] || \
19                          ((c)[EXP]==threshclr[EXP] && (c)[GRN]>threshclr[GRN]))
20  
21 + static void quiterr(char *err);
22 + static void ra2hex(void);
23  
24 < main(argc, argv)
25 < int  argc;
26 < char  *argv[];
24 >
25 > int
26 > main(
27 >        int  argc,
28 >        char  *argv[]
29 > )
30   {
31          int  i;
32          
# Line 60 | Line 58 | char  *argv[];
58          }
59                                  /* assign threshold color */
60          setcolr(threshclr, thresh, thresh, thresh);
61 +                                /* binary input */
62 +        SET_FILE_BINARY(stdin);
63                                  /* get our header */
64          if (checkheader(stdin, COLRFMT, NULL) < 0 ||
65                          fgetresolu(&xmax, &ymax, stdin) < 0)
# Line 74 | Line 74 | userr:
74   }
75  
76  
77 < quiterr(err)            /* print message and exit */
78 < char  *err;
77 > static void
78 > quiterr(                /* print message and exit */
79 >        char  *err
80 > )
81   {
82          if (err != NULL) {
83                  fprintf(stderr, "%s: %s\n", progname, err);
# Line 85 | Line 87 | char  *err;
87   }
88  
89  
90 < ra2hex()                /* convert Radiance scanlines to 4x1 bit hex */
90 > static void
91 > ra2hex(void)            /* convert Radiance scanlines to 4x1 bit hex */
92   {
93          static char     cmap[] = "0123456789ABCDEF";
94          COLR    *scanin;
# Line 115 | Line 118 | ra2hex()               /* convert Radiance scanlines to 4x1 bit hex
118                          quiterr("error writing hex bit file");
119          }
120                                                  /* free scanline */
121 <        free((char *)scanin);
121 >        free((void *)scanin);
122   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines