--- ray/src/px/pcond.c 2003/07/27 22:12:03 3.17 +++ ray/src/px/pcond.c 2004/01/02 12:47:01 3.20 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: pcond.c,v 3.17 2003/07/27 22:12:03 schorsch Exp $"; +static const char RCSid[] = "$Id: pcond.c,v 3.20 2004/01/02 12:47:01 schorsch Exp $"; #endif /* * Condition Radiance picture for display/output @@ -7,6 +7,8 @@ static const char RCSid[] = "$Id: pcond.c,v 3.17 2003/ */ #include "platform.h" +#include "paths.h" +#include "rtprocess.h" #include "pcond.h" @@ -42,7 +44,9 @@ double bwavg; /* mean brightness */ double scalef = 0.; /* linear scaling factor */ +static gethfunc headline; + main(argc, argv) int argc; char *argv[]; @@ -196,8 +200,11 @@ char *s; } -headline(s) /* process header line */ -char *s; +static int +headline( /* process header line */ + char *s, + void *p +) { static RGBPRIMS inprimS; char fmt[32]; @@ -305,8 +312,7 @@ mapimage() /* map picture and send to stdout */ getfovimg() /* load foveal sampled image */ { - extern FILE *popen(); - char combuf[128]; + char combuf[PATH_MAX]; FILE *fp; int x, y; /* compute image size */ @@ -321,7 +327,7 @@ getfovimg() /* load foveal sampled image */ } if ((fovimg = (COLOR *)malloc(fvxr*fvyr*sizeof(COLOR))) == NULL) syserror("malloc"); - sprintf(combuf, "pfilt -1 -b -pa 0 -x %d -y %d %s", fvxr, fvyr, infn); + sprintf(combuf, "pfilt -1 -b -pa 0 -x %d -y %d \"%s\"", fvxr, fvyr, infn); if ((fp = popen(combuf, "r")) == NULL) syserror("popen"); getheader(fp, NULL, NULL); /* skip header */