ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/x11raster.c
(Generate patch)

Comparing ray/src/px/x11raster.c (file contents):
Revision 2.6 by greg, Thu May 28 09:39:22 1992 UTC vs.
Revision 2.7 by greg, Mon Oct 12 14:52:19 1992 UTC

# Line 14 | Line 14 | static char SCCSid[] = "$SunId$ LBL";
14   #include <X11/Xlib.h>
15   #include <X11/Xutil.h>
16  
17 + #include "color.h"
18   #include "x11raster.h"
19  
20  
# Line 59 | Line 60 | int    bm_pad;
60  
61  
62   int
63 < init_rcolors(xr, rmap, gmap, bmap)              /* initialize colors */
63 > init_rcolors(xr, cmap)                  /* initialize colors */
64   register XRASTER        *xr;
65 < int     rmap[256], gmap[256], bmap[256];
65 > BYTE    cmap[][3];
66   {
67          register unsigned char  *p;
68          register int    i;
69  
70 <        if (xr->image->depth > 8 || xr->ncolors != 0)
70 >        if (xr->image->depth > 8 | xr->ncolors != 0)
71                  return(xr->ncolors);
72          xr->pmap = (short *)malloc(256*sizeof(short));
73          if (xr->pmap == NULL)
# Line 80 | Line 81 | int    rmap[256], gmap[256], bmap[256];
81                          i = xr->image->width*xr->image->height;
82                          i--; p++)
83                  if (xr->pmap[*p] == -1) {
84 <                        xr->cdefs[xr->ncolors].red = rmap[*p] << 8;
85 <                        xr->cdefs[xr->ncolors].green = gmap[*p] << 8;
86 <                        xr->cdefs[xr->ncolors].blue = bmap[*p] << 8;
84 >                        xr->cdefs[xr->ncolors].red = cmap[*p][RED] << 8;
85 >                        xr->cdefs[xr->ncolors].green = cmap[*p][GRN] << 8;
86 >                        xr->cdefs[xr->ncolors].blue = cmap[*p][BLU] << 8;
87                          xr->cdefs[xr->ncolors].pixel = *p;
88                          xr->cdefs[xr->ncolors].flags = DoRed|DoGreen|DoBlue;
89                          xr->pmap[*p] = xr->ncolors++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines