提交 ffa89243 编写于 作者: G Glenn Randers-Pehrson

[devel] Added "bit_depth" parameter to the private png_build_gamma_table()

function.  Pass bit_depth=8 to png_build_gamma_table() when bit_depth is 16
but the PNG_16_TO_8 transform has been set, to avoid unnecessary build of
16-bit tables.
上级 0452bbcf
Libpng 1.4.0beta108 - December 11, 2009 Libpng 1.4.0beta109 - December 13, 2009
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
...@@ -9,20 +9,20 @@ Files available for download: ...@@ -9,20 +9,20 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a Source files with LF line endings (for Unix/Linux) and with a
"configure" script "configure" script
1.4.0beta108.tar.xz (LZMA-compressed, recommended) 1.4.0beta109.tar.xz (LZMA-compressed, recommended)
1.4.0beta108.tar.gz 1.4.0beta109.tar.gz
1.4.0beta108.tar.bz2 1.4.0beta109.tar.bz2
Source files with CRLF line endings (for Windows), without the Source files with CRLF line endings (for Windows), without the
"configure" script "configure" script
lp140b108.zip lp140b109.zip
lp140b108.7z lp140b109.7z
Other information: Other information:
1.4.0beta108-README.txt 1.4.0beta109-README.txt
1.4.0beta108-LICENSE.txt 1.4.0beta109-LICENSE.txt
Changes since the last public release (1.2.10): Changes since the last public release (1.2.10):
...@@ -734,6 +734,12 @@ version 1.4.0beta108 [December 11, 2009] ...@@ -734,6 +734,12 @@ version 1.4.0beta108 [December 11, 2009]
change in version 1.2.41beta08 caused transparency to be handled wrong change in version 1.2.41beta08 caused transparency to be handled wrong
in some 16-bit datastreams (Yusaku Sugai). in some 16-bit datastreams (Yusaku Sugai).
version 1.4.0beta109 [December 13, 2009]
Added "bit_depth" parameter to the private png_build_gamma_table() function.
Pass bit_depth=8 to png_build_gamma_table() when bit_depth is 16 but the
PNG_16_TO_8 transform has been set, to avoid unnecessary build of 16-bit
tables.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement
......
...@@ -2421,6 +2421,12 @@ version 1.4.0beta108 [December 11, 2009] ...@@ -2421,6 +2421,12 @@ version 1.4.0beta108 [December 11, 2009]
change in version 1.2.41beta08 caused transparency to be handled wrong change in version 1.2.41beta08 caused transparency to be handled wrong
in some 16-bit datastreams (Yusaku Sugai). in some 16-bit datastreams (Yusaku Sugai).
version 1.4.0beta109 [December 13, 2009]
Added "bit_depth" parameter to the private png_build_gamma_table() function.
Pass bit_depth=8 to png_build_gamma_table() when bit_depth is 16 but the
PNG_16_TO_8 transform has been set, to avoid unnecessary build of 16-bit
tables.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement
......
.TH LIBPNGPF 3 "December 11, 2009" .TH LIBPNGPF 3 "December 13, 2009"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta108 libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta108
(private functions) (private functions)
...@@ -15,7 +15,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta108 ...@@ -15,7 +15,7 @@ libpng \- Portable Network Graphics (PNG) Reference Library 1.4.0beta108
\fI\fB \fI\fB
\fBvoid png_build_gamma_table (png_structp \fIpng_ptr\fP\fB);\fP \fBvoid png_build_gamma_table (png_structp \fP\fIpng_ptr\fP\fB, png_byte \fIbit_depth\fP\fB);\fP
\fI\fB \fI\fB
......
/* pngpriv.h - private declarations for use inside libpng /* pngpriv.h - private declarations for use inside libpng
* *
* libpng version 1.4.0beta108 - December 11, 2009 * libpng version 1.4.0beta109 - December 13, 2009
* For conditions of distribution and use, see copyright notice in png.h * For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
...@@ -475,7 +475,8 @@ PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr)); ...@@ -475,7 +475,8 @@ PNG_EXTERN void png_write_finish_row PNGARG((png_structp png_ptr));
PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr)); PNG_EXTERN void png_write_start_row PNGARG((png_structp png_ptr));
#ifdef PNG_READ_GAMMA_SUPPORTED #ifdef PNG_READ_GAMMA_SUPPORTED
PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr)); PNG_EXTERN void png_build_gamma_table PNGARG((png_structp png_ptr,
png_byte bit_depth));
#endif #endif
/* Combine a row of data, dealing with alpha, etc. if requested */ /* Combine a row of data, dealing with alpha, etc. if requested */
......
/* pngrtran.c - transforms the data in a row for PNG readers /* pngrtran.c - transforms the data in a row for PNG readers
* *
* Last changed in libpng 1.4.0 [December 11, 2009] * Last changed in libpng 1.4.0 [December 13, 2009]
* Copyright (c) 1998-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
...@@ -886,7 +886,11 @@ png_init_read_transformations(png_structp png_ptr) ...@@ -886,7 +886,11 @@ png_init_read_transformations(png_structp png_ptr)
if ((png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) && if ((png_ptr->transformations & (PNG_GAMMA | PNG_RGB_TO_GRAY)) &&
png_ptr->gamma != 0.0) png_ptr->gamma != 0.0)
{ {
png_build_gamma_table(png_ptr); if (png_ptr->transformations & PNG_16_TO_8)
png_build_gamma_table(png_ptr, 8);
else
png_build_gamma_table(png_ptr, png_ptr->bit_depth);
#ifdef PNG_READ_BACKGROUND_SUPPORTED #ifdef PNG_READ_BACKGROUND_SUPPORTED
if (png_ptr->transformations & PNG_BACKGROUND) if (png_ptr->transformations & PNG_BACKGROUND)
{ {
...@@ -3910,11 +3914,11 @@ static PNG_CONST int png_gamma_shift[] = ...@@ -3910,11 +3914,11 @@ static PNG_CONST int png_gamma_shift[] =
*/ */
void /* PRIVATE */ void /* PRIVATE */
png_build_gamma_table(png_structp png_ptr) png_build_gamma_table(png_structp png_ptr, png_byte bit_depth)
{ {
png_debug(1, "in png_build_gamma_table"); png_debug(1, "in png_build_gamma_table");
if (png_ptr->bit_depth <= 8) if (bit_depth <= 8)
{ {
int i; int i;
double g; double g;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册