1 |
– |
/* Copyright (c) 1993 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 |
|
* pcompos.c - program to composite pictures. |
6 |
|
* |
8 |
|
*/ |
9 |
|
|
10 |
|
#include <stdio.h> |
14 |
– |
|
11 |
|
#include <math.h> |
12 |
+ |
#include <time.h> |
13 |
+ |
#include <string.h> |
14 |
|
|
15 |
< |
#ifdef MSDOS |
18 |
< |
#include <fcntl.h> |
19 |
< |
#endif |
15 |
> |
#include "copyright.h" |
16 |
|
|
17 |
+ |
#include "platform.h" |
18 |
+ |
#include "rtprocess.h" |
19 |
|
#include "color.h" |
22 |
– |
|
20 |
|
#include "resolu.h" |
21 |
|
|
22 |
|
#define MAXFILE 64 |
58 |
|
char ourfmt[LPICFMT+1] = PICFMT; |
59 |
|
int wrongformat = 0; |
60 |
|
|
61 |
< |
FILE *popen(), *lblopen(); |
61 |
> |
FILE *lblopen(); |
62 |
> |
void quit(); |
63 |
|
|
64 |
< |
extern char *malloc(); |
64 |
> |
static gethfunc tabputs; |
65 |
|
|
66 |
|
|
67 |
< |
tabputs(s) /* print line preceded by a tab */ |
68 |
< |
char *s; |
67 |
> |
static int |
68 |
> |
tabputs( /* print line preceded by a tab */ |
69 |
> |
char *s, |
70 |
> |
void *p |
71 |
> |
) |
72 |
|
{ |
73 |
|
char fmt[32]; |
74 |
|
|
98 |
|
int xsgn, ysgn; |
99 |
|
char *thislabel; |
100 |
|
int an; |
101 |
< |
#ifdef MSDOS |
102 |
< |
extern int _fmode; |
103 |
< |
_fmode = O_BINARY; |
103 |
< |
setmode(fileno(stdin), O_BINARY); |
104 |
< |
setmode(fileno(stdout), O_BINARY); |
105 |
< |
#endif |
101 |
> |
SET_DEFAULT_BINARY(); |
102 |
> |
SET_FILE_BINARY(stdin); |
103 |
> |
SET_FILE_BINARY(stdout); |
104 |
|
progname = argv[0]; |
105 |
|
|
106 |
|
for (an = 1; an < argc && argv[an][0] == '-'; an++) |
149 |
|
} |
150 |
|
dofiles: |
151 |
|
newheader("RADIANCE", stdout); |
152 |
+ |
fputnow(stdout); |
153 |
|
for (nfile = 0; an < argc; nfile++) { |
154 |
|
if (nfile >= MAXFILE) |
155 |
|
goto toomany; |
227 |
|
printf("%s:\n", input[nfile].name); |
228 |
|
getheader(input[nfile].fp, tabputs, NULL); |
229 |
|
if (wrongformat) { |
230 |
< |
fprintf(stderr, "%s: bad Radiance input file\n", |
230 |
> |
fprintf(stderr, "%s: incompatible input format\n", |
231 |
|
input[nfile].name); |
232 |
|
quit(1); |
233 |
|
} |
387 |
|
|
388 |
|
j = 4; /* check exponents first! */ |
389 |
|
while (j--) |
390 |
< |
if (i = c1[j] - c2[j]) |
390 |
> |
if ( (i = c1[j] - c2[j]) ) |
391 |
|
return(i); |
392 |
|
return(0); |
393 |
|
} |
398 |
|
char *s; |
399 |
|
int *xp, *yp; |
400 |
|
{ |
401 |
< |
char com[128]; |
401 |
> |
char com[PATH_MAX]; |
402 |
|
FILE *fp; |
403 |
|
|
404 |
|
sprintf(com, "psign -s -.15 -a 2 -x %d -y %d '%.90s'", *xp, *yp, s); |
415 |
|
} |
416 |
|
|
417 |
|
|
418 |
+ |
void |
419 |
|
quit(code) /* exit gracefully */ |
420 |
|
int code; |
421 |
|
{ |