Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
c4a2ae6c
T
Third Party Libpng
项目概览
OpenHarmony
/
Third Party Libpng
1 年多 前同步成功
通知
4
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Libpng
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c4a2ae6c
编写于
1月 16, 1998
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Imported from libpng-0.98.tar
上级
2687fcc7
变更
26
展开全部
隐藏空白更改
内联
并排
Showing
26 changed file
with
687 addition
and
240 deletion
+687
-240
CHANGES
CHANGES
+23
-10
README
README
+19
-15
TODO
TODO
+1
-1
example.c
example.c
+11
-5
libpng.txt
libpng.txt
+116
-45
makefile.elf
makefile.elf
+2
-2
makefile.sgi
makefile.sgi
+69
-0
makefile.tc3
makefile.tc3
+1
-1
png.c
png.c
+3
-3
png.h
png.h
+61
-47
pngconf.h
pngconf.h
+25
-13
pngerror.c
pngerror.c
+2
-2
pngget.c
pngget.c
+6
-6
pngmem.c
pngmem.c
+18
-9
pngpread.c
pngpread.c
+2
-2
pngread.c
pngread.c
+8
-2
pngrio.c
pngrio.c
+2
-2
pngrtran.c
pngrtran.c
+119
-15
pngrutil.c
pngrutil.c
+8
-8
pngset.c
pngset.c
+8
-8
pngtest.c
pngtest.c
+45
-23
pngtrans.c
pngtrans.c
+12
-2
pngwio.c
pngwio.c
+2
-2
pngwrite.c
pngwrite.c
+35
-9
pngwtran.c
pngwtran.c
+82
-2
pngwutil.c
pngwutil.c
+7
-6
未找到文件。
CHANGES
浏览文件 @
c4a2ae6c
...
@@ -170,20 +170,33 @@ version 0.96 [May, 1997]
...
@@ -170,20 +170,33 @@ version 0.96 [May, 1997]
version 0.97 [January, 1998]
version 0.97 [January, 1998]
removed PNG_USE_OWN_CRC capability
removed PNG_USE_OWN_CRC capability
relocated png_set_crc_action from pngrutil.c to pngrtran.c
relocated png_set_crc_action from pngrutil.c to pngrtran.c
fixed typecasts of "new_key", etc.
fixed typecasts of "new_key", etc.
(Andreas Dilger)
added RFC 1152 date support
added RFC 1152
[sic]
date support
fixed bug in gamma handling of 4-bit grayscale
fixed bug in gamma handling of 4-bit grayscale
added more typecasts. 65536L becomes (png_uint_32)65536L, etc.
added 2-bit grayscale gamma handling (Glenn R-P)
added more typecasts. 65536L becomes (png_uint_32)65536L, etc. (Glenn R-P)
minor corrections in libpng.txt
minor corrections in libpng.txt
added simple sRGB support
added simple sRGB support (Glenn R-P)
make it simpler to do conditional compiling: PNG_READ_NOT_FULLY_SUPPORTED
easier conditional compiling, e.g. define PNG_READ/WRITE_NOT_FULLY_SUPPORTED;
fixed memory leak in pngwrite.c (free info_ptr->text)
all configurable options can be selected from command-line instead
of having to edit pngconf.h (Glenn R-P)
fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P)
added more conditions for png_do_background, to avoid changing
added more conditions for png_do_background, to avoid changing
black pixels to background when a background is supplied and
black pixels to background when a background is supplied and
no pixels are transparent
no pixels are transparent
repaired PNG_NO_STDIO behaviour
repaired PNG_NO_STDIO behaviour
tested NODIV support and made it default behaviour
tested NODIV support and made it default behaviour (Greg Roelofs)
added "-m" option to pngtest
added "-m" option and PNGTEST_DEBUG_MEMORY to pngtest (John Bowler)
[anything else? 2-bit grayscale gamma bug?]
regularized version numbering scheme and bumped shared-library major
regularized version numbering scheme and bumped shared-library major
version number to 2 to avoid potential problems with libpng 0.89 apps
version number to 2 to avoid problems with libpng 0.89 apps (Greg Roelofs)
version 0.98 [January, 1998]
cleaned up some typos in libpng.txt and in code documentation
fixed memory leaks in pCAL chunk processing (Glenn R-P and John Bowler)
cosmetic change "display_gamma" to "screen_gamma" in pngrtran.c
changed recommendation about file_gamma for PC images to .51 from .45,
in example.c and libpng.txt, added comments to distinguish between
screen_gamma, viewing_gamma, and display_gamma.
changed all references to RFC1152 to read RFC1123 and changed the
PNG_TIME_RFC1152_SUPPORTED macro to PNG_TIME_RFC1123_SUPPORTED
added png_invert_alpha capability (Glenn R-P -- suggestion by Jon Vincent)
changed srgb_intent from png_byte to int to avoid compiler bugs
README
浏览文件 @
c4a2ae6c
[NOTE: this is still beta version 0.97
c
; the text below has already
[NOTE: this is still beta version 0.97
d
; the text below has already
been updated in anticipation of the imminent 1.0 release.]
been updated in anticipation of the imminent 1.0 release.]
...
@@ -6,7 +6,7 @@ README for libpng 1.0
...
@@ -6,7 +6,7 @@ README for libpng 1.0
This is the first official release of libpng. Don't let the fact that
This is the first official release of libpng. Don't let the fact that
it's the first release fool you. The libpng library has been in
it's the first release fool you. The libpng library has been in
extensive use and testing for about two years. However, it's
extensive use and testing for about two
and a half
years. However, it's
finally gotten to the stage where there haven't been significant
finally gotten to the stage where there haven't been significant
changes to the API in some time, and people have a bad feeling about
changes to the API in some time, and people have a bad feeling about
libraries with versions < 1.0.
libraries with versions < 1.0.
...
@@ -77,7 +77,7 @@ If not, it should be at ftp.uu.net in /graphics/png
...
@@ -77,7 +77,7 @@ If not, it should be at ftp.uu.net in /graphics/png
Eventually, it will be at ftp.uu.net in /pub/archiving/zip/zlib
Eventually, it will be at ftp.uu.net in /pub/archiving/zip/zlib
You may also want a copy of the PNG specification. It is available
You may also want a copy of the PNG specification. It is available
as an
Internet Draft, and RFC,
and a W3C Recommendation. Failing
as an
RFC
and a W3C Recommendation. Failing
these resources you can try ftp.uu.net in the /graphics/png directory.
these resources you can try ftp.uu.net in the /graphics/png directory.
This code is currently being archived at ftp.uu.net in the
This code is currently being archived at ftp.uu.net in the
...
@@ -97,19 +97,19 @@ Finally, if you get any warning messages when compiling libpng
...
@@ -97,19 +97,19 @@ Finally, if you get any warning messages when compiling libpng
fix. Please mention "libpng" somewhere in the subject line. Thanks.
fix. Please mention "libpng" somewhere in the subject line. Thanks.
This release was created and will be supported by myself (of course
This release was created and will be supported by myself (of course
based in a large way on Guy's earlier work), and the PNG group.
based in a large way on Guy's
and Andreas'
earlier work), and the PNG group.
adilger@enel.ucalgary.ca
adilger@enel.ucalgary.ca
png-implement@dworkin.wustl.edu
png-implement@dworkin.wustl.edu
You can reach Guy, the original libpng author, at (internet preferred):
You can't reach Guy, the original libpng author, at the addresses
given in previous versions of this document. He will read mail
internet: schalnat@group42.com
addressed to the png-implement list, however.
CompuServe: 75501,1625
Please do not send general questions about PNG. Send them to
Please do not send general questions about PNG. Send them to
the address in the specification. At the same time, please do
the address in the specification (png-group@w3.org). At the same
not send libpng questions to that address, send them to me. I'll
time, please do not send libpng questions to that address, send them to me
or to png-implement@dworkin.wustl.edu. I'll
get them in the end anyway. If you have a question about something
get them in the end anyway. If you have a question about something
in the PNG specification that is related to using libpng, send it
in the PNG specification that is related to using libpng, send it
to me. Send me any questions that start with "I was using libpng,
to me. Send me any questions that start with "I was using libpng,
...
@@ -132,18 +132,20 @@ Files in this distribution:
...
@@ -132,18 +132,20 @@ Files in this distribution:
descrip.mms => VMS project file
descrip.mms => VMS project file
example.c => Example code for using libpng functions
example.c => Example code for using libpng functions
libpng.txt => Description of libpng and its functions
libpng.txt => Description of libpng and its functions
makefile => Default Unixish makefile
makefile.aco => ACORN makefile
makefile.aco => ACORN makefile
makefile.ama => Amiga makefile
makefile.ama => Amiga makefile
makefile.atr => Atari makefile
makefile.atr => Atari makefile
makefile.bor => Borland makefile
makefile.bor => Borland makefile
makefile.dec => DEC makefile
makefile.dj2 => DJGPP 2 makefile
makefile.dj2 => DJGPP 2 makefile
makefile.elf => Unix ELF makefile
makefile.elf => Unix ELF makefile
makefile.knr => Makefile which calls ansi2knr to convert files
makefile.knr => Makefile which calls ansi2knr to convert files
makefile.mip => MIPS makefile
makefile.mip => MIPS makefile
makefile.msc => Microsoft C makefile
makefile.msc => Microsoft C makefile
makefile.sgi => Silicon Graphics Irix makefile
makefile.std => Standard Unix makefile
makefile.std => Standard Unix makefile
makefile.tc => Turbo C makefile
makefile.sun => SUN makefile
makefile.tc3 => Turbo C 3.0 makefile
makevms.com => VMS make program
makevms.com => VMS make program
png.c => Basic interface functions common to library
png.c => Basic interface functions common to library
png.h => Library function and interface declarations
png.h => Library function and interface declarations
...
@@ -166,13 +168,15 @@ Files in this distribution:
...
@@ -166,13 +168,15 @@ Files in this distribution:
Good luck, and happy coding.
Good luck, and happy coding.
-Glenn Randers-Pehrson
Internet: randeg@alumni.rpi.edu
Web: http://www.rpi.edu/~randeg/index.html
-Andreas Eric Dilger
-Andreas Eric Dilger
Internet: adilger@enel.ucalgary.ca
Internet: adilger@enel.ucalgary.ca
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
Web: http://www-mddsp.enel.ucalgary.ca/People/adilger/
-Guy Eric Schalnat
-Guy Eric Schalnat
Group 42, Inc.
(formerly of Group 42, Inc)
Internet: schalnat@group42.com
CompuServe: 75501,1625
Web: http://www.group42.com/
Web: http://www.group42.com/
TODO
浏览文件 @
c4a2ae6c
...
@@ -5,7 +5,7 @@ improved dithering
...
@@ -5,7 +5,7 @@ improved dithering
multi-lingual error and warning message support
multi-lingual error and warning message support
sPLT chunk handling
sPLT chunk handling
cHRM transformation
cHRM transformation
complete sRGB transformation (presently it simply uses gamma=0.5)
complete sRGB transformation (presently it simply uses gamma=0.5
1
)
man pages for function calls
man pages for function calls
high-level API for reading images
high-level API for reading images
final bug fixes
final bug fixes
...
...
example.c
浏览文件 @
c4a2ae6c
...
@@ -190,19 +190,22 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
...
@@ -190,19 +190,22 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
PNG_BACKGROUND_GAMMA_SCREEN
,
0
,
1
.
0
);
PNG_BACKGROUND_GAMMA_SCREEN
,
0
,
1
.
0
);
/* Some suggestions as to how to get a screen gamma value */
/* Some suggestions as to how to get a screen gamma value */
/* Note that screen gamma is (display_gamma/viewing_gamma)
if (/* We have a user-defined screen gamma value */
)
if (/* We have a user-defined screen gamma value */
)
{
{
screen_gamma
=
user
-
defined
screen_gamma
;
screen_gamma
=
user
-
defined
screen_gamma
;
}
}
/* This is one way that applications share the same screen gamma value */
/* This is one way that applications share the same screen gamma value */
else
if
((
gamma_str
=
getenv
(
"
DISPLAY
_GAMMA"
))
!=
NULL
)
else
if
((
gamma_str
=
getenv
(
"
SCREEN
_GAMMA"
))
!=
NULL
)
{
{
screen_gamma
=
atof
(
gamma_str
);
screen_gamma
=
atof
(
gamma_str
);
}
}
/* If we don't have another value */
/* If we don't have another value */
else
else
{
{
screen_gamma
=
2
.
2
;
/* A good guess for PC monitors */
screen_gamma
=
2
.
2
;
/* A good guess for a PC monitors in a brightly
lit room */
screen_gamma
=
1
.
7
or
1
.
0
;
/* A good guess for Mac systems */
screen_gamma
=
1
.
7
or
1
.
0
;
/* A good guess for Mac systems */
}
}
...
@@ -211,13 +214,16 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
...
@@ -211,13 +214,16 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */
* by the user at run time by the user. It is strongly suggested that
* by the user at run time by the user. It is strongly suggested that
* your application support gamma correction.
* your application support gamma correction.
*/
*/
if
(
png_get_sRGB
(
png_ptr
,
info_ptr
,
&
srgb_intent
)
png_set_sRGB
(
png_ptr
,
srgb_intent
,
0
);
int
intent
;
if
(
png_get_sRGB
(
png_ptr
,
info_ptr
,
&
intent
)
png_set_sRGB
(
png_ptr
,
intent
,
0
);
else
else
if
(
png_get_gAMA
(
png_ptr
,
info_ptr
,
&
image_gamma
)
if
(
png_get_gAMA
(
png_ptr
,
info_ptr
,
&
image_gamma
)
png_set_gamma
(
png_ptr
,
screen_gamma
,
image_gamma
);
png_set_gamma
(
png_ptr
,
screen_gamma
,
image_gamma
);
else
else
png_set_gamma
(
png_ptr
,
screen_gamma
,
0
.
45
);
png_set_gamma
(
png_ptr
,
screen_gamma
,
0
.
51
);
/* Dither RGB files down to 8 bit palette or reduce palettes
/* Dither RGB files down to 8 bit palette or reduce palettes
* to the number of colors available on your screen.
* to the number of colors available on your screen.
...
...
libpng.txt
浏览文件 @
c4a2ae6c
此差异已折叠。
点击以展开。
makefile.elf
浏览文件 @
c4a2ae6c
# makefile for libpng on Linux ELF with gcc
# makefile for libpng on Linux ELF with gcc
# Copyright (C) 1996, 1997 Andreas Dilger
# Copyright (C) 1996, 1997 Andreas Dilger
# Copyright (C) 1998 G
lenn Randers-Pehrson
# Copyright (C) 1998 G
reg Roelofs
# For conditions of distribution and use, see copyright notice in png.h
# For conditions of distribution and use, see copyright notice in png.h
CC
=
gcc
CC
=
gcc
...
@@ -22,7 +22,7 @@ RANLIB=ranlib
...
@@ -22,7 +22,7 @@ RANLIB=ranlib
#RANLIB=echo
#RANLIB=echo
PNGMAJ
=
2
PNGMAJ
=
2
PNGMIN
=
0.9
7
PNGMIN
=
0.9
8
PNGVER
=
$(PNGMAJ)
.
$(PNGMIN)
PNGVER
=
$(PNGMAJ)
.
$(PNGMIN)
# where make install puts libpng.a, libpng.so*, and png.h
# where make install puts libpng.a, libpng.so*, and png.h
...
...
makefile.sgi
0 → 100644
浏览文件 @
c4a2ae6c
# makefile for libpng
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
# For conditions of distribution and use, see copyright notice in png.h
# Where the zlib library and include files are located
#ZLIBLIB=/usr/local/lib
#ZLIBINC=/usr/local/include
ZLIBLIB
=
../zlib
ZLIBINC
=
../zlib
CC
=
cc
CFLAGS
=
-I
$(ZLIBINC)
-O
-fullwarn
# -g -DPNG_DEBUG=1
LDFLAGS
=
-L
.
-L
$(ZLIBLIB)
-lpng
-lz
-lm
RANLIB
=
echo
#RANLIB=ranlib
# where make install puts libpng.a and png.h
prefix
=
/usr/local
OBJS
=
png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o
\
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o
\
pngwtran.o pngmem.o pngerror.o pngpread.o
all
:
libpng.a pngtest
libpng.a
:
$(OBJS)
ar rc
$@
$(OBJS)
$(RANLIB)
$@
pngtest
:
pngtest.o libpng.a
$(CC)
-o
pngtest
$(CCFLAGS)
pngtest.o
$(LDFLAGS)
test
:
pngtest
./pngtest
install
:
libpng.a
-
@mkdir
$(prefix)
/include
-
@mkdir
$(prefix)
/lib
cp
png.h
$(prefix)
/include
cp
pngconf.h
$(prefix)
/include
chmod
644
$(prefix)
/include/png.h
chmod
644
$(prefix)
/include/pngconf.h
cp
libpng.a
$(prefix)
/lib
chmod
644
$(prefix)
/lib/libpng.a
clean
:
rm
-f
*
.o libpng.a pngtest pngout.png
# DO NOT DELETE THIS LINE -- make depend depends on it.
png.o
:
png.h pngconf.h
pngerror.o
:
png.h pngconf.h
pngrio.o
:
png.h pngconf.h
pngwio.o
:
png.h pngconf.h
pngmem.o
:
png.h pngconf.h
pngset.o
:
png.h pngconf.h
pngget.o
:
png.h pngconf.h
pngread.o
:
png.h pngconf.h
pngrtran.o
:
png.h pngconf.h
pngrutil.o
:
png.h pngconf.h
pngtest.o
:
png.h pngconf.h
pngtrans.o
:
png.h pngconf.h
pngwrite.o
:
png.h pngconf.h
pngwtran.o
:
png.h pngconf.h
pngwutil.o
:
png.h pngconf.h
pngpread.o
:
png.h pngconf.h
makefile.tc
→
makefile.tc
3
浏览文件 @
c4a2ae6c
# Makefile for libpng
# Makefile for libpng
# TurboC++ 3.0 (Note: All modules are compiled in C mode)
# TurboC++ 3.0 (Note: All modules are compiled in C mode)
# To use, do "make -fmakefile.tc"
# To use, do "make -fmakefile.tc
3
"
# ------------- Turbo C++ 3.0 -------------
# ------------- Turbo C++ 3.0 -------------
MODEL
=
-ml
MODEL
=
-ml
...
...
png.c
浏览文件 @
c4a2ae6c
/* png.c - location for general purpose libpng functions
/* png.c - location for general purpose libpng functions
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*/
*/
#define PNG_INTERNAL
#define PNG_INTERNAL
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
/* Version information for C files. This had better match the version
/* Version information for C files. This had better match the version
* string defined in png.h.
* string defined in png.h.
*/
*/
char
png_libpng_ver
[]
=
"0.9
7
"
;
char
png_libpng_ver
[]
=
"0.9
8
"
;
/* Place to hold the signiture string for a PNG file. */
/* Place to hold the signiture string for a PNG file. */
png_byte
FARDATA
png_sig
[
8
]
=
{
137
,
80
,
78
,
71
,
13
,
10
,
26
,
10
};
png_byte
FARDATA
png_sig
[
8
]
=
{
137
,
80
,
78
,
71
,
13
,
10
,
26
,
10
};
...
...
png.h
浏览文件 @
c4a2ae6c
/* png.h - header file for PNG reference library
/* png.h - header file for PNG reference library
*
*
* libpng 0.9
7
beta
* libpng 0.9
8
beta
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998 Glenn Randers-Pehrson
* Copyright (c) 1998 Glenn Randers-Pehrson
* January 7, 1998
* January 16, 1998
*
* Note about libpng version numbers:
*
* Due to various miscommunications, unforeseen code incompatibilities
* and occasional factors outside the authors' control, version numbering
* on the library has not always been consistent and straightforward.
* The following table summarizes matters since version 0.89c, which was
* the first widely used release:
*
* source png.h shared-lib
* version string version
* ------- ------ ----------
* 0.89c ("1.0 beta 3") 0.89 1.0.89
* 0.90 ("1.0 beta 4") 0.90 0.90 [should have been 2.0.90]
* 0.95 ("1.0 beta 5") 0.95 0.95 [should have been 2.0.95]
* 0.96 ("1.0 beta 6") 0.96 0.96 [should have been 2.0.96]
* 0.97b ("1.00.97 beta 7") 1.00.97 1.0.0 [should have been 2.0.97]
* 0.97c 0.97 2.0.97
* 0.98 0.98 2.0.98
* 0.99 0.99 2.0.99
* 1.0 1.00 2.1.0
*
* Henceforth the source version will match the shared-library minor
* and patch numbers; the shared-library major version number will be
* used for changes in backward compatibility, as it is intended.
*
*
* BETA NOTICE:
* BETA NOTICE:
* This is a beta version. It reads and writes valid files on the
* This is a beta version. It reads and writes valid files on the
...
@@ -94,12 +119,12 @@ extern "C" {
...
@@ -94,12 +119,12 @@ extern "C" {
*/
*/
/* Version information for png.h - this should match the version in png.c */
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "0.9
7
"
#define PNG_LIBPNG_VER_STRING "0.9
8
"
/* careful here. At one time, I wanted to use 082, but that would be octal.
/* careful here. At one time, I wanted to use 082, but that would be octal.
* Version 1.0 will be 100 here, etc.
* Version 1.0 will be 100 here, etc.
*/
*/
#define PNG_LIBPNG_VER 9
7
#define PNG_LIBPNG_VER 9
8
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
/* variables declared in png.c - only it needs to define PNG_NO_EXTERN */
#ifndef PNG_NO_EXTERN
#ifndef PNG_NO_EXTERN
...
@@ -108,33 +133,6 @@ extern "C" {
...
@@ -108,33 +133,6 @@ extern "C" {
*/
*/
extern
char
png_libpng_ver
[];
extern
char
png_libpng_ver
[];
/*
* Note about libpng version numbers:
*
* Due to various miscommunications, unforeseen code incompatibilities
* and occasional factors outside the authors' control, version numbering
* on the library has not always been consistent and straightforward.
* The following table summarizes matters since version 0.89c, which was
* the first widely used release:
*
* source png.h shared-lib
* version string version
* ------- ------ ----------
* 0.89c ("1.0 beta 3") 0.89 1.0.89
* 0.90 ("1.0 beta 4") 0.90 0.90 [should have been 2.0.90]
* 0.95 ("1.0 beta 5") 0.95 0.95 [should have been 2.0.95]
* 0.96 ("1.0 beta 6") 0.96 0.96 [should have been 2.0.96]
* 0.97b ("1.00.97 beta 7") 1.00.97 1.0.0 [should have been 2.0.97]
* 0.97c 0.97 2.0.97
* 0.98 0.98 2.0.98
* 0.99 0.99 2.0.99
* 1.0 1.00 2.1.0
*
* Henceforth the source version will match the shared-library minor
* and patch numbers; the shared-library major version number will be
* used for changes in backward compatibility, as it is intended.
*/
/* Structures to facilitate easy interlacing. See png.c for more details */
/* Structures to facilitate easy interlacing. See png.c for more details */
extern
int
FARDATA
png_pass_start
[];
extern
int
FARDATA
png_pass_start
[];
extern
int
FARDATA
png_pass_inc
[];
extern
int
FARDATA
png_pass_inc
[];
...
@@ -582,9 +580,9 @@ struct png_struct_def
...
@@ -582,9 +580,9 @@ struct png_struct_def
png_uint_32
flush_rows
;
/* number of rows written since last flush */
png_uint_32
flush_rows
;
/* number of rows written since last flush */
#endif
/* PNG_WRITE_FLUSH_SUPPORTED */
#endif
/* PNG_WRITE_FLUSH_SUPPORTED */
#if defined(PNG_READ_GAMMA_SUPPORTED)
#if defined(PNG_READ_GAMMA_SUPPORTED)
int
gamma_shift
;
/* number of "insignificant" bits 16-bit gamma */
int
gamma_shift
;
/* number of "insignificant" bits 16-bit gamma */
float
gamma
;
/* file gamma value */
float
gamma
;
/* file gamma value */
float
display_gamma
;
/* display gamma value
*/
float
screen_gamma
;
/* screen gamma value (display_gamma/viewing_gamma
*/
#endif
/* PNG_READ_GAMMA_SUPPORTED */
#endif
/* PNG_READ_GAMMA_SUPPORTED */
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED)
png_bytep
gamma_table
;
/* gamma table for 8 bit depth files */
png_bytep
gamma_table
;
/* gamma table for 8 bit depth files */
...
@@ -626,6 +624,7 @@ struct png_struct_def
...
@@ -626,6 +624,7 @@ struct png_struct_def
png_charp
current_text
;
/* current text chunk buffer */
png_charp
current_text
;
/* current text chunk buffer */
png_charp
current_text_ptr
;
/* current location in current_text */
png_charp
current_text_ptr
;
/* current location in current_text */
#endif
/* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_READ_tEXt/zTXt_SUPPORTED */
#endif
/* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_READ_tEXt/zTXt_SUPPORTED */
#endif
/* PNG_PROGRESSIVE_READ_SUPPORTED */
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
/* for the Borland special 64K segment handler */
/* for the Borland special 64K segment handler */
png_bytepp
offset_table_ptr
;
png_bytepp
offset_table_ptr
;
...
@@ -633,8 +632,7 @@ struct png_struct_def
...
@@ -633,8 +632,7 @@ struct png_struct_def
png_uint_16
offset_table_number
;
png_uint_16
offset_table_number
;
png_uint_16
offset_table_count
;
png_uint_16
offset_table_count
;
png_uint_16
offset_table_count_free
;
png_uint_16
offset_table_count_free
;
#endif
/* PNG_PROGRESSIVE_READ_SUPPORTED&&__TURBOC__&&!_Windows&&!__FLAT__ */
#endif
/* __TURBOC__&&!_Windows&&!__FLAT__ */
#endif
/* PNG_PROGRESSIVE_READ_SUPPORTED */
#if defined(PNG_READ_DITHER_SUPPORTED)
#if defined(PNG_READ_DITHER_SUPPORTED)
png_bytep
palette_lookup
;
/* lookup table for dithering */
png_bytep
palette_lookup
;
/* lookup table for dithering */
png_bytep
dither_index
;
/* index translation for palette files */
png_bytep
dither_index
;
/* index translation for palette files */
...
@@ -649,9 +647,9 @@ struct png_struct_def
...
@@ -649,9 +647,9 @@ struct png_struct_def
png_uint_16p
filter_costs
;
/* relative filter calculation cost */
png_uint_16p
filter_costs
;
/* relative filter calculation cost */
png_uint_16p
inv_filter_costs
;
/* 1/relative filter calculation cost */
png_uint_16p
inv_filter_costs
;
/* 1/relative filter calculation cost */
#endif
/* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
#endif
/* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */
#if defined(PNG_TIME_RFC11
52
_SUPPORTED)
#if defined(PNG_TIME_RFC11
23
_SUPPORTED)
png_charp
time_buffer
;
/* String to hold RFC 11
52
time text */
png_charp
time_buffer
;
/* String to hold RFC 11
23
time text */
#endif
/* PNG_TIME_RFC11
52
_SUPPORTED */
#endif
/* PNG_TIME_RFC11
23
_SUPPORTED */
};
};
typedef
png_struct
FAR
*
FAR
*
png_structpp
;
typedef
png_struct
FAR
*
FAR
*
png_structpp
;
...
@@ -706,10 +704,10 @@ extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr,
...
@@ -706,10 +704,10 @@ extern PNG_EXPORT(void,png_write_info) PNGARG((png_structp png_ptr,
extern
PNG_EXPORT
(
void
,
png_read_info
)
PNGARG
((
png_structp
png_ptr
,
extern
PNG_EXPORT
(
void
,
png_read_info
)
PNGARG
((
png_structp
png_ptr
,
png_infop
info_ptr
));
png_infop
info_ptr
));
#if defined(PNG_TIME_RFC11
52
_SUPPORTED)
#if defined(PNG_TIME_RFC11
23
_SUPPORTED)
extern
PNG_EXPORT
(
png_charp
,
png_convert_to_rfc11
52
)
extern
PNG_EXPORT
(
png_charp
,
png_convert_to_rfc11
23
)
PNGARG
((
png_structp
png_ptr
,
png_timep
ptime
));
PNGARG
((
png_structp
png_ptr
,
png_timep
ptime
));
#endif
/* PNG_TIME_RFC11
52
_SUPPORTED */
#endif
/* PNG_TIME_RFC11
23
_SUPPORTED */
#if defined(PNG_WRITE_tIME_SUPPORTED)
#if defined(PNG_WRITE_tIME_SUPPORTED)
/* convert from a struct tm to png_time */
/* convert from a struct tm to png_time */
...
@@ -753,6 +751,11 @@ extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr));
...
@@ -753,6 +751,11 @@ extern PNG_EXPORT(void,png_set_strip_alpha) PNGARG((png_structp png_ptr));
extern
PNG_EXPORT
(
void
,
png_set_swap_alpha
)
PNGARG
((
png_structp
png_ptr
));
extern
PNG_EXPORT
(
void
,
png_set_swap_alpha
)
PNGARG
((
png_structp
png_ptr
));
#endif
/* PNG_READ_SWAP_ALPHA_SUPPORTED || PNG_WRITE_SWAP_ALPHA_SUPPORTED */
#endif
/* PNG_READ_SWAP_ALPHA_SUPPORTED || PNG_WRITE_SWAP_ALPHA_SUPPORTED */
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
extern
PNG_EXPORT
(
void
,
png_set_invert_alpha
)
PNGARG
((
png_structp
png_ptr
));
#endif
/* PNG_READ_INVERT_ALPHA_SUPPORTED || PNG_WRITE_INVERT_ALPHA_SUPPORTED */
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
#if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED)
/* Add a filler byte to 24-bit RGB images. */
/* Add a filler byte to 24-bit RGB images. */
extern
PNG_EXPORT
(
void
,
png_set_filler
)
PNGARG
((
png_structp
png_ptr
,
extern
PNG_EXPORT
(
void
,
png_set_filler
)
PNGARG
((
png_structp
png_ptr
,
...
@@ -819,7 +822,7 @@ extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr,
...
@@ -819,7 +822,7 @@ extern PNG_EXPORT(void,png_set_dither) PNGARG((png_structp png_ptr,
#endif
/* PNG_READ_DITHER_SUPPORTED */
#endif
/* PNG_READ_DITHER_SUPPORTED */
#if defined(PNG_READ_GAMMA_SUPPORTED)
#if defined(PNG_READ_GAMMA_SUPPORTED)
/* Handle gamma correction. */
/* Handle gamma correction.
Screen_gamma=(display_gamma/viewing_gamma)
*/
extern
PNG_EXPORT
(
void
,
png_set_gamma
)
PNGARG
((
png_structp
png_ptr
,
extern
PNG_EXPORT
(
void
,
png_set_gamma
)
PNGARG
((
png_structp
png_ptr
,
double
screen_gamma
,
double
default_file_gamma
));
double
screen_gamma
,
double
default_file_gamma
));
#endif
/* PNG_READ_GAMMA_SUPPORTED */
#endif
/* PNG_READ_GAMMA_SUPPORTED */
...
@@ -1240,14 +1243,14 @@ extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr,
...
@@ -1240,14 +1243,14 @@ extern PNG_EXPORT(void,png_set_sBIT) PNGARG((png_structp png_ptr,
#if defined(PNG_READ_sRGB_SUPPORTED)
#if defined(PNG_READ_sRGB_SUPPORTED)
extern
PNG_EXPORT
(
png_uint_32
,
png_get_sRGB
)
PNGARG
((
png_structp
png_ptr
,
extern
PNG_EXPORT
(
png_uint_32
,
png_get_sRGB
)
PNGARG
((
png_structp
png_ptr
,
png_infop
info_ptr
,
png_bytep
srgb_
intent
));
png_infop
info_ptr
,
int
*
intent
));
#endif
/* PNG_READ_sRGB_SUPPORTED */
#endif
/* PNG_READ_sRGB_SUPPORTED */
#if defined(PNG_READ_sRGB_SUPPORTED) || defined(PNG_WRITE_sRGB_SUPPORTED)
#if defined(PNG_READ_sRGB_SUPPORTED) || defined(PNG_WRITE_sRGB_SUPPORTED)
extern
PNG_EXPORT
(
void
,
png_set_sRGB
)
PNGARG
((
png_structp
png_ptr
,
extern
PNG_EXPORT
(
void
,
png_set_sRGB
)
PNGARG
((
png_structp
png_ptr
,
png_infop
info_ptr
,
png_byte
srgb_
intent
));
png_infop
info_ptr
,
int
intent
));
extern
PNG_EXPORT
(
void
,
png_set_sRGB_gAMA_and_cHRM
)
PNGARG
((
png_structp
png_ptr
,
extern
PNG_EXPORT
(
void
,
png_set_sRGB_gAMA_and_cHRM
)
PNGARG
((
png_structp
png_ptr
,
png_infop
info_ptr
,
png_byte
srgb_
intent
));
png_infop
info_ptr
,
int
intent
));
#endif
/* PNG_READ_sRGB_SUPPORTED || PNG_WRITE_sRGB_SUPPORTED */
#endif
/* PNG_READ_sRGB_SUPPORTED || PNG_WRITE_sRGB_SUPPORTED */
#if defined(PNG_READ_tEXt_SUPPORTED) || defined(PNG_READ_zTXt_SUPPORTED)
#if defined(PNG_READ_tEXt_SUPPORTED) || defined(PNG_READ_zTXt_SUPPORTED)
...
@@ -1361,6 +1364,7 @@ extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
...
@@ -1361,6 +1364,7 @@ extern PNG_EXPORT(void,png_set_tRNS) PNGARG((png_structp png_ptr,
#define PNG_PACKSWAP 0x10000
#define PNG_PACKSWAP 0x10000
#define PNG_SWAP_ALPHA 0x20000
#define PNG_SWAP_ALPHA 0x20000
#define PNG_STRIP_ALPHA 0x40000
#define PNG_STRIP_ALPHA 0x40000
#define PNG_INVERT_ALPHA 0x80000
/* flags for png_create_struct */
/* flags for png_create_struct */
#define PNG_STRUCT_PNG 0x0001
#define PNG_STRUCT_PNG 0x0001
...
@@ -1585,7 +1589,7 @@ PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr,
...
@@ -1585,7 +1589,7 @@ PNG_EXTERN void png_write_cHRM PNGARG((png_structp png_ptr,
#if defined(PNG_WRITE_sRGB_SUPPORTED)
#if defined(PNG_WRITE_sRGB_SUPPORTED)
PNG_EXTERN
void
png_write_sRGB
PNGARG
((
png_structp
png_ptr
,
PNG_EXTERN
void
png_write_sRGB
PNGARG
((
png_structp
png_ptr
,
png_byte
srgb_
intent
));
int
intent
));
#endif
#endif
#if defined(PNG_WRITE_tRNS_SUPPORTED)
#if defined(PNG_WRITE_tRNS_SUPPORTED)
...
@@ -1702,6 +1706,16 @@ PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info,
...
@@ -1702,6 +1706,16 @@ PNG_EXTERN void png_do_write_swap_alpha PNGARG((png_row_infop row_info,
png_bytep
row
));
png_bytep
row
));
#endif
#endif
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
PNG_EXTERN
void
png_do_read_invert_alpha
PNGARG
((
png_row_infop
row_info
,
png_bytep
row
));
#endif
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
PNG_EXTERN
void
png_do_write_invert_alpha
PNGARG
((
png_row_infop
row_info
,
png_bytep
row
));
#endif
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
#if defined(PNG_WRITE_FILLER_SUPPORTED) || \
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
defined(PNG_READ_STRIP_ALPHA_SUPPORTED)
PNG_EXTERN
void
png_do_strip_filler
PNGARG
((
png_row_infop
row_info
,
PNG_EXTERN
void
png_do_strip_filler
PNGARG
((
png_row_infop
row_info
,
...
...
pngconf.h
浏览文件 @
c4a2ae6c
/* pngconf.c - machine configurable file for libpng
/* pngconf.c - machine configurable file for libpng
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*/
*/
/* Any machine specific code is near the front of this file, so if you
/* Any machine specific code is near the front of this file, so if you
...
@@ -191,24 +191,25 @@ __dont__ include it again
...
@@ -191,24 +191,25 @@ __dont__ include it again
* less then 8, and even that may not work (I haven't tested it).
* less then 8, and even that may not work (I haven't tested it).
*/
*/
#ifndef PNG_MAX_GAMMA_8
#define PNG_MAX_GAMMA_8 11
#define PNG_MAX_GAMMA_8 11
#endif
/* This controls how much a difference in gamma we can tolerate before
/* This controls how much a difference in gamma we can tolerate before
* we actually start doing gamma conversion.
* we actually start doing gamma conversion.
*/
*/
#ifndef PNG_GAMMA_THRESHOLD
#define PNG_GAMMA_THRESHOLD 0.05
#define PNG_GAMMA_THRESHOLD 0.05
#endif
#endif
/* PNG_INTERNAL */
#endif
/* PNG_INTERNAL */
/* The following uses const char * instead of char * for error
/* The following uses const char * instead of char * for error
* and warning message functions, so some compilers won't complain.
* and warning message functions, so some compilers won't complain.
* If you want to use const, define PNG_USE_CONST here. It is not
* If you do not want to use const, define PNG_NO_CONST here.
* normally defined to make configuration easier, as it is not a
* critical part of the code.
*/
*/
#define PNG_USE_CONST
#if
def PNG_USE
_CONST
#if
ndef PNG_NO
_CONST
# define PNG_CONST const
# define PNG_CONST const
#else
#else
# define PNG_CONST
# define PNG_CONST
...
@@ -259,6 +260,7 @@ __dont__ include it again
...
@@ -259,6 +260,7 @@ __dont__ include it again
#define PNG_READ_GAMMA_SUPPORTED
#define PNG_READ_GAMMA_SUPPORTED
#define PNG_READ_GRAY_TO_RGB_SUPPORTED
#define PNG_READ_GRAY_TO_RGB_SUPPORTED
#define PNG_READ_SWAP_ALPHA_SUPPORTED
#define PNG_READ_SWAP_ALPHA_SUPPORTED
#define PNG_READ_INVERT_ALPHA_SUPPORTED
#define PNG_READ_STRIP_ALPHA_SUPPORTED
#define PNG_READ_STRIP_ALPHA_SUPPORTED
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
/* well tested on Intel */
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
/* well tested on Intel */
#endif
/* PNG_READ_FULLY_SUPPORTED */
#endif
/* PNG_READ_FULLY_SUPPORTED */
...
@@ -275,22 +277,32 @@ __dont__ include it again
...
@@ -275,22 +277,32 @@ __dont__ include it again
#define PNG_WRITE_FILLER_SUPPORTED
/* This is the same as WRITE_STRIP_ALPHA */
#define PNG_WRITE_FILLER_SUPPORTED
/* This is the same as WRITE_STRIP_ALPHA */
#define PNG_WRITE_FLUSH_SUPPORTED
#define PNG_WRITE_FLUSH_SUPPORTED
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
#endif
/* PNG_WRITE_FULLY_SUPPORTED */
#endif
/* PNG_WRITE_FULLY_SUPPORTED */
#if !defined(PNG_NO_STDIO)
#if !defined(PNG_NO_STDIO)
#define PNG_TIME_RFC11
52
_SUPPORTED
#define PNG_TIME_RFC11
23
_SUPPORTED
#endif
#endif
/* These are currently experimental features */
/* These are currently experimental features, define them if you want */
#undef PNG_READ_16_TO_8_ACCURATE_SHIFT_SUPPORTED
/* very little testing */
/* very little testing */
/*
#define PNG_READ_16_TO_8_ACCURATE_SHIFT_SUPPORTED
*/
/* This is only for PowerPC big-endian and 680x0 systems */
/* This is only for PowerPC big-endian and 680x0 systems */
#undef PNG_READ_BIG_ENDIAN_SUPPORTED
/* some testing */
/* some testing */
/*
#define PNG_READ_BIG_ENDIAN_SUPPORTED
*/
/* These functions are turned off by default, as they will be phased out. */
/* These functions are turned off by default, as they will be phased out. */
#undef PNG_USELESS_TESTS_SUPPORTED
/*
#undef PNG_CORRECT_PALETTE_SUPPORTED
#define PNG_USELESS_TESTS_SUPPORTED
#define PNG_CORRECT_PALETTE_SUPPORTED
*/
/* Any chunks you are not interested in, you can undef here. The
/* Any chunks you are not interested in, you can undef here. The
* ones that allocate memory may be expecially important (hIST,
* ones that allocate memory may be expecially important (hIST,
...
...
pngerror.c
浏览文件 @
c4a2ae6c
/* pngerror.c - stub functions for i/o and memory allocation
/* pngerror.c - stub functions for i/o and memory allocation
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*
*
* This file provides a location for all error handling. Users which
* This file provides a location for all error handling. Users which
* need special error handling are expected to write replacement functions
* need special error handling are expected to write replacement functions
...
...
pngget.c
浏览文件 @
c4a2ae6c
/* pngget.c - retrieval of values from info struct
/* pngget.c - retrieval of values from info struct
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*/
*/
#define PNG_INTERNAL
#define PNG_INTERNAL
...
@@ -112,14 +112,13 @@ png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
...
@@ -112,14 +112,13 @@ png_get_gAMA(png_structp png_ptr, png_infop info_ptr, double *file_gamma)
#if defined(PNG_READ_sRGB_SUPPORTED)
#if defined(PNG_READ_sRGB_SUPPORTED)
png_uint_32
png_uint_32
png_get_sRGB
(
png_structp
png_ptr
,
png_infop
info_ptr
,
png_bytep
png_get_sRGB
(
png_structp
png_ptr
,
png_infop
info_ptr
,
int
*
file_srgb_intent
)
file_srgb_intent
)
{
{
if
(
info_ptr
!=
NULL
&&
info_ptr
->
valid
&
PNG_INFO_sRGB
&&
if
(
info_ptr
!=
NULL
&&
info_ptr
->
valid
&
PNG_INFO_sRGB
&&
file_srgb_intent
!=
NULL
)
file_srgb_intent
!=
NULL
)
{
{
png_debug1
(
1
,
"in %s retrieval function
\n
"
,
"sRGB"
);
png_debug1
(
1
,
"in %s retrieval function
\n
"
,
"sRGB"
);
*
file_srgb_intent
=
info_ptr
->
srgb_intent
;
*
file_srgb_intent
=
(
int
)
info_ptr
->
srgb_intent
;
return
(
PNG_INFO_sRGB
);
return
(
PNG_INFO_sRGB
);
}
}
return
(
0
);
return
(
0
);
...
@@ -272,7 +271,8 @@ png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr,
...
@@ -272,7 +271,8 @@ png_get_text(png_structp png_ptr, png_infop info_ptr, png_textp *text_ptr,
if
((
info_ptr
!=
NULL
)
||
(
info_ptr
->
num_text
>
0
))
if
((
info_ptr
!=
NULL
)
||
(
info_ptr
->
num_text
>
0
))
{
{
png_debug1
(
1
,
"in %s retrieval function
\n
"
,
png_debug1
(
1
,
"in %s retrieval function
\n
"
,
(
png_ptr
->
chunk_name
[
0
]
==
'\0'
?
"text"
:
png_ptr
->
chunk_name
));
(
png_ptr
->
chunk_name
[
0
]
==
'\0'
?
"text"
:
(
png_const_charp
)
png_ptr
->
chunk_name
));
if
(
text_ptr
!=
NULL
)
if
(
text_ptr
!=
NULL
)
*
text_ptr
=
info_ptr
->
text
;
*
text_ptr
=
info_ptr
->
text
;
if
(
num_text
!=
NULL
)
if
(
num_text
!=
NULL
)
...
...
pngmem.c
浏览文件 @
c4a2ae6c
/* pngmem.c - stub functions for memory allocation
/* pngmem.c - stub functions for memory allocation
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*
*
* This file provides a location for all memory allocation. Users which
* This file provides a location for all memory allocation. Users which
* need special memory handling are expected to modify the code in this file
* need special memory handling are expected to modify the code in this file
...
@@ -16,6 +15,16 @@
...
@@ -16,6 +15,16 @@
#define PNG_INTERNAL
#define PNG_INTERNAL
#include "png.h"
#include "png.h"
/* The following "hides" PNG_MALLOC and PNG_FREE thus allowing the pngtest
application to put a wrapper on top of them. */
#ifdef PNGTEST_MEMORY_DEBUG
#define PNG_MALLOC png_debug_malloc
#define PNG_FREE png_debug_free
#else
#define PNG_MALLOC png_malloc
#define PNG_FREE png_free
#endif
/* Borland DOS special memory handler */
/* Borland DOS special memory handler */
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
/* if you change this, be sure to change the one in png.h also */
/* if you change this, be sure to change the one in png.h also */
...
@@ -72,7 +81,7 @@ png_destroy_struct(png_voidp struct_ptr)
...
@@ -72,7 +81,7 @@ png_destroy_struct(png_voidp struct_ptr)
* (which should cause a fatal error) and introducing major problems.
* (which should cause a fatal error) and introducing major problems.
*/
*/
png_voidp
png_voidp
png_malloc
(
png_structp
png_ptr
,
png_uint_32
size
)
PNG_MALLOC
(
png_structp
png_ptr
,
png_uint_32
size
)
{
{
png_voidp
ret
;
png_voidp
ret
;
if
(
png_ptr
==
NULL
||
size
==
0
)
if
(
png_ptr
==
NULL
||
size
==
0
)
...
@@ -166,11 +175,11 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
...
@@ -166,11 +175,11 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
return
ret
;
return
ret
;
}
}
/* free a pointer allocated by
png_malloc
(). In the default
/* free a pointer allocated by
PNG_MALLOC
(). In the default
configuration, png_ptr is not used, but is passed in case it
configuration, png_ptr is not used, but is passed in case it
is needed. If ptr is NULL, return without taking any action. */
is needed. If ptr is NULL, return without taking any action. */
void
void
png_free
(
png_structp
png_ptr
,
png_voidp
ptr
)
PNG_FREE
(
png_structp
png_ptr
,
png_voidp
ptr
)
{
{
if
(
png_ptr
==
NULL
||
ptr
==
NULL
)
if
(
png_ptr
==
NULL
||
ptr
==
NULL
)
return
;
return
;
...
@@ -260,7 +269,7 @@ png_destroy_struct(png_voidp struct_ptr)
...
@@ -260,7 +269,7 @@ png_destroy_struct(png_voidp struct_ptr)
have the ability to do that. */
have the ability to do that. */
png_voidp
png_voidp
png_malloc
(
png_structp
png_ptr
,
png_uint_32
size
)
PNG_MALLOC
(
png_structp
png_ptr
,
png_uint_32
size
)
{
{
png_voidp
ret
;
png_voidp
ret
;
if
(
png_ptr
==
NULL
||
size
==
0
)
if
(
png_ptr
==
NULL
||
size
==
0
)
...
@@ -289,11 +298,11 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
...
@@ -289,11 +298,11 @@ png_malloc(png_structp png_ptr, png_uint_32 size)
return
ret
;
return
ret
;
}
}
/* Free a pointer allocated by
png_malloc
(). In the default
/* Free a pointer allocated by
PNG_MALLOC
(). In the default
configuration, png_ptr is not used, but is passed in case it
configuration, png_ptr is not used, but is passed in case it
is needed. If ptr is NULL, return without taking any action. */
is needed. If ptr is NULL, return without taking any action. */
void
void
png_free
(
png_structp
png_ptr
,
png_voidp
ptr
)
PNG_FREE
(
png_structp
png_ptr
,
png_voidp
ptr
)
{
{
if
(
png_ptr
==
NULL
||
ptr
==
NULL
)
if
(
png_ptr
==
NULL
||
ptr
==
NULL
)
return
;
return
;
...
...
pngpread.c
浏览文件 @
c4a2ae6c
/* pngpread.c - read a png file in push mode
/* pngpread.c - read a png file in push mode
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*/
*/
#define PNG_INTERNAL
#define PNG_INTERNAL
...
...
pngread.c
浏览文件 @
c4a2ae6c
/* pngread.c - read a PNG file
/* pngread.c - read a PNG file
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*
*
* This file contains routines that an application calls directly to
* This file contains routines that an application calls directly to
* read a PNG file or stream.
* read a PNG file or stream.
...
@@ -655,12 +655,18 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
...
@@ -655,12 +655,18 @@ png_destroy_read_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr,
if
(
info_ptr
!=
NULL
)
if
(
info_ptr
!=
NULL
)
{
{
#if defined(PNG_READ_tEXt_SUPPORTED) || defined(PNG_READ_zTXt_SUPPORTED)
png_free
(
png_ptr
,
info_ptr
->
text
);
#endif
png_destroy_struct
((
png_voidp
)
info_ptr
);
png_destroy_struct
((
png_voidp
)
info_ptr
);
*
info_ptr_ptr
=
(
png_infop
)
NULL
;
*
info_ptr_ptr
=
(
png_infop
)
NULL
;
}
}
if
(
end_info_ptr
!=
NULL
)
if
(
end_info_ptr
!=
NULL
)
{
{
#if defined(PNG_READ_tEXt_SUPPORTED) || defined(PNG_READ_zTXt_SUPPORTED)
png_free
(
png_ptr
,
info_ptr
->
text
);
#endif
png_destroy_struct
((
png_voidp
)
end_info_ptr
);
png_destroy_struct
((
png_voidp
)
end_info_ptr
);
*
end_info_ptr_ptr
=
(
png_infop
)
NULL
;
*
end_info_ptr_ptr
=
(
png_infop
)
NULL
;
}
}
...
...
pngrio.c
浏览文件 @
c4a2ae6c
/* pngrio.c - functions for data input
/* pngrio.c - functions for data input
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*
*
* This file provides a location for all input. Users which need
* This file provides a location for all input. Users which need
* special handling are expected to write a function which has the same
* special handling are expected to write a function which has the same
...
...
pngrtran.c
浏览文件 @
c4a2ae6c
/* pngrtran.c - transforms the data in a row for PNG readers
/* pngrtran.c - transforms the data in a row for PNG readers
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*
*
* This file contains functions optionally called by an application
* This file contains functions optionally called by an application
* in order to tell libpng how to handle data when reading a PNG.
* in order to tell libpng how to handle data when reading a PNG.
...
@@ -549,13 +549,13 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
...
@@ -549,13 +549,13 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
* also needlessly introduces small errors.
* also needlessly introduces small errors.
*/
*/
void
void
png_set_gamma
(
png_structp
png_ptr
,
double
scr
ee
n_gamma
,
double
file_gamma
)
png_set_gamma
(
png_structp
png_ptr
,
double
scrn_gamma
,
double
file_gamma
)
{
{
png_debug
(
1
,
"in png_set_gamma
\n
"
);
png_debug
(
1
,
"in png_set_gamma
\n
"
);
if
(
fabs
(
scr
ee
n_gamma
*
file_gamma
-
1
.
0
)
>
PNG_GAMMA_THRESHOLD
)
if
(
fabs
(
scrn_gamma
*
file_gamma
-
1
.
0
)
>
PNG_GAMMA_THRESHOLD
)
png_ptr
->
transformations
|=
PNG_GAMMA
;
png_ptr
->
transformations
|=
PNG_GAMMA
;
png_ptr
->
gamma
=
(
float
)
file_gamma
;
png_ptr
->
gamma
=
(
float
)
file_gamma
;
png_ptr
->
display_gamma
=
(
float
)
scree
n_gamma
;
png_ptr
->
screen_gamma
=
(
float
)
scr
n_gamma
;
}
}
#endif
#endif
...
@@ -592,6 +592,7 @@ png_set_rgb_to_gray(png_structp png_ptr, int gray_bits)
...
@@ -592,6 +592,7 @@ png_set_rgb_to_gray(png_structp png_ptr, int gray_bits)
png_debug
(
1
,
"in png_set_rgb_to_gray
\n
"
);
png_debug
(
1
,
"in png_set_rgb_to_gray
\n
"
);
png_ptr
->
transformations
|=
PNG_RGB_TO_GRAY
;
png_ptr
->
transformations
|=
PNG_RGB_TO_GRAY
;
/* Need to do something with gray_bits here. */
/* Need to do something with gray_bits here. */
png_warning
(
png_ptr
,
"RGB to GRAY transformation is not yet implemented."
);
}
}
#endif
#endif
...
@@ -644,6 +645,23 @@ png_init_read_transformations(png_structp png_ptr)
...
@@ -644,6 +645,23 @@ png_init_read_transformations(png_structp png_ptr)
png_ptr
->
palette
[
png_ptr
->
background
.
index
].
green
;
png_ptr
->
palette
[
png_ptr
->
background
.
index
].
green
;
png_ptr
->
background
.
blue
=
png_ptr
->
background
.
blue
=
png_ptr
->
palette
[
png_ptr
->
background
.
index
].
blue
;
png_ptr
->
palette
[
png_ptr
->
background
.
index
].
blue
;
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
if
(
png_ptr
->
transformations
&
PNG_INVERT_ALPHA
)
{
#if defined(PNG_READ_EXPAND_SUPPORTED)
if
(
png_ptr
->
transformations
&
!
PNG_EXPAND
)
#endif
{
/* invert the alpha channel (in tRNS) unless the pixels are
going to be expanded, in which case leave it for later */
int
i
;
for
(
i
=
0
;
i
<
png_ptr
->
num_trans
;
i
++
)
png_ptr
->
trans
[
i
]
=
255
-
png_ptr
->
trans
[
i
];
}
}
#endif
}
}
}
}
#endif
#endif
...
@@ -681,7 +699,7 @@ png_init_read_transformations(png_structp png_ptr)
...
@@ -681,7 +699,7 @@ png_init_read_transformations(png_structp png_ptr)
{
{
double
g
;
double
g
;
g
=
1
.
0
/
(
png_ptr
->
background_gamma
*
png_ptr
->
display
_gamma
);
g
=
1
.
0
/
(
png_ptr
->
background_gamma
*
png_ptr
->
screen
_gamma
);
if
(
png_ptr
->
background_gamma_type
==
PNG_BACKGROUND_GAMMA_SCREEN
||
if
(
png_ptr
->
background_gamma_type
==
PNG_BACKGROUND_GAMMA_SCREEN
||
fabs
(
g
-
1
.
0
)
<
PNG_GAMMA_THRESHOLD
)
fabs
(
g
-
1
.
0
)
<
PNG_GAMMA_THRESHOLD
)
...
@@ -761,17 +779,17 @@ png_init_read_transformations(png_structp png_ptr)
...
@@ -761,17 +779,17 @@ png_init_read_transformations(png_structp png_ptr)
switch
(
png_ptr
->
background_gamma_type
)
switch
(
png_ptr
->
background_gamma_type
)
{
{
case
PNG_BACKGROUND_GAMMA_SCREEN
:
case
PNG_BACKGROUND_GAMMA_SCREEN
:
g
=
(
png_ptr
->
display
_gamma
);
g
=
(
png_ptr
->
screen
_gamma
);
gs
=
1
.
0
;
gs
=
1
.
0
;
break
;
break
;
case
PNG_BACKGROUND_GAMMA_FILE
:
case
PNG_BACKGROUND_GAMMA_FILE
:
g
=
1
.
0
/
(
png_ptr
->
gamma
);
g
=
1
.
0
/
(
png_ptr
->
gamma
);
gs
=
1
.
0
/
(
png_ptr
->
gamma
*
png_ptr
->
display
_gamma
);
gs
=
1
.
0
/
(
png_ptr
->
gamma
*
png_ptr
->
screen
_gamma
);
break
;
break
;
case
PNG_BACKGROUND_GAMMA_UNIQUE
:
case
PNG_BACKGROUND_GAMMA_UNIQUE
:
g
=
1
.
0
/
(
png_ptr
->
background_gamma
);
g
=
1
.
0
/
(
png_ptr
->
background_gamma
);
gs
=
1
.
0
/
(
png_ptr
->
background_gamma
*
gs
=
1
.
0
/
(
png_ptr
->
background_gamma
*
png_ptr
->
display
_gamma
);
png_ptr
->
screen
_gamma
);
break
;
break
;
}
}
...
@@ -954,7 +972,7 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
...
@@ -954,7 +972,7 @@ png_read_transform_info(png_structp png_ptr, png_infop info_ptr)
else
else
info_ptr
->
channels
=
1
;
info_ptr
->
channels
=
1
;
#if defined(PNG_STRIP_ALPHA_SUPPORTED)
#if defined(PNG_
READ_
STRIP_ALPHA_SUPPORTED)
if
((
png_ptr
->
transformations
&
PNG_STRIP_ALPHA
)
&&
if
((
png_ptr
->
transformations
&
PNG_STRIP_ALPHA
)
&&
info_ptr
->
color_type
&
PNG_COLOR_MASK_ALPHA
)
info_ptr
->
color_type
&
PNG_COLOR_MASK_ALPHA
)
{
{
...
@@ -1112,6 +1130,11 @@ png_do_read_transformations(png_structp png_ptr)
...
@@ -1112,6 +1130,11 @@ png_do_read_transformations(png_structp png_ptr)
png_do_read_swap_alpha
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
png_do_read_swap_alpha
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
#endif
#endif
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
if
(
png_ptr
->
transformations
&
PNG_INVERT_ALPHA
)
png_do_read_invert_alpha
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
#endif
#if defined(PNG_READ_SWAP_SUPPORTED)
#if defined(PNG_READ_SWAP_SUPPORTED)
if
(
png_ptr
->
transformations
&
PNG_SWAP_BYTES
)
if
(
png_ptr
->
transformations
&
PNG_SWAP_BYTES
)
png_do_swap
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
png_do_swap
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
...
@@ -1468,6 +1491,87 @@ png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
...
@@ -1468,6 +1491,87 @@ png_do_read_swap_alpha(png_row_infop row_info, png_bytep row)
}
}
#endif
#endif
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED)
void
png_do_read_invert_alpha
(
png_row_infop
row_info
,
png_bytep
row
)
{
png_debug
(
1
,
"in png_do_read_invert_alpha
\n
"
);
#if defined(PNG_USELESS_TESTS_SUPPORTED)
if
(
row
!=
NULL
&&
row_info
!=
NULL
)
#endif
{
if
(
row_info
->
color_type
==
PNG_COLOR_TYPE_RGB_ALPHA
)
{
/* This inverts the alpha channel in RGBA */
if
(
row_info
->
bit_depth
==
8
)
{
png_bytep
sp
,
dp
;
png_uint_32
i
;
for
(
i
=
0
,
sp
=
dp
=
row
+
row_info
->
rowbytes
;
i
<
row_info
->
width
;
i
++
)
{
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
255
-
*
(
--
sp
);
}
}
/* This inverts the alpha channel in RRGGBBAA */
else
{
png_bytep
sp
,
dp
;
png_uint_32
i
;
for
(
i
=
0
,
sp
=
dp
=
row
+
row_info
->
rowbytes
;
i
<
row_info
->
width
;
i
++
)
{
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
255
-
*
(
--
sp
);
*
(
--
dp
)
=
255
-
*
(
--
sp
);
}
}
}
else
if
(
row_info
->
color_type
==
PNG_COLOR_TYPE_GRAY_ALPHA
)
{
/* This inverts the alpha channel in AG */
if
(
row_info
->
bit_depth
==
8
)
{
png_bytep
sp
,
dp
;
png_uint_32
i
;
for
(
i
=
0
,
sp
=
dp
=
row
+
row_info
->
rowbytes
;
i
<
row_info
->
width
;
i
++
)
{
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
255
-
*
(
--
sp
);
}
}
/* This inverts the alpha channel in AAGG */
else
{
png_bytep
sp
,
dp
;
png_uint_32
i
;
for
(
i
=
0
,
sp
=
dp
=
row
+
row_info
->
rowbytes
;
i
<
row_info
->
width
;
i
++
)
{
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
*
(
--
sp
);
*
(
--
dp
)
=
255
-
*
(
--
sp
);
*
(
--
dp
)
=
255
-
*
(
--
sp
);
}
}
}
}
}
#endif
#if defined(PNG_READ_FILLER_SUPPORTED)
#if defined(PNG_READ_FILLER_SUPPORTED)
/* Add filler channel if we have RGB color */
/* Add filler channel if we have RGB color */
void
void
...
@@ -1693,7 +1797,7 @@ png_correct_palette(png_structp png_ptr, png_colorp palette,
...
@@ -1693,7 +1797,7 @@ png_correct_palette(png_structp png_ptr, png_colorp palette,
{
{
double
g
;
double
g
;
g
=
1
.
0
/
(
png_ptr
->
background_gamma
*
png_ptr
->
display
_gamma
);
g
=
1
.
0
/
(
png_ptr
->
background_gamma
*
png_ptr
->
screen
_gamma
);
if
(
png_ptr
->
background_gamma_type
==
PNG_BACKGROUND_GAMMA_SCREEN
||
if
(
png_ptr
->
background_gamma_type
==
PNG_BACKGROUND_GAMMA_SCREEN
||
fabs
(
g
-
1
.
0
)
<
PNG_GAMMA_THRESHOLD
)
fabs
(
g
-
1
.
0
)
<
PNG_GAMMA_THRESHOLD
)
...
@@ -3082,7 +3186,7 @@ png_build_gamma_table(png_structp png_ptr)
...
@@ -3082,7 +3186,7 @@ png_build_gamma_table(png_structp png_ptr)
int
i
;
int
i
;
double
g
;
double
g
;
g
=
1
.
0
/
(
png_ptr
->
gamma
*
png_ptr
->
display
_gamma
);
g
=
1
.
0
/
(
png_ptr
->
gamma
*
png_ptr
->
screen
_gamma
);
png_ptr
->
gamma_table
=
(
png_bytep
)
png_malloc
(
png_ptr
,
png_ptr
->
gamma_table
=
(
png_bytep
)
png_malloc
(
png_ptr
,
(
png_uint_32
)
256
);
(
png_uint_32
)
256
);
...
@@ -3107,7 +3211,7 @@ png_build_gamma_table(png_structp png_ptr)
...
@@ -3107,7 +3211,7 @@ png_build_gamma_table(png_structp png_ptr)
g
)
*
255
.
0
+
.
5
);
g
)
*
255
.
0
+
.
5
);
}
}
g
=
1
.
0
/
(
png_ptr
->
display
_gamma
);
g
=
1
.
0
/
(
png_ptr
->
screen
_gamma
);
png_ptr
->
gamma_from_1
=
(
png_bytep
)
png_malloc
(
png_ptr
,
png_ptr
->
gamma_from_1
=
(
png_bytep
)
png_malloc
(
png_ptr
,
(
png_uint_32
)
256
);
(
png_uint_32
)
256
);
...
@@ -3160,7 +3264,7 @@ png_build_gamma_table(png_structp png_ptr)
...
@@ -3160,7 +3264,7 @@ png_build_gamma_table(png_structp png_ptr)
num
=
(
1
<<
(
8
-
shift
));
num
=
(
1
<<
(
8
-
shift
));
g
=
1
.
0
/
(
png_ptr
->
gamma
*
png_ptr
->
display
_gamma
);
g
=
1
.
0
/
(
png_ptr
->
gamma
*
png_ptr
->
screen
_gamma
);
png_ptr
->
gamma_16_table
=
(
png_uint_16pp
)
png_malloc
(
png_ptr
,
png_ptr
->
gamma_16_table
=
(
png_uint_16pp
)
png_malloc
(
png_ptr
,
num
*
sizeof
(
png_uint_16p
));
num
*
sizeof
(
png_uint_16p
));
...
@@ -3238,7 +3342,7 @@ png_build_gamma_table(png_structp png_ptr)
...
@@ -3238,7 +3342,7 @@ png_build_gamma_table(png_structp png_ptr)
65535
.
0
,
g
)
*
65535
.
0
+
.
5
);
65535
.
0
,
g
)
*
65535
.
0
+
.
5
);
}
}
}
}
g
=
1
.
0
/
(
png_ptr
->
display
_gamma
);
g
=
1
.
0
/
(
png_ptr
->
screen
_gamma
);
png_ptr
->
gamma_16_from_1
=
(
png_uint_16pp
)
png_malloc
(
png_ptr
,
png_ptr
->
gamma_16_from_1
=
(
png_uint_16pp
)
png_malloc
(
png_ptr
,
num
*
sizeof
(
png_uint_16p
));
num
*
sizeof
(
png_uint_16p
));
...
...
pngrutil.c
浏览文件 @
c4a2ae6c
/* pngrutil.c - utilities to read a PNG file
/* pngrutil.c - utilities to read a PNG file
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*
*
* This file contains routines which are only called from within
* This file contains routines which are only called from within
* libpng itself during the course of reading an image.
* libpng itself during the course of reading an image.
...
@@ -106,7 +106,7 @@ png_crc_finish(png_structp png_ptr, png_uint_32 skip)
...
@@ -106,7 +106,7 @@ png_crc_finish(png_structp png_ptr, png_uint_32 skip)
return
0
;
return
0
;
}
}
/* Compare the CRC stored in the PNG file with that calulated by libpng from
/* Compare the CRC stored in the PNG file with that cal
c
ulated by libpng from
the data it has read thus far. */
the data it has read thus far. */
int
int
png_crc_error
(
png_structp
png_ptr
)
png_crc_error
(
png_structp
png_ptr
)
...
@@ -281,7 +281,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
...
@@ -281,7 +281,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
}
}
num
=
(
int
)
length
/
3
;
num
=
(
int
)
length
/
3
;
palette
=
(
png_colorp
)
png_zalloc
(
png_ptr
,
num
,
sizeof
(
png_color
));
palette
=
(
png_colorp
)
png_zalloc
(
png_ptr
,
(
uInt
)
num
,
sizeof
(
png_color
));
png_ptr
->
flags
|=
PNG_FLAG_FREE_PALETTE
;
png_ptr
->
flags
|=
PNG_FLAG_FREE_PALETTE
;
for
(
i
=
0
;
i
<
num
;
i
++
)
for
(
i
=
0
;
i
<
num
;
i
++
)
{
{
...
@@ -318,7 +318,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
...
@@ -318,7 +318,7 @@ png_handle_PLTE(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
{
{
png_chunk_warning
(
png_ptr
,
"CRC error"
);
png_chunk_warning
(
png_ptr
,
"CRC error"
);
png_ptr
->
flags
&=
~
PNG_FLAG_FREE_PALETTE
;
png_ptr
->
flags
&=
~
PNG_FLAG_FREE_PALETTE
;
png_free
(
png_ptr
,
palette
);
png_
z
free
(
png_ptr
,
palette
);
return
;
return
;
}
}
}
}
...
@@ -404,7 +404,7 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
...
@@ -404,7 +404,7 @@ png_handle_gAMA(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
#if defined(PNG_READ_sRGB_SUPPORTED)
#if defined(PNG_READ_sRGB_SUPPORTED)
if
(
info_ptr
->
valid
&
PNG_INFO_sRGB
)
if
(
info_ptr
->
valid
&
PNG_INFO_sRGB
)
if
(
igamma
!=
(
png_uint_32
)
45
000L
)
if
(
igamma
!=
(
png_uint_32
)
51
000L
)
{
{
png_warning
(
png_ptr
,
png_warning
(
png_ptr
,
"Ignoring incorrect gAMA value when sRGB is also present"
);
"Ignoring incorrect gAMA value when sRGB is also present"
);
...
@@ -626,7 +626,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
...
@@ -626,7 +626,7 @@ png_handle_cHRM(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
void
void
png_handle_sRGB
(
png_structp
png_ptr
,
png_infop
info_ptr
,
png_uint_32
length
)
png_handle_sRGB
(
png_structp
png_ptr
,
png_infop
info_ptr
,
png_uint_32
length
)
{
{
png_byte
intent
;
int
intent
;
png_byte
buf
[
1
];
png_byte
buf
[
1
];
png_debug
(
1
,
"in png_handle_sRGB
\n
"
);
png_debug
(
1
,
"in png_handle_sRGB
\n
"
);
...
@@ -671,7 +671,7 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
...
@@ -671,7 +671,7 @@ png_handle_sRGB(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
#ifdef PNG_READ_gAMA_SUPPORTED
#ifdef PNG_READ_gAMA_SUPPORTED
if
((
info_ptr
->
valid
&
PNG_INFO_gAMA
))
if
((
info_ptr
->
valid
&
PNG_INFO_gAMA
))
if
((
png_uint_32
)(
png_ptr
->
gamma
*
(
float
)
100000
.
+
.
5
)
!=
(
png_uint_32
)
45
000L
)
if
((
png_uint_32
)(
png_ptr
->
gamma
*
(
float
)
100000
.
+
.
5
)
!=
(
png_uint_32
)
51
000L
)
{
{
png_warning
(
png_ptr
,
png_warning
(
png_ptr
,
"Ignoring incorrect gAMA value when sRGB is also present"
);
"Ignoring incorrect gAMA value when sRGB is also present"
);
...
...
pngset.c
浏览文件 @
c4a2ae6c
/* pngset.c - storage of image information into info struct
/* pngset.c - storage of image information into info struct
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*
*
* The functions here are used during reads to store data from the file
* The functions here are used during reads to store data from the file
* into the info struct, and during writes to store application data
* into the info struct, and during writes to store application data
...
@@ -213,18 +213,18 @@ png_set_sBIT(png_structp png_ptr, png_infop info_ptr,
...
@@ -213,18 +213,18 @@ png_set_sBIT(png_structp png_ptr, png_infop info_ptr,
#if defined(PNG_READ_sRGB_SUPPORTED) || defined(PNG_WRITE_sRGB_SUPPORTED)
#if defined(PNG_READ_sRGB_SUPPORTED) || defined(PNG_WRITE_sRGB_SUPPORTED)
void
void
png_set_sRGB
(
png_structp
png_ptr
,
png_infop
info_ptr
,
png_byte
intent
)
png_set_sRGB
(
png_structp
png_ptr
,
png_infop
info_ptr
,
int
intent
)
{
{
png_debug1
(
1
,
"in %s storage function
\n
"
,
"sRGB"
);
png_debug1
(
1
,
"in %s storage function
\n
"
,
"sRGB"
);
if
(
info_ptr
==
NULL
)
if
(
info_ptr
==
NULL
)
return
;
return
;
info_ptr
->
srgb_intent
=
intent
;
info_ptr
->
srgb_intent
=
(
png_byte
)
intent
;
info_ptr
->
valid
|=
PNG_INFO_sRGB
;
info_ptr
->
valid
|=
PNG_INFO_sRGB
;
}
}
void
void
png_set_sRGB_gAMA_and_cHRM
(
png_structp
png_ptr
,
png_infop
info_ptr
,
png_set_sRGB_gAMA_and_cHRM
(
png_structp
png_ptr
,
png_infop
info_ptr
,
png_byte
intent
)
int
intent
)
{
{
#if defined(PNG_READ_gAMA_SUPPORTED) || defined(PNG_WRITE_gAMA_SUPPORTED)
#if defined(PNG_READ_gAMA_SUPPORTED) || defined(PNG_WRITE_gAMA_SUPPORTED)
float
file_gamma
;
float
file_gamma
;
...
@@ -239,7 +239,7 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
...
@@ -239,7 +239,7 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
png_set_sRGB
(
png_ptr
,
info_ptr
,
intent
);
png_set_sRGB
(
png_ptr
,
info_ptr
,
intent
);
#if defined(PNG_READ_gAMA_SUPPORTED) || defined(PNG_WRITE_gAMA_SUPPORTED)
#if defined(PNG_READ_gAMA_SUPPORTED) || defined(PNG_WRITE_gAMA_SUPPORTED)
file_gamma
=
(
float
).
45
;
file_gamma
=
(
float
).
51
;
png_set_gAMA
(
png_ptr
,
info_ptr
,
file_gamma
);
png_set_gAMA
(
png_ptr
,
info_ptr
,
file_gamma
);
#endif
#endif
...
@@ -269,7 +269,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
...
@@ -269,7 +269,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
int
i
;
int
i
;
png_debug1
(
1
,
"in %s storage function
\n
"
,
(
png_ptr
->
chunk_name
[
0
]
==
'\0'
?
png_debug1
(
1
,
"in %s storage function
\n
"
,
(
png_ptr
->
chunk_name
[
0
]
==
'\0'
?
"text"
:
png_ptr
->
chunk_name
));
"text"
:
(
png_const_charp
)
png_ptr
->
chunk_name
));
if
(
info_ptr
==
NULL
||
num_text
==
0
)
if
(
info_ptr
==
NULL
||
num_text
==
0
)
return
;
return
;
...
@@ -308,7 +308,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
...
@@ -308,7 +308,7 @@ png_set_text(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
png_textp
textp
=
&
(
info_ptr
->
text
[
info_ptr
->
num_text
]);
png_textp
textp
=
&
(
info_ptr
->
text
[
info_ptr
->
num_text
]);
if
(
text_ptr
[
i
].
text
==
NULL
)
if
(
text_ptr
[
i
].
text
==
NULL
)
text_ptr
[
i
].
text
=
""
;
text_ptr
[
i
].
text
=
(
png_charp
)
""
;
if
(
text_ptr
[
i
].
text
[
0
]
==
'\0'
)
if
(
text_ptr
[
i
].
text
[
0
]
==
'\0'
)
{
{
...
...
pngtest.c
浏览文件 @
c4a2ae6c
/* pngtest.c - a simple test program to test libpng
/* pngtest.c - a simple test program to test libpng
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*
*
* This program reads in a PNG image, writes it out again, and then
* This program reads in a PNG image, writes it out again, and then
* compares the two files. If the files are identical, this shows that
* compares the two files. If the files are identical, this shows that
...
@@ -37,6 +37,8 @@
...
@@ -37,6 +37,8 @@
#include "png.h"
#include "png.h"
int
test_one_file
(
PNG_CONST
char
*
inname
,
PNG_CONST
char
*
outname
);
#ifdef __TURBOC__
#ifdef __TURBOC__
#include <mem.h>
#include <mem.h>
#endif
#endif
...
@@ -45,10 +47,10 @@
...
@@ -45,10 +47,10 @@
/* #define STDERR stderr */
/* #define STDERR stderr */
#define STDERR stdout
/* for DOS */
#define STDERR stdout
/* for DOS */
#if defined(PNG_NO_STDIO)
/* START of code to validate stdio-free compilation */
/* START of code to validate stdio-free compilation */
/* These copies of the default read/write functions come from pngrio.c and */
/* These copies of the default read/write functions come from pngrio.c and */
/* pngwio.c. They allow "don't include stdio" testing of the library. */
/* pngwio.c. They allow "don't include stdio" testing of the library. */
#if defined(PNG_NO_STDIO)
/* This is the function which does the actual reading of data. If you are
/* This is the function which does the actual reading of data. If you are
not reading from a standard C stream, you should create a replacement
not reading from a standard C stream, you should create a replacement
read_data function and use it at run time with png_set_read_fn(), rather
read_data function and use it at run time with png_set_read_fn(), rather
...
@@ -118,7 +120,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
...
@@ -118,7 +120,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
png_error
(
png_ptr
,
"read Error"
);
png_error
(
png_ptr
,
"read Error"
);
}
}
}
}
#endif
#endif
/* USE_FAR_KEYWORD */
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
#if defined(PNG_WRITE_FLUSH_SUPPORTED)
static
void
static
void
...
@@ -196,7 +198,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
...
@@ -196,7 +198,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
}
}
}
}
#endif
#endif
/* USE_FAR_KEYWORD */
/* This function is called when there is a warning, but the library thinks
/* This function is called when there is a warning, but the library thinks
* it can continue anyway. Replacement functions don't have to do anything
* it can continue anyway. Replacement functions don't have to do anything
...
@@ -224,13 +226,13 @@ png_default_error(png_structp png_ptr, png_const_charp message)
...
@@ -224,13 +226,13 @@ png_default_error(png_structp png_ptr, png_const_charp message)
/* We can return because png_error calls the default handler which is
/* We can return because png_error calls the default handler which is
* actually ok in this case. */
* actually ok in this case. */
}
}
#endif
#endif
/* PNG_NO_STDIO */
/* END of code to validate stdio-free compilation */
/* END of code to validate stdio-free compilation */
/* Test one file */
/* Test one file */
int
test
(
PNG_CONST
char
*
inname
,
PNG_CONST
char
*
outname
)
int
test
_one_file
(
PNG_CONST
char
*
inname
,
PNG_CONST
char
*
outname
)
{
{
FILE
*
fpin
,
*
fpout
;
static
FILE
*
fpin
,
*
fpout
;
/* "static" prevents setjmp corruption */
png_structp
read_ptr
,
write_ptr
;
png_structp
read_ptr
,
write_ptr
;
png_infop
read_info_ptr
,
write_info_ptr
,
end_info_ptr
;
png_infop
read_info_ptr
,
write_info_ptr
,
end_info_ptr
;
png_bytep
row_buf
;
png_bytep
row_buf
;
...
@@ -263,16 +265,18 @@ int test(PNG_CONST char *inname, PNG_CONST char *outname)
...
@@ -263,16 +265,18 @@ int test(PNG_CONST char *inname, PNG_CONST char *outname)
read_ptr
=
png_create_read_struct
(
PNG_LIBPNG_VER_STRING
,
(
png_voidp
)
NULL
,
read_ptr
=
png_create_read_struct
(
PNG_LIBPNG_VER_STRING
,
(
png_voidp
)
NULL
,
(
png_error_ptr
)
NULL
,
(
png_error_ptr
)
NULL
);
(
png_error_ptr
)
NULL
,
(
png_error_ptr
)
NULL
);
#if defined(PNG_NO_STDIO)
#if defined(PNG_NO_STDIO)
png_set_error_fn
(
read_ptr
,
(
png_voidp
)
inname
,
png_default_error
,
png_default_warning
);
png_set_error_fn
(
read_ptr
,
(
png_voidp
)
inname
,
png_default_error
,
png_default_warning
);
#endif
#endif
write_ptr
=
png_create_write_struct
(
PNG_LIBPNG_VER_STRING
,
(
png_voidp
)
NULL
,
write_ptr
=
png_create_write_struct
(
PNG_LIBPNG_VER_STRING
,
(
png_voidp
)
NULL
,
(
png_error_ptr
)
NULL
,
(
png_error_ptr
)
NULL
);
(
png_error_ptr
)
NULL
,
(
png_error_ptr
)
NULL
);
#if defined(PNG_NO_STDIO)
#if defined(PNG_NO_STDIO)
png_set_error_fn
(
write_ptr
,
(
png_voidp
)
inname
,
png_default_error
,
png_default_warning
);
png_set_error_fn
(
write_ptr
,
(
png_voidp
)
inname
,
png_default_error
,
png_default_warning
);
#endif
#endif
png_debug
(
0
,
"Allocating read_info, write_info and end_info structures
\n
"
);
png_debug
(
0
,
"Allocating read_info, write_info and end_info structures
\n
"
);
read_info_ptr
=
png_create_info_struct
(
read_ptr
);
read_info_ptr
=
png_create_info_struct
(
read_ptr
);
write_info_ptr
=
png_create_info_struct
(
read
_ptr
);
write_info_ptr
=
png_create_info_struct
(
write
_ptr
);
end_info_ptr
=
png_create_info_struct
(
read_ptr
);
end_info_ptr
=
png_create_info_struct
(
read_ptr
);
png_debug
(
0
,
"Setting jmpbuf for read struct
\n
"
);
png_debug
(
0
,
"Setting jmpbuf for read struct
\n
"
);
...
@@ -371,7 +375,7 @@ int test(PNG_CONST char *inname, PNG_CONST char *outname)
...
@@ -371,7 +375,7 @@ int test(PNG_CONST char *inname, PNG_CONST char *outname)
#endif
#endif
#if defined(PNG_READ_sRGB_SUPPORTED) && defined(PNG_WRITE_sRGB_SUPPORTED)
#if defined(PNG_READ_sRGB_SUPPORTED) && defined(PNG_WRITE_sRGB_SUPPORTED)
{
{
png_byte
intent
;
int
intent
;
if
(
png_get_sRGB
(
read_ptr
,
read_info_ptr
,
&
intent
))
if
(
png_get_sRGB
(
read_ptr
,
read_info_ptr
,
&
intent
))
{
{
...
@@ -515,14 +519,13 @@ int test(PNG_CONST char *inname, PNG_CONST char *outname)
...
@@ -515,14 +519,13 @@ int test(PNG_CONST char *inname, PNG_CONST char *outname)
png_write_end
(
write_ptr
,
end_info_ptr
);
png_write_end
(
write_ptr
,
end_info_ptr
);
png_debug
(
0
,
"Destroying data structs
\n
"
);
png_debug
(
0
,
"Destroying data structs
\n
"
);
png_free
(
read_ptr
,
row_buf
);
png_destroy_read_struct
(
&
read_ptr
,
&
read_info_ptr
,
&
end_info_ptr
);
png_destroy_read_struct
(
&
read_ptr
,
&
read_info_ptr
,
&
end_info_ptr
);
png_destroy_write_struct
(
&
write_ptr
,
&
write_info_ptr
);
png_destroy_write_struct
(
&
write_ptr
,
&
write_info_ptr
);
fclose
(
fpin
);
fclose
(
fpin
);
fclose
(
fpout
);
fclose
(
fpout
);
png_free
(
read_ptr
,
row_buf
);
png_debug
(
0
,
"Opening files for comparison
\n
"
);
png_debug
(
0
,
"Opening files for comparison
\n
"
);
if
((
fpin
=
fopen
(
inname
,
"rb"
))
==
NULL
)
if
((
fpin
=
fopen
(
inname
,
"rb"
))
==
NULL
)
{
{
...
@@ -576,8 +579,8 @@ int test(PNG_CONST char *inname, PNG_CONST char *outname)
...
@@ -576,8 +579,8 @@ int test(PNG_CONST char *inname, PNG_CONST char *outname)
PNG_CONST
char
*
inname
=
"pngtest_png"
;
PNG_CONST
char
*
inname
=
"pngtest_png"
;
PNG_CONST
char
*
outname
=
"pngout_png"
;
PNG_CONST
char
*
outname
=
"pngout_png"
;
#else
#else
PNG_CONST
char
*
inname
=
"pngtest.png"
;
static
char
*
inname
=
"pngtest.png"
;
PNG_CONST
char
*
outname
=
"pngout.png"
;
static
char
*
outname
=
"pngout.png"
;
#endif
#endif
int
int
...
@@ -608,12 +611,15 @@ main(int argc, char *argv[])
...
@@ -608,12 +611,15 @@ main(int argc, char *argv[])
if
(
!
multiple
&&
argc
==
3
)
if
(
!
multiple
&&
argc
==
3
)
outname
=
argv
[
2
];
outname
=
argv
[
2
];
if
(
!
multiple
&&
argc
>
3
||
multiple
&&
argc
<
2
)
if
(
(
!
multiple
&&
argc
>
3
)
||
(
multiple
&&
argc
<
2
)
)
{
{
fprintf
(
STDERR
,
"usage: %s [infile.png] [outfile.png]
\n\t
%s -m {infile.png}
\n
"
,
fprintf
(
STDERR
,
"usage: %s [infile.png] [outfile.png]
\n\t
%s -m {infile.png}
\n
"
,
argv
[
0
],
argv
[
0
]);
argv
[
0
],
argv
[
0
]);
fprintf
(
STDERR
,
" reads/writes one PNG file (without -m) or multiple files (-m)
\n
"
);
fprintf
(
STDERR
,
fprintf
(
STDERR
,
" with -m %s is used as a temporary file
\n
"
,
outname
);
" reads/writes one PNG file (without -m) or multiple files (-m)
\n
"
);
fprintf
(
STDERR
,
" with -m %s is used as a temporary file
\n
"
,
outname
);
exit
(
1
);
exit
(
1
);
}
}
...
@@ -622,13 +628,29 @@ main(int argc, char *argv[])
...
@@ -622,13 +628,29 @@ main(int argc, char *argv[])
int
i
;
int
i
;
for
(
i
=
2
;
i
<
argc
;
++
i
)
for
(
i
=
2
;
i
<
argc
;
++
i
)
{
{
fprintf
(
STDERR
,
"Testing %s:
\n
"
,
argv
[
i
]);
int
kerror
;
ierror
+=
test
(
argv
[
i
],
outname
);
fprintf
(
STDERR
,
"Testing %s:"
,
argv
[
i
]);
kerror
=
test_one_file
(
argv
[
i
],
outname
);
if
(
kerror
==
0
)
fprintf
(
STDERR
,
" PASS
\n
"
);
else
{
fprintf
(
STDERR
,
" FAIL
\n
"
);
ierror
+=
kerror
;
}
}
}
}
}
else
else
{
{
ierror
+=
test
(
inname
,
outname
);
int
i
;
for
(
i
=
0
;
i
<
3
;
++
i
)
{
int
kerror
;
fprintf
(
STDERR
,
"Testing %s:"
,
inname
);
kerror
=
test_one_file
(
inname
,
outname
);
if
(
kerror
==
0
)
fprintf
(
STDERR
,
" PASS
\n
"
);
else
{
fprintf
(
STDERR
,
" FAIL
\n
"
);
ierror
+=
kerror
;
}
}
}
}
if
(
ierror
==
0
)
if
(
ierror
==
0
)
...
...
pngtrans.c
浏览文件 @
c4a2ae6c
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*/
*/
#define PNG_INTERNAL
#define PNG_INTERNAL
...
@@ -118,6 +118,16 @@ png_set_swap_alpha(png_structp png_ptr)
...
@@ -118,6 +118,16 @@ png_set_swap_alpha(png_structp png_ptr)
}
}
#endif
#endif
#if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \
defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
void
png_set_invert_alpha
(
png_structp
png_ptr
)
{
png_debug
(
1
,
"in png_set_invert_alpha
\n
"
);
png_ptr
->
transformations
|=
PNG_INVERT_ALPHA
;
}
#endif
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
#if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED)
void
void
png_set_invert_mono
(
png_structp
png_ptr
)
png_set_invert_mono
(
png_structp
png_ptr
)
...
...
pngwio.c
浏览文件 @
c4a2ae6c
/* pngwio.c - functions for data output
/* pngwio.c - functions for data output
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*
*
* This file provides a location for all output. Users which need
* This file provides a location for all output. Users which need
* special handling are expected to write functions which have the same
* special handling are expected to write functions which have the same
...
...
pngwrite.c
浏览文件 @
c4a2ae6c
/* pngwrite.c - general routines to write a PNG file
/* pngwrite.c - general routines to write a PNG file
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*/
*/
/* get internal access to png.h */
/* get internal access to png.h */
...
@@ -43,7 +43,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
...
@@ -43,7 +43,7 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
#endif
#endif
#if defined(PNG_WRITE_sRGB_SUPPORTED)
#if defined(PNG_WRITE_sRGB_SUPPORTED)
if
(
info_ptr
->
valid
&
PNG_INFO_sRGB
)
if
(
info_ptr
->
valid
&
PNG_INFO_sRGB
)
png_write_sRGB
(
png_ptr
,
info_ptr
->
srgb_intent
);
png_write_sRGB
(
png_ptr
,
(
int
)
info_ptr
->
srgb_intent
);
#endif
#endif
#if defined(PNG_WRITE_sBIT_SUPPORTED)
#if defined(PNG_WRITE_sBIT_SUPPORTED)
if
(
info_ptr
->
valid
&
PNG_INFO_sBIT
)
if
(
info_ptr
->
valid
&
PNG_INFO_sBIT
)
...
@@ -62,10 +62,23 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
...
@@ -62,10 +62,23 @@ png_write_info(png_structp png_ptr, png_infop info_ptr)
(
png_uint_32
)
info_ptr
->
num_palette
);
(
png_uint_32
)
info_ptr
->
num_palette
);
else
if
(
info_ptr
->
color_type
==
PNG_COLOR_TYPE_PALETTE
)
else
if
(
info_ptr
->
color_type
==
PNG_COLOR_TYPE_PALETTE
)
png_error
(
png_ptr
,
"Valid palette required for paletted images
\n
"
);
png_error
(
png_ptr
,
"Valid palette required for paletted images
\n
"
);
#if defined(PNG_WRITE_tRNS_SUPPORTED)
#if defined(PNG_WRITE_tRNS_SUPPORTED)
if
(
info_ptr
->
valid
&
PNG_INFO_tRNS
)
if
(
info_ptr
->
valid
&
PNG_INFO_tRNS
)
{
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
/* invert the alpha channel (in tRNS) */
if
(
png_ptr
->
transformations
&
PNG_INVERT_ALPHA
&&
info_ptr
->
color_type
==
PNG_COLOR_TYPE_PALETTE
)
{
int
i
;
for
(
i
=
0
;
i
<
info_ptr
->
num_trans
;
i
++
)
info_ptr
->
trans
[
i
]
=
255
-
info_ptr
->
trans
[
i
];
}
#endif
png_write_tRNS
(
png_ptr
,
info_ptr
->
trans
,
&
(
info_ptr
->
trans_values
),
png_write_tRNS
(
png_ptr
,
info_ptr
->
trans
,
&
(
info_ptr
->
trans_values
),
info_ptr
->
num_trans
,
info_ptr
->
color_type
);
info_ptr
->
num_trans
,
info_ptr
->
color_type
);
}
#endif
#endif
#if defined(PNG_WRITE_bKGD_SUPPORTED)
#if defined(PNG_WRITE_bKGD_SUPPORTED)
if
(
info_ptr
->
valid
&
PNG_INFO_bKGD
)
if
(
info_ptr
->
valid
&
PNG_INFO_bKGD
)
...
@@ -200,12 +213,12 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
...
@@ -200,12 +213,12 @@ png_write_end(png_structp png_ptr, png_infop info_ptr)
png_write_IEND
(
png_ptr
);
png_write_IEND
(
png_ptr
);
}
}
#if defined(PNG_TIME_RFC11
52
_SUPPORTED)
#if defined(PNG_TIME_RFC11
23
_SUPPORTED)
/* Convert the supplied time into an RFC 11
52
string suitable for use in
/* Convert the supplied time into an RFC 11
23
string suitable for use in
* a "Creation Time" or other text-based time string.
* a "Creation Time" or other text-based time string.
*/
*/
png_charp
png_charp
png_convert_to_rfc11
52
(
png_structp
png_ptr
,
png_timep
ptime
)
png_convert_to_rfc11
23
(
png_structp
png_ptr
,
png_timep
ptime
)
{
{
const
char
*
short_months
[
12
]
=
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
const
char
*
short_months
[
12
]
=
{
"Jan"
,
"Feb"
,
"Mar"
,
"Apr"
,
"May"
,
"Jun"
,
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
};
"Jul"
,
"Aug"
,
"Sep"
,
"Oct"
,
"Nov"
,
"Dec"
};
...
@@ -233,7 +246,7 @@ png_convert_to_rfc1152(png_structp png_ptr, png_timep ptime)
...
@@ -233,7 +246,7 @@ png_convert_to_rfc1152(png_structp png_ptr, png_timep ptime)
#endif
#endif
return
png_ptr
->
time_buffer
;
return
png_ptr
->
time_buffer
;
}
}
#endif
/* PNG_TIME_RFC11
52
_SUPPORTED */
#endif
/* PNG_TIME_RFC11
23
_SUPPORTED */
#if defined(PNG_WRITE_tIME_SUPPORTED)
#if defined(PNG_WRITE_tIME_SUPPORTED)
void
void
...
@@ -582,6 +595,19 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
...
@@ -582,6 +595,19 @@ png_destroy_write_struct(png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)
{
{
#ifdef PNG_WRITE_tEXt_SUPPORTED
#ifdef PNG_WRITE_tEXt_SUPPORTED
png_free
(
png_ptr
,
info_ptr
->
text
);
png_free
(
png_ptr
,
info_ptr
->
text
);
#endif
#if defined(PNG_READ_pCAL_SUPPORTED)
png_free
(
png_ptr
,
info_ptr
->
pcal_purpose
);
png_free
(
png_ptr
,
info_ptr
->
pcal_units
);
if
(
info_ptr
->
pcal_params
!=
NULL
)
{
int
i
;
for
(
i
=
0
;
i
<
info_ptr
->
pcal_nparams
;
i
++
)
{
png_free
(
png_ptr
,
info_ptr
->
pcal_params
[
i
]);
}
png_free
(
png_ptr
,
info_ptr
->
pcal_params
);
}
#endif
#endif
png_destroy_struct
((
png_voidp
)
info_ptr
);
png_destroy_struct
((
png_voidp
)
info_ptr
);
*
info_ptr_ptr
=
(
png_infop
)
NULL
;
*
info_ptr_ptr
=
(
png_infop
)
NULL
;
...
@@ -617,9 +643,9 @@ png_write_destroy(png_structp png_ptr)
...
@@ -617,9 +643,9 @@ png_write_destroy(png_structp png_ptr)
png_free
(
png_ptr
,
png_ptr
->
up_row
);
png_free
(
png_ptr
,
png_ptr
->
up_row
);
png_free
(
png_ptr
,
png_ptr
->
avg_row
);
png_free
(
png_ptr
,
png_ptr
->
avg_row
);
png_free
(
png_ptr
,
png_ptr
->
paeth_row
);
png_free
(
png_ptr
,
png_ptr
->
paeth_row
);
#if defined(PNG_TIME_RFC11
52
_SUPPORTED)
#if defined(PNG_TIME_RFC11
23
_SUPPORTED)
png_free
(
png_ptr
,
png_ptr
->
time_buffer
);
png_free
(
png_ptr
,
png_ptr
->
time_buffer
);
#endif
/* PNG_TIME_RFC11
52
_SUPPORTED */
#endif
/* PNG_TIME_RFC11
23
_SUPPORTED */
#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
#if defined(PNG_WRITE_WEIGHTED_FILTER_SUPPORTED)
png_free
(
png_ptr
,
png_ptr
->
prev_filters
);
png_free
(
png_ptr
,
png_ptr
->
prev_filters
);
png_free
(
png_ptr
,
png_ptr
->
filter_weights
);
png_free
(
png_ptr
,
png_ptr
->
filter_weights
);
...
...
pngwtran.c
浏览文件 @
c4a2ae6c
/* pngwtran.c - transforms the data in a row for PNG writers
/* pngwtran.c - transforms the data in a row for PNG writers
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*/
*/
#define PNG_INTERNAL
#define PNG_INTERNAL
...
@@ -42,6 +42,10 @@ png_do_write_transformations(png_structp png_ptr)
...
@@ -42,6 +42,10 @@ png_do_write_transformations(png_structp png_ptr)
if
(
png_ptr
->
transformations
&
PNG_SWAP_ALPHA
)
if
(
png_ptr
->
transformations
&
PNG_SWAP_ALPHA
)
png_do_write_swap_alpha
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
png_do_write_swap_alpha
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
#endif
#endif
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
if
(
png_ptr
->
transformations
&
PNG_INVERT_ALPHA
)
png_do_write_invert_alpha
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
#endif
#if defined(PNG_WRITE_BGR_SUPPORTED)
#if defined(PNG_WRITE_BGR_SUPPORTED)
if
(
png_ptr
->
transformations
&
PNG_BGR
)
if
(
png_ptr
->
transformations
&
PNG_BGR
)
png_do_bgr
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
png_do_bgr
(
&
(
png_ptr
->
row_info
),
png_ptr
->
row_buf
+
1
);
...
@@ -394,3 +398,79 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
...
@@ -394,3 +398,79 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row)
}
}
#endif
#endif
#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED)
void
png_do_write_invert_alpha
(
png_row_infop
row_info
,
png_bytep
row
)
{
png_debug
(
1
,
"in png_do_write_invert_alpha
\n
"
);
#if defined(PNG_USELESS_TESTS_SUPPORTED)
if
(
row
!=
NULL
&&
row_info
!=
NULL
)
#endif
{
if
(
row_info
->
color_type
==
PNG_COLOR_TYPE_RGB_ALPHA
)
{
/* This inverts the alpha channel in RGBA */
if
(
row_info
->
bit_depth
==
8
)
{
png_bytep
sp
,
dp
;
png_uint_32
i
;
for
(
i
=
0
,
sp
=
dp
=
row
;
i
<
row_info
->
width
;
i
++
)
{
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
255
-
*
(
sp
++
);
}
}
/* This inverts the alpha channel in RRGGBBAA */
else
{
png_bytep
sp
,
dp
;
png_uint_32
i
;
for
(
i
=
0
,
sp
=
dp
=
row
;
i
<
row_info
->
width
;
i
++
)
{
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
255
-
*
(
sp
++
);
*
(
dp
++
)
=
255
-
*
(
sp
++
);
}
}
}
else
if
(
row_info
->
color_type
==
PNG_COLOR_TYPE_GRAY_ALPHA
)
{
/* This inverts the alpha channel in GA */
if
(
row_info
->
bit_depth
==
8
)
{
png_bytep
sp
,
dp
;
png_uint_32
i
;
for
(
i
=
0
,
sp
=
dp
=
row
;
i
<
row_info
->
width
;
i
++
)
{
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
255
-
*
(
sp
++
);
}
}
/* This inverts the alpha channel in GGAA */
else
{
png_bytep
sp
,
dp
;
png_uint_32
i
;
for
(
i
=
0
,
sp
=
dp
=
row
;
i
<
row_info
->
width
;
i
++
)
{
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
*
(
sp
++
);
*
(
dp
++
)
=
255
-
*
(
sp
++
);
*
(
dp
++
)
=
255
-
*
(
sp
++
);
}
}
}
}
}
#endif
pngwutil.c
浏览文件 @
c4a2ae6c
/* pngwutil.c - utilities to write a PNG file
/* pngwutil.c - utilities to write a PNG file
*
*
* libpng 0.9
7
* libpng 0.9
8
* 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) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1996, 1997 Andreas Dilger
* Copyright (c) 1998, Glenn Randers-Pehrson
* Copyright (c) 1998, Glenn Randers-Pehrson
* January
7
, 1998
* January
16
, 1998
*/
*/
#define PNG_INTERNAL
#define PNG_INTERNAL
...
@@ -346,7 +346,7 @@ png_write_gAMA(png_structp png_ptr, double file_gamma)
...
@@ -346,7 +346,7 @@ png_write_gAMA(png_structp png_ptr, double file_gamma)
#if defined(PNG_WRITE_sRGB_SUPPORTED)
#if defined(PNG_WRITE_sRGB_SUPPORTED)
/* write a sRGB chunk */
/* write a sRGB chunk */
void
void
png_write_sRGB
(
png_structp
png_ptr
,
png_byte
srgb_intent
)
png_write_sRGB
(
png_structp
png_ptr
,
int
srgb_intent
)
{
{
png_byte
buf
[
1
];
png_byte
buf
[
1
];
...
@@ -354,7 +354,7 @@ png_write_sRGB(png_structp png_ptr, png_byte srgb_intent)
...
@@ -354,7 +354,7 @@ png_write_sRGB(png_structp png_ptr, png_byte srgb_intent)
if
(
srgb_intent
>
3
)
if
(
srgb_intent
>
3
)
png_warning
(
png_ptr
,
png_warning
(
png_ptr
,
"Invalid sRGB rendering intent specified"
);
"Invalid sRGB rendering intent specified"
);
buf
[
0
]
=
srgb_intent
;
buf
[
0
]
=
(
png_byte
)
srgb_intent
;
png_write_chunk
(
png_ptr
,
png_sRGB
,
buf
,
(
png_size_t
)
1
);
png_write_chunk
(
png_ptr
,
png_sRGB
,
buf
,
(
png_size_t
)
1
);
}
}
#endif
#endif
...
@@ -506,7 +506,7 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
...
@@ -506,7 +506,7 @@ png_write_tRNS(png_structp png_ptr, png_bytep trans, png_color_16p tran,
}
}
else
else
{
{
png_warning
(
png_ptr
,
"Can't write tRNS with an
d
alpha channel"
);
png_warning
(
png_ptr
,
"Can't write tRNS with an alpha channel"
);
}
}
}
}
#endif
#endif
...
@@ -992,6 +992,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
...
@@ -992,6 +992,7 @@ png_write_pCAL(png_structp png_ptr, png_charp purpose, png_int_32 X0,
(
png_size_t
)
params_len
[
i
]);
(
png_size_t
)
params_len
[
i
]);
}
}
png_free
(
png_ptr
,
params_len
);
png_write_chunk_end
(
png_ptr
);
png_write_chunk_end
(
png_ptr
);
}
}
#endif
#endif
...
@@ -1395,7 +1396,7 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
...
@@ -1395,7 +1396,7 @@ png_write_find_filter(png_structp png_ptr, png_row_infop row_info)
* smallest value when summing the absolute values of the distances
* smallest value when summing the absolute values of the distances
* from zero using anything >= 128 as negative numbers. This is known
* from zero using anything >= 128 as negative numbers. This is known
* as the "minimum sum of absolute differences" heuristic. Other
* as the "minimum sum of absolute differences" heuristic. Other
* he
ru
istics are the "weighted minumum sum of absolute differences"
* he
ur
istics are the "weighted minumum sum of absolute differences"
* (experimental and can in theory improve compression), and the "zlib
* (experimental and can in theory improve compression), and the "zlib
* predictive" method (not implemented in libpng 0.95), which does test
* predictive" method (not implemented in libpng 0.95), which does test
* compressions of lines using different filter methods, and then chooses
* compressions of lines using different filter methods, and then chooses
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录