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 2.15 by greg, Mon Mar 8 12:37:35 1993 UTC vs.
Revision 2.16 by greg, Wed Jun 2 21:04:02 1993 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1993 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 263 | Line 263 | char  *s;
263   {
264          char  buf[128];
265          register char  *cp;
266        register PNODE  *p;
266          RECT  r;
267          int  x, y;
268 <        double  e;
269 <
268 >        register PNODE  *p = &ptrunk;
269 >        int  adapt = 0;
270 >        double  e = 1.0;
271 > start:
272          for (cp = s; isspace(*cp); cp++)
273                  ;
274 +        if (*cp == '@') {
275 +                adapt++;
276 +                goto start;
277 +        }
278          if (*cp == '\0') {              /* normalize to point */
279                  if (dev->getcur == NULL)
280                          return;
# Line 279 | Line 284 | char  *s;
284                  r.l = r.d = 0;
285                  r.r = hresolu; r.u = vresolu;
286                  p = findrect(x, y, &ptrunk, &r, -1);
282                e = 1.0;
287          } else {
288                  if (*cp == '=') {       /* absolute setting */
289                          p = NULL;
# Line 295 | Line 299 | char  *s;
299                                  if (*cp == '\0')
300                                          return;
301                          }
298                } else {                /* normalize to average */
299                        p = &ptrunk;
300                        e = 1.0;
302                  }
303                  if (*cp == '+' || *cp == '-')   /* f-stops */
304                          e *= pow(2.0, atof(cp));
# Line 309 | Line 310 | char  *s;
310                          error(COMMAND, "cannot normalize to zero");
311                          return;
312                  }
313 <                e *= 0.5 / bright(p->v);
313 >                if (adapt)
314 >                        e *= 106./pow(1.219+pow(luminance(p->v)/exposure,.4),2.5)/exposure;
315 >                else
316 >                        e *= 0.5 / bright(p->v);
317          }
318          if (e <= FTINY || fabs(1.0 - e) <= FTINY)
319                  return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines