The R Project SVN R

Rev

Rev 68956 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68956 Rev 76910
Line 35... Line 35...
35
 */
35
 */
36
static image copy2image8 (drawing dw)
36
static image copy2image8 (drawing dw)
37
{
37
{
38
    image new_img;
38
    image new_img;
39
    long   x, y, w, h, j;
39
    long   x, y, w, h, j;
40
    byte * pixel8;
40
    GAbyte * pixel8;
41
    int    cmapsize;
41
    int    cmapsize;
42
    int low, high, mid;
42
    int low, high, mid;
43
    rgb    col;
43
    rgb    col;
44
    rgb    cmap[256];
44
    rgb    cmap[256];
45
    point p;
45
    point p;
Line 85... Line 85...
85
    if (! new_img)
85
    if (! new_img)
86
	return new_img;
86
	return new_img;
87
    setpalette(new_img, cmapsize, cmap);
87
    setpalette(new_img, cmapsize, cmap);
88
    /* now convert each 32-bit pixel into an 8-bit pixel: */
88
    /* now convert each 32-bit pixel into an 8-bit pixel: */
89
 
89
 
90
    pixel8 = (byte *) new_img->pixels;
90
    pixel8 = (GAbyte *) new_img->pixels;
91
 
91
 
92
    for (y = 0; y < h; y++) {
92
    for (y = 0; y < h; y++) {
93
	p.y = y;
93
	p.y = y;
94
	for (x = 0; x < w; x++) {
94
	for (x = 0; x < w; x++) {
95
	    p.x =  x;
95
	    p.x =  x;