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 "color.h" |
12 |
+ |
#include "rtio.h" |
13 |
|
#include "resolu.h" |
14 |
|
|
15 |
– |
extern char *malloc(); |
16 |
– |
|
15 |
|
char *progname; |
18 |
– |
|
16 |
|
int xmax, ymax; |
20 |
– |
|
17 |
|
double thresh = 0.5; /* threshold value */ |
22 |
– |
|
18 |
|
COLR threshclr; |
19 |
|
|
20 |
|
#define abovethresh(c) ((c)[EXP]>threshclr[EXP] || \ |
21 |
|
((c)[EXP]==threshclr[EXP] && (c)[GRN]>threshclr[GRN])) |
22 |
|
|
23 |
+ |
static void quiterr(char *err); |
24 |
+ |
static void ra2hex(void); |
25 |
|
|
26 |
< |
main(argc, argv) |
27 |
< |
int argc; |
28 |
< |
char *argv[]; |
26 |
> |
|
27 |
> |
int |
28 |
> |
main( |
29 |
> |
int argc, |
30 |
> |
char *argv[] |
31 |
> |
) |
32 |
|
{ |
33 |
|
int i; |
34 |
|
|
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); |
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; |
118 |
|
quiterr("error writing hex bit file"); |
119 |
|
} |
120 |
|
/* free scanline */ |
121 |
< |
free((char *)scanin); |
121 |
> |
free((void *)scanin); |
122 |
|
} |