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.16 by greg, Thu Oct 22 17:51:05 1992 UTC vs.
Revision 2.19 by greg, Thu Feb 4 21:00:32 1993 UTC

# Line 614 | Line 614 | XKeyPressedEvent  *ekey;
614                          make_rpixmap(ourras, wind);
615                  redraw(0, 0, width, height);
616                  return(0);
617 +        case '0':                               /* recenter origin */
618 +                if (xoff == 0 & yoff == 0)
619 +                        return(0);
620 +                xoff = yoff = 0;
621 +                XClearWindow(thedisplay, wind);
622 +                redraw(0, 0, width, height);
623 +                return(0);
624          case ' ':                               /* clear */
625                  redraw(box.xmin, box.ymin, box.xsiz, box.ysiz);
626                  return(0);
# Line 782 | Line 789 | COLR  *scan;
789          static short  cerr[ICONSIZ];
790          static int  ynext;
791          static char  *dp;
792 <        double  sf;
786 <        COLOR  col;
792 >        COLR  clr;
793          register int  err;
794          register int    x, ti;
795          int  errp;
# Line 808 | Line 814 | COLR  *scan;
814          }
815          if (y < ynext*ymax/iconheight)  /* skip this one */
816                  return;
811        sf = pow(2.0, (double)(scale+8));
817          err = 0;
818          for (x = 0; x < iconwidth; x++) {
819                  if (!(x&7))
820                          *++dp = 0;
821                  errp = err;
822                  ti = x*xmax/iconwidth;
823 <                colr_color(col, scan[ti]);
824 <                ti = sf*bright(col);
825 <                if (ti > 255) ti = 255;
821 <                err += ti + cerr[x];
823 >                copycolr(clr, scan[ti]);
824 >                normcolrs(clr, 1, scale);
825 >                err += normbright(clr) + cerr[x];
826                  if (err > 127)
827                          err -= 255;
828                  else
# Line 873 | Line 877 | getgrey()                      /* get greyscale data */
877                  add2icon(y, scanline);
878                  if (scale)
879                          shiftcolrs(scanline, xmax, scale);
880 +                for (x = 0; x < xmax; x++)
881 +                        scanline[x][GRN] = normbright(scanline[x]);
882                  colrs_gambs(scanline, xmax);
883                  if (maxcolors < 256)
884                          for (x = 0; x < xmax; x++)
885 <                                *dp++ = ((long)normbright(scanline[x]) *
886 <                                        maxcolors + 128) >> 8;
885 >                                *dp++ = ((long)scanline[x][GRN] *
886 >                                        maxcolors + maxcolors/2) >> 8;
887                  else
888                          for (x = 0; x < xmax; x++)
889 <                                *dp++ = normbright(scanline[x]);
889 >                                *dp++ = scanline[x][GRN];
890          }
891          for (x = 0; x < maxcolors; x++)
892                  clrtab[x][RED] = clrtab[x][GRN] =
893 <                        clrtab[x][BLU] = ((long)x*256+maxcolors/2)/maxcolors;
893 >                        clrtab[x][BLU] = ((long)x*256 + 128)/maxcolors;
894   }
895  
896  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines