1 |
– |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Radiance picture to PostScript file translator -- one way! |
6 |
|
*/ |
8 |
|
#include <stdio.h> |
9 |
|
#include <math.h> |
10 |
|
#include <ctype.h> |
11 |
< |
#ifdef MSDOS |
12 |
< |
#include <fcntl.h> |
16 |
< |
#endif |
11 |
> |
|
12 |
> |
#include "platform.h" |
13 |
|
#include "color.h" |
14 |
|
|
15 |
|
#define UPPER(c) ((c)&~0x20) /* ASCII trick */ |
57 |
|
|
58 |
|
int xmax, ymax; /* input image dimensions */ |
59 |
|
|
64 |
– |
extern char *malloc(); |
60 |
|
extern double unit2inch(); |
61 |
|
|
62 |
|
|
155 |
|
progname, argv[i+1]); |
156 |
|
exit(1); |
157 |
|
} |
158 |
< |
#ifdef MSDOS |
164 |
< |
setmode(fileno(stdin), O_BINARY); |
165 |
< |
#endif |
158 |
> |
SET_FILE_BINARY(stdin); |
159 |
|
/* get our header */ |
160 |
|
getheader(stdin, headline, NULL); |
161 |
|
if (wrongformat || fgetresolu(&xmax, &ymax, stdin) < 0) |
298 |
|
/* EPS comments */ |
299 |
|
puts("%!PS-Adobe-2.0 EPSF-2.0"); |
300 |
|
printf("%%%%Title: "); printargs(ac, av, stdout); |
301 |
< |
printf("%%%%Creator: %s\n", SCCSid); |
301 |
> |
printf("%%%%Creator: %s\n", progname); |
302 |
|
printf("%%%%Pages: %d\n", ncopies); |
303 |
|
if (landscape = xmax > pixaspect*ymax) |
304 |
|
puts("%%Orientation: Landscape"); |
467 |
|
} |
468 |
|
putchar('\n'); |
469 |
|
/* free scanline */ |
470 |
< |
free((char *)scanin); |
470 |
> |
free((void *)scanin); |
471 |
|
} |
472 |
|
|
473 |
|
|