| 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 |
|
|
| 66 |
– |
extern char *malloc(); |
| 64 |
|
|
| 68 |
– |
|
| 65 |
|
tabputs(s) /* print line preceded by a tab */ |
| 66 |
|
char *s; |
| 67 |
|
{ |
| 93 |
|
int xsgn, ysgn; |
| 94 |
|
char *thislabel; |
| 95 |
|
int an; |
| 96 |
< |
#ifdef MSDOS |
| 97 |
< |
extern int _fmode; |
| 98 |
< |
_fmode = O_BINARY; |
| 103 |
< |
setmode(fileno(stdin), O_BINARY); |
| 104 |
< |
setmode(fileno(stdout), O_BINARY); |
| 105 |
< |
#endif |
| 96 |
> |
SET_DEFAULT_BINARY(); |
| 97 |
> |
SET_FILE_BINARY(stdin); |
| 98 |
> |
SET_FILE_BINARY(stdout); |
| 99 |
|
progname = argv[0]; |
| 100 |
|
|
| 101 |
|
for (an = 1; an < argc && argv[an][0] == '-'; an++) |
| 144 |
|
} |
| 145 |
|
dofiles: |
| 146 |
|
newheader("RADIANCE", stdout); |
| 147 |
+ |
fputnow(stdout); |
| 148 |
|
for (nfile = 0; an < argc; nfile++) { |
| 149 |
|
if (nfile >= MAXFILE) |
| 150 |
|
goto toomany; |
| 222 |
|
printf("%s:\n", input[nfile].name); |
| 223 |
|
getheader(input[nfile].fp, tabputs, NULL); |
| 224 |
|
if (wrongformat) { |
| 225 |
< |
fprintf(stderr, "%s: bad Radiance input file\n", |
| 225 |
> |
fprintf(stderr, "%s: incompatible input format\n", |
| 226 |
|
input[nfile].name); |
| 227 |
|
quit(1); |
| 228 |
|
} |
| 382 |
|
|
| 383 |
|
j = 4; /* check exponents first! */ |
| 384 |
|
while (j--) |
| 385 |
< |
if (i = c1[j] - c2[j]) |
| 385 |
> |
if ( (i = c1[j] - c2[j]) ) |
| 386 |
|
return(i); |
| 387 |
|
return(0); |
| 388 |
|
} |
| 410 |
|
} |
| 411 |
|
|
| 412 |
|
|
| 413 |
+ |
void |
| 414 |
|
quit(code) /* exit gracefully */ |
| 415 |
|
int code; |
| 416 |
|
{ |