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.18 by greg, Wed Nov 11 17:34:08 1992 UTC

# Line 782 | Line 782 | COLR  *scan;
782          static short  cerr[ICONSIZ];
783          static int  ynext;
784          static char  *dp;
785 <        double  sf;
786 <        COLOR  col;
785 >        COLR  clr;
786          register int  err;
787          register int    x, ti;
788          int  errp;
# Line 808 | Line 807 | COLR  *scan;
807          }
808          if (y < ynext*ymax/iconheight)  /* skip this one */
809                  return;
811        sf = pow(2.0, (double)(scale+8));
810          err = 0;
811          for (x = 0; x < iconwidth; x++) {
812                  if (!(x&7))
813                          *++dp = 0;
814                  errp = err;
815                  ti = x*xmax/iconwidth;
816 <                colr_color(col, scan[ti]);
817 <                ti = sf*bright(col);
818 <                if (ti > 255) ti = 255;
821 <                err += ti + cerr[x];
816 >                copycolr(clr, scan[ti]);
817 >                normcolrs(clr, 1, scale);
818 >                err += normbright(clr) + cerr[x];
819                  if (err > 127)
820                          err -= 255;
821                  else
# Line 873 | Line 870 | getgrey()                      /* get greyscale data */
870                  add2icon(y, scanline);
871                  if (scale)
872                          shiftcolrs(scanline, xmax, scale);
873 +                for (x = 0; x < xmax; x++)
874 +                        scanline[x][GRN] = normbright(scanline[x]);
875                  colrs_gambs(scanline, xmax);
876                  if (maxcolors < 256)
877                          for (x = 0; x < xmax; x++)
878 <                                *dp++ = ((long)normbright(scanline[x]) *
879 <                                        maxcolors + 128) >> 8;
878 >                                *dp++ = ((long)scanline[x][GRN] *
879 >                                        maxcolors + maxcolors/2) >> 8;
880                  else
881                          for (x = 0; x < xmax; x++)
882 <                                *dp++ = normbright(scanline[x]);
882 >                                *dp++ = scanline[x][GRN];
883          }
884          for (x = 0; x < maxcolors; x++)
885                  clrtab[x][RED] = clrtab[x][GRN] =
886 <                        clrtab[x][BLU] = ((long)x*256+maxcolors/2)/maxcolors;
886 >                        clrtab[x][BLU] = ((long)x*256 + 128)/maxcolors;
887   }
888  
889  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines