--- ray/src/px/ra_rgbe.c 1991/11/11 14:01:34 1.2 +++ ray/src/px/ra_rgbe.c 1992/10/02 16:26:39 2.4 @@ -1,4 +1,4 @@ -/* Copyright (c) 1991 Regents of the University of California */ +/* Copyright (c) 1992 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -9,10 +9,16 @@ static char SCCSid[] = "$SunId$ LBL"; */ #include - +#include #include "color.h" #include "resolu.h" +#ifdef MSDOS +#include +#endif + +extern char *malloc(); + int bradj = 0; /* brightness adjustment */ int doflat = 1; /* produce flat file */ @@ -25,7 +31,12 @@ int argc; char *argv[]; { int i; - +#ifdef MSDOS + extern int _fmode; + _fmode = O_BINARY; + setmode(fileno(stdin), O_BINARY); + setmode(fileno(stdout), O_BINARY); +#endif progname = argv[0]; for (i = 1; i < argc; i++) @@ -79,9 +90,8 @@ char *err; transfer() /* transfer Radiance picture */ { - extern double pow(); int order; - int xmax, ymax; + int xmax, ymax; COLR *scanin; register int x; int y; @@ -89,13 +99,18 @@ transfer() /* transfer Radiance picture */ if (checkheader(stdin, COLRFMT, stdout) < 0 || (order = fgetresolu(&xmax, &ymax, stdin)) < 0) quiterr("bad picture format"); + fputs(progname, stdout); if (bradj) - fputexpos(pow(2.0, (double)bradj), stdout); - if (!doflat) { + printf(" -e %+d", bradj); + if (doflat) + fputs("\n", stdout); + else { + fputs(" -r\n", stdout); fputformat(COLRFMT, stdout); - printf("%s -r\n\n", progname); - } else - printf("%s\n\n", progname); + } + if (bradj) + fputexpos(pow(2.0, (double)bradj), stdout); + fputs("\n", stdout); fputresolu(order, xmax, ymax, stdout); /* allocate scanline */ scanin = (COLR *)malloc(xmax*sizeof(COLR));