--- ray/src/px/ra_rgbe.c 1991/08/23 17:37:14 1.1 +++ ray/src/px/ra_rgbe.c 1992/01/03 22:58:08 2.2 @@ -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"; @@ -11,6 +11,7 @@ static char SCCSid[] = "$SunId$ LBL"; #include #include "color.h" +#include "resolu.h" int bradj = 0; /* brightness adjustment */ @@ -79,22 +80,28 @@ char *err; transfer() /* transfer Radiance picture */ { extern double pow(); + int order; int xmax, ymax; COLR *scanin; register int x; int y; /* get header info. */ if (checkheader(stdin, COLRFMT, stdout) < 0 || - fgetresolu(&xmax, &ymax, stdin) != (YMAJOR|YDECR)) + (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); - fputresolu(YMAJOR|YDECR, xmax, ymax, stdout); + } + 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)); if (scanin == NULL)