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.7 by greg, Thu May 28 09:43:09 1992 UTC vs.
Revision 2.8 by greg, Fri May 29 14:21:12 1992 UTC

# Line 41 | Line 41 | static char SCCSid[] = "$SunId$ LBL";
41   #define  ICONSIZ        (8*10)          /* maximum icon dimension (even 8) */
42  
43   #define  ourscreen      DefaultScreen(thedisplay)
44 #define  ourblack       BlackPixel(thedisplay,ourscreen)
45 #define  ourwhite       WhitePixel(thedisplay,ourscreen)
44   #define  ourroot        RootWindow(thedisplay,ourscreen)
45  
46   #define  revline(x0,y0,x1,y1)   XDrawLine(thedisplay,wind,revgc,x0,y0,x1,y1)
# Line 57 | Line 55 | int  fast = 0;                         /* keep picture in Pixmap? */
55   char    *dispname = NULL;               /* our display name */
56  
57   Window  wind = 0;                       /* our output window */
58 + unsigned long  ourblack=1, ourwhite=0;  /* black and white for this visual */
59   Font  fontid;                           /* our font */
60  
61   int  maxcolors = 0;                     /* maximum colors */
# Line 244 | Line 243 | init()                 /* get data and open window */
243          width = xmax;
244          height = ymax;
245          ourgc = XCreateGC(thedisplay, wind, 0, 0);
246 <        XSetState(thedisplay, ourgc, BlackPixel(thedisplay,ourscreen),
248 <                        WhitePixel(thedisplay,ourscreen), GXcopy, AllPlanes);
246 >        XSetState(thedisplay, ourgc, ourblack, ourwhite, GXcopy, AllPlanes);
247          revgc = XCreateGC(thedisplay, wind, 0, 0);
248          XSetFunction(thedisplay, revgc, GXinvert);
249          fontid = XLoadFont(thedisplay, FONTNAME);
# Line 416 | Line 414 | static char  vistype[][12] = {
414          fprintf(stderr, "Selected visual type %s, depth %d\n",
415                          vistype[ourvis.class], ourvis.depth);
416   #endif
417 +                                        /* make appropriate adjustments */
418          if (ourvis.class == GrayScale || ourvis.class == StaticGray)
419                  greyscale = 1;
420          if (ourvis.depth <= 8 && ourvis.colormap_size < maxcolors)
421                  maxcolors = ourvis.colormap_size;
422          if (maxcolors > 4)
423                  maxcolors -= 2;
424 +        if (ourvis.class == StaticGray) {
425 +                ourblack = 0;
426 +                ourwhite = 255;
427 +        } else if (ourvis.class == PseudoColor) {
428 +                ourblack = BlackPixel(thedisplay,ourscreen);
429 +                ourwhite = WhitePixel(thedisplay,ourscreen);
430 +        } else {
431 +                ourblack = 0;
432 +                ourwhite = ~0;
433 +        }
434          XFree((char *)xvi);
435   }
436  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines