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.31 by greg, Mon May 6 15:19:03 1991 UTC vs.
Revision 2.8 by gwlarson, Tue Oct 27 09:08:28 1998 UTC

# Line 23 | Line 23 | static char SCCSid[] = "$SunId$ LBL";
23  
24   #include  "color.h"
25  
26 + #include  "resolu.h"
27 +
28   #include  "xraster.h"
29  
30   #include  "view.h"
# Line 35 | Line 37 | static char SCCSid[] = "$SunId$ LBL";
37  
38   #define  FONTNAME       "9x15"          /* text font we'll use */
39  
40 < #define  CTRL(c)        ('c'-'@')
40 > #define  CTRL(c)        ((c)-'@')
41  
42   #define  BORWIDTH       5               /* border width */
43   #define  BARHEIGHT      25              /* menu bar size */
# Line 88 | Line 90 | extern long  ftell();
90  
91   extern char  *malloc(), *calloc();
92  
93 < extern double  atof(), pow(), log();
93 > extern double  pow(), log();
94  
95  
96   main(argc, argv)
97   int  argc;
98   char  *argv[];
99   {
100 +        extern char  *getenv();
101 +        char  *gv;
102          int  headline();
103          int  i;
104          
105          progname = argv[0];
106 +        if ((gv = getenv("DISPLAY_GAMMA")) != NULL)
107 +                gamcor = atof(gv);
108  
109          for (i = 1; i < argc; i++)
110                  if (argv[i][0] == '-')
# Line 165 | Line 171 | userr:
171   }
172  
173  
174 + int
175   headline(s)             /* get relevant info from header */
176   char  *s;
177   {
171        static char  *altname[] = {"rview","rpict",VIEWSTR,NULL};
172        register char  **an;
178          char  fmt[32];
179  
180          if (isexpos(s))
# Line 177 | Line 182 | char  *s;
182          else if (isformat(s)) {
183                  formatval(fmt, s);
184                  wrongformat = strcmp(fmt, COLRFMT);
185 <        } else
186 <                for (an = altname; *an != NULL; an++)
187 <                        if (!strncmp(*an, s, strlen(*an))) {
183 <                                if (sscanview(&ourview, s+strlen(*an)) > 0)
184 <                                        gotview++;
185 <                                return;
186 <                        }
185 >        } else if (isview(s) && sscanview(&ourview, s) > 0)
186 >                gotview++;
187 >        return(0);
188   }
189  
190  
# Line 365 | Line 366 | XKeyEvent  *ekey;
366                  return(0);
367          switch (*cp) {                  /* interpret command */
368          case 'q':
369 <        case CTRL(D):                           /* quit */
369 >        case CTRL('D'):                         /* quit */
370                  quit(0);
371          case '\n':
372          case '\r':
# Line 435 | Line 436 | XKeyEvent  *ekey;
436                  free_raster(ourras);
437                  getras();
438          /* fall through */
439 <        case CTRL(R):                           /* redraw */
440 <        case CTRL(L):
439 >        case CTRL('R'):                         /* redraw */
440 >        case CTRL('L'):
441                  unmap_rcolors(ourras);
442                  XClear(wind);
443                  return(redraw(0, 0, width, height));
# Line 645 | Line 646 | int  y;
646                  if (fseek(fin, scanpos[y], 0) == -1)
647                          quiterr("fseek error");
648                  cury = y;
649 <        } else if (scanpos != NULL)
649 >        } else if (scanpos != NULL && scanpos[y] == -1)
650                  scanpos[y] = ftell(fin);
651  
652          if (freadcolrs(scanline, xmax, fin) < 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines