Lines 261-269
int main(int argc, char *argv[])
Link Here
|
261 |
png_info_init(info_ptr); |
261 |
png_info_init(info_ptr); |
262 |
#endif |
262 |
#endif |
263 |
png_init_io(png_ptr, fp); |
263 |
png_init_io(png_ptr, fp); |
|
|
264 |
#if PNG_LIBPNG_VER < 10500 /* 1.5.0 */ |
264 |
info_ptr->width = win.cols; |
265 |
info_ptr->width = win.cols; |
265 |
info_ptr->height = win.rows; |
266 |
info_ptr->height = win.rows; |
266 |
info_ptr->bit_depth = depth; |
267 |
info_ptr->bit_depth = depth; |
|
|
268 |
#endif |
267 |
|
269 |
|
268 |
/* explicit filter-type (or none) required */ |
270 |
/* explicit filter-type (or none) required */ |
269 |
if ((filter >= 0) && (filter <= 4)) { |
271 |
if ((filter >= 0) && (filter <= 4)) { |
Lines 302-311
int main(int argc, char *argv[])
Link Here
|
302 |
/*if(!gscale->answer){ *//* 24BIT COLOR IMAGE */ |
304 |
/*if(!gscale->answer){ *//* 24BIT COLOR IMAGE */ |
303 |
|
305 |
|
304 |
if (TRUE) { |
306 |
if (TRUE) { |
|
|
307 |
int color_type; |
305 |
if (do_alpha) |
308 |
if (do_alpha) |
306 |
info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; |
309 |
color_type = PNG_COLOR_TYPE_RGB_ALPHA; |
307 |
else |
310 |
else |
308 |
info_ptr->color_type = PNG_COLOR_TYPE_RGB; |
311 |
color_type = PNG_COLOR_TYPE_RGB; |
|
|
312 |
#if PNG_LIBPNG_VER < 10500 /* 1.5.0 */ |
313 |
info_ptr->color_type = color_type; |
314 |
#else |
315 |
png_set_IHDR(png_ptr, info_ptr, win.cols, win.rows, depth, |
316 |
color_type, PNG_INTERLACE_NONE, |
317 |
PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); |
318 |
#endif |
309 |
|
319 |
|
310 |
/* write the png-info struct */ |
320 |
/* write the png-info struct */ |
311 |
png_write_info(png_ptr, info_ptr); |
321 |
png_write_info(png_ptr, info_ptr); |