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

Comparing ray/src/px/ximage.c (file contents):
Revision 1.2 by greg, Fri Apr 7 16:36:10 1989 UTC vs.
Revision 1.7 by greg, Tue May 23 10:46:32 1989 UTC

# Line 137 | Line 137 | char  *argv[];
137                          sprintf(errmsg, "can't open file \"%s\"", fname);
138                          quiterr(errmsg);
139                  }
140 <        } else
141 <                goto userr;
142 <
140 >        }
141                                  /* get header */
142          getheader(fin, headline);
143                                  /* get picture dimensions */
# Line 170 | Line 168 | userr:
168   headline(s)             /* get relevant info from header */
169   char  *s;
170   {
171 <        static char  *altname[] = {"rview","rpict","VIEW=",NULL};
171 >        static char  *altname[] = {"rview","rpict",VIEWSTR,NULL};
172          register char  **an;
173  
174          if (!strncmp(s, "EXPOSURE=", 9))
# Line 347 | Line 345 | redraw(x, y, w, h)                     /* redraw section of window */
345   int  x, y;
346   int  w, h;
347   {
348 <        if (map_rcolors(ourras) == NULL) {
348 >        if (ourras->ncolors && map_rcolors(ourras) == NULL) {
349                  fprintf(stderr, "%s: cannot allocate colors\n", progname);
350                  return(-1);
351          }
# Line 419 | Line 417 | XKeyEvent  *ekey;
417                  if (avgbox(cval) == -1)
418                          return(-1);
419                  n = log(.5/bright(cval))/.69315 - scale;        /* truncate */
420 <                if (n == 0) {
423 <                        XFeep(0);
420 >                if (n == 0)
421                          return(0);
425                }
422                  scale_rcolors(ourras, pow(2.0, (double)n));
423                  scale += n;
424                  sprintf(buf, "%+d", scale);
# Line 431 | Line 427 | XKeyEvent  *ekey;
427                  XFlush();
428                  free_raster(ourras);
429                  getras();
430 <                return(redraw(0, 0, width, height));
430 >        /* fall through */
431          case CTRL(R):                           /* redraw */
432 +        case CTRL(L):
433                  XClear(wind);
434                  return(redraw(0, 0, width, height));
435          case ' ':                               /* clear */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines