ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/vwrays.c
(Generate patch)

Comparing ray/src/util/vwrays.c (file contents):
Revision 3.13 by greg, Sun May 7 15:44:28 2006 UTC vs.
Revision 3.16 by greg, Sat Aug 20 20:57:52 2011 UTC

# Line 31 | Line 31 | int    zfd = -1;
31  
32   int     fromstdin = 0;
33  
34 + int     unbuffered = 0;
35 +
36   char    *progname;
37  
38  
# Line 105 | Line 107 | main(
107                          if (argv[i][2] == 'a')
108                                  pa = atof(argv[++i]);
109                          else if (argv[i][2] == 'j')
110 <                                pj= atof(argv[++i]);
110 >                                pj = atof(argv[++i]);
111                          else
112                                  goto userr;
113                          break;
114                  case 'i':                       /* get pixels from stdin */
115                          fromstdin = 1;
116                          break;
117 +                case 'u':                       /* unbuffered output */
118 +                        unbuffered = 1;
119 +                        break;
120                  default:
121                          goto userr;
122                  }
# Line 151 | Line 156 | main(
156          exit(0);
157   userr:
158          fprintf(stderr,
159 <        "Usage: %s [ -i -f{a|f|d} | -d ] { view opts .. | picture [zbuf] }\n",
159 >        "Usage: %s [ -i -u -f{a|f|d} | -d ] { view opts .. | picture [zbuf] }\n",
160                          progname);
161          exit(1);
162   }
# Line 184 | Line 189 | pix2rays(
189  
190          while (fscanf(fp, "%lf %lf", &px, &py) == 2) {
191                  px += .5; py += .5;
187                if (px < 0 || px >= rs.xr ||
188                                py < 0 || py >= rs.yr) {
189                        fprintf(stderr,
190                                "%s: (x,y) pair (%.0f,%.0f) out of range\n",
191                                        progname, px, py);
192                        exit(1);
193                }
192                  loc[0] = px/rs.xr; loc[1] = py/rs.yr;
193                  if (zfd >= 0) {
194                          loc2pix(pp, &rs, loc[0], loc[1]);
# Line 218 | Line 216 | pix2rays(
216                          rdir[0] *= d; rdir[1] *= d; rdir[2] *= d;
217                  }
218                  (*putr)(rorg, rdir);
219 +                if (unbuffered)
220 +                        fflush(stdout);
221          }
222          if (!feof(fp)) {
223                  fprintf(stderr, "%s: expected px py on input\n", progname);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines