diff --git a/ANNOUNCE b/ANNOUNCE index 8156a7eaf..b79704eac 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.4.6beta04 - January 15, 2011 +Libpng 1.4.6beta04 - January 21, 2011 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -38,8 +38,11 @@ version 1.4.6beta02 [January 14, 2011] version 1.4.6beta03 [January 14, 2011] Fixed some typecasts in png_debug statements (Cosmin). -version 1.4.6beta04 [January 15, 2011] +version 1.4.6beta04 [January 21, 2011] Updated documentation of png_set|get_tRNS() (Thomas Klausner). + Added const_png_structp and const_png_infop types, and used them in + prototypes for most png_get_*() functions. + In the manual, describe the png_get_IHDR() arguments in the correct order. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 64c8e361d..29c5c69fe 100644 --- a/CHANGES +++ b/CHANGES @@ -2747,8 +2747,11 @@ version 1.4.6beta02 [January 14, 2011] version 1.4.6beta03 [January 14, 2011] Fixed some typecasts in png_debug statements (Cosmin). -version 1.4.6beta04 [January 15, 2011] +version 1.4.6beta04 [January 21, 2011] Updated documentation of png_set|get_tRNS() (Thomas Klausner). + Added const_png_structp and const_png_infop types, and used them in + prototypes for most png_get_*() functions. + In the manual, describe the png_get_IHDR() arguments in the correct order. Send comments/corrections/commendations to glennrp at users.sourceforge.net or to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/libpng-1.4.6beta04.txt b/libpng-1.4.6beta04.txt index 48149a24c..c1d68fd16 100644 --- a/libpng-1.4.6beta04.txt +++ b/libpng-1.4.6beta04.txt @@ -1,6 +1,6 @@ libpng.txt - A description on how to use and modify libpng - libpng version 1.4.6beta04 - January 15, 2011 + libpng version 1.4.6beta04 - January 21, 2011 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.4.6beta04 - January 15, 2011 + libpng versions 0.97, January 1998, through 1.4.6beta04 - January 21, 2011 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson @@ -576,15 +576,17 @@ in until png_read_end() has read the chunk data following the image. PNG_COLOR_MASK_COLOR PNG_COLOR_MASK_ALPHA + interlace_type - (PNG_INTERLACE_NONE or + PNG_INTERLACE_ADAM7) + + compression_type - (must be PNG_COMPRESSION_TYPE_BASE + for PNG 1.0) + filter_method - (must be PNG_FILTER_TYPE_BASE for PNG 1.0, and can also be PNG_INTRAPIXEL_DIFFERENCING if the PNG datastream is embedded in a MNG-1.0 datastream) - compression_type - (must be PNG_COMPRESSION_TYPE_BASE - for PNG 1.0) - interlace_type - (PNG_INTERLACE_NONE or - PNG_INTERLACE_ADAM7) Any or all of interlace_type, compression_type, or filter_method can be NULL if you are @@ -605,11 +607,11 @@ in until png_read_end() has read the chunk data following the image. info_ptr); color_type = png_get_color_type(png_ptr, info_ptr); - filter_method = png_get_filter_type(png_ptr, + interlace_type = png_get_interlace_type(png_ptr, info_ptr); compression_type = png_get_compression_type(png_ptr, info_ptr); - interlace_type = png_get_interlace_type(png_ptr, + filter_method = png_get_filter_type(png_ptr, info_ptr); channels = png_get_channels(png_ptr, info_ptr); @@ -3303,7 +3305,7 @@ Other rules can be inferred by inspecting the libpng source. XIII. Y2K Compliance in libpng -January 15, 2011 +January 21, 2011 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. diff --git a/libpng.3 b/libpng.3 index bf89e81d9..514a883ff 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,4 +1,4 @@ -.TH LIBPNG 3 "January 15, 2011" +.TH LIBPNG 3 "January 21, 2011" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.4.6beta04 .SH SYNOPSIS @@ -92,75 +92,75 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.6beta04 \fI\fB -\fBpng_byte png_get_bit_depth (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_byte png_get_bit_depth (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fI*background\fP\fB);\fP +\fBpng_uint_32 png_get_bKGD (const_png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_16p \fI*background\fP\fB);\fP \fI\fB -\fBpng_byte png_get_channels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_byte png_get_channels (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*white_x\fP\fB, double \fP\fI*white_y\fP\fB, double \fP\fI*red_x\fP\fB, double \fP\fI*red_y\fP\fB, double \fP\fI*green_x\fP\fB, double \fP\fI*green_y\fP\fB, double \fP\fI*blue_x\fP\fB, double \fI*blue_y\fP\fB);\fP +\fBpng_uint_32 png_get_cHRM (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, double \fP\fI*white_x\fP\fB, double \fP\fI*white_y\fP\fB, double \fP\fI*red_x\fP\fB, double \fP\fI*red_y\fP\fB, double \fP\fI*green_x\fP\fB, double \fP\fI*green_y\fP\fB, double \fP\fI*blue_x\fP\fB, double \fI*blue_y\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*white_x\fP\fB, png_uint_32 \fP\fI*white_y\fP\fB, png_uint_32 \fP\fI*red_x\fP\fB, png_uint_32 \fP\fI*red_y\fP\fB, png_uint_32 \fP\fI*green_x\fP\fB, png_uint_32 \fP\fI*green_y\fP\fB, png_uint_32 \fP\fI*blue_x\fP\fB, png_uint_32 \fI*blue_y\fP\fB);\fP +\fBpng_uint_32 png_get_cHRM_fixed (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*white_x\fP\fB, png_uint_32 \fP\fI*white_y\fP\fB, png_uint_32 \fP\fI*red_x\fP\fB, png_uint_32 \fP\fI*red_y\fP\fB, png_uint_32 \fP\fI*green_x\fP\fB, png_uint_32 \fP\fI*green_y\fP\fB, png_uint_32 \fP\fI*blue_x\fP\fB, png_uint_32 \fI*blue_y\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_chunk_cache_max (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_chunk_cache_max (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_color_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_byte png_get_color_type (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_compression_buffer_size (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_compression_buffer_size (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_compression_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_byte png_get_compression_type (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_copyright (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_byte png_get_copyright (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_error_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_voidp png_get_error_ptr (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_filter_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_byte png_get_filter_type (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, double \fI*file_gamma\fP\fB);\fP +\fBpng_uint_32 png_get_gAMA (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, double \fI*file_gamma\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fI*int_file_gamma\fP\fB);\fP +\fBpng_uint_32 png_get_gAMA_fixed (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fI*int_file_gamma\fP\fB);\fP \fI\fB -\fBpng_byte png_get_header_ver (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_byte png_get_header_ver (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_header_version (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_byte png_get_header_version (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP +\fBpng_uint_32 png_get_hIST (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, png_charpp \fP\fIprofile\fP\fB, png_uint_32 \fI*proflen\fP\fB);\fP +\fBpng_uint_32 png_get_iCCP (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, png_charpp \fP\fIprofile\fP\fB, png_uint_32 \fI*proflen\fP\fB);\fP \fI\fB @@ -168,11 +168,11 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.6beta04 \fI\fB -\fBpng_uint_32 png_get_image_height (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_image_height (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_image_width (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_image_width (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB @@ -180,89 +180,93 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.6beta04 \fI\fB -\fBpng_byte png_get_interlace_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_byte png_get_interlace_type (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_io_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_voidp png_get_io_chunk_name (png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_libpng_ver (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_voidp png_get_io_ptr (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_alloc_size_t png_get_chunk_malloc_max (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_byte png_get_libpng_ver (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_mem_ptr(png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_alloc_size_t png_get_chunk_malloc_max (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*offset_x\fP\fB, png_uint_32 \fP\fI*offset_y\fP\fB, int \fI*unit_type\fP\fB);\fP +\fBpng_voidp png_get_mem_ptr(const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fI*purpose\fP\fB, png_int_32 \fP\fI*X0\fP\fB, png_int_32 \fP\fI*X1\fP\fB, int \fP\fI*type\fP\fB, int \fP\fI*nparams\fP\fB, png_charp \fP\fI*units\fP\fB, png_charpp \fI*params\fP\fB);\fP +\fBpng_uint_32 png_get_oFFs (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*offset_x\fP\fB, png_uint_32 \fP\fI*offset_y\fP\fB, int \fI*unit_type\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP +\fBpng_uint_32 png_get_pCAL (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_charp \fP\fI*purpose\fP\fB, png_int_32 \fP\fI*X0\fP\fB, png_int_32 \fP\fI*X1\fP\fB, int \fP\fI*type\fP\fB, int \fP\fI*nparams\fP\fB, png_charp \fP\fI*units\fP\fB, png_charpp \fI*params\fP\fB);\fP \fI\fB -\fBfloat png_get_pixel_aspect_ratio (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_pHYs (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fP\fI*res_x\fP\fB, png_uint_32 \fP\fI*res_y\fP\fB, int \fI*unit_type\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBfloat png_get_pixel_aspect_ratio (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_progressive_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_pixels_per_meter (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fI*palette\fP\fB, int \fI*num_palette\fP\fB);\fP +\fBpng_voidp png_get_progressive_ptr (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_byte png_get_rgb_to_gray_status (png_structp \fIpng_ptr) - -\fBpng_uint_32 png_get_rowbytes (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_PLTE (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_colorp \fP\fI*palette\fP\fB, int \fI*num_palette\fP\fB);\fP \fI\fB -\fBpng_bytepp png_get_rows (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_byte png_get_rgb_to_gray_status (const_png_structp \fIpng_ptr) + +\fBpng_uint_32 png_get_rowbytes (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fI*sig_bit\fP\fB);\fP +\fBpng_bytepp png_get_rows (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_bytep png_get_signature (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_sBIT (const_png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_color_8p \fI*sig_bit\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fI*splt_ptr\fP\fB);\fP +\fBpng_bytep png_get_signature (const_png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, int \fI*intent\fP\fB);\fP +\fBpng_uint_32 png_get_sPLT (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_spalette_p \fI*splt_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_text (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fI*text_ptr\fP\fB, int \fI*num_text\fP\fB);\fP +\fBpng_uint_32 png_get_sRGB (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, int \fI*intent\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fI*mod_time\fP\fB);\fP +\fBpng_uint_32 png_get_text (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fI*text_ptr\fP\fB, int \fI*num_text\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fI*trans_alpha\fP\fB, int \fP\fI*num_trans\fP\fB, png_color_16p \fI*trans_color\fP\fB);\fP +\fBpng_uint_32 png_get_tIME (const_png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_timep \fI*mod_time\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_tRNS (const_png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fP\fI*trans_alpha\fP\fB, int \fP\fI*num_trans\fP\fB, png_color_16p \fI*trans_color\fP\fB);\fP \fI\fB @@ -272,7 +276,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.6beta04 \fI\fB -\fBpng_uint_32 png_get_uint_31 (png_bytep \fIbuf\fP\fB);\fP +\fBpng_uint_32 png_get_uint_31 (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIbuf) \fI\fB @@ -282,51 +286,51 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.6beta04 \fI\fB -\fBpng_uint_32 png_get_unknown_chunks (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkpp \fIunknowns\fP\fB);\fP +\fBpng_uint_32 png_get_unknown_chunks (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_unknown_chunkpp \fIunknowns\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_user_chunk_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_voidp png_get_user_chunk_ptr (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_user_height_max( png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_user_height_max(const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_voidp png_get_user_transform_ptr (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_voidp png_get_user_transform_ptr (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_user_width_max (png_structp \fIpng_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_user_width_max (const_png_structp \fIpng_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_valid (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP +\fBpng_uint_32 png_get_valid (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIflag\fP\fB);\fP \fI\fB -\fBpng_int_32 png_get_x_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_int_32 png_get_x_offset_microns (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_int_32 png_get_x_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_int_32 png_get_x_offset_pixels (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_x_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_x_pixels_per_meter (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_int_32 png_get_y_offset_microns (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_int_32 png_get_y_offset_microns (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_int_32 png_get_y_offset_pixels (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_int_32 png_get_y_offset_pixels (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB -\fBpng_uint_32 png_get_y_pixels_per_meter (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP +\fBpng_uint_32 png_get_y_pixels_per_meter (const_png_structp \fP\fIpng_ptr\fP\fB, const_png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB @@ -785,7 +789,7 @@ Following is a copy of the libpng.txt file that accompanies libpng. .SH LIBPNG.TXT libpng.txt - A description on how to use and modify libpng - libpng version 1.4.6beta04 - January 15, 2011 + libpng version 1.4.6beta04 - January 21, 2011 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson @@ -796,7 +800,7 @@ libpng.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.4.6beta04 - January 15, 2011 + libpng versions 0.97, January 1998, through 1.4.6beta04 - January 21, 2011 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson @@ -1361,15 +1365,17 @@ in until png_read_end() has read the chunk data following the image. PNG_COLOR_MASK_COLOR PNG_COLOR_MASK_ALPHA + interlace_type - (PNG_INTERLACE_NONE or + PNG_INTERLACE_ADAM7) + + compression_type - (must be PNG_COMPRESSION_TYPE_BASE + for PNG 1.0) + filter_method - (must be PNG_FILTER_TYPE_BASE for PNG 1.0, and can also be PNG_INTRAPIXEL_DIFFERENCING if the PNG datastream is embedded in a MNG-1.0 datastream) - compression_type - (must be PNG_COMPRESSION_TYPE_BASE - for PNG 1.0) - interlace_type - (PNG_INTERLACE_NONE or - PNG_INTERLACE_ADAM7) Any or all of interlace_type, compression_type, or filter_method can be NULL if you are @@ -1390,11 +1396,11 @@ in until png_read_end() has read the chunk data following the image. info_ptr); color_type = png_get_color_type(png_ptr, info_ptr); - filter_method = png_get_filter_type(png_ptr, + interlace_type = png_get_interlace_type(png_ptr, info_ptr); compression_type = png_get_compression_type(png_ptr, info_ptr); - interlace_type = png_get_interlace_type(png_ptr, + filter_method = png_get_filter_type(png_ptr, info_ptr); channels = png_get_channels(png_ptr, info_ptr); @@ -4088,7 +4094,7 @@ Other rules can be inferred by inspecting the libpng source. .SH XIII. Y2K Compliance in libpng -January 15, 2011 +January 21, 2011 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. @@ -4286,7 +4292,7 @@ the first widely used release: 1.4.5beta05-07 14 10405 14.so.14.5[.0] 1.4.5rc02-03 14 10405 14.so.14.5[.0] 1.4.5 14 10405 14.so.14.5[.0] - 1.4.6beta01-03 14 10406 14.so.14.6[.0] + 1.4.6beta01-04 14 10406 14.so.14.6[.0] 1.4.6rc01 14 10406 14.so.14.6[.0] Henceforth the source version will match the shared-library minor @@ -4343,7 +4349,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.4.6beta04 - January 15, 2011: +Libpng version 1.4.6beta04 - January 21, 2011: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -4366,7 +4372,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.2.6, August 15, 2004, through 1.4.6beta04, January 15, 2011, are +libpng versions 1.2.6, August 15, 2004, through 1.4.6beta04, January 21, 2011, are Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -4465,7 +4471,7 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -January 15, 2011 +January 21, 2011 .\" end of man page diff --git a/png.c b/png.c index 292d6010b..8e052f1d1 100644 --- a/png.c +++ b/png.c @@ -1,8 +1,8 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.4.2 [May 6, 2010] - * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * Last changed in libpng 1.4.6 [January 21, 2011] + * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -470,7 +470,7 @@ png_info_destroy(png_structp png_ptr, png_infop info_ptr) * pointer before png_write_destroy() or png_read_destroy() are called. */ png_voidp PNGAPI -png_get_io_ptr(png_structp png_ptr) +png_get_io_ptr(const_png_structp png_ptr) { if (png_ptr == NULL) return (NULL); @@ -539,7 +539,7 @@ png_convert_to_rfc1123(png_structp png_ptr, png_timep ptime) #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ png_charp PNGAPI -png_get_copyright(png_structp png_ptr) +png_get_copyright(const_png_structp png_ptr) { png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ #ifdef PNG_STRING_COPYRIGHT @@ -547,13 +547,13 @@ png_get_copyright(png_structp png_ptr) #else #ifdef __STDC__ return ((png_charp) PNG_STRING_NEWLINE \ - "libpng version 1.4.6beta04 - January 15, 2011" PNG_STRING_NEWLINE \ + "libpng version 1.4.6beta04 - January 21, 2011" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2010 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE); #else - return ((png_charp) "libpng version 1.4.6beta04 - January 15, 2011\ + return ((png_charp) "libpng version 1.4.6beta04 - January 21, 2011\ Copyright (c) 1998-2010 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."); @@ -570,7 +570,7 @@ png_get_copyright(png_structp png_ptr) * it is guaranteed that png.c uses the correct version of png.h. */ png_charp PNGAPI -png_get_libpng_ver(png_structp png_ptr) +png_get_libpng_ver(const_png_structp png_ptr) { /* Version of *.c files used when building libpng */ png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ @@ -578,7 +578,7 @@ png_get_libpng_ver(png_structp png_ptr) } png_charp PNGAPI -png_get_header_ver(png_structp png_ptr) +png_get_header_ver(const_png_structp png_ptr) { /* Version of *.h files used when building libpng */ png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ @@ -586,7 +586,7 @@ png_get_header_ver(png_structp png_ptr) } png_charp PNGAPI -png_get_header_version(png_structp png_ptr) +png_get_header_version(const_png_structp png_ptr) { /* Returns longer string containing both version and date */ png_ptr = png_ptr; /* Silence compiler warning about unused png_ptr */ diff --git a/png.h b/png.h index ed6498c3e..f2aa89040 100644 --- a/png.h +++ b/png.h @@ -1,8 +1,8 @@ /* png.h - header file for PNG reference library * - * libpng version 1.4.6beta04 - January 15, 2011 - * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * libpng version 1.4.6beta04 - January 21, 2011 + * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -11,7 +11,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.4.6beta04 - January 15, 2011: Glenn + * libpng versions 0.97, January 1998, through 1.4.6beta04 - January 21, 2011: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -153,7 +153,7 @@ * 1.4.5beta05-07 14 10405 14.so.14.5[.0] * 1.4.5rc02-03 14 10405 14.so.14.5[.0] * 1.4.5 14 10405 14.so.14.5[.0] - * 1.4.6beta01-03 14 10406 14.so.14.6[.0] + * 1.4.6beta01-04 14 10406 14.so.14.6[.0] * 1.4.6rc01 14 10406 14.so.14.6[.0] * * Henceforth the source version will match the shared-library major @@ -186,7 +186,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.2.6, August 15, 2004, through 1.4.6beta04, January 15, 2011, are + * libpng versions 1.2.6, August 15, 2004, through 1.4.6beta04, January 21, 2011, are * Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.2.5 * with the following individual added to the list of Contributing Authors: @@ -298,7 +298,7 @@ * Y2K compliance in libpng: * ========================= * - * January 15, 2011 + * January 21, 2011 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. @@ -362,7 +362,7 @@ /* Version information for png.h - this should match the version in png.c */ #define PNG_LIBPNG_VER_STRING "1.4.6beta04" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.4.6beta04 - January 15, 2011\n" + " libpng version 1.4.6beta04 - January 21, 2011\n" #define PNG_LIBPNG_VER_SONUM 14 #define PNG_LIBPNG_VER_DLLNUM 14 @@ -907,6 +907,7 @@ defined(PNG_READ_BACKGROUND_SUPPORTED) } png_info; typedef png_info FAR * png_infop; +typedef PNG_CONST png_info FAR * const_png_infop; typedef png_info FAR * FAR * png_infopp; /* Maximum positive integer used in PNG is (2^31)-1 */ @@ -1027,6 +1028,7 @@ typedef png_row_info FAR * FAR * png_row_infopp; */ typedef struct png_struct_def png_struct; typedef png_struct FAR * png_structp; +typedef PNG_CONST png_struct FAR * const_png_structp; typedef void (PNGAPI *png_error_ptr) PNGARG((png_structp, png_const_charp)); typedef void (PNGAPI *png_rw_ptr) PNGARG((png_structp, png_bytep, png_size_t)); @@ -1527,7 +1529,7 @@ PNG_EXPORT(png_structp,png_create_write_struct) png_error_ptr error_fn, png_error_ptr warn_fn)) PNG_ALLOCATED; PNG_EXPORT(png_size_t,png_get_compression_buffer_size) - PNGARG((png_structp png_ptr)); + PNGARG((const_png_structp png_ptr)); PNG_EXPORT(void,png_set_compression_buffer_size) PNGARG((png_structp png_ptr, png_size_t size)); @@ -1649,7 +1651,7 @@ PNG_EXPORT(void,png_set_rgb_to_gray) PNGARG((png_structp png_ptr, #endif PNG_EXPORT(void,png_set_rgb_to_gray_fixed) PNGARG((png_structp png_ptr, int error_action, png_fixed_point red, png_fixed_point green )); -PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((png_structp +PNG_EXPORT(png_byte,png_get_rgb_to_gray_status) PNGARG((const_png_structp png_ptr)); #endif @@ -1971,7 +1973,7 @@ PNG_EXPORT(void,png_set_error_fn) PNGARG((png_structp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); /* Return the user pointer associated with the error functions */ -PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((png_structp png_ptr)); +PNG_EXPORT(png_voidp,png_get_error_ptr) PNGARG((const_png_structp png_ptr)); /* Replace the default data output functions with a user supplied one(s). * If buffered output is not used, then output_flush_fn can be set to NULL. @@ -1991,7 +1993,7 @@ PNG_EXPORT(void,png_set_read_fn) PNGARG((png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)); /* Return the user pointer associated with the I/O functions */ -PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((png_structp png_ptr)); +PNG_EXPORT(png_voidp,png_get_io_ptr) PNGARG((const_png_structp png_ptr)); PNG_EXPORT(void,png_set_read_status_fn) PNGARG((png_structp png_ptr, png_read_status_ptr read_row_fn)); @@ -2004,7 +2006,7 @@ PNG_EXPORT(void,png_set_write_status_fn) PNGARG((png_structp png_ptr, PNG_EXPORT(void,png_set_mem_fn) PNGARG((png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); /* Return the user pointer associated with the memory functions */ -PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((png_structp png_ptr)); +PNG_EXPORT(png_voidp,png_get_mem_ptr) PNGARG((const_png_structp png_ptr)); #endif #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED @@ -2024,13 +2026,13 @@ PNG_EXPORT(void,png_set_user_transform_info) PNGARG((png_structp int user_transform_channels)); /* Return the user pointer associated with the user transform functions */ PNG_EXPORT(png_voidp,png_get_user_transform_ptr) - PNGARG((png_structp png_ptr)); + PNGARG((const_png_structp png_ptr)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED PNG_EXPORT(void,png_set_read_user_chunk_fn) PNGARG((png_structp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); -PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((png_structp +PNG_EXPORT(png_voidp,png_get_user_chunk_ptr) PNGARG((const_png_structp png_ptr)); #endif @@ -2045,7 +2047,7 @@ PNG_EXPORT(void,png_set_progressive_read_fn) PNGARG((png_structp png_ptr, /* Returns the user pointer associated with the push read functions */ PNG_EXPORT(png_voidp,png_get_progressive_ptr) - PNGARG((png_structp png_ptr)); + PNGARG((const_png_structp png_ptr)); /* Function to be called when data becomes available */ PNG_EXPORT(void,png_process_data) PNGARG((png_structp png_ptr, @@ -2153,19 +2155,19 @@ PNG_EXPORT(void,png_set_benign_errors) PNGARG((png_structp * png_info_struct. */ /* Returns "flag" if chunk data is valid in info_ptr. */ -PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((png_structp png_ptr, -png_infop info_ptr, png_uint_32 flag)); +PNG_EXPORT(png_uint_32,png_get_valid) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_uint_32 flag)); /* Returns number of bytes needed to hold a transformed row. */ -PNG_EXPORT(png_size_t,png_get_rowbytes) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_size_t,png_get_rowbytes) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* Returns row_pointers, which is an array of pointers to scanlines that was * returned from png_read_png(). */ -PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_bytepp,png_get_rows) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr)); /* Set row_pointers, which is an array of pointers to scanlines for use * by png_write_png(). */ @@ -2174,70 +2176,70 @@ PNG_EXPORT(void,png_set_rows) PNGARG((png_structp png_ptr, #endif /* Returns number of color channels in image. */ -PNG_EXPORT(png_byte,png_get_channels) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_byte,png_get_channels) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr)); #ifdef PNG_EASY_ACCESS_SUPPORTED /* Returns image width in pixels. */ -PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(png_uint_32, png_get_image_width) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); /* Returns image height in pixels. */ -PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(png_uint_32, png_get_image_height) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); /* Returns image bit_depth. */ -PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(png_byte, png_get_bit_depth) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); /* Returns image color_type. */ -PNG_EXPORT(png_byte, png_get_color_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(png_byte, png_get_color_type) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); /* Returns image filter_type. */ -PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(png_byte, png_get_filter_type) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); /* Returns image interlace_type. */ -PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(png_byte, png_get_interlace_type) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); /* Returns image compression_type. */ -PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(png_byte, png_get_compression_type) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); /* Returns image resolution in pixels per meter, from pHYs chunk data. */ -PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(png_uint_32, png_get_pixels_per_meter) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); +PNG_EXPORT(png_uint_32, png_get_x_pixels_per_meter) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); +PNG_EXPORT(png_uint_32, png_get_y_pixels_per_meter) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); /* Returns pixel aspect ratio, computed from pHYs chunk data. */ #ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(float, png_get_pixel_aspect_ratio) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); #endif /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ -PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); -PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((png_structp -png_ptr, png_infop info_ptr)); +PNG_EXPORT(png_int_32, png_get_x_offset_pixels) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); +PNG_EXPORT(png_int_32, png_get_y_offset_pixels) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); +PNG_EXPORT(png_int_32, png_get_x_offset_microns) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); +PNG_EXPORT(png_int_32, png_get_y_offset_microns) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr)); #endif /* PNG_EASY_ACCESS_SUPPORTED */ /* Returns pointer to signature string read from PNG header */ -PNG_EXPORT(png_bytep,png_get_signature) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_bytep,png_get_signature) PNGARG((const_png_structp png_ptr, + png_infop info_ptr)); #ifdef PNG_bKGD_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((png_structp png_ptr, +PNG_EXPORT(png_uint_32,png_get_bKGD) PNGARG((const_png_structp png_ptr, png_infop info_ptr, png_color_16p *background)); #endif @@ -2248,14 +2250,14 @@ PNG_EXPORT(void,png_set_bKGD) PNGARG((png_structp png_ptr, #ifdef PNG_cHRM_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *white_x, double *white_y, double *red_x, +PNG_EXPORT(png_uint_32,png_get_cHRM) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y)); #endif #ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point +PNG_EXPORT(png_uint_32,png_get_cHRM_fixed) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_fixed_point *int_white_x, png_fixed_point *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)); @@ -2279,11 +2281,11 @@ PNG_EXPORT(void,png_set_cHRM_fixed) PNGARG((png_structp png_ptr, #ifdef PNG_gAMA_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((png_structp png_ptr, - png_infop info_ptr, double *file_gamma)); +PNG_EXPORT(png_uint_32,png_get_gAMA) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, double *file_gamma)); #endif -PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_fixed_point *int_file_gamma)); +PNG_EXPORT(png_uint_32,png_get_gAMA_fixed) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_fixed_point *int_file_gamma)); #endif #ifdef PNG_gAMA_SUPPORTED @@ -2296,8 +2298,8 @@ PNG_EXPORT(void,png_set_gAMA_fixed) PNGARG((png_structp png_ptr, #endif #ifdef PNG_hIST_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_16p *hist)); +PNG_EXPORT(png_uint_32,png_get_hIST) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_uint_16p *hist)); #endif #ifdef PNG_hIST_SUPPORTED @@ -2316,8 +2318,8 @@ PNG_EXPORT(void,png_set_IHDR) PNGARG((png_structp png_ptr, int filter_method)); #ifdef PNG_oFFs_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, +PNG_EXPORT(png_uint_32,png_get_oFFs) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)); #endif @@ -2328,8 +2330,8 @@ PNG_EXPORT(void,png_set_oFFs) PNGARG((png_structp png_ptr, #endif #ifdef PNG_pCAL_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, +PNG_EXPORT(png_uint_32,png_get_pCAL) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params)); #endif @@ -2340,8 +2342,8 @@ PNG_EXPORT(void,png_set_pCAL) PNGARG((png_structp png_ptr, #endif #ifdef PNG_pHYs_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +PNG_EXPORT(png_uint_32,png_get_pHYs) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); #endif #ifdef PNG_pHYs_SUPPORTED @@ -2349,14 +2351,14 @@ PNG_EXPORT(void,png_set_pHYs) PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); #endif -PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_colorp *palette, int *num_palette)); +PNG_EXPORT(png_uint_32,png_get_PLTE) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_colorp *palette, int *num_palette)); PNG_EXPORT(void,png_set_PLTE) PNGARG((png_structp png_ptr, png_infop info_ptr, png_colorp palette, int num_palette)); #ifdef PNG_sBIT_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((png_structp png_ptr, +PNG_EXPORT(png_uint_32,png_get_sBIT) PNGARG((const_png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit)); #endif @@ -2366,8 +2368,8 @@ PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr, #endif #ifdef PNG_sRGB_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *intent)); +PNG_EXPORT(png_uint_32,png_get_sRGB) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, int *intent)); #endif #ifdef PNG_sRGB_SUPPORTED @@ -2378,8 +2380,8 @@ PNG_EXPORT(void,png_set_sRGB_gAMA_and_cHRM) PNGARG((png_structp png_ptr, #endif #ifdef PNG_iCCP_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_charpp name, int *compression_type, +PNG_EXPORT(png_uint_32,png_get_iCCP) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_charpp name, int *compression_type, png_charpp profile, png_uint_32 *proflen)); /* Note to maintainer: profile should be png_bytepp */ #endif @@ -2392,8 +2394,8 @@ PNG_EXPORT(void,png_set_iCCP) PNGARG((png_structp png_ptr, #endif #ifdef PNG_sPLT_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_sPLT_tpp entries)); +PNG_EXPORT(png_uint_32,png_get_sPLT) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_sPLT_tpp entries)); #endif #ifdef PNG_sPLT_SUPPORTED @@ -2403,8 +2405,8 @@ PNG_EXPORT(void,png_set_sPLT) PNGARG((png_structp png_ptr, #ifdef PNG_TEXT_SUPPORTED /* png_get_text also returns the number of text chunks in *num_text */ -PNG_EXPORT(png_uint_32,png_get_text) PNGARG((png_structp png_ptr, - png_infop info_ptr, png_textp *text_ptr, int *num_text)); +PNG_EXPORT(png_uint_32,png_get_text) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_textp *text_ptr, int *num_text)); #endif /* Note while png_set_text() will accept a structure whose text, @@ -2420,7 +2422,7 @@ PNG_EXPORT(void,png_set_text) PNGARG((png_structp png_ptr, #endif #ifdef PNG_tIME_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((png_structp png_ptr, +PNG_EXPORT(png_uint_32,png_get_tIME) PNGARG((const_png_structp png_ptr, png_infop info_ptr, png_timep *mod_time)); #endif @@ -2430,7 +2432,7 @@ PNG_EXPORT(void,png_set_tIME) PNGARG((png_structp png_ptr, #endif #ifdef PNG_tRNS_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((png_structp png_ptr, +PNG_EXPORT(png_uint_32,png_get_tRNS) PNGARG((const_png_structp png_ptr, png_infop info_ptr, png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)); #endif @@ -2446,12 +2448,12 @@ PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr, #ifdef PNG_sCAL_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, double *width, double *height)); +PNG_EXPORT(png_uint_32,png_get_sCAL) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, int *unit, double *width, double *height)); #else #ifdef PNG_FIXED_POINT_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((png_structp png_ptr, - png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); +PNG_EXPORT(png_uint_32,png_get_sCAL_s) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); #endif #endif #endif /* PNG_sCAL_SUPPORTED */ @@ -2488,8 +2490,8 @@ PNG_EXPORT(void, png_set_unknown_chunks) PNGARG((png_structp png_ptr, png_infop info_ptr, png_unknown_chunkp unknowns, int num_unknowns)); PNG_EXPORT(void, png_set_unknown_chunk_location) PNGARG((png_structp png_ptr, png_infop info_ptr, int chunk, int location)); -PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((png_structp - png_ptr, png_infop info_ptr, png_unknown_chunkpp entries)); +PNG_EXPORT(png_uint_32,png_get_unknown_chunks) PNGARG((const_png_structp + png_ptr, const_png_infop info_ptr, png_unknown_chunkpp entries)); #endif /* Png_free_data() will turn off the "valid" flag for anything it frees. @@ -2511,11 +2513,11 @@ PNG_EXPORT(void, png_write_png) PNGARG((png_structp png_ptr, png_voidp params)); #endif -PNG_EXPORT(png_charp,png_get_copyright) PNGARG((png_structp png_ptr)); -PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((png_structp png_ptr)); -PNG_EXPORT(png_charp,png_get_header_version) PNGARG((png_structp +PNG_EXPORT(png_charp,png_get_copyright) PNGARG((const_png_structp png_ptr)); +PNG_EXPORT(png_charp,png_get_header_ver) PNGARG((const_png_structp png_ptr)); +PNG_EXPORT(png_charp,png_get_header_version) PNGARG((const_png_structp png_ptr)); -PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((png_structp png_ptr)); +PNG_EXPORT(png_charp,png_get_libpng_ver) PNGARG((const_png_structp png_ptr)); #ifdef PNG_MNG_FEATURES_SUPPORTED PNG_EXPORT(png_uint_32,png_permit_mng_features) PNGARG((png_structp @@ -2540,47 +2542,48 @@ PNG_EXPORT(void,png_set_strip_error_numbers) PNGARG((png_structp #ifdef PNG_SET_USER_LIMITS_SUPPORTED PNG_EXPORT(void,png_set_user_limits) PNGARG((png_structp png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); -PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((png_structp +PNG_EXPORT(png_uint_32,png_get_user_width_max) PNGARG((const_png_structp png_ptr)); -PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((png_structp +PNG_EXPORT(png_uint_32,png_get_user_height_max) PNGARG((const_png_structp png_ptr)); /* Added in libpng-1.4.0 */ PNG_EXPORT(void,png_set_chunk_cache_max) PNGARG((png_structp png_ptr, png_uint_32 user_chunk_cache_max)); PNG_EXPORT(png_uint_32,png_get_chunk_cache_max) - PNGARG((png_structp png_ptr)); + PNGARG((const_png_structp png_ptr)); /* Added in libpng-1.4.1 */ PNG_EXPORT(void,png_set_chunk_malloc_max) PNGARG((png_structp png_ptr, png_alloc_size_t user_chunk_cache_max)); PNG_EXPORT(png_alloc_size_t,png_get_chunk_malloc_max) - PNGARG((png_structp png_ptr)); + PNGARG((const_png_structp png_ptr)); #endif #if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) -PNG_EXPORT(png_uint_32,png_get_pixels_per_inch) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_uint_32,png_get_pixels_per_inch) + PNGARG((const_png_structp png_ptr, const_png_infop info_ptr)); -PNG_EXPORT(png_uint_32,png_get_x_pixels_per_inch) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_uint_32,png_get_x_pixels_per_inch) + PNGARG((const_png_structp png_ptr, const_png_infop info_ptr)); -PNG_EXPORT(png_uint_32,png_get_y_pixels_per_inch) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(png_uint_32,png_get_y_pixels_per_inch) + PNGARG((const_png_structp png_ptr, const_png_infop info_ptr)); -PNG_EXPORT(float,png_get_x_offset_inches) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(float,png_get_x_offset_inches) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr)); -PNG_EXPORT(float,png_get_y_offset_inches) PNGARG((png_structp png_ptr, -png_infop info_ptr)); +PNG_EXPORT(float,png_get_y_offset_inches) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr)); #ifdef PNG_pHYs_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_pHYs_dpi) PNGARG((png_structp png_ptr, -png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); +PNG_EXPORT(png_uint_32,png_get_pHYs_dpi) PNGARG((const_png_structp png_ptr, + const_png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, + int *unit_type)); #endif /* PNG_pHYs_SUPPORTED */ #endif /* PNG_INCH_CONVERSIONS && PNG_FLOATING_POINT_SUPPORTED */ /* Added in libpng-1.4.0 */ #ifdef PNG_IO_STATE_SUPPORTED -PNG_EXPORT(png_uint_32,png_get_io_state) PNGARG((png_structp png_ptr)); +PNG_EXPORT(png_uint_32,png_get_io_state) PNGARG((const_png_structp png_ptr)); PNG_EXPORT(png_bytep,png_get_io_chunk_name) PNGARG((png_structp png_ptr)); diff --git a/pngconf.h b/pngconf.h index 36968f151..39fbf29d4 100644 --- a/pngconf.h +++ b/pngconf.h @@ -1,9 +1,9 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.4.6beta04 - January 15, 2011 + * libpng version 1.4.6beta04 - January 21, 2011 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * diff --git a/pngerror.c b/pngerror.c index 633eae29f..4eec6930b 100644 --- a/pngerror.c +++ b/pngerror.c @@ -1,8 +1,8 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.4.0 [January 3, 2010] - * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * Last changed in libpng 1.4.6 [January 21, 2011] + * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -380,7 +380,7 @@ png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, * pointer before png_write_destroy and png_read_destroy are called. */ png_voidp PNGAPI -png_get_error_ptr(png_structp png_ptr) +png_get_error_ptr(const_png_structp png_ptr) { if (png_ptr == NULL) return NULL; diff --git a/pngget.c b/pngget.c index 9b3a9ccee..ef25d8537 100644 --- a/pngget.c +++ b/pngget.c @@ -1,8 +1,8 @@ /* pngget.c - retrieval of values from info struct * - * Last changed in libpng 1.4.2 [May 6, 2010] - * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * Last changed in libpng 1.4.6 [January 21, 2011] + * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -18,7 +18,8 @@ #include "pngpriv.h" png_uint_32 PNGAPI -png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag) +png_get_valid(const_png_structp png_ptr, const_png_infop info_ptr, + png_uint_32 flag) { if (png_ptr != NULL && info_ptr != NULL) return(info_ptr->valid & flag); @@ -28,7 +29,7 @@ png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag) } png_size_t PNGAPI -png_get_rowbytes(png_structp png_ptr, png_infop info_ptr) +png_get_rowbytes(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return(info_ptr->rowbytes); @@ -39,7 +40,7 @@ png_get_rowbytes(png_structp png_ptr, png_infop info_ptr) #ifdef PNG_INFO_IMAGE_SUPPORTED png_bytepp PNGAPI -png_get_rows(png_structp png_ptr, png_infop info_ptr) +png_get_rows(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return(info_ptr->row_pointers); @@ -52,7 +53,7 @@ png_get_rows(png_structp png_ptr, png_infop info_ptr) #ifdef PNG_EASY_ACCESS_SUPPORTED /* Easy access to info, added in libpng-0.99 */ png_uint_32 PNGAPI -png_get_image_width(png_structp png_ptr, png_infop info_ptr) +png_get_image_width(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return info_ptr->width; @@ -61,7 +62,7 @@ png_get_image_width(png_structp png_ptr, png_infop info_ptr) } png_uint_32 PNGAPI -png_get_image_height(png_structp png_ptr, png_infop info_ptr) +png_get_image_height(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return info_ptr->height; @@ -70,7 +71,7 @@ png_get_image_height(png_structp png_ptr, png_infop info_ptr) } png_byte PNGAPI -png_get_bit_depth(png_structp png_ptr, png_infop info_ptr) +png_get_bit_depth(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return info_ptr->bit_depth; @@ -79,7 +80,7 @@ png_get_bit_depth(png_structp png_ptr, png_infop info_ptr) } png_byte PNGAPI -png_get_color_type(png_structp png_ptr, png_infop info_ptr) +png_get_color_type(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return info_ptr->color_type; @@ -88,7 +89,7 @@ png_get_color_type(png_structp png_ptr, png_infop info_ptr) } png_byte PNGAPI -png_get_filter_type(png_structp png_ptr, png_infop info_ptr) +png_get_filter_type(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return info_ptr->filter_type; @@ -97,7 +98,7 @@ png_get_filter_type(png_structp png_ptr, png_infop info_ptr) } png_byte PNGAPI -png_get_interlace_type(png_structp png_ptr, png_infop info_ptr) +png_get_interlace_type(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return info_ptr->interlace_type; @@ -106,7 +107,7 @@ png_get_interlace_type(png_structp png_ptr, png_infop info_ptr) } png_byte PNGAPI -png_get_compression_type(png_structp png_ptr, png_infop info_ptr) +png_get_compression_type(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return info_ptr->compression_type; @@ -115,7 +116,7 @@ png_get_compression_type(png_structp png_ptr, png_infop info_ptr) } png_uint_32 PNGAPI -png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) +png_get_x_pixels_per_meter(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) #ifdef PNG_pHYs_SUPPORTED @@ -136,7 +137,7 @@ png_get_x_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) } png_uint_32 PNGAPI -png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) +png_get_y_pixels_per_meter(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) #ifdef PNG_pHYs_SUPPORTED @@ -157,7 +158,7 @@ png_get_y_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) } png_uint_32 PNGAPI -png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) +png_get_pixels_per_meter(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) #ifdef PNG_pHYs_SUPPORTED @@ -180,7 +181,7 @@ png_get_pixels_per_meter(png_structp png_ptr, png_infop info_ptr) #ifdef PNG_FLOATING_POINT_SUPPORTED float PNGAPI -png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr) +png_get_pixel_aspect_ratio(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) #ifdef PNG_pHYs_SUPPORTED @@ -204,7 +205,7 @@ png_get_pixel_aspect_ratio(png_structp png_ptr, png_infop info_ptr) #endif png_int_32 PNGAPI -png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr) +png_get_x_offset_microns(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) #ifdef PNG_oFFs_SUPPORTED @@ -226,7 +227,7 @@ png_get_x_offset_microns(png_structp png_ptr, png_infop info_ptr) } png_int_32 PNGAPI -png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr) +png_get_y_offset_microns(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) @@ -248,7 +249,7 @@ png_get_y_offset_microns(png_structp png_ptr, png_infop info_ptr) } png_int_32 PNGAPI -png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr) +png_get_x_offset_pixels(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) @@ -270,7 +271,7 @@ png_get_x_offset_pixels(png_structp png_ptr, png_infop info_ptr) } png_int_32 PNGAPI -png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr) +png_get_y_offset_pixels(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) @@ -293,35 +294,35 @@ png_get_y_offset_pixels(png_structp png_ptr, png_infop info_ptr) #if defined(PNG_INCH_CONVERSIONS) && defined(PNG_FLOATING_POINT_SUPPORTED) png_uint_32 PNGAPI -png_get_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) +png_get_pixels_per_inch(const_png_structp png_ptr, const_png_infop info_ptr) { return ((png_uint_32)((float)png_get_pixels_per_meter(png_ptr, info_ptr) *.0254 +.5)); } png_uint_32 PNGAPI -png_get_x_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) +png_get_x_pixels_per_inch(const_png_structp png_ptr, const_png_infop info_ptr) { return ((png_uint_32)((float)png_get_x_pixels_per_meter(png_ptr, info_ptr) *.0254 +.5)); } png_uint_32 PNGAPI -png_get_y_pixels_per_inch(png_structp png_ptr, png_infop info_ptr) +png_get_y_pixels_per_inch(const_png_structp png_ptr, const_png_infop info_ptr) { return ((png_uint_32)((float)png_get_y_pixels_per_meter(png_ptr, info_ptr) *.0254 +.5)); } float PNGAPI -png_get_x_offset_inches(png_structp png_ptr, png_infop info_ptr) +png_get_x_offset_inches(const_png_structp png_ptr, const_png_infop info_ptr) { return ((float)png_get_x_offset_microns(png_ptr, info_ptr) *.00003937); } float PNGAPI -png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr) +png_get_y_offset_inches(const_png_structp png_ptr, const_png_infop info_ptr) { return ((float)png_get_y_offset_microns(png_ptr, info_ptr) *.00003937); @@ -329,7 +330,7 @@ png_get_y_offset_inches(png_structp png_ptr, png_infop info_ptr) #ifdef PNG_pHYs_SUPPORTED png_uint_32 PNGAPI -png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr, +png_get_pHYs_dpi(const_png_structp png_ptr, const_png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) { png_uint_32 retval = 0; @@ -369,7 +370,7 @@ png_get_pHYs_dpi(png_structp png_ptr, png_infop info_ptr, #endif /* PNG_EASY_ACCESS_SUPPORTED */ png_byte PNGAPI -png_get_channels(png_structp png_ptr, png_infop info_ptr) +png_get_channels(const_png_structp png_ptr, const_png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return(info_ptr->channels); @@ -378,7 +379,7 @@ png_get_channels(png_structp png_ptr, png_infop info_ptr) } png_bytep PNGAPI -png_get_signature(png_structp png_ptr, png_infop info_ptr) +png_get_signature(const_png_structp png_ptr, png_infop info_ptr) { if (png_ptr != NULL && info_ptr != NULL) return(info_ptr->signature); @@ -388,7 +389,7 @@ png_get_signature(png_structp png_ptr, png_infop info_ptr) #ifdef PNG_bKGD_SUPPORTED png_uint_32 PNGAPI -png_get_bKGD(png_structp png_ptr, png_infop info_ptr, +png_get_bKGD(const_png_structp png_ptr, png_infop info_ptr, png_color_16p *background) { if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) @@ -406,7 +407,7 @@ png_get_bKGD(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_cHRM_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED png_uint_32 PNGAPI -png_get_cHRM(png_structp png_ptr, png_infop info_ptr, +png_get_cHRM(const_png_structp png_ptr, const_png_infop info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y) { @@ -437,7 +438,7 @@ png_get_cHRM(png_structp png_ptr, png_infop info_ptr, #endif #ifdef PNG_FIXED_POINT_SUPPORTED png_uint_32 PNGAPI -png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, +png_get_cHRM_fixed(const_png_structp png_ptr, const_png_infop info_ptr, png_fixed_point *white_x, png_fixed_point *white_y, png_fixed_point *red_x, png_fixed_point *red_y, png_fixed_point *green_x, png_fixed_point *green_y, png_fixed_point *blue_x, png_fixed_point *blue_y) @@ -472,7 +473,7 @@ png_get_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_gAMA_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED png_uint_32 PNGAPI -png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma) +png_get_gAMA(const_png_structp png_ptr, const_png_infop info_ptr, double *file_gamma) { png_debug1(1, "in %s retrieval function", "gAMA"); @@ -487,7 +488,7 @@ png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma) #endif #ifdef PNG_FIXED_POINT_SUPPORTED png_uint_32 PNGAPI -png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, +png_get_gAMA_fixed(const_png_structp png_ptr, const_png_infop info_ptr, png_fixed_point *int_file_gamma) { png_debug1(1, "in %s retrieval function", "gAMA"); @@ -505,7 +506,8 @@ png_get_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_sRGB_SUPPORTED png_uint_32 PNGAPI -png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent) +png_get_sRGB(const_png_structp png_ptr, const_png_infop info_ptr, + int *file_srgb_intent) { png_debug1(1, "in %s retrieval function", "sRGB"); @@ -521,7 +523,7 @@ png_get_sRGB(png_structp png_ptr, png_infop info_ptr, int *file_srgb_intent) #ifdef PNG_iCCP_SUPPORTED png_uint_32 PNGAPI -png_get_iCCP(png_structp png_ptr, png_infop info_ptr, +png_get_iCCP(const_png_structp png_ptr, const_png_infop info_ptr, png_charpp name, int *compression_type, png_charpp profile, png_uint_32 *proflen) { @@ -545,7 +547,7 @@ png_get_iCCP(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_sPLT_SUPPORTED png_uint_32 PNGAPI -png_get_sPLT(png_structp png_ptr, png_infop info_ptr, +png_get_sPLT(const_png_structp png_ptr, const_png_infop info_ptr, png_sPLT_tpp spalettes) { if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL) @@ -559,7 +561,8 @@ png_get_sPLT(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_hIST_SUPPORTED png_uint_32 PNGAPI -png_get_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_16p *hist) +png_get_hIST(const_png_structp png_ptr, const_png_infop info_ptr, + png_uint_16p *hist) { png_debug1(1, "in %s retrieval function", "hIST"); @@ -614,7 +617,7 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_oFFs_SUPPORTED png_uint_32 PNGAPI -png_get_oFFs(png_structp png_ptr, png_infop info_ptr, +png_get_oFFs(const_png_structp png_ptr, const_png_infop info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type) { png_debug1(1, "in %s retrieval function", "oFFs"); @@ -633,7 +636,7 @@ png_get_oFFs(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_pCAL_SUPPORTED png_uint_32 PNGAPI -png_get_pCAL(png_structp png_ptr, png_infop info_ptr, +png_get_pCAL(const_png_structp png_ptr, const_png_infop info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params) { @@ -659,7 +662,7 @@ png_get_pCAL(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_sCAL_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED png_uint_32 PNGAPI -png_get_sCAL(png_structp png_ptr, png_infop info_ptr, +png_get_sCAL(const_png_structp png_ptr, const_png_infop info_ptr, int *unit, double *width, double *height) { if (png_ptr != NULL && info_ptr != NULL && @@ -675,7 +678,7 @@ png_get_sCAL(png_structp png_ptr, png_infop info_ptr, #else #ifdef PNG_FIXED_POINT_SUPPORTED png_uint_32 PNGAPI -png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr, +png_get_sCAL_s(const_png_structp png_ptr, const_png_infop info_ptr, int *unit, png_charpp width, png_charpp height) { if (png_ptr != NULL && info_ptr != NULL && @@ -694,7 +697,7 @@ png_get_sCAL_s(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_pHYs_SUPPORTED png_uint_32 PNGAPI -png_get_pHYs(png_structp png_ptr, png_infop info_ptr, +png_get_pHYs(const_png_structp png_ptr, const_png_infop info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type) { png_uint_32 retval = 0; @@ -727,7 +730,8 @@ png_get_pHYs(png_structp png_ptr, png_infop info_ptr, #endif png_uint_32 PNGAPI -png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette, +png_get_PLTE(const_png_structp png_ptr, const_png_infop info_ptr, + png_colorp *palette, int *num_palette) { png_debug1(1, "in %s retrieval function", "PLTE"); @@ -745,7 +749,8 @@ png_get_PLTE(png_structp png_ptr, png_infop info_ptr, png_colorp *palette, #ifdef PNG_sBIT_SUPPORTED png_uint_32 PNGAPI -png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit) +png_get_sBIT(const_png_structp png_ptr, png_infop info_ptr, + png_color_8p *sig_bit) { png_debug1(1, "in %s retrieval function", "sBIT"); @@ -761,8 +766,8 @@ png_get_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p *sig_bit) #ifdef PNG_TEXT_SUPPORTED png_uint_32 PNGAPI -png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr, - int *num_text) +png_get_text(const_png_structp png_ptr, const_png_infop info_ptr, + png_textp *text_ptr, int *num_text) { if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) { @@ -786,7 +791,8 @@ png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr, #ifdef PNG_tIME_SUPPORTED png_uint_32 PNGAPI -png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time) +png_get_tIME(const_png_structp png_ptr, png_infop info_ptr, + png_timep *mod_time) { png_debug1(1, "in %s retrieval function", "tIME"); @@ -802,7 +808,7 @@ png_get_tIME(png_structp png_ptr, png_infop info_ptr, png_timep *mod_time) #ifdef PNG_tRNS_SUPPORTED png_uint_32 PNGAPI -png_get_tRNS(png_structp png_ptr, png_infop info_ptr, +png_get_tRNS(const_png_structp png_ptr, png_infop info_ptr, png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color) { png_uint_32 retval = 0; @@ -844,7 +850,7 @@ png_get_tRNS(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED png_uint_32 PNGAPI -png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, +png_get_unknown_chunks(const_png_structp png_ptr, const_png_infop info_ptr, png_unknown_chunkpp unknowns) { if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL) @@ -858,7 +864,7 @@ png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED png_byte PNGAPI -png_get_rgb_to_gray_status(png_structp png_ptr) +png_get_rgb_to_gray_status(const_png_structp png_ptr) { return (png_byte)(png_ptr? png_ptr->rgb_to_gray_status : 0); } @@ -866,14 +872,14 @@ png_get_rgb_to_gray_status(png_structp png_ptr) #ifdef PNG_USER_CHUNKS_SUPPORTED png_voidp PNGAPI -png_get_user_chunk_ptr(png_structp png_ptr) +png_get_user_chunk_ptr(const_png_structp png_ptr) { return (png_ptr? png_ptr->user_chunk_ptr : NULL); } #endif png_size_t PNGAPI -png_get_compression_buffer_size(png_structp png_ptr) +png_get_compression_buffer_size(const_png_structp png_ptr) { return (png_ptr ? png_ptr->zbuf_size : 0L); } @@ -883,24 +889,24 @@ png_get_compression_buffer_size(png_structp png_ptr) /* These functions were added to libpng 1.2.6 and were enabled * by default in libpng-1.4.0 */ png_uint_32 PNGAPI -png_get_user_width_max(png_structp png_ptr) +png_get_user_width_max(const_png_structp png_ptr) { return (png_ptr? png_ptr->user_width_max : 0); } png_uint_32 PNGAPI -png_get_user_height_max(png_structp png_ptr) +png_get_user_height_max(const_png_structp png_ptr) { return (png_ptr? png_ptr->user_height_max : 0); } /* This function was added to libpng 1.4.0 */ png_uint_32 PNGAPI -png_get_chunk_cache_max(png_structp png_ptr) +png_get_chunk_cache_max(const_png_structp png_ptr) { return (png_ptr? png_ptr->user_chunk_cache_max : 0); } /* This function was added to libpng 1.4.1 */ png_alloc_size_t PNGAPI -png_get_chunk_malloc_max(png_structp png_ptr) +png_get_chunk_malloc_max(const_png_structp png_ptr) { return (png_ptr? png_ptr->user_chunk_malloc_max : 0); @@ -910,7 +916,7 @@ png_get_chunk_malloc_max(png_structp png_ptr) /* These functions were added to libpng 1.4.0 */ #ifdef PNG_IO_STATE_SUPPORTED png_uint_32 PNGAPI -png_get_io_state(png_structp png_ptr) +png_get_io_state(const_png_structp png_ptr) { return png_ptr->io_state; } diff --git a/pngmem.c b/pngmem.c index c8a3f6f59..6e160d51d 100644 --- a/pngmem.c +++ b/pngmem.c @@ -1,8 +1,8 @@ /* pngmem.c - stub functions for memory allocation * - * Last changed in libpng 1.4.2 [May 6, 2010] - * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * Last changed in libpng 1.4.6 [January 21, 2011] + * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -601,7 +601,7 @@ png_set_mem_fn(png_structp png_ptr, png_voidp mem_ptr, png_malloc_ptr * pointer before png_write_destroy and png_read_destroy are called. */ png_voidp PNGAPI -png_get_mem_ptr(png_structp png_ptr) +png_get_mem_ptr(const_png_structp png_ptr) { if (png_ptr == NULL) return (NULL); diff --git a/pngpread.c b/pngpread.c index 9c69a89d1..aed2ee8f0 100644 --- a/pngpread.c +++ b/pngpread.c @@ -1,8 +1,8 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.4.3 [June 26, 2010] - * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * Last changed in libpng 1.4.6 [January 21, 2011] + * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -1757,7 +1757,7 @@ png_set_progressive_read_fn(png_structp png_ptr, png_voidp progressive_ptr, } png_voidp PNGAPI -png_get_progressive_ptr(png_structp png_ptr) +png_get_progressive_ptr(const_png_structp png_ptr) { if (png_ptr == NULL) return (NULL); diff --git a/pngpriv.h b/pngpriv.h index bc4d09821..e87567c47 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -1,9 +1,9 @@ /* pngpriv.h - private declarations for use inside libpng * - * libpng version 1.4.6beta04 - January 15, 2011 + * libpng version 1.4.6beta04 - January 21, 2011 * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * diff --git a/pngrutil.c b/pngrutil.c index cf04d0b7d..048d7c706 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -1,7 +1,7 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.4.6 [January 14, 2011] + * Last changed in libpng 1.4.6 [January 21, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) diff --git a/pngtrans.c b/pngtrans.c index 741daf45b..8c5a29bed 100644 --- a/pngtrans.c +++ b/pngtrans.c @@ -1,8 +1,8 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * Last changed in libpng 1.4.2 [April 29, 2010] - * Copyright (c) 1998-2010 Glenn Randers-Pehrson + * Last changed in libpng 1.4.6 [January 21, 2011] + * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -662,7 +662,7 @@ png_set_user_transform_info(png_structp png_ptr, png_voidp * are called. */ png_voidp PNGAPI -png_get_user_transform_ptr(png_structp png_ptr) +png_get_user_transform_ptr(const_png_structp png_ptr) { if (png_ptr == NULL) return (NULL);