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 1.13 by greg, Mon Mar 18 09:35:06 1991 UTC vs.
Revision 1.16 by greg, Wed May 1 12:40:00 1991 UTC

# Line 30 | Line 30 | static char SCCSid[] = "$SunId$ LBL";
30   #include  "pic.h"
31   #include  "x11raster.h"
32   #include  "random.h"
33 + #include  "x11icon.h"
34  
35   #define  FONTNAME       "8x13"          /* text font we'll use */
36  
# Line 77 | Line 78 | int  cury = 0;                         /* current scan location */
78  
79   double  exposure = 1.0;                 /* exposure compensation used */
80  
81 + int  wrongformat = 0;                   /* input in another format? */
82 +
83   GC      revgc;                          /* graphics context with GXinvert */
84  
85   XRASTER *ourras;                        /* our stored image */
# Line 156 | Line 159 | char  *argv[];
159          } else if (i != argc)
160                  goto userr;
161                                  /* get header */
162 <        getheader(fin, headline);
162 >        getheader(fin, headline, NULL);
163                                  /* get picture dimensions */
164 <        if (fgetresolu(&xmax, &ymax, fin) != (YMAJOR|YDECR))
165 <                quiterr("bad picture size");
164 >        if (wrongformat || fgetresolu(&xmax, &ymax, fin) != (YMAJOR|YDECR))
165 >                quiterr("bad picture format");
166                                  /* set view parameters */
167          if (gotview && setview(&ourview) != NULL)
168                  gotview = 0;
# Line 183 | Line 186 | char  *s;
186   {
187          static char  *altname[] = {"rview","rpict","pinterp",VIEWSTR,NULL};
188          register char  **an;
189 +        char  fmt[32];
190  
191          if (isexpos(s))
192                  exposure *= exposval(s);
193 <        else
193 >        else if (isformat(s)) {
194 >                formatval(fmt, s);
195 >                wrongformat = strcmp(fmt, COLRFMT);
196 >        } else
197                  for (an = altname; *an != NULL; an++)
198                          if (!strncmp(*an, s, strlen(*an))) {
199                                  if (sscanview(&ourview, s+strlen(*an)) > 0)
# Line 198 | Line 205 | char  *s;
205  
206   init()                  /* get data and open window */
207   {
208 +        XWMHints        ourxwmhints;
209          XSetWindowAttributes    ourwinattr;
210          XSizeHints  oursizhints;
211          register int  i;
# Line 260 | Line 268 | init()                 /* get data and open window */
268                  }
269                  XSetNormalHints(thedisplay, wind, &oursizhints);
270          }
271 +        ourxwmhints.flags = InputHint|IconPixmapHint;
272 +        ourxwmhints.input = True;
273 +        ourxwmhints.icon_pixmap = XCreateBitmapFromData(thedisplay,
274 +                        wind, x11icon_bits, x11icon_width, x11icon_height);
275 +        XSetWMHints(thedisplay, wind, &ourxwmhints);
276          XSelectInput(thedisplay, wind, ButtonPressMask|ButtonReleaseMask
277                          |ButtonMotionMask|StructureNotifyMask
278                          |KeyPressMask|ExposureMask);
# Line 411 | Line 424 | XKeyPressedEvent  *ekey;
424                          sprintf(buf, "%.3f", intens(cval)/exposure);
425                          break;
426                  case 'l':                               /* luminance */
427 <                        sprintf(buf, "%.0fn", luminance(cval)/exposure);
427 >                        sprintf(buf, "%.0fL", luminance(cval)/exposure);
428                          break;
429                  case 'c':                               /* color */
430                          comp = pow(2.0, (double)scale);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines