--- ray/src/px/x11image.c 1997/07/31 21:00:57 2.50 +++ ray/src/px/x11image.c 1999/06/16 08:15:17 2.54 @@ -1,4 +1,4 @@ -/* Copyright (c) 1997 Silicon Graphics, Inc. */ +/* Copyright (c) 1998 Silicon Graphics, Inc. */ #ifndef lint static char SCCSid[] = "$SunId$ SGI"; @@ -29,16 +29,13 @@ static char SCCSid[] = "$SunId$ SGI"; #undef NOPROTO #define NOPROTO 1 +#include "color.h" #include "tonemap.h" #include "view.h" #include "x11raster.h" #include "random.h" #include "resolu.h" -#ifndef int4 -#define int4 int /* most int's are 32-bit */ -#endif - #define FONTNAME "8x13" /* text font we'll use */ #define CTRL(c) ((c)-'@') @@ -94,7 +91,7 @@ RESOLU inpres; /* input resolution and ordering */ int xmax, ymax; /* picture dimensions */ int width, height; /* window size */ char *fname = NULL; /* input file name */ -FILE *fin = stdin; /* input file */ +FILE *fin = NULL; /* input file */ long *scanpos = NULL; /* scan line positions in file */ int cury = 0; /* current scan location */ @@ -146,6 +143,7 @@ char *argv[]; int pid; progname = argv[0]; + fin = stdin; for (i = 1; i < argc; i++) if (argv[i][0] == '-') @@ -253,6 +251,7 @@ userr: } +int headline(s) /* get relevant info from header */ char *s; { @@ -264,6 +263,7 @@ char *s; wrongformat = strcmp(fmt, COLRFMT); else if (isview(s) && sscanview(&ourview, s) > 0) gotview++; + return(0); } @@ -736,10 +736,14 @@ XKeyPressedEvent *ekey; case 't': /* trace */ return(traceray(ekey->x, ekey->y)); case 'a': /* auto exposure */ + if (fname == NULL) + return(-1); tmflags = TM_F_CAMERA; strcpy(buf, "auto exposure..."); goto remap; case 'h': /* human response */ + if (fname == NULL) + return(-1); tmflags = TM_F_HUMAN; strcpy(buf, "human exposure..."); goto remap;