f = fopen (filename, "w");
write_png_argb32 (char *buffer, char *filename,		  int width, int height, int stride){    FILE *f;    int i;    png_struct *png;    png_info *info;    png_byte **rows;    png_color_16 white;        f = fopen (filename, "w");    rows = malloc (height * sizeof(png_byte*));    for (i = 0; i < height; i++) {	rows[i] = buffer + i * stride;    }    png = png_create_write_struct (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);    info = png_create_info_struct (png);    png_init_io (png, f);    png_set_IHDR (png, info,		  width, height, 8,		  PNG_COLOR_TYPE_RGB_ALPHA, 		  PNG_INTERLACE_NONE,		  PNG_COMPRESSION_TYPE_DEFAULT,		  PNG_FILTER_TYPE_DEFAULT);    white.red = 0xff;    white.blue = 0xff;    white.green = 0xff;    png_set_bKGD (png, info, &white);    png_set_write_user_transform_fn (png, unpremultiply_data);    png_set_bgr (png);    png_write_info (png, info);    png_write_image (png, rows);    png_write_end (png, info);    png_destroy_write_struct (&png, &info);    free (rows);    fclose (f);}