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.15 by greg, Tue Oct 13 16:43:39 1992 UTC vs.
Revision 2.18 by greg, Wed Nov 11 17:34:08 1992 UTC

# Line 755 | Line 755 | getmono()                      /* get monochrome data */
755          dp = ourdata - 1;
756          for (y = 0; y < ymax; y++) {
757                  getscan(y);
758                normcolrs(scanline, xmax, scale);
758                  add2icon(y, scanline);
759 +                normcolrs(scanline, xmax, scale);
760                  err = 0;
761                  for (x = 0; x < xmax; x++) {
762                          if (!(x&7))
# Line 782 | Line 782 | COLR  *scan;
782          static short  cerr[ICONSIZ];
783          static int  ynext;
784          static char  *dp;
785 +        COLR  clr;
786          register int  err;
787          register int    x, ti;
788          int  errp;
# Line 812 | Line 813 | COLR  *scan;
813                          *++dp = 0;
814                  errp = err;
815                  ti = x*xmax/iconwidth;
816 <                err += normbright(scan[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 835 | Line 838 | getfull()                      /* get full (24-bit) data */
838          dp = (unsigned long *)ourdata;
839          for (y = 0; y < ymax; y++) {
840                  getscan(y);
841 +                add2icon(y, scanline);
842                  if (scale)
843                          shiftcolrs(scanline, xmax, scale);
844                  colrs_gambs(scanline, xmax);
841                add2icon(y, scanline);
845                  if (ourras->image->blue_mask & 1)
846                          for (x = 0; x < xmax; x++)
847                                  *dp++ = scanline[x][RED] << 16 |
# Line 864 | Line 867 | getgrey()                      /* get greyscale data */
867          dp = ourdata;
868          for (y = 0; y < ymax; y++) {
869                  getscan(y);
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);
870                add2icon(y, scanline);
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  
# Line 892 | Line 897 | getmapped()                    /* get color-mapped data */
897          for (y = 0; y < ymax; y++) {
898                  if (getscan(y) < 0)
899                          quiterr("seek error in getmapped");
900 +                add2icon(y, scanline);
901                  if (scale)
902                          shiftcolrs(scanline, xmax, scale);
903                  colrs_gambs(scanline, xmax);
898                add2icon(y, scanline);
904                  cnt_colrs(scanline, xmax);
905          }
906                                          /* map pixels */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines