--- ray/src/px/pcond.c 1997/03/19 13:04:09 3.11 +++ ray/src/px/pcond.c 1998/10/27 09:08:26 3.13 @@ -85,6 +85,9 @@ char *argv[]; if (fixfrac > FTINY) what2do |= DO_FIXHIST; else what2do &= ~DO_FIXHIST; break; + case 'I': + bool(DO_PREHIST); + break; case 'l': bool(DO_LINEAR); break; @@ -137,6 +140,10 @@ char *argv[]; default: goto userr; } + if ((what2do & (DO_FIXHIST|DO_PREHIST)) == (DO_FIXHIST|DO_PREHIST)) { + fprintf(stderr, "%s: only one of -i or -I option\n", progname); + exit(1); + } if ((mbcalfile != NULL) + (cwarpfile != NULL) + (outprims != stdprims) > 1) { fprintf(stderr, @@ -164,15 +171,18 @@ char *argv[]; printargs(argc, argv, stdout); /* add to output header */ if (mbcalfile == NULL & outprims != stdprims) fputprims(outprims, stdout); - getfovimg(); /* get foveal sample image */ - if (what2do&DO_FIXHIST) /* get fixation history? */ + if ((what2do & (DO_PREHIST|DO_VEIL|DO_ACUITY)) != DO_PREHIST) + getfovimg(); /* get foveal sample image? */ + if (what2do&DO_PREHIST) /* get histogram? */ + gethisto(stdin); + else if (what2do&DO_FIXHIST) /* get fixation history? */ getfixations(stdin); mapimage(); /* map the picture */ if (mapfp != NULL) /* write out basic mapping */ putmapping(mapfp); exit(0); userr: - fprintf(stderr, "Usage: %s [-{h|a|v|s|c|l|w}[+-]][-i ffrac][-e ev][-p xr yr xg yg xb yb xw yw|-f mbf.cal|-m rgb.cwp][-u Ldmax][-d Lddyn][-x mapfile] inpic [outpic]\n", + fprintf(stderr, "Usage: %s [-{h|a|v|s|c|l|w}[+-]][-I|-i ffrac][-e ev][-p xr yr xg yg xb yb xw yw|-f mbf.cal|-m rgb.cwp][-u Ldmax][-d Lddyn][-x mapfile] inpic [outpic]\n", progname); exit(1); #undef bool @@ -198,22 +208,22 @@ char *s; if (!strcmp(fmt,COLRFMT)) lumf = rgblum; else if (!strcmp(fmt,CIEFMT)) lumf = cielum; else lumf = NULL; - return; /* don't echo */ + return(0); /* don't echo */ } if (isprims(s)) { /* get input primaries */ primsval(inprimS, s); inprims= inprimS; - return; /* don't echo */ + return(0); /* don't echo */ } if (isexpos(s)) { /* picture exposure */ inpexp *= exposval(s); - return; /* don't echo */ + return(0); /* don't echo */ } if (isaspect(s)) /* pixel aspect ratio */ pixaspect *= aspectval(s); if (isview(s)) /* image view */ gotview += sscanview(&ourview, s); - fputs(s, stdout); + return(fputs(s, stdout)); }