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

Comparing ray/src/rt/rv2.c (file contents):
Revision 1.31 by greg, Tue Oct 22 11:58:17 1991 UTC vs.
Revision 2.5 by greg, Wed Jan 15 16:55:21 1992 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18  
19   #include  "rpaint.h"
20  
21 + #include  "resolu.h"
22 +
23   #include  <ctype.h>
24  
25 < #define  CTRL(c)        ('c'-'@')
25 > #define  CTRL(c)        ((c)-'@')
26  
27   extern char  VersionID[];
28   extern char  *progname;
# Line 73 | Line 75 | char  *s;
75          sprintf(buf, "view type (%c): ", ourview.type);
76          (*dev->comout)(buf);
77          (*dev->comin)(buf, NULL);
78 <        if (buf[0] == CTRL(C)) return;
78 >        if (buf[0] == CTRL('C')) return;
79          if (buf[0] && buf[0] != ourview.type) {
80                  nv.type = buf[0];
81                  change++;
# Line 83 | Line 85 | char  *s;
85                          ourview.vp[0], ourview.vp[1], ourview.vp[2]);
86          (*dev->comout)(buf);
87          (*dev->comin)(buf, NULL);
88 <        if (buf[0] == CTRL(C)) return;
88 >        if (buf[0] == CTRL('C')) return;
89          if (sscanf(buf, "%lf %lf %lf", &nv.vp[0], &nv.vp[1], &nv.vp[2]) == 3)
90                  change++;
91          else
# Line 92 | Line 94 | char  *s;
94                          ourview.vdir[0], ourview.vdir[1], ourview.vdir[2]);
95          (*dev->comout)(buf);
96          (*dev->comin)(buf, NULL);
97 <        if (buf[0] == CTRL(C)) return;
97 >        if (buf[0] == CTRL('C')) return;
98          if (sscanf(buf,"%lf %lf %lf",&nv.vdir[0],&nv.vdir[1],&nv.vdir[2]) == 3)
99                  change++;
100          else
# Line 101 | Line 103 | char  *s;
103                          ourview.vup[0], ourview.vup[1], ourview.vup[2]);
104          (*dev->comout)(buf);
105          (*dev->comin)(buf, NULL);
106 <        if (buf[0] == CTRL(C)) return;
106 >        if (buf[0] == CTRL('C')) return;
107          if (sscanf(buf,"%lf %lf %lf",&nv.vup[0],&nv.vup[1],&nv.vup[2]) == 3)
108                  change++;
109          else
# Line 110 | Line 112 | char  *s;
112                          ourview.horiz, ourview.vert);
113          (*dev->comout)(buf);
114          (*dev->comin)(buf, NULL);
115 <        if (buf[0] == CTRL(C)) return;
115 >        if (buf[0] == CTRL('C')) return;
116          if (sscanf(buf, "%lf %lf", &nv.horiz, &nv.vert) == 2)
117                  change++;
118          else {
# Line 120 | Line 122 | char  *s;
122                          ourview.hoff, ourview.voff);
123          (*dev->comout)(buf);
124          (*dev->comin)(buf, NULL);
125 <        if (buf[0] == CTRL(C)) return;
125 >        if (buf[0] == CTRL('C')) return;
126          if (sscanf(buf, "%lf %lf", &nv.hoff, &nv.voff) == 2)
127                  change++;
128          else {
# Line 142 | Line 144 | char  *s;
144          if (sscanf(s, "%s", buf) == 1) {        /* get parameters from a file */
145                  copystruct(&nv, &stdview);
146                  if ((fname = getpath(buf, NULL, 0)) == NULL ||
147 <                                (success = viewfile(fname, &nv, 0, 0)) == -1) {
147 >                                (success = viewfile(fname, &nv, NULL)) == -1) {
148                          sprintf(errmsg, "cannot open \"%s\"", buf);
149                          error(COMMAND, errmsg);
150                          return;
# Line 244 | Line 246 | register char  *s;
246   getexposure(s)                          /* get new exposure */
247   char  *s;
248   {
247        double  atof(), pow(), fabs();
249          char  buf[128];
250          register char  *cp;
251          register PNODE  *p;
# Line 339 | Line 340 | register union {int i; double d; COLOR C;}  *ptr;
340          case 'b':                       /* boolean */
341                  if (sscanf(str, "%1s", buf) != 1) {
342                          (*dev->comout)(dsc);
343 <                        sprintf(buf, " (%c): ", ptr->i ? 'y' : 'n');
343 >                        sprintf(buf, "? (%c): ", ptr->i ? 'y' : 'n');
344                          (*dev->comout)(buf);
345                          (*dev->comin)(buf, NULL);
346                          if (buf[0] == '\0' ||
# Line 386 | Line 387 | register char  *s;
387          extern int  directinvis;
388          extern double  srcsizerat;
389          extern int  do_irrad;
390 +        extern double  specjitter;
391 +        extern double  specthresh;
392          char  buf[128];
393          
394          if (s[0] == '\0') {
395                  (*dev->comout)(
396 <                        "aa ab ad ar as av b dc di dj ds dt i lr lw sp st: ");
396 >                "aa ab ad ar as av b dc di dj ds dt i lr lw ps pt sj st: ");
397                  (*dev->comin)(buf, NULL);
398                  s = buf;
399          }
# Line 461 | Line 464 | register char  *s;
464                          goto badparam;
465                  }
466                  break;
467 <        case 's':                       /* sample */
467 >        case 'p':                       /* pixel */
468                  switch (s[1]) {
469 <                case 'p':                       /* pixel */
470 <                        if (getparam(s+2, "sample pixel", 'i', &psample))
469 >                case 's':                       /* sample */
470 >                        if (getparam(s+2, "pixel sample", 'i', &psample))
471                                  pdepth = 0;
472                          break;
473                  case 't':                       /* threshold */
474 <                        if (getparam(s+2, "sample threshold", 'r', &maxdiff))
474 >                        if (getparam(s+2, "pixel threshold", 'r', &maxdiff))
475                                  pdepth = 0;
476                          break;
477                  default:
478                          goto badparam;
479                  }
480                  break;
481 +        case 's':                       /* specular */
482 +                switch (s[1]) {
483 +                case 'j':                       /* jitter */
484 +                        getparam(s+2, "specular jitter", 'r', &specjitter);
485 +                        break;
486 +                case 't':                       /* threshold */
487 +                        getparam(s+2, "specular threshold", 'r', &specthresh);
488 +                        break;
489 +                default:
490 +                        goto badparam;
491 +                }
492 +                break;
493          case '\0':                      /* nothing */
494                  break;
495          default:;
# Line 536 | Line 551 | char  *s;
551                          (*dev->comout)(buf);
552                  }
553                  (*dev->comin)(buf, NULL);
554 <                sprintf(buf, "with value (%.6g %.6g %.6g)",
554 >                sprintf(buf, "value (%.5g %.5g %.5g) (%.1fL)",
555                                  colval(thisray.rcol,RED),
556                                  colval(thisray.rcol,GRN),
557 <                                colval(thisray.rcol,BLU));
557 >                                colval(thisray.rcol,BLU),
558 >                                luminance(thisray.rcol));
559                  (*dev->comout)(buf);
560          }
561          (*dev->comin)(buf, NULL);
# Line 582 | Line 598 | char  *s;
598                  fputaspect(dev->pixaspect, fp);
599          fputformat(COLRFMT, fp);
600          putc('\n', fp);
601 <        fputresolu(YMAJOR|YDECR, hresolu, vresolu, fp);
601 >        fprtresolu(hresolu, vresolu, fp);
602  
603          scanline = (COLR *)malloc(hresolu*sizeof(COLR));
604          if (scanline == NULL) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines