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

Comparing ray/src/px/x11image.c (file contents):
Revision 2.32 by greg, Thu Oct 28 11:39:59 1993 UTC vs.
Revision 2.34 by greg, Mon Nov 15 10:55:33 1993 UTC

# Line 197 | Line 197 | char  *argv[];
197          if (i < argc) {                 /* open picture file */
198                  fname = argv[i];
199                  fin = fopen(fname, "r");
200 <                if (fin == NULL) {
201 <                        sprintf(errmsg, "cannot open file \"%s\"", fname);
202 <                        quiterr(errmsg);
203 <                }
200 >                if (fin == NULL)
201 >                        quiterr("cannot open picture file");
202          }
203                                  /* get header */
204          getheader(fin, headline, NULL);
# Line 674 | Line 672 | XKeyPressedEvent  *ekey;
672          case '@':                               /* adaptation level */
673                  if (avgbox(cval) == -1)
674                          return(-1);
675 <                comp = com=='@'
676 <                ? 106./pow(1.219+pow(luminance(cval)/exposure,.4),2.5)/exposure
677 <                : .5/bright(cval) ;
675 >                comp = bright(cval);
676 >                if (comp < 1e-20) {
677 >                        XBell(thedisplay, 0);
678 >                        return(-1);
679 >                }
680 >                if (com == '@')
681 >                        comp = 106./exposure/
682 >                        pow(1.219+pow(comp*WHTEFFICACY/exposure,.4),2.5);
683 >                else
684 >                        comp = .5/comp;
685                  comp = log(comp)/.69315 - scale;
686                  n = comp < 0 ? comp-.5 : comp+.5 ;      /* round */
687                  if (n == 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines