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.30 by greg, Wed May 1 12:40:03 1991 UTC vs.
Revision 2.3 by greg, Mon Dec 23 23:20:06 1991 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)
# Line 365 | Line 367 | XKeyEvent  *ekey;
367                  return(0);
368          switch (*cp) {                  /* interpret command */
369          case 'q':
370 <        case CTRL(D):                           /* quit */
370 >        case CTRL('D'):                         /* quit */
371                  quit(0);
372          case '\n':
373          case '\r':
# Line 435 | Line 437 | XKeyEvent  *ekey;
437                  free_raster(ourras);
438                  getras();
439          /* fall through */
440 <        case CTRL(R):                           /* redraw */
441 <        case CTRL(L):
440 >        case CTRL('R'):                         /* redraw */
441 >        case CTRL('L'):
442                  unmap_rcolors(ourras);
443                  XClear(wind);
444                  return(redraw(0, 0, width, height));
# Line 548 | Line 550 | getmono()                      /* get monochrome data */
550   {
551          register unsigned short *dp;
552          register int    x, err;
553 <        int     y;
553 >        int     y, errp;
554          rgbpixel        *inl;
555          short   *cerr;
556  
# Line 562 | Line 564 | getmono()                      /* get monochrome data */
564                  for (x = 0; x < xmax; x++) {
565                          if (!(x&0xf))
566                                  *++dp = 0;
567 +                        errp = err;
568                          err += rgb_bright(&inl[x]) + cerr[x];
569                          if (err > 127)
570                                  err -= 255;
571                          else
572                                  *dp |= 1<<(x&0xf);
573 <                        cerr[x] = err >>= 1;
573 >                        err /= 3;
574 >                        cerr[x] = err + errp;
575                  }
576          }
577          free((char *)inl);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines