[libpng16] Reverted addition of png_set_filler_16 and png_set_add_alpha_16()

functions. They unnecessarily duplicate png_set_filler() and png_set_add_alpha()
which now work properly with 16-bit images.
This commit is contained in:
Glenn Randers-Pehrson
2015-09-24 22:39:53 -05:00
parent 5b038f83e7
commit 01a0e8062d
13 changed files with 63 additions and 135 deletions

View File

@@ -1,4 +1,4 @@
.TH LIBPNG 3 "September 24, 2015"
.TH LIBPNG 3 "September 25, 2015"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.6.19beta03
.SH SYNOPSIS
@@ -277,8 +277,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.19beta03
\fBvoid png_set_add_alpha (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP
\fBvoid png_set_add_alpha_16 (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP
\fBvoid png_set_alpha_mode (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImode\fP\fB, double \fIoutput_gamma\fP\fB);\fP
\fBvoid png_set_alpha_mode_fixed (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImode\fP\fB, png_fixed_point \fIoutput_gamma\fP\fB);\fP
@@ -327,8 +325,6 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.6.19beta03
\fBvoid png_set_filler (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP
\fBvoid png_set_filler_16 (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, int \fIflags\fP\fB);\fP
\fBvoid png_set_filter (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fImethod\fP\fB, int \fIfilters\fP\fB);\fP
\fBvoid png_set_filter_heuristics (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIheuristic_method\fP\fB, int \fP\fInum_weights\fP\fB, png_doublep \fP\fIfilter_weights\fP\fB, png_doublep \fIfilter_costs\fP\fB);\fP
@@ -512,7 +508,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
.SH LIBPNG.TXT
libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.6.19beta03 - September 24, 2015
libpng version 1.6.19beta03 - September 25, 2015
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2015 Glenn Randers-Pehrson
@@ -523,7 +519,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
libpng versions 0.97, January 1998, through 1.6.19beta03 - September 24, 2015
libpng versions 0.97, January 1998, through 1.6.19beta03 - September 25, 2015
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2015 Glenn Randers-Pehrson
@@ -2199,19 +2195,16 @@ 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_16() or png_set_add_alpha_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_scale_16() is called to
transform it to regular RGB RGB triplets, or png_set_filler_16() or
png_set_add alpha_16() is called to insert two filler bytes, either before
or after each RRGGBB triplet. Similarly, 8-bit or 16-bit grayscale data
can be modified with png_set_filler_16(), png_set_add_alpha_16(),
png_set_strip_16(), or png_set_scale_16(). Note that png_set_filler_16()
and png_set_add_alpha_16(), which can be used with either 8-bit or 16-bit
images have replaced the png_set_filler() and png_set_add_alpha() functions,
which only work properly with 8-bit data.
transform it to regular RGB RGB triplets, or png_set_filler() or
png_set_add alpha() is called to insert two 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(), png_set_strip_16(),
or png_set_scale_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
@@ -2301,7 +2294,7 @@ Within the matrix,
"-" means the transformation is not supported.
"." means nothing is necessary (a tRNS chunk can just be ignored).
"t" means the transformation is obtained by png_set_tRNS.
"A" means the transformation is obtained by png_set_add_alpha_16().
"A" means the transformation is obtained by png_set_add_alpha().
"X" means the transformation is obtained by png_set_expand().
"1" means the transformation is obtained by
png_set_expand_gray_1_2_4_to_8() (and by png_set_expand()
@@ -2364,26 +2357,25 @@ PNG files store RGB pixels packed into 3 or 6 bytes. This code expands them
into 4 or 8 bytes for windowing systems that need them in this format:
if (color_type == PNG_COLOR_TYPE_RGB)
png_set_filler_16(png_ptr, filler, PNG_FILLER_BEFORE);
png_set_filler(png_ptr, filler, PNG_FILLER_BEFORE);
where "filler" is the 8-bit or 16-bit number to fill with, and the location
is either PNG_FILLER_BEFORE or PNG_FILLER_AFTER, depending upon whether
you want the filler before the RGB or after. This transformation
does not affect images that already have full alpha channels. To add an
opaque alpha channel, use filler=0xffff and PNG_FILLER_AFTER which
will generate RGBA pixels.
you want the filler before the RGB or after. When filling an 8-bit pixel,
the least significant 8 bits of the number are used, if a 16-bit number is
supplied. This transformation does not affect images that already have full
alpha channels. To add an opaque alpha channel, use filler=0xffff and
PNG_FILLER_AFTER which will generate RGBA pixels.
Note that png_set_filler_16() does not change the color type. If you want
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_16(png_ptr, filler, PNG_FILLER_AFTER);
png_set_add_alpha(png_ptr, filler, PNG_FILLER_AFTER);
where "filler" contains the alpha value to assign to each pixel.
The png_set_alpha() function was added in libpng-1.2.7 and the
png_set_alpha_16() function, which can be used for either 8-bit or
16-bit images, was added in libpng-1.5.24.
The png_set_add_alpha() 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:
@@ -5424,12 +5416,6 @@ limits are now
The png_set_option() function (and the "options" member of the png struct) was
added to libpng-1.5.15, with option PNG_ARM_NEON.
The png_set_filler_16() and png_set_add_alpha_16() functions were added
at libpng-1.5.24 and libpng-1.6.19. These replace the png_set_filler(() and
the png_set_add_alpha() functions, which did not work properly with 16-bit
images. The new functions can be used with either 8-bit or 16-bit images,
while the old functions are still available for use only with 8-bit images.
The library now supports a complete fixed point implementation and can
thus be used on systems that have no floating point support or very
limited or slow support. Previously gamma correction, an essential part
@@ -5836,7 +5822,7 @@ Other rules can be inferred by inspecting the libpng source.
.SH XVI. Y2K Compliance in libpng
September 24, 2015
September 25, 2015
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
@@ -6157,7 +6143,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.6.19beta03 - September 24, 2015:
Libpng version 1.6.19beta03 - September 25, 2015:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
@@ -6180,7 +6166,7 @@ this sentence.
This code is released under the libpng license.
libpng versions 1.0.7, July 1, 2000, through 1.6.19beta03, September 24, 2015, are
libpng versions 1.0.7, July 1, 2000, through 1.6.19beta03, September 25, 2015, are
Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors:
@@ -6274,7 +6260,7 @@ the additional disclaimers inserted at version 1.0.7.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
September 24, 2015
September 25, 2015
.\" end of man page