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.35 by greg, Mon Nov 22 11:33:18 1993 UTC vs.
Revision 2.39 by greg, Mon Nov 21 09:18:48 1994 UTC

# Line 113 | Line 113 | char  *progname;
113  
114   char  errmsg[128];
115  
116 < extern BYTE  clrtab[256][3];            /* global color map */
116 > BYTE  clrtab[256][3];                   /* global color map */
117  
118   extern long  ftell();
119  
# Line 214 | Line 214 | char  *argv[];
214  
215          init(argc, argv);                       /* get file and open window */
216  
217        if (parent < 0) {
218                kill(getppid(), SIGCONT);       /* signal parent if child */
219                sigrecv--;
220        }
217          for ( ; ; )
218                  getevent();             /* main loop */
219   userr:
# Line 276 | Line 272 | char **argv;
272          if (gamstr == NULL)             /* get it from the X server */
273                  gamstr = XGetDefault(thedisplay, "radiance", "gamma");
274          if (gamstr == NULL)             /* get it from the environment */
275 <                gamstr = getenv("GAMMA");
275 >                gamstr = getenv("DISPLAY_GAMMA");
276          if (gamstr != NULL)
277                  gamcor = atof(gamstr);
278                                  /* get best visual for default screen */
# Line 353 | Line 349 | char **argv;
349          XSetWMProtocols(thedisplay, wind, &closedownAtom, 1);
350  
351          XMapWindow(thedisplay, wind);
356        return;
352   } /* end of init */
353  
354  
# Line 366 | Line 361 | char  *err;
361          if (es = err != NULL)
362                  fprintf(stderr, "%s: %s: %s\n", progname,
363                                  fname==NULL?"<stdin>":fname, err);
364 <        if (parent > 0 & wind != 0) {
365 <                XDestroyWindow(thedisplay, wind);
366 <                XFlush(thedisplay);
372 <        } else if (parent < 0 & sigrecv == 0)
364 >        if (thedisplay != NULL)
365 >                XCloseDisplay(thedisplay);
366 >        if (parent < 0 & sigrecv == 0)
367                  kill(getppid(), SIGCONT);
368          while (parent > 0 && wait(&cs) != -1) { /* wait for any children */
369                  if (es == 0)
# Line 563 | Line 557 | getevent()                             /* process the next event */
557                  map_rcolors(ourras, wind);
558                  if (fast)
559                          make_rpixmap(ourras, wind);
560 +                if (parent < 0 & sigrecv == 0) {        /* notify parent */
561 +                        kill(getppid(), SIGCONT);
562 +                        sigrecv--;
563 +                }
564                  break;
565          case UnmapNotify:
566                  if (!fast)
# Line 1000 | Line 998 | getmapped()                    /* get color-mapped data */
998                                          /* set gamma correction */
999          setcolrgam(gamcor);
1000                                          /* make histogram */
1001 <        new_histo();
1001 >        if (new_histo((long)xmax*ymax) == -1)
1002 >                quiterr("cannot initialize histogram");
1003          for (y = 0; y < ymax; y++) {
1004                  if (getscan(y) < 0)
1005                          break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines