--- ray/src/rt/lookamb.c 1992/10/15 21:13:13 2.4 +++ ray/src/rt/lookamb.c 2003/06/05 19:29:34 2.9 @@ -1,23 +1,14 @@ -/* Copyright (c) 1991 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: lookamb.c,v 2.9 2003/06/05 19:29:34 schorsch Exp $"; #endif - /* * lookamb.c - program to examine ambient components. - * - * 10/8/86 */ -#include +#include "copyright.h" -#ifdef MSDOS -#include -#endif - -#include "color.h" - +#include "platform.h" +#include "ray.h" #include "ambient.h" @@ -29,6 +20,7 @@ AMBVAL av; main(argc, argv) /* load ambient values from a file */ +int argc; char *argv[]; { FILE *fp; @@ -64,19 +56,17 @@ char *argv[]; if (header) { if (checkheader(fp, "ascii", stdout) < 0) goto formaterr; - } else + } else { + newheader("RADIANCE", stdout); printargs(argc, argv, stdout); + } fputformat(AMBFMT, stdout); putchar('\n'); -#ifdef MSDOS - setmode(fileno(stdout), O_BINARY); -#endif + SET_FILE_BINARY(stdout); putambmagic(stdout); writamb(fp); } else { -#ifdef MSDOS - setmode(fileno(fp), O_BINARY); -#endif + SET_FILE_BINARY(fp); if (checkheader(fp, AMBFMT, header ? stdout : (FILE *)NULL) < 0) goto formaterr; if (!hasambmagic(fp)) @@ -95,6 +85,7 @@ formaterr: } +void lookamb(fp) /* get ambient values from a file */ FILE *fp; { @@ -130,6 +121,7 @@ FILE *fp; } +void writamb(fp) /* write binary ambient values */ FILE *fp; {