[libpng16] Updated simplified API synopses and description of the png_image

structure in the manual.
This commit is contained in:
Glenn Randers-Pehrson
2012-09-01 08:16:51 -05:00
parent b2aba47a6d
commit 97a77a6f7b
4 changed files with 70 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.6.0beta29 - August 29, 2012
libpng version 1.6.0beta29 - September 1, 2012
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2011 Glenn Randers-Pehrson
@@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
libpng versions 0.97, January 1998, through 1.6.0beta29 - August 29, 2012
libpng versions 0.97, January 1998, through 1.6.0beta29 - September 1, 2012
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2011 Glenn Randers-Pehrson
@@ -3524,12 +3524,13 @@ png_image is a structure that describes the in-memory format of an image
when it is being read or define the in-memory format of an image that you
need to write. The "png_image" structure contains the following members:
png_uint_32 version Set to PNG_IMAGE_VERSION
png_uint_32 width Image width in pixels (columns)
png_uint_32 height Image height in pixels (rows)
png_uint_32 format Image format as defined below
png_uint_32 flags A bit mask containing informational flags
png_controlp opaque Initialize to NULL, free with png_image_free
png_const_bytep colormap A pointer to the application color-map
png_uint_32 colormap_entries; Number of entries in the color-map
png_uint_32 warning_or_error;
char message[64];
@@ -3689,6 +3690,22 @@ First the information about the samples.
a fixed number determined by the format so can easily be allocated on the
stack if necessary.
#define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\
(PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256)
/* The maximum size of the color-map required by the format expressed in a
* count of components. This can be used to compile-time allocate a
* color-map:
*
* png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)];
*
* png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)];
*
* Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the
* information from one of the png_image_begin_read_ APIs and dynamically
* allocate the required memory.
*/
Corresponding information about the pixels
PNG_IMAGE_PIXEL_(test,fmt)
@@ -3747,7 +3764,8 @@ READ APIs
The PNG header is read from the given memory buffer.
int png_image_finish_read(png_imagep image,
png_colorp background, void *buffer, png_int_32 row_stride));
png_colorp background, void *buffer,
png_int_32 row_stride, void *colormap));
Finish reading the image into the supplied buffer and
clean up the png_image structure.
@@ -3784,6 +3802,7 @@ WRITE APIS
For write you must initialize a png_image structure to describe the image to
be written:
version: must be set to PNG_IMAGE_VERSION
opaque: must be initialized to NULL
width: image width in pixels
height: image height in rows
@@ -3791,15 +3810,17 @@ be written:
flags: set to 0 unless one of the defined flags applies; set
PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images
where the RGB values do not correspond to the colors in sRGB.
colormap_entries: set to the number of entries in the color-map (0 to 256)
int png_image_write_to_file, (png_imagep image,
const char *file, int convert_to_8bit, const void *buffer,
png_int_32 row_stride));
png_int_32 row_stride, const void *colormap));
Write the image to the named file.
int png_image_write_to_stdio(png_imagep image, FILE *file,
int convert_to_8_bit, const void *buffer, png_int_32 row_stride)
int convert_to_8_bit, const void *buffer,
png_int_32 row_stride, const void *colormap)
Write the image to the given (FILE*).
@@ -5043,7 +5064,7 @@ Other rules can be inferred by inspecting the libpng source.
XVI. Y2K Compliance in libpng
August 29, 2012
September 1, 2012
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.