The R Project SVN R

Rev

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

Rev 55676 Rev 55677
Line 80... Line 80...
80
__declspec(dllexport)
80
__declspec(dllexport)
81
int R_SaveAsPng(void  *d, int width, int height,
81
int R_SaveAsPng(void  *d, int width, int height,
82
		unsigned int (*gp)(void *, int, int),
82
		unsigned int (*gp)(void *, int, int),
83
		int bgr, FILE *fp, unsigned int transparent, int res)
83
		int bgr, FILE *fp, unsigned int transparent, int res)
84
{
84
{
85
    printf("transparent: %x\n", transparent);
-
 
86
    png_structp png_ptr;
85
    png_structp png_ptr;
87
    png_infop info_ptr;
86
    png_infop info_ptr;
88
    unsigned int  col, palette[256];
87
    unsigned int  col, palette[256];
89
    png_color pngpalette[256];
88
    png_color pngpalette[256];
90
    png_bytep pscanline;
89
    png_bytep pscanline;
Line 174... Line 173...
174
	}
173
	}
175
    }
174
    }
176
 
175
 
177
    have_alpha &= (transparent == 0);
176
    have_alpha &= (transparent == 0);
178
 
177
 
179
    printf("have_alpha: %d\n", have_alpha);
-
 
180
    /* Set the image information here.  Width and height are up to 2^31,
178
    /* Set the image information here.  Width and height are up to 2^31,
181
     * bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on
179
     * bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on
182
     * the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY,
180
     * the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY,
183
     * PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB,
181
     * PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB,
184
     * or PNG_COLOR_TYPE_RGB_ALPHA.  interlace is either PNG_INTERLACE_NONE or
182
     * or PNG_COLOR_TYPE_RGB_ALPHA.  interlace is either PNG_INTERLACE_NONE or