X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5b02c8a11f0e0d284eff32cfde1fcd2a4b2e659d..b00403b401b75f95b6984cf5d0f6d71492f0a1f9:/src/png/libpng.3 diff --git a/src/png/libpng.3 b/src/png/libpng.3 index e7fa62e6ad..fb5d65491a 100644 --- a/src/png/libpng.3 +++ b/src/png/libpng.3 @@ -1,6 +1,6 @@ -.TH LIBPNG 3 "August 15, 2004" +.TH LIBPNG 3 "December 18, 2008" .SH NAME -libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6 +libpng \- Portable Network Graphics (PNG) Reference Library 1.2.34 .SH SYNOPSIS \fI\fB @@ -176,6 +176,14 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6 \fI\fB +\fB#if \fI!defined(PNG_1_0_X) + +\fBpng_int_32 png_get_int_32 (png_bytep \fIbuf\fP\fB);\fP + +\fI\fB#endif + +\fI\fB + \fBpng_byte png_get_interlace_type (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP \fI\fB @@ -258,6 +266,22 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6 \fI\fB +\fB#if \fI!defined(PNG_1_0_X) + +\fBpng_uint_16 png_get_uint_16 (png_bytep \fIbuf\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_uint_31 (png_bytep \fIbuf\fP\fB);\fP + +\fI\fB + +\fBpng_uint_32 png_get_uint_32 (png_bytep \fIbuf\fP\fB);\fP + +\fI\fB#endif + +\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 \fI\fB @@ -402,6 +426,26 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6 \fI\fB +\fB#if \fI!defined(PNG_1_0_X) + +\fBpng_save_int_32 (png_bytep \fP\fIbuf\fP\fB, png_int_32 \fIi\fP\fB);\fP + +\fI\fB + +\fBvoid png_save_uint_16 (png_bytep \fP\fIbuf\fP\fB, unsigned int \fIi\fP\fB);\fP + +\fI\fB + +\fBvoid png_save_uint_32 (png_bytep \fP\fIbuf\fP\fB, png_uint_32 \fIi\fP\fB);\fP + +\fI\fB + +\fBvoid png_set_add_alpha (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP + +\fI\fB#endif + +\fI\fB + \fBvoid png_set_background (png_structp \fP\fIpng_ptr\fP\fB, png_color_16p \fP\fIbackground_color\fP\fB, int \fP\fIbackground_gamma_code\fP\fB, int \fP\fIneed_expand\fP\fB, double \fIbackground_gamma\fP\fB);\fP \fI\fB @@ -458,6 +502,10 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.2.6 \fI\fB +\fBvoid png_set_expand_gray_1_2_4_to_8(png_structp \fIpng_ptr\fP\fB);\fP + +\fI\fB + \fBvoid png_set_filler (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP \fI\fB @@ -773,14 +821,18 @@ 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.2.6 - August 15, 2004 + libpng version 1.2.34 - December 18, 2008 Updated and distributed by Glenn Randers-Pehrson - - Copyright (c) 1998-2004 Glenn Randers-Pehrson + + Copyright (c) 1998-2008 Glenn Randers-Pehrson For conditions of distribution and use, see copyright notice in png.h. - based on: + Based on: + + libpng versions 0.97, January 1998, through 1.2.34 - December 18, 2008 + Updated and distributed by Glenn Randers-Pehrson + Copyright (c) 1998-2008 Glenn Randers-Pehrson libpng 1.0 beta 6 version 0.96 May 28, 1997 Updated and distributed by Andreas Dilger @@ -806,23 +858,33 @@ it is heavily commented and should include everything most people will need. We assume that libpng is already installed; see the INSTALL file for instructions on how to install libpng. +For examples of libpng usage, see the files "example.c", "pngtest.c", +and the files in the "contrib" directory, all of which are included in the +libpng distribution. + Libpng was written as a companion to the PNG specification, as a way of reducing the amount of time and effort it takes to support the PNG file format in application programs. -The PNG-1.2 specification is available at -and at . +The PNG specification (second edition), November 2003, is available as +a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2003 (E)) at +. It is technically equivalent +to the PNG specification (second edition) but has some additional material. The PNG-1.0 specification is available -as RFC 2083 and as a -W3C Recommendation . Some -additional chunks are described in the special-purpose public chunks -documents at . +as RFC 2083 and as a +W3C Recommendation . + +Some additional chunks are described in the special-purpose public chunks +documents at . Other information about PNG, and the latest version of libpng, can be found at the PNG home -page, -and at . +page, . Most users will not have to modify the library significantly; advanced users may want to modify it more. All attempts were made to make it as @@ -851,10 +913,7 @@ Libpng is thread safe, provided the threads are using different instances of the structures. Each thread should have its own png_struct and png_info instances, and thus its own image. Libpng does not protect itself against two threads using the -same instance of a structure. Note: thread safety may be defeated -by use of some of the MMX assembler code in pnggccrd.c, which is only -compiled when the user defines PNG_THREAD_UNSAFE_OK. - +same instance of a structure. .SH II. Structures @@ -1028,15 +1087,19 @@ input stream. You must supply the function png_unknown_chunkp chunk); { /* The unknown chunk structure contains your - chunk data: */ + chunk data, along with similar data for any other + unknown chunks: */ + png_byte name[5]; png_byte *data; png_size_t size; + /* Note that libpng has already taken care of the CRC handling */ - /* put your code here. Return one of the - following: */ + /* put your code here. Search for your chunk in the + unknown chunk structure, process it, and return one + of the following: */ return (-n); /* chunk had an error */ return (0); /* did not recognize */ @@ -1056,6 +1119,11 @@ you can retrieve with png_get_user_chunk_ptr(png_ptr); +If you call the png_set_read_user_chunk_fn() function, then all unknown +chunks will be saved when read, in case your callback function will need +one or more of them. This behavior can be changed with the +png_set_keep_unknown_chunks() function, described below. + At this point, you can set up a callback function that will be called after each row has been read, which you can use to control a progress meter or the like. It's demonstrated in pngtest.c. @@ -1073,40 +1141,41 @@ To inform libpng about your function, use png_set_read_status_fn(png_ptr, read_row_callback); -%-%.SS Width and height limits -%-% -%-%The PNG specification allows the width and height of an image to be as -%-%large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns. -%-%Since very few applications really need to process such large images, -%-%we have imposed an arbitrary 1-million limit on rows and columns. -%-%Larger images will be rejected immediately with a png_error() call. If -%-%you wish to override this limit, you can use -%-% -%-% png_set_user_limits(png_ptr, width_max, height_max); -%-% -%-%to set your own limits, or use width_max = height_max = 0x7fffffffL -%-%to allow all valid dimensions (libpng may reject some very large images -%-%anyway because of potential buffer overflow conditions). -%-% -%-%You should put this statement after you create the PNG structure and -%-%before calling png_read_info(), png_read_png(), or png_process_data(). -%-%If you need to retrieve the limits that are being applied, use -%-% -%-% width_max = png_get_user_width_max(png_ptr); -%-% height_max = png_get_user_height_max(png_ptr); -%-% +.SS Width and height limits + +The PNG specification allows the width and height of an image to be as +large as 2^31-1 (0x7fffffff), or about 2.147 billion rows and columns. +Since very few applications really need to process such large images, +we have imposed an arbitrary 1-million limit on rows and columns. +Larger images will be rejected immediately with a png_error() call. If +you wish to override this limit, you can use + + png_set_user_limits(png_ptr, width_max, height_max); + +to set your own limits, or use width_max = height_max = 0x7fffffffL +to allow all valid dimensions (libpng may reject some very large images +anyway because of potential buffer overflow conditions). + +You should put this statement after you create the PNG structure and +before calling png_read_info(), png_read_png(), or png_process_data(). +If you need to retrieve the limits that are being applied, use + + width_max = png_get_user_width_max(png_ptr); + height_max = png_get_user_height_max(png_ptr); + .SS Unknown-chunk handling Now you get to set the way the library processes unknown chunks in the input PNG stream. Both known and unknown chunks will be read. Normal behavior is that known chunks will be parsed into information in -various info_ptr members; unknown chunks will be discarded. To change -this, you can call: +various info_ptr members while unknown chunks will be discarded. This +behavior can be wasteful if your application will never use some known +chunk types. To change this, you can call: png_set_keep_unknown_chunks(png_ptr, keep, chunk_list, num_chunks); - keep - 0: do not handle as unknown - 1: do not keep + keep - 0: default unknown chunk handling + 1: ignore; do not keep 2: keep only if safe-to-copy 3: keep even if unsafe-to-copy You can use these definitions: @@ -1129,6 +1198,37 @@ instances of png_set_keep_unknown_chunks(), the final instance will take precedence. The IHDR and IEND chunks should not be named in chunk_list; if they are, libpng will process them normally anyway. +Here is an example of the usage of png_set_keep_unknown_chunks(), +where the private "vpAg" chunk will later be processed by a user chunk +callback function: + + png_byte vpAg[5]={118, 112, 65, 103, (png_byte) '\0'}; + + #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + png_byte unused_chunks[]= + { + 104, 73, 83, 84, (png_byte) '\0', /* hIST */ + 105, 84, 88, 116, (png_byte) '\0', /* iTXt */ + 112, 67, 65, 76, (png_byte) '\0', /* pCAL */ + 115, 67, 65, 76, (png_byte) '\0', /* sCAL */ + 115, 80, 76, 84, (png_byte) '\0', /* sPLT */ + 116, 73, 77, 69, (png_byte) '\0', /* tIME */ + }; + #endif + + ... + + #if defined(PNG_UNKNOWN_CHUNKS_SUPPORTED) + /* ignore all unknown chunks: */ + png_set_keep_unknown_chunks(read_ptr, 1, NULL, 0); + /* except for vpAg: */ + png_set_keep_unknown_chunks(read_ptr, 2, vpAg, 1); + /* also ignore unused known chunks: */ + png_set_keep_unknown_chunks(read_ptr, 1, unused_chunks, + (int)sizeof(unused_chunks)/5); + #endif + + .SS The high-level read interface At this point there are two ways to proceed; through the high-level @@ -1162,7 +1262,7 @@ dithering, and setting filler.) If this is the case, simply do this: png_read_png(png_ptr, info_ptr, png_transforms, NULL) -where png_transforms is an integer containing the logical OR of +where png_transforms is an integer containing the bitwise OR of some set of transformation flags. This call is equivalent to png_read_info(), followed the set of transformations indicated by the transform mask, then png_read_image(), and finally png_read_end(). @@ -1170,6 +1270,9 @@ then png_read_image(), and finally png_read_end(). (The final parameter of this call is not yet used. Someday it might point to transformation parameters required by some future input transform.) +You must use png_transforms and not call any png_set_transform() functions +when you use png_read_png(). + After you have called png_read_png(), you can retrieve the image data with @@ -1534,14 +1637,15 @@ unless the library has been told to transform it into another format. For example, 4 bit/pixel paletted or grayscale data will be returned 2 pixels/byte with the leftmost pixel in the high-order bits of the byte, unless png_set_packing() is called. 8-bit RGB data will be stored -in RGB RGB RGB format unless png_set_filler() is called to insert filler -bytes, either before or after each RGB triplet. 16-bit RGB data will -be returned RRGGBB RRGGBB, with the most significant byte of the color -value first, unless png_set_strip_16() is called to transform it to -regular RGB RGB triplets, or png_set_filler() is called to insert -filler bytes, either before or after each RRGGBB triplet. Similarly, -8-bit or 16-bit grayscale data can be modified with png_set_filler() -or png_set_strip_16(). +in RGB RGB RGB format unless png_set_filler() or png_set_add_alpha() +is called to insert filler bytes, either before or after each RGB triplet. +16-bit RGB data will be returned RRGGBB RRGGBB, with the most significant +byte of the color value first, unless png_set_strip_16() is called to +transform it to regular RGB RGB triplets, or png_set_filler() or +png_set_add alpha() is called to insert filler bytes, either before or +after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data can +be modified with +png_set_filler(), png_set_add_alpha(), or png_set_strip_16(). The following code transforms grayscale images of less than 8 to 8 bits, changes paletted images to RGB, and adds a full alpha channel if there is @@ -1553,7 +1657,7 @@ viewing application that wishes to treat all images in the same way. png_set_palette_to_rgb(png_ptr); if (color_type == PNG_COLOR_TYPE_GRAY && - bit_depth < 8) png_set_gray_1_2_4_to_8(png_ptr); + bit_depth < 8) png_set_expand_gray_1_2_4_to_8(png_ptr); if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png_ptr); @@ -1563,6 +1667,12 @@ in libpng version 1.0.4, with the function names expanded to improve code readability. In some future version they may actually do different things. +As of libpng version 1.2.9, png_set_expand_gray_1_2_4_to_8() was +added. It expands the sample depth without changing tRNS to alpha. +At the same time, png_set_gray_1_2_4_to_8() was deprecated, and it +will be removed from a future version. + + PNG can have files with 16 bits per channel. If you only can handle 8 bits per channel, this will strip the pixels down to 8 bit. @@ -1626,6 +1736,16 @@ does not affect images that already have full alpha channels. To add an opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which will generate RGBA pixels. +Note that png_set_filler() does not change the color type. If you want +to do that, you can add a true alpha channel with + + if (color_type == PNG_COLOR_TYPE_RGB || + color_type == PNG_COLOR_TYPE_GRAY) + png_set_add_alpha(png_ptr, filler, PNG_FILLER_AFTER); + +where "filler" contains the alpha value to assign to each pixel. +This function was added in libpng-1.2.7. + If you are reading an image with an alpha channel, and you need the data as ARGB instead of the normal PNG format RGBA: @@ -1679,7 +1799,7 @@ the normalized graylevel is computed: The default values approximate those recommended in the Charles Poynton's Color FAQ, -Copyright (c) 1998-01-04 Charles Poynton poynton@inforamp.net +Copyright (c) 1998-01-04 Charles Poynton Y = 0.212671 * R + 0.715160 * G + 0.072169 * B @@ -2004,8 +2124,8 @@ the second parameter NULL. .SS Finishing a sequential read -After you are finished reading the image through either the high- or -low-level interfaces, you can finish reading the file. If you are +After you are finished reading the image through the +low-level interface, you can finish reading the file. If you are interested in comments or time, which may be stored either before or after the image data, you should pass the separate png_info struct if you want to keep the comments from before and after the image @@ -2023,7 +2143,7 @@ point to libpng-allocated storage with the following function: png_free_data(png_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask - containing the logical OR of one or + containing the bitwise OR of one or more of PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_HIST, PNG_FREE_ICCP, @@ -2085,7 +2205,7 @@ application instead of by libpng, you can use png_set_invalid(png_ptr, info_ptr, mask); mask - identifies the chunks to be made invalid, - containing the logical OR of one or + containing the bitwise OR of one or more of PNG_INFO_gAMA, PNG_INFO_sBIT, PNG_INFO_cHRM, PNG_INFO_PLTE, @@ -2352,6 +2472,14 @@ Libpng section below. png_init_io(png_ptr, fp); +If you are embedding your PNG into a datastream such as MNG, and don't +want libpng to write the 8-byte signature, or if you have already +written the signature in your application, use + + png_set_sig_bytes(png_ptr, 8); + +to inform libpng that it should not write a signature. + .SS Write callbacks At this point, you can set up a callback function that will be @@ -2389,7 +2517,7 @@ types. /* turn on or off filtering, and/or choose specific filters. You can use either a single - PNG_FILTER_VALUE_NAME or the logical OR of one + PNG_FILTER_VALUE_NAME or the bitwise OR of one or more PNG_FILTER_NAME masks. */ png_set_filter(png_ptr, 0, PNG_FILTER_NONE | PNG_FILTER_VALUE_NONE | @@ -2484,6 +2612,11 @@ Some of the more important parts of the png_info are: can also be PNG_INTRAPIXEL_DIFFERENCING) +If you call png_set_IHDR(), the call must appear before any of the +other png_set_*() functions, which might require access to some of +the IHDR settings. The remaining png_set_*() functions can be called +in any order. + png_set_PLTE(png_ptr, info_ptr, palette, num_palette); palette - the palette for the file @@ -2762,7 +2895,7 @@ png_set_rows() to put image data in the info structure), simply do this: png_write_png(png_ptr, info_ptr, png_transforms, NULL) -where png_transforms is an integer containing the logical OR of some set of +where png_transforms is an integer containing the bitwise OR of some set of transformation flags. This call is equivalent to png_write_info(), followed the set of transformations indicated by the transform mask, then png_write_image(), and finally png_write_end(). @@ -2770,6 +2903,9 @@ then png_write_image(), and finally png_write_end(). (The final parameter of this call is not yet used. Someday it might point to transformation parameters required by some future output transform.) +You must use png_transforms and not call any png_set_transform() functions +when you use png_write_png(). + .SS The low-level write interface If you are going the low-level route instead, you are now ready to @@ -3019,7 +3155,7 @@ point to libpng-allocated storage with the following function: png_free_data(png_ptr, info_ptr, mask, seq) mask - identifies data to be freed, a mask - containing the logical OR of one or + containing the bitwise OR of one or more of PNG_FREE_PLTE, PNG_FREE_TRNS, PNG_FREE_HIST, PNG_FREE_ICCP, @@ -3091,17 +3227,13 @@ For a more compact example of writing a PNG image, see the file example.c. .SH V. Modifying/Customizing libpng: -There are three issues here. The first is changing how libpng does +There are two issues here. The first is changing how libpng does standard things like memory allocation, input/output, and error handling. The second deals with more complicated things like adding new chunks, adding new transformations, and generally changing how libpng works. Both of those are compile-time issues; that is, they are generally determined at the time the code is written, and there is rarely a need -to provide the user with a means of changing them. The third is a -run-time issue: choosing between and/or tuning one or more alternate -versions of computationally intensive routines; specifically, optimized -assembly-language (and therefore compiler- and platform-dependent) -versions. +to provide the user with a means of changing them. Memory allocation, input/output, and error handling @@ -3133,6 +3265,9 @@ Your malloc_fn() must return NULL in case of failure. The png_malloc() function will normally call png_error() if it receives a NULL from the system memory allocator or from your replacement malloc_fn(). +Your free_fn() will never be called with a NULL ptr, since libpng's +png_free() checks for NULL before calling free_fn(). + Input/Output in libpng is done through png_read() and png_write(), which currently just call fread() and fwrite(). The FILE * is stored in png_struct and is initialized via png_init_io(). If you wish to change @@ -3212,7 +3347,7 @@ to use the "cexcept" facility (see http://cexcept.sourceforge.net). If you need to read or write custom chunks, you may need to get deeper into the libpng code. The library now has mechanisms for storing and writing chunks of unknown type; you can even declare callbacks -for custom chunks. Hoewver, this may not be good enough if the +for custom chunks. However, this may not be good enough if the library code itself needs to know about interactions between your chunk and existing `intrinsic' chunks. @@ -3462,126 +3597,7 @@ When PNG_DEBUG = 1, the macros are defined, but only png_debug statements having level = 0 will be printed. There aren't any such statements in this version of libpng, but if you insert some they will be printed. -%-%.SH VI. Runtime optimization -%-% -%-%A new feature in libpng 1.2.0 is the ability to dynamically switch between -%-%standard and optimized versions of some routines. Currently these are -%-%limited to three computationally intensive tasks when reading PNG files: -%-%decoding row filters, expanding interlacing, and combining interlaced or -%-%transparent row data with previous row data. Currently the optimized -%-%versions are available only for x86 (Intel, AMD, etc.) platforms with -%-%MMX support, though this may change in future versions. (For example, -%-%the non-MMX assembler optimizations for zlib might become similarly -%-%runtime-selectable in future releases, in which case libpng could be -%-%extended to support them. Alternatively, the compile-time choice of -%-%floating-point versus integer routines for gamma correction might become -%-%runtime-selectable.) -%-% -%-%Because such optimizations tend to be very platform- and compiler-dependent, -%-%both in how they are written and in how they perform, the new runtime code -%-%in libpng has been written to allow programs to query, enable, and disable -%-%either specific optimizations or all such optimizations. For example, to -%-%enable all possible optimizations (bearing in mind that some "optimizations" -%-%may actually run more slowly in rare cases): -%-% -%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) -%-% png_uint_32 mask, flags; -%-% -%-% flags = png_get_asm_flags(png_ptr); -%-% mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE); -%-% png_set_asm_flags(png_ptr, flags | mask); -%-% #endif -%-% -%-%To enable only optimizations relevant to reading PNGs, use PNG_SELECT_READ -%-%by itself when calling png_get_asm_flagmask(); similarly for optimizing -%-%only writing. To disable all optimizations: -%-% -%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) -%-% flags = png_get_asm_flags(png_ptr); -%-% mask = png_get_asm_flagmask(PNG_SELECT_READ | PNG_SELECT_WRITE); -%-% png_set_asm_flags(png_ptr, flags & ~mask); -%-% #endif -%-% -%-%To enable or disable only MMX-related features, use png_get_mmx_flagmask() -%-%in place of png_get_asm_flagmask(). The mmx version takes one additional -%-%parameter: -%-% -%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) -%-% int selection = PNG_SELECT_READ | PNG_SELECT_WRITE; -%-% int compilerID; -%-% -%-% mask = png_get_mmx_flagmask(selection, &compilerID); -%-% #endif -%-% -%-%On return, compilerID will indicate which version of the MMX assembler -%-%optimizations was compiled. Currently two flavors exist: Microsoft -%-%Visual C++ (compilerID == 1) and GNU C (a.k.a. gcc/gas, compilerID == 2). -%-%On non-x86 platforms or on systems compiled without MMX optimizations, a -%-%value of -1 is used. -%-% -%-%Note that both png_get_asm_flagmask() and png_get_mmx_flagmask() return -%-%all valid, settable optimization bits for the version of the library that's -%-%currently in use. In the case of shared (dynamically linked) libraries, -%-%this may include optimizations that did not exist at the time the code was -%-%written and compiled. It is also possible, of course, to enable only known, -%-%specific optimizations; for example: -%-% -%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) -%-% flags = PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ -%-% | PNG_ASM_FLAG_MMX_READ_INTERLACE \ -%-% | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ -%-% | PNG_ASM_FLAG_MMX_READ_FILTER_UP \ -%-% | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ -%-% | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ; -%-% png_set_asm_flags(png_ptr, flags); -%-% #endif -%-% -%-%This method would enable only the MMX read-optimizations available at the -%-%time of libpng 1.2.0's release, regardless of whether a later version of -%-%the DLL were actually being used. (Also note that these functions did not -%-%exist in versions older than 1.2.0, so any attempt to run a dynamically -%-%linked app on such an older version would fail.) -%-% -%-%To determine whether the processor supports MMX instructions at all, use -%-%the png_mmx_support() function: -%-% -%-% #if defined(PNG_LIBPNG_VER) && (PNG_LIBPNG_VER >= 10200) -%-% mmxsupport = png_mmx_support(); -%-% #endif -%-% -%-%It returns -1 if MMX support is not compiled into libpng, 0 if MMX code -%-%is compiled but MMX is not supported by the processor, or 1 if MMX support -%-%is fully available. Note that png_mmx_support(), png_get_mmx_flagmask(), -%-%and png_get_asm_flagmask() all may be called without allocating and ini- -%-%tializing any PNG structures (for example, as part of a usage screen or -%-%"about" box). -%-% -%-%The following code can be used to prevent an application from using the -%-%thread_unsafe features, even if libpng was built with PNG_THREAD_UNSAFE_OK -%-%defined: -%-% -%-%#if defined(PNG_USE_PNGGCCRD) && defined(PNG_ASSEMBLER_CODE_SUPPORTED) \ -%-% && defined(PNG_THREAD_UNSAFE_OK) -%-% /* Disable thread-unsafe features of pnggccrd */ -%-% if (png_access_version() >= 10200) -%-% { -%-% png_uint_32 mmx_disable_mask = 0; -%-% png_uint_32 asm_flags; -%-% -%-% mmx_disable_mask |= ( PNG_ASM_FLAG_MMX_READ_COMBINE_ROW \ -%-% | PNG_ASM_FLAG_MMX_READ_FILTER_SUB \ -%-% | PNG_ASM_FLAG_MMX_READ_FILTER_AVG \ -%-% | PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ); -%-% asm_flags = png_get_asm_flags(png_ptr); -%-% png_set_asm_flags(png_ptr, asm_flags & ~mmx_disable_mask); -%-% } -%-%#endif -%-% -%-%For more extensive examples of runtime querying, enabling and disabling -%-%of optimized features, see contrib/gregbook/readpng2.c in the libpng -%-%source-code distribution. -%-% -.SH VI. MNG support +.SH VII. MNG support The MNG specification (available at http://www.libpng.org/pub/mng) allows certain extensions to PNG for PNG images that are embedded in MNG datastreams. @@ -3589,12 +3605,12 @@ Libpng can support some of these extensions. To enable them, use the png_permit_mng_features() function: feature_set = png_permit_mng_features(png_ptr, mask) - mask is a png_uint_32 containing the logical OR of the + mask is a png_uint_32 containing the bitwise OR of the features you want to enable. These include PNG_FLAG_MNG_EMPTY_PLTE PNG_FLAG_MNG_FILTER_64 PNG_ALL_MNG_FEATURES - feature_set is a png_uint_32 that is the logical AND of + feature_set is a png_uint_32 that is the bitwise AND of your mask with the set of MNG features that is supported by the version of libpng that you are using. @@ -3606,7 +3622,7 @@ or any other MNG chunks; your application must provide its own support for them. You may wish to consider using libmng (available at http://www.libmng.com) instead. -.SH VII. Changes to Libpng from version 0.88 +.SH VIII. Changes to Libpng from version 0.88 It should be noted that versions of libpng later than 0.96 are not distributed by the original libpng author, Guy Schalnat, nor by @@ -3655,15 +3671,15 @@ application: png_uint_32 application_vn = PNG_LIBPNG_VER; -.SH VII. Y2K Compliance in libpng +.SH IX. Y2K Compliance in libpng -August 15, 2004 +December 18, 2008 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. This is your unofficial assurance that libpng from version 0.71 and -upward through 1.2.6 are Y2K compliant. It is my belief that earlier +upward through 1.2.34 are Y2K compliant. It is my belief that earlier versions were also Y2K compliant. Libpng only has three year fields. One is a 2-byte unsigned integer that @@ -3806,6 +3822,120 @@ the first widely used release: 1.2.6rc1-5 13 10206 12.so.0.1.2.6rc1-5 1.0.16 10 10016 10.so.0.1.0.16 1.2.6 13 10206 12.so.0.1.2.6 + 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 + 1.0.17rc1 10 10017 10.so.0.1.0.17rc1 + 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 + 1.0.17 10 10017 10.so.0.1.0.17 + 1.2.7 13 10207 12.so.0.1.2.7 + 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 + 1.0.18rc1-5 10 10018 10.so.0.1.0.18rc1-5 + 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 + 1.0.18 10 10018 10.so.0.1.0.18 + 1.2.8 13 10208 12.so.0.1.2.8 + 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 + 1.2.9beta4-11 13 10209 12.so.0.9[.0] + 1.2.9rc1 13 10209 12.so.0.9[.0] + 1.2.9 13 10209 12.so.0.9[.0] + 1.2.10beta1-8 13 10210 12.so.0.10[.0] + 1.2.10rc1-3 13 10210 12.so.0.10[.0] + 1.2.10 13 10210 12.so.0.10[.0] + 1.2.11beta1-4 13 10211 12.so.0.11[.0] + 1.0.19rc1-5 10 10019 10.so.0.19[.0] + 1.2.11rc1-5 13 10211 12.so.0.11[.0] + 1.0.19 10 10019 10.so.0.19[.0] + 1.2.11 13 10211 12.so.0.11[.0] + 1.0.20 10 10020 10.so.0.20[.0] + 1.2.12 13 10212 12.so.0.12[.0] + 1.2.13beta1 13 10213 12.so.0.13[.0] + 1.0.21 10 10021 10.so.0.21[.0] + 1.2.13 13 10213 12.so.0.13[.0] + 1.2.14beta1-2 13 10214 12.so.0.14[.0] + 1.0.22rc1 10 10022 10.so.0.22[.0] + 1.2.14rc1 13 10214 12.so.0.14[.0] + 1.2.15beta1-6 13 10215 12.so.0.15[.0] + 1.0.23rc1-5 10 10023 10.so.0.23[.0] + 1.2.15rc1-5 13 10215 12.so.0.15[.0] + 1.0.23 10 10023 10.so.0.23[.0] + 1.2.15 13 10215 12.so.0.15[.0] + 1.2.16beta1-2 13 10216 12.so.0.16[.0] + 1.2.16rc1 13 10216 12.so.0.16[.0] + 1.0.24 10 10024 10.so.0.24[.0] + 1.2.16 13 10216 12.so.0.16[.0] + 1.2.17beta1-2 13 10217 12.so.0.17[.0] + 1.0.25rc1 10 10025 10.so.0.25[.0] + 1.2.17rc1-3 13 10217 12.so.0.17[.0] + 1.0.25 10 10025 10.so.0.25[.0] + 1.2.17 13 10217 12.so.0.17[.0] + 1.0.26 10 10026 10.so.0.26[.0] + 1.2.18 13 10218 12.so.0.18[.0] + 1.2.19beta1-31 13 10219 12.so.0.19[.0] + 1.0.27rc1-6 10 10027 10.so.0.27[.0] + 1.2.19rc1-6 13 10219 12.so.0.19[.0] + 1.0.27 10 10027 10.so.0.27[.0] + 1.2.19 13 10219 12.so.0.19[.0] + 1.2.20beta01-04 13 10220 12.so.0.20[.0] + 1.0.28rc1-6 10 10028 10.so.0.28[.0] + 1.2.20rc1-6 13 10220 12.so.0.20[.0] + 1.0.28 10 10028 10.so.0.28[.0] + 1.2.20 13 10220 12.so.0.20[.0] + 1.2.21beta1-2 13 10221 12.so.0.21[.0] + 1.2.21rc1-3 13 10221 12.so.0.21[.0] + 1.0.29 10 10029 10.so.0.29[.0] + 1.2.21 13 10221 12.so.0.21[.0] + 1.2.22beta1-4 13 10222 12.so.0.22[.0] + 1.0.30rc1 13 10030 10.so.0.30[.0] + 1.2.22rc1 13 10222 12.so.0.22[.0] + 1.0.30 10 10030 10.so.0.30[.0] + 1.2.22 13 10222 12.so.0.22[.0] + 1.2.23beta01-05 13 10223 12.so.0.23[.0] + 1.2.23rc01 13 10223 12.so.0.23[.0] + 1.2.23 13 10223 12.so.0.23[.0] + 1.2.24beta01-02 13 10224 12.so.0.24[.0] + 1.2.24rc01 13 10224 12.so.0.24[.0] + 1.2.24 13 10224 12.so.0.24[.0] + 1.2.25beta01-06 13 10225 12.so.0.25[.0] + 1.2.25rc01-02 13 10225 12.so.0.25[.0] + 1.0.31 10 10031 10.so.0.31[.0] + 1.2.25 13 10225 12.so.0.25[.0] + 1.2.26beta01-06 13 10226 12.so.0.26[.0] + 1.2.26rc01 13 10226 12.so.0.26[.0] + 1.2.26 13 10226 12.so.0.26[.0] + 1.0.32 10 10032 10.so.0.32[.0] + 1.2.27beta01-06 13 10227 12.so.0.27[.0] + 1.2.27rc01 13 10227 12.so.0.27[.0] + 1.0.33 10 10033 10.so.0.33[.0] + 1.2.27 13 10227 12.so.0.27[.0] + 1.0.34 10 10034 10.so.0.34[.0] + 1.2.28 13 10228 12.so.0.28[.0] + 1.2.29beta01-03 13 10229 12.so.0.29[.0] + 1.2.29rc01 13 10229 12.so.0.29[.0] + 1.0.35 10 10035 10.so.0.35[.0] + 1.2.29 13 10229 12.so.0.29[.0] + 1.0.37 10 10037 10.so.0.37[.0] + 1.2.30beta01-04 13 10230 12.so.0.30[.0] + 1.0.38rc01-08 10 10038 10.so.0.38[.0] + 1.2.30rc01-08 13 10230 12.so.0.30[.0] + 1.0.38 10 10038 10.so.0.38[.0] + 1.2.30 13 10230 12.so.0.30[.0] + 1.0.39rc01-03 10 10039 10.so.0.39[.0] + 1.2.31rc01-03 13 10231 12.so.0.31[.0] + 1.0.39 10 10039 10.so.0.39[.0] + 1.2.31 13 10231 12.so.0.31[.0] + 1.2.32beta01-02 13 10232 12.so.0.32[.0] + 1.0.40rc01 10 10040 10.so.0.40[.0] + 1.2.32rc01 13 10232 12.so.0.32[.0] + 1.0.40 10 10040 10.so.0.40[.0] + 1.2.32 13 10232 12.so.0.32[.0] + 1.2.33beta01-02 13 10233 12.so.0.33[.0] + 1.2.33rc01-02 13 10233 12.so.0.33[.0] + 1.0.41rc01 10 10041 10.so.0.41[.0] + 1.2.33 13 10233 12.so.0.33[.0] + 1.0.41 10 10041 10.so.0.41[.0] + 1.2.34beta01-07 13 10234 12.so.0.34[.0] + 1.0.42rc01 10 10042 10.so.0.42[.0] + 1.2.34rc01 13 10234 12.so.0.34[.0] + 1.0.42 10 10042 10.so.0.42[.0] + 1.2.34 13 10234 12.so.0.34[.0] Henceforth the source version will match the shared-library minor and patch numbers; the shared-library major version number will be @@ -3818,11 +3948,11 @@ version 1.0.6j; from then on they were given the upcoming public release number plus "betaNN" or "rcN". .SH "SEE ALSO" -libpngpf(3), png(5) +.IR libpngpf(3) ", " png(5) .LP .IR libpng : .IP -ftp://ftp.uu.net/graphics/png +http://libpng.sourceforge.net (follow the [DOWNLOAD] link) http://www.libpng.org/pub/png .LP @@ -3832,8 +3962,6 @@ http://www.libpng.org/pub/png .I libpng or at .br -ftp://ftp.uu.net/pub/archiving/zip/zlib -.br ftp://ftp.info-zip.org/pub/infozip/zlib .LP @@ -3843,7 +3971,7 @@ ftp://ftp.info-zip.org/pub/infozip/zlib .I libpng or at .br -ftp://ds.internic.net/rfc/rfc2083.txt +ftp://ftp.rfc-editor.org:/in-notes/rfc2083.txt .br or (as a W3C Recommendation) at .br @@ -3855,7 +3983,7 @@ and this library, the specification takes precedence. .SH AUTHORS This man page: Glenn Randers-Pehrson - + The contributing authors would like to thank all those who helped with testing, bug fixes, and patience. This wouldn't have been @@ -3863,13 +3991,17 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.2.6 - August 15, 2004: +Libpng version 1.2.34 - December 18, 2008: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. -Currently maintained by Glenn Randers-Pehrson (glennrp@users.sourceforge.net). +Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). Supported by the PNG development group .br -(png-implement@ccrc.wustl.edu). +png-mng-implement at lists.sf.net +(subscription required; visit +png-mng-implement at lists.sourceforge.net (subscription required; visit +https://lists.sourceforge.net/lists/listinfo/png-mng-implement +to subscribe). .SH COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: @@ -3880,8 +4012,8 @@ included in the libpng distribution, the latter shall prevail.) If you modify libpng you may insert additional notices immediately following this sentence. -libpng version 1.2.6, August 15, 2004, is -Copyright (c) 2004 Glenn Randers-Pehrson, and is +libpng versions 1.2.6, August 15, 2004, through 1.2.34, December 18, 2008, are +Copyright (c) 2004,2006-2008 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 @@ -3978,8 +4110,8 @@ Libpng is OSI Certified Open Source Software. OSI Certified Open Source is a certification mark of the Open Source Initiative. Glenn Randers-Pehrson -glennrp@users.sourceforge.net -August 15, 2004 +glennrp at users.sourceforge.net +December 18, 2008 .\" end of man page