1 |
– |
/* Copyright (c) 1992 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_t8.c - program to convert between RADIANCE and |
6 |
|
* Targa 8-bit color-mapped images. |
9 |
|
*/ |
10 |
|
|
11 |
|
#include <stdio.h> |
12 |
+ |
#include <time.h> |
13 |
+ |
#include <math.h> |
14 |
|
|
15 |
+ |
#include "platform.h" |
16 |
|
#include "color.h" |
17 |
– |
|
17 |
|
#include "resolu.h" |
19 |
– |
|
18 |
|
#include "targa.h" |
19 |
|
|
22 |
– |
#ifdef MSDOS |
23 |
– |
#include <fcntl.h> |
24 |
– |
#endif |
20 |
|
|
26 |
– |
#include <math.h> |
27 |
– |
|
28 |
– |
#ifndef BSD |
29 |
– |
#define bcopy(s,d,n) (void)memcpy(d,s,n) |
30 |
– |
#endif |
31 |
– |
|
21 |
|
#define goodpic(h) (my_imType(h) && my_mapType(h)) |
22 |
|
#define my_imType(h) (((h)->dataType==IM_CMAP || (h)->dataType==IM_CCMAP) \ |
23 |
|
&& (h)->dataBits==8 && (h)->imType==0) |
59 |
|
int ncolors = 256; |
60 |
|
int greyscale = 0; |
61 |
|
int i; |
62 |
< |
#ifdef MSDOS |
63 |
< |
extern int _fmode; |
64 |
< |
_fmode = O_BINARY; |
76 |
< |
setmode(fileno(stdin), O_BINARY); |
77 |
< |
setmode(fileno(stdout), O_BINARY); |
78 |
< |
#endif |
62 |
> |
SET_DEFAULT_BINARY(); |
63 |
> |
SET_FILE_BINARY(stdin); |
64 |
> |
SET_FILE_BINARY(stdout); |
65 |
|
progname = argv[0]; |
66 |
|
samplefac = 0; |
67 |
|
|
180 |
|
} |
181 |
|
|
182 |
|
|
183 |
+ |
void |
184 |
|
eputs(s) |
185 |
|
char *s; |
186 |
|
{ |
188 |
|
} |
189 |
|
|
190 |
|
|
191 |
+ |
void |
192 |
|
quit(code) |
193 |
|
int code; |
194 |
|
{ |
331 |
|
if (fwritecolrs(scanline, xmax, stdout) < 0) |
332 |
|
quiterr("error writing RADIANCE file"); |
333 |
|
} |
334 |
< |
free((char *)scanline); |
335 |
< |
free((char *)tarData); |
334 |
> |
free((void *)scanline); |
335 |
> |
free((void *)tarData); |
336 |
|
} |
337 |
|
|
338 |
|
|