| 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 "resolu.h" |
| 13 |
|
|
| 15 |
– |
extern char *malloc(); |
| 16 |
– |
|
| 14 |
|
char *progname; |
| 18 |
– |
|
| 15 |
|
int xmax, ymax; |
| 20 |
– |
|
| 16 |
|
double thresh = 0.5; /* threshold value */ |
| 22 |
– |
|
| 17 |
|
COLR threshclr; |
| 18 |
|
|
| 19 |
|
#define abovethresh(c) ((c)[EXP]>threshclr[EXP] || \ |
| 20 |
|
((c)[EXP]==threshclr[EXP] && (c)[GRN]>threshclr[GRN])) |
| 21 |
|
|
| 22 |
+ |
static void quiterr(char *err); |
| 23 |
+ |
static void ra2hex(void); |
| 24 |
|
|
| 25 |
< |
main(argc, argv) |
| 26 |
< |
int argc; |
| 27 |
< |
char *argv[]; |
| 25 |
> |
|
| 26 |
> |
int |
| 27 |
> |
main( |
| 28 |
> |
int argc, |
| 29 |
> |
char *argv[] |
| 30 |
> |
) |
| 31 |
|
{ |
| 32 |
|
int i; |
| 33 |
|
|
| 73 |
|
} |
| 74 |
|
|
| 75 |
|
|
| 76 |
< |
quiterr(err) /* print message and exit */ |
| 77 |
< |
char *err; |
| 76 |
> |
static void |
| 77 |
> |
quiterr( /* print message and exit */ |
| 78 |
> |
char *err |
| 79 |
> |
) |
| 80 |
|
{ |
| 81 |
|
if (err != NULL) { |
| 82 |
|
fprintf(stderr, "%s: %s\n", progname, err); |
| 86 |
|
} |
| 87 |
|
|
| 88 |
|
|
| 89 |
< |
ra2hex() /* convert Radiance scanlines to 4x1 bit hex */ |
| 89 |
> |
static void |
| 90 |
> |
ra2hex(void) /* convert Radiance scanlines to 4x1 bit hex */ |
| 91 |
|
{ |
| 92 |
|
static char cmap[] = "0123456789ABCDEF"; |
| 93 |
|
COLR *scanin; |
| 117 |
|
quiterr("error writing hex bit file"); |
| 118 |
|
} |
| 119 |
|
/* free scanline */ |
| 120 |
< |
free((char *)scanin); |
| 120 |
> |
free((void *)scanin); |
| 121 |
|
} |