Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
e3e8f6bf
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e3e8f6bf
编写于
4月 28, 2010
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[devel] Revised contrib/pngminim to use the "everything off" option
in pngusr.dfa.
上级
cd745498
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
447 addition
and
289 deletion
+447
-289
ANNOUNCE
ANNOUNCE
+1
-0
CHANGES
CHANGES
+1
-0
contrib/pngminim/decoder/README
contrib/pngminim/decoder/README
+5
-4
contrib/pngminim/decoder/gather.sh
contrib/pngminim/decoder/gather.sh
+0
-15
contrib/pngminim/decoder/makefile
contrib/pngminim/decoder/makefile
+107
-18
contrib/pngminim/decoder/pngusr.dfa
contrib/pngminim/decoder/pngusr.dfa
+27
-0
contrib/pngminim/decoder/pngusr.h
contrib/pngminim/decoder/pngusr.h
+10
-57
contrib/pngminim/encoder/README
contrib/pngminim/encoder/README
+5
-4
contrib/pngminim/encoder/dummy_inflate.c
contrib/pngminim/encoder/dummy_inflate.c
+0
-22
contrib/pngminim/encoder/gather.sh
contrib/pngminim/encoder/gather.sh
+0
-17
contrib/pngminim/encoder/makefile
contrib/pngminim/encoder/makefile
+105
-9
contrib/pngminim/encoder/pngusr.dfa
contrib/pngminim/encoder/pngusr.dfa
+24
-0
contrib/pngminim/encoder/pngusr.h
contrib/pngminim/encoder/pngusr.h
+10
-57
contrib/pngminim/preader/README
contrib/pngminim/preader/README
+5
-4
contrib/pngminim/preader/gather.sh
contrib/pngminim/preader/gather.sh
+0
-18
contrib/pngminim/preader/makefile
contrib/pngminim/preader/makefile
+108
-14
contrib/pngminim/preader/pngusr.dfa
contrib/pngminim/preader/pngusr.dfa
+29
-0
contrib/pngminim/preader/pngusr.h
contrib/pngminim/preader/pngusr.h
+10
-50
未找到文件。
ANNOUNCE
浏览文件 @
e3e8f6bf
...
...
@@ -200,6 +200,7 @@ version 1.5.0beta22 [April 28, 2010]
Fixed dependencies of GET_INT_32 - it does not require READ_INT_FUNCTIONS
because it has a macro equivalent.
Improved the options.awk script; added an "everything off" option.
Revised contrib/pngminim to use the "everything off" option in pngusr.dfa.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit
...
...
CHANGES
浏览文件 @
e3e8f6bf
...
...
@@ -2682,6 +2682,7 @@ version 1.5.0beta22 [April 28, 2010]
Fixed dependencies of GET_INT_32 - it does not require READ_INT_FUNCTIONS
because it has a macro equivalent.
Improved the options.awk script; added an "everything off" option.
Revised contrib/pngminim to use the "everything off" option in pngusr.dfa.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
...
...
contrib/pngminim/decoder/README
浏览文件 @
e3e8f6bf
This demonstrates the use of PNG_USER_CONFIG
and pngusr.h
This demonstrates the use of PNG_USER_CONFIG
, pngusr.h and pngusr.dfa
To build a minimal read-only decoder with embedded libpng and zlib, run
The makefile builds a minimal read-only decoder with embedded libpng
and zlib.
gather.sh # to collect needed files from pngminus, libpng, and zlib
make
Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
on the make command line.
If you prefer to use the shared libraries, go to contrib/pngminus
and build the png2pnm application there.
contrib/pngminim/decoder/gather.sh
浏览文件 @
e3e8f6bf
test
-n
"
${
PNGSRC
}
"
||
PNGSRC
=
../../..
cp
${
PNGSRC
}
/contrib/pngminus/png2pnm.c pngm2pnm.c
cp
"
${
PNGSRC
}
"
/
*
.h
.
cp
"
${
PNGSRC
}
"
/
*
.c
.
rm
example.c pngtest.c pngpread.c pngw
*
.c
rm
-f
pnglibconf.h
test
-d
scripts
||
mkdir
scripts
cp
"
${
PNGSRC
}
"
/scripts/pnglibconf.mak scripts
cp
"
${
PNGSRC
}
"
/scripts/pnglibconf.dfa scripts
cp
"
${
PNGSRC
}
"
/scripts/options.awk scripts
# change the following if zlib is somewhere else
test
-n
"
${
ZLIBSRC
}
"
||
ZLIBSRC
=
"
${
PNGSRC
}
"
/../zlib
cp
"
${
ZLIBSRC
}
"
/
*
.h
.
cp
"
${
ZLIBSRC
}
"
/
*
.c
.
rm
minigzip.c example.c compress.c deflate.c gz
*
contrib/pngminim/decoder/makefile
浏览文件 @
e3e8f6bf
...
...
@@ -4,24 +4,73 @@
#CC=cc
CC
=
gcc
LD
=
$(CC)
STRIP
=
strip
RM
=
rm
-f
COPY
=
cp
CFLAGS
=
-DPNG_USER_CONFIG
-DNO_GZCOMPRESS
-DNO_GZIP
\
-DdeflateParams
\(
a,b,c
\)
=
Z_OK
-I
.
-O1
CFLAGS
=
-DPNG_USER_CONFIG
-DNO_GZCOMPRESS
-DNO_GZIP
-I
.
-O1
C
=
.c
O
=
.o
L
=
.a
E
=
# Where to find the source code:
PNGSRC
=
../../..
ZLIBSRC
=
$(PNGSRC)
/../zlib
PROGSRC
=
$(PNGSRC)
/contrib/pngminus
# Zlib (minimal inflate requirements - crc32 is used by libpng)
# zutil can be eliminated if you provide your own zcalloc and zcfree
ZSRCS
=
adler32
$(C)
crc32
$(C)
\
inffast
$(C)
inflate
$(C)
inftrees
$(C)
\
zutil
$(C)
# Standard headers
ZH
=
zlib.h crc32.h inffast.h inffixed.h
\
inflate.h inftrees.h zutil.h
# Machine generated headers
ZCONF
=
zconf.h
# Headers callers use
ZINC
=
zlib.h
$(ZCONF)
# Headers the Zlib source uses
ZHDRS
=
$(ZH)
$(ZCONF)
ZOBJS
=
adler32
$(O)
crc32
$(O)
\
infback
$(O)
inffast
$(O)
inflate
$(O)
inftrees
$(O)
\
trees
$(O)
uncompr
$(O)
zutil
$(O)
inffast
$(O)
inflate
$(O)
inftrees
$(O)
\
zutil
$(O)
# libpng
PNGSRCS
=
png
$(C)
pngerror
$(C)
pngget
$(C)
pngmem
$(C)
\
pngread
$(C)
pngrio
$(C)
pngrtran
$(C)
pngrutil
$(C)
\
pngset
$(C)
pngtrans
$(C)
# Standard headres
PNGH
=
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
# Machine generated headers
PNGCONF
=
pnglibconf.h
OBJS
=
pngm2pnm
$(O)
png
$(O)
pngerror
$(O)
pngget
$(O)
pngmem
$(O)
\
# Headers callers use
PNGINC
=
png.h pngconf.h pngusr.h
$(PNGCONF)
# Headers the PNG library uses
PNGHDRS
=
$(PNGH)
$(PNGCONF)
pngusr.h
PNGOBJS
=
png
$(O)
pngerror
$(O)
pngget
$(O)
pngmem
$(O)
\
pngread
$(O)
pngrio
$(O)
pngrtran
$(O)
pngrutil
$(O)
\
pngset
$(O)
pngtrans
$(O)
$(ZOBJS)
pngset
$(O)
pngtrans
$(O)
PROGSRCS
=
pngm2pnm
$(C)
PROGHDRS
=
PROGDOCS
=
PROGOBJS
=
pngm2pnm
$(O)
OBJS
=
$(PROGOBJS)
$(PNGOBJS)
$(ZOBJS)
# implicit make rules -------------------------------------------------------
...
...
@@ -35,23 +84,63 @@ all: pngm2pnm$(E)
pngm2pnm$(E)
:
$(OBJS)
$(LD)
-o
pngm2pnm
$(E)
$(OBJS)
strip pngm2pnm
$(E)
pnglibconf.h
:
scripts/pnglibconf.mak scripts/pnglibconf.dfa
\
scripts/options.awk pngusr.h
rm
-f
pnglibconf.h
$(MAKE)
$(MAKEFLAGS)
-f
scripts/pnglibconf.mak\
CPPFLAGS
=
-DPNG_USER_CONFIG
$@
$(STRIP)
pngm2pnm
$(E)
# The DFA_XTRA setting turns all libpng options off then
# turns on those required for this minimal build.
# The CPP_FLAGS setting causes pngusr.h to be included in
# both the build of pnglibconf.h and, subsequently, when
# building libpng itself.
$(PNGCONF)
:
$(PNGSRC)/scripts/pnglibconf.mak
\
$(PNGSRC)/scripts/pnglibconf.dfa
\
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
$(RM)
pnglibconf.h pnglibconf.dfn
$(MAKE)
$(MAKEFLAGS)
-f
$(PNGSRC)
/scripts/pnglibconf.mak
\
srcdir
=
$(PNGSRC)
CPPFLAGS
=
"-DPNG_USER_CONFIG"
\
DFA_XTRA
=
"pngusr.dfa"
$@
clean
:
$(MAKE)
$(MAKEFLAGS)
-f
scripts/pnglibconf.mak clean
$(MAKE)
$(MAKEFLAGS)
-f
$(PNGSRC)
/scripts/pnglibconf.mak
\
srcdir
=
$(PNGSRC)
clean
$(RM)
pngm2pnm
$(O)
$(RM)
pngm2pnm
$(E)
$(RM)
$(OBJS)
$(OBJS)
:
png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h
\
pnginfo.h pngdebug.h zlib.h
# distclean also removes the copied source and headers
distclean
:
clean
$(RM)
-r
scripts
# historical reasons
$(RM)
$(PNGSRCS)
$(PNGH)
$(RM)
$(ZSRCS)
$(ZH)
$(ZCONF)
$(RM)
$(PROGSRCS)
$(PROGHDRS)
$(PROGDOCS)
# Header file dependencies:
$(PROGOBJS)
:
$(PROGHDRS) $(PNGINC) $(ZINC)
$(PNGOBJS)
:
$(PNGHDRS) $(ZINC)
$(ZOBJS)
:
$(ZHDRS)
# Gather the source code from the respective directories
$(PNGSRCS) $(PNGH)
:
$(PNGSRC)/$@
$(RM)
$@
$(COPY)
$(PNGSRC)
/
$@
$@
# No dependency on the ZLIBSRC target so that it only needs
# to be specified once.
$(ZSRCS) $(ZH)
:
$(RM)
$@
$(COPY)
$(ZLIBSRC)
/
$@
$@
# The unconfigured zconf.h varies in name according to the
# zlib release
$(ZCONF)
:
$(RM)
$@
@
for
f
in
zconf.h.in zconf.in.h zconf.h
;
do
\
test
-r
$(ZLIBSRC)
/
$$
f
&&
\
echo
$(COPY)
$(ZLIBSRC)
/
$$
f
$@
&&
\
$(COPY)
$(ZLIBSRC)
/
$$
f
$@
&&
exit
0
;
\
done
;
echo
copy:
$(ZLIBSRC)
/zconf.h not found
;
exit
1
pngm2pnm.c
:
$(PROGSRC)/png2pnm.c
$(RM)
$@
$(COPY)
$(PROGSRC)
/png2pnm.c
$@
# End of makefile for pngm2pnm
contrib/pngminim/decoder/pngusr.dfa
0 → 100644
浏览文件 @
e3e8f6bf
# pngminim/decoder/pngusr.dfa
#
# Copyright (c) 2010 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# First all the build options off:
everything = off
# All that is required is some read code. This example switches
# on the sequential read code (see ../preader for a progressive
# read example).
option SEQUENTIAL_READ on
# You must choose fixed or floating point arithmetic:
option FLOATING_POINT on
# option FIXED_POINT on
# Your program will probably need other options. The example
# program here, pngm2pnm, requires the following. Take a look
# at pnglibconf.h to find out the full set of what has to be
# enabled to make the following work.
option SETJMP on
option STDIO on
option READ_EXPAND on
contrib/pngminim/decoder/pngusr.h
浏览文件 @
e3e8f6bf
...
...
@@ -16,64 +16,17 @@
/* No 16-bit support beyond reading with strip_16 */
#endif
#define PNG_USER_PRIVATEBUILD "PNG minimal build"
#define PNG_USER_DLLFNAME_POSTFIX "MN"
/* If pngusr.h is included during the build the following must
* be defined either here or in the .dfa file (pngusr.dfa in
* this case). To include pngusr.h set -DPNG_USER_CONFIG in
* CPPFLAGS
*/
#define PNG_USER_PRIVATEBUILD "libpng minimal conformant PNG decoder"
#define PNG_USER_DLLFNAME_POSTFIX "mr"
/* List options to turn off features of the build that do not
* affect the API (so are not recorded in pnglibconf.h)
*/
#define PNG_NO_WARNINGS
#define PNG_NO_ERROR_TEXT
#define PNG_NO_READ_INT_FUNCTIONS
#define PNG_NO_READ_BGR
#define PNG_NO_READ_GAMMA
#define PNG_NO_READ_BACKGROUND
#define PNG_NO_READ_QUANTIZE
#define PNG_NO_READ_INVERT
#define PNG_NO_READ_SHIFT
#define PNG_NO_READ_PACK
#define PNG_NO_READ_PACKSWAP
#define PNG_NO_READ_FILLER
#define PNG_NO_READ_SWAP
#define PNG_NO_READ_SWAP_ALPHA
#define PNG_NO_READ_INVERT_ALPHA
#define PNG_NO_READ_RGB_TO_GRAY
#define PNG_NO_READ_USER_TRANSFORM
#define PNG_NO_READ_bKGD
#define PNG_NO_READ_cHRM
#define PNG_NO_READ_gAMA
#define PNG_NO_READ_hIST
#define PNG_NO_READ_iCCP
#define PNG_NO_READ_pCAL
#define PNG_NO_READ_pHYs
#define PNG_NO_READ_sBIT
#define PNG_NO_READ_sCAL
#define PNG_NO_READ_sPLT
#define PNG_NO_READ_sRGB
#define PNG_NO_READ_TEXT
#define PNG_NO_READ_tIME
#define PNG_NO_READ_UNKNOWN_CHUNKS
#define PNG_NO_READ_USER_CHUNKS
#define PNG_NO_READ_EMPTY_PLTE
#define PNG_NO_READ_OPT_PLTE
#define PNG_NO_READ_STRIP_ALPHA
#define PNG_NO_READ_oFFs
#define PNG_NO_WRITE_SUPPORTED
#define PNG_NO_INFO_IMAGE
#define PNG_NO_IO_STATE
#define PNG_NO_USER_MEM
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_MNG_FEATURES
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_HANDLE_AS_UNKNOWN
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_PROGRESSIVE_READ
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
#define PNG_NO_TIME_RFC1123
#endif
/* MINRDPNGCONF_H */
contrib/pngminim/encoder/README
浏览文件 @
e3e8f6bf
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
To build a minimal write-only decoder with embedded libpng and zlib, run
The makefile builds a minimal write-only decoder with embedded libpng
and zlib.
Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
on the make command line.
gather.sh # to collect needed files from pngminus, libpng, and zlib
make
If you prefer to use the shared libraries, go to contrib/pngminus
and build the pnm2png application there.
contrib/pngminim/encoder/dummy_inflate.c
浏览文件 @
e3e8f6bf
#include "zlib.h"
int
ZEXPORT
inflate
(
strm
,
flush
)
z_streamp
strm
;
int
flush
;
{
return
Z_OK
;
}
int
ZEXPORT
inflateReset
(
strm
)
z_streamp
strm
;
{
return
Z_OK
;
}
int
ZEXPORT
inflateEnd
(
strm
)
z_streamp
strm
;
{
return
Z_STREAM_ERROR
;
}
int
ZEXPORT
inflateInit_
(
strm
,
version
,
stream_size
)
z_streamp
strm
;
const
char
*
version
;
int
stream_size
;
{
return
Z_OK
;
}
int
ZEXPORT
inflateInit2_
(
strm
,
windowBits
,
version
,
stream_size
)
z_streamp
strm
;
int
windowBits
;
const
char
*
version
;
int
stream_size
;
{
return
Z_STREAM_ERROR
;
}
contrib/pngminim/encoder/gather.sh
浏览文件 @
e3e8f6bf
test
-n
"
${
PNGSRC
}
"
||
PNGSRC
=
../../..
cp
${
PNGSRC
}
/contrib/pngminus/pnm2png.c pnm2pngm.c
cp
"
${
PNGSRC
}
"
/
*
.h
.
cp
"
${
PNGSRC
}
"
/
*
.c
.
rm
example.c pngtest.c pngr
*
.c pngpread.c
rm
-f
pnglibconf.h
test
-d
scripts
||
mkdir
scripts
cp
"
${
PNGSRC
}
"
/scripts/pnglibconf.mak scripts
cp
"
${
PNGSRC
}
"
/scripts/pnglibconf.dfa scripts
cp
"
${
PNGSRC
}
"
/scripts/options.awk scripts
# change the following if zlib is somewhere else
test
-n
"
${
ZLIBSRC
}
"
||
ZLIBSRC
=
"
${
PNGSRC
}
"
/../zlib
cp
"
${
ZLIBSRC
}
"
/
*
.h
.
cp
"
${
ZLIBSRC
}
"
/
*
.c
.
rm
inf
*
.[ch]
rm
minigzip.c example.c gz
*
contrib/pngminim/encoder/makefile
浏览文件 @
e3e8f6bf
...
...
@@ -4,8 +4,10 @@
#CC=cc
CC
=
gcc
LD
=
$(CC)
STRIP
=
strip
RM
=
rm
-f
COPY
=
cp
CFLAGS
=
-DPNG_USER_CONFIG
-DNO_GZIP
-I
.
-O1
...
...
@@ -14,13 +16,62 @@ O=.o
L
=
.a
E
=
# Where to find the source code:
PNGSRC
=
../../..
ZLIBSRC
=
$(PNGSRC)
/../zlib
PROGSRC
=
$(PNGSRC)
/contrib/pngminus
# Zlib
ZSRCS
=
adler32
$(C)
compress
$(C)
crc32
$(C)
deflate
$(C)
\
trees
$(C)
zutil
$(C)
# Standard headers
#ZH = zlib.h crc32.h deflate.h trees.h zutil.h
ZH
=
zlib.h crc32.h deflate.h trees.h zutil.h
# Machine generated headers
ZCONF
=
zconf.h
# Headers callers use
ZINC
=
zlib.h
$(ZCONF)
# Headers the Zlib source uses
ZHDRS
=
$(ZH)
$(ZCONF)
# compress is not required; it is needed to link the zlib
# code because deflate defines an unused API function deflateBound
# which itself calls compressBound from compress.
ZOBJS
=
adler32
$(O)
compress
$(O)
crc32
$(O)
deflate
$(O)
\
dummy_inflate
$(O)
\
trees
$(O)
uncompr
$(O)
zutil
$(O)
trees
$(O)
zutil
$(O)
# libpng
PNGSRCS
=
png
$(C)
pngerror
$(C)
pngget
$(C)
pngmem
$(C)
\
pngset
$(C)
pngtrans
$(C)
pngwio
$(C)
pngwrite
$(C)
\
pngwtran
$(C)
pngwutil
$(C)
# Standard headres
PNGH
=
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
# Machine generated headers
PNGCONF
=
pnglibconf.h
OBJS
=
pnm2pngm
$(O)
png
$(O)
pngerror
$(O)
pngget
$(O)
pngmem
$(O)
\
# Headers callers use
PNGINC
=
png.h pngconf.h pngusr.h
$(PNGCONF)
# Headers the PNG library uses
PNGHDRS
=
$(PNGH)
$(PNGCONF)
pngusr.h
PNGOBJS
=
png
$(O)
pngerror
$(O)
pngget
$(O)
pngmem
$(O)
\
pngset
$(O)
pngtrans
$(O)
pngwio
$(O)
pngwrite
$(O)
\
pngwtran
$(O)
pngwutil
$(O)
$(ZOBJS)
pngwtran
$(O)
pngwutil
$(O)
PROGSRCS
=
pnm2pngm
$(C)
PROGHDRS
=
PROGDOCS
=
PROGOBJS
=
pnm2pngm
$(O)
OBJS
=
$(PROGOBJS)
$(PNGOBJS)
$(ZOBJS)
# implicit make rules -------------------------------------------------------
...
...
@@ -33,18 +84,63 @@ all: pnm2pngm$(E)
pnm2pngm$(E)
:
$(OBJS)
$(LD)
-o
pnm2pngm
$(E)
$(OBJS)
strip
pnm2pngm
$(E)
$(STRIP)
pnm2pngm
$(E)
pnglibconf.h
:
scripts/pnglibconf.mak scripts/pnglibconf.dfa scripts/options.awk pngusr.h
rm
-f
pnglibconf.h
$(MAKE)
$(MAKEFLAGS)
-f
scripts/pnglibconf.mak
CPPFLAGS
=
-DPNG_USER_CONFIG
$@
# The DFA_XTRA setting turns all libpng options off then
# turns on those required for this minimal build.
# The CPP_FLAGS setting causes pngusr.h to be included in
# both the build of pnglibconf.h and, subsequently, when
# building libpng itself.
$(PNGCONF)
:
$(PNGSRC)/scripts/pnglibconf.mak
\
$(PNGSRC)/scripts/pnglibconf.dfa
\
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
$(RM)
pnglibconf.h pnglibconf.dfn
$(MAKE)
$(MAKEFLAGS)
-f
$(PNGSRC)
/scripts/pnglibconf.mak
\
srcdir
=
$(PNGSRC)
CPPFLAGS
=
"-DPNG_USER_CONFIG"
\
DFA_XTRA
=
"pngusr.dfa"
$@
clean
:
$(MAKE)
$(MAKEFLAGS)
-f
scripts/pnglibconf.mak clean
$(MAKE)
$(MAKEFLAGS)
-f
$(PNGSRC)
/scripts/pnglibconf.mak
\
srcdir
=
$(PNGSRC)
clean
$(RM)
pnm2pngm
$(O)
$(RM)
pnm2pngm
$(E)
$(RM)
$(OBJS)
$(OBJS)
:
png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h pngusr.h zlib.h
# distclean also removes the copied source and headers
distclean
:
clean
$(RM)
-r
scripts
# historical reasons
$(RM)
$(PNGSRCS)
$(PNGH)
$(RM)
$(ZSRCS)
$(ZH)
$(ZCONF)
$(RM)
$(PROGSRCS)
$(PROGHDRS)
$(PROGDOCS)
# Header file dependencies:
$(PROGOBJS)
:
$(PROGHDRS) $(PNGINC) $(ZINC)
$(PNGOBJS)
:
$(PNGHDRS) $(ZINC)
$(ZOBJS)
:
$(ZHDRS)
# Gather the source code from the respective directories
$(PNGSRCS) $(PNGH)
:
$(PNGSRC)/$@
$(RM)
$@
$(COPY)
$(PNGSRC)
/
$@
$@
# No dependency on the ZLIBSRC target so that it only needs
# to be specified once.
$(ZSRCS) $(ZH)
:
$(RM)
$@
$(COPY)
$(ZLIBSRC)
/
$@
$@
# The unconfigured zconf.h varies in name according to the
# zlib release
$(ZCONF)
:
$(RM)
$@
@
for
f
in
zconf.h.in zconf.in.h zconf.h
;
do
\
test
-r
$(ZLIBSRC)
/
$$
f
&&
\
echo
$(COPY)
$(ZLIBSRC)
/
$$
f
$@
&&
\
$(COPY)
$(ZLIBSRC)
/
$$
f
$@
&&
exit
0
;
\
done
;
echo
copy:
$(ZLIBSRC)
/zconf.h not found
;
exit
1
pnm2pngm.c
:
$(PROGSRC)/pnm2png.c
$(RM)
$@
$(COPY)
$(PROGSRC)
/pnm2png.c
$@
# End of makefile for pnm2pngm
contrib/pngminim/encoder/pngusr.dfa
0 → 100644
浏览文件 @
e3e8f6bf
# pngminim/encoder/pngusr.dfa
#
# Copyright (c) 2010 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# First all the build options off:
everything = off
# Switch on the write code - this makes a minimalist encoder
option WRITE on
# You must choose fixed or floating point arithmetic:
option FLOATING_POINT on
# option FIXED_POINT on
# Your program will probably need other options. The example
# program here, pnm2pngm, requires the following. Take a look
# at pnglibconf.h to find out the full set of what has to be
# enabled to make the following work.
option SETJMP on
option STDIO on
contrib/pngminim/encoder/pngusr.h
浏览文件 @
e3e8f6bf
...
...
@@ -12,64 +12,17 @@
#ifndef MINWRPNGCONF_H
#define MINWRPNGCONF_H
#define PNG_USER_PRIVATEBUILD "PNG minimal build"
#define PNG_USER_DLLFNAME_POSTFIX "MN"
#define PNG_NO_READ_SUPPORTED
/* If pngusr.h is included during the build the following must
* be defined either here or in the .dfa file (pngusr.dfa in
* this case). To include pngusr.h set -DPNG_USER_CONFIG in
* CPPFLAGS
*/
#define PNG_USER_PRIVATEBUILD "libpng minimal conformant PNG encoder"
#define PNG_USER_DLLFNAME_POSTFIX "me"
/* List options to turn off features of the build that do not
* affect the API (so are not recorded in pnglibconf.h)
*/
#define PNG_NO_WARNINGS
#define PNG_NO_ERROR_TEXT
#define PNG_NO_WRITE_BACKGROUND
#define PNG_NO_WRITE_BGR
#define PNG_NO_WRITE_GAMMA
#define PNG_NO_WRITE_QUANTIZE
#define PNG_NO_WRITE_INVERT
#define PNG_NO_WRITE_SHIFT
#define PNG_NO_WRITE_PACK
#define PNG_NO_WRITE_PACKSWAP
#define PNG_NO_WRITE_FILLER
#define PNG_NO_WRITE_SWAP
#define PNG_NO_WRITE_SWAP_ALPHA
#define PNG_NO_WRITE_INVERT_ALPHA
#define PNG_NO_WRITE_RGB_TO_GRAY
#define PNG_NO_WRITE_USER_TRANSFORM
#define PNG_NO_WRITE_bKGD
#define PNG_NO_WRITE_cHRM
#define PNG_NO_WRITE_gAMA
#define PNG_NO_WRITE_hIST
#define PNG_NO_WRITE_iCCP
#define PNG_NO_WRITE_oFFs
#define PNG_NO_WRITE_pCAL
#define PNG_NO_WRITE_pHYs
#define PNG_NO_WRITE_sBIT
#define PNG_NO_WRITE_sCAL
#define PNG_NO_WRITE_sPLT
#define PNG_NO_WRITE_sRGB
#define PNG_NO_WRITE_TEXT
#define PNG_NO_WRITE_tIME
#define PNG_NO_WRITE_UNKNOWN_CHUNKS
#define PNG_NO_WRITE_USER_CHUNKS
#define PNG_NO_WRITE_EMPTY_PLTE
#define PNG_NO_WRITE_OPT_PLTE
#define PNG_NO_WRITE_FILTER
#define PNG_NO_WRITE_WEIGHTED_FILTER
#define PNG_NO_WRITE_INTERLACING_SUPPORTED
#define PNG_NO_WRITE_FLUSH
#define PNG_NO_INFO_IMAGE
#define PNG_NO_IO_STATE
#define PNG_NO_USER_MEM
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_MNG_FEATURES
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_HANDLE_AS_UNKNOWN
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
#define PNG_NO_TIME_RFC1123
#endif
/* MINWRPNGCONF_H */
contrib/pngminim/preader/README
浏览文件 @
e3e8f6bf
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
T
o build a minimal read-only progressive decoder embedded libpng and
zlib and with your system's X library, run
T
he makefile builds a minimal read-only progressive decoder with
embedded libpng, zlib and your system's X library.
gather.sh # to collect needed files from gregbook, libpng, and zlib
Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
on the make command line.
Edit makefile if required, to find your X library and include files,
then
make
make
ZLIBSRC=directory
If you prefer to use the shared libraries, go to contrib/gregbook
and build the rpng2-x application there.
contrib/pngminim/preader/gather.sh
浏览文件 @
e3e8f6bf
test
-n
"
${
PNGSRC
}
"
||
PNGSRC
=
../../..
cp
"
${
PNGSRC
}
"
/contrib/gregbook/rpng2-x.c
.
cp
"
${
PNGSRC
}
"
/contrib/gregbook/readpng2.[ch]
.
cp
"
${
PNGSRC
}
"
/contrib/gregbook/COPYING
.
cp
"
${
PNGSRC
}
"
/contrib/gregbook/LICENSE
.
cp
"
${
PNGSRC
}
"
/
*
.h
.
cp
"
${
PNGSRC
}
"
/
*
.c
.
rm
example.c pngtest.c pngw
*
.c
rm
-f
pnglibconf.h
test
-d
scripts
||
mkdir
scripts
cp
"
${
PNGSRC
}
"
/scripts/pnglibconf.mak scripts
cp
"
${
PNGSRC
}
"
/scripts/pnglibconf.dfa scripts
cp
"
${
PNGSRC
}
"
/scripts/options.awk scripts
# change the following if zlib is somewhere else
test
-n
"
${
ZLIBSRC
}
"
||
ZLIBSRC
=
"
${
PNGSRC
}
"
/../zlib
cp
"
${
ZLIBSRC
}
"
/
*
.h
.
cp
"
${
ZLIBSRC
}
"
/
*
.c
.
rm
minigzip.c example.c compress.c deflate.c gz
*
contrib/pngminim/preader/makefile
浏览文件 @
e3e8f6bf
...
...
@@ -4,8 +4,10 @@
#CC=cc
CC
=
gcc
LD
=
$(CC)
STRIP
=
strip
RM
=
rm
-f
COPY
=
cp
#XINC = -I/usr/include # old-style, stock X distributions
#XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
...
...
@@ -23,21 +25,68 @@ XLIB = -L/usr/X11R6/lib -lX11
#LIBS = $(XLIB)
LIBS
=
$(XLIB)
-lm
#platforms that need libm
CFLAGS
=
-DPNG_USER_CONFIG
-DNO_GZCOMPRESS
-DNO_GZIP
\
-DdeflateParams
\(
a,b,c
\)
=
Z_OK
-I
.
$(XINC)
-O1
CFLAGS
=
-DPNG_USER_CONFIG
-DNO_GZCOMPRESS
-DNO_GZIP
-I
.
$(XINC)
-O1
C
=
.c
O
=
.o
L
=
.a
E
=
# Where to find the source code:
PNGSRC
=
../../..
ZLIBSRC
=
$(PNGSRC)
/../zlib
PROGSRC
=
$(PNGSRC)
/contrib/gregbook
# Zlib (minimal inflate requirements - crc32 is used by libpng)
# zutil can be eliminated if you provide your own zcalloc and zcfree
ZSRCS
=
adler32
$(C)
crc32
$(C)
\
inffast
$(C)
inflate
$(C)
inftrees
$(C)
\
zutil
$(C)
# Standard headers
ZH
=
zlib.h crc32.h inffast.h inffixed.h
\
inflate.h inftrees.h zutil.h
# Machine generated headers
ZCONF
=
zconf.h
# Headers callers use
ZINC
=
zlib.h
$(ZCONF)
# Headers the Zlib source uses
ZHDRS
=
$(ZH)
$(ZCONF)
ZOBJS
=
adler32
$(O)
crc32
$(O)
\
infback
$(O)
inffast
$(O)
inflate
$(O)
inftrees
$(O)
\
trees
$(O)
uncompr
$(O)
zutil
$(O)
inffast
$(O)
inflate
$(O)
inftrees
$(O)
\
zutil
$(O)
# libpng
PNGSRCS
=
png
$(C)
pngerror
$(C)
pngget
$(C)
pngmem
$(C)
\
pngpread
$(C)
pngread
$(C)
pngrio
$(C)
pngrtran
$(C)
pngrutil
$(C)
\
pngset
$(C)
pngtrans
$(C)
OBJS
=
rpng2-x
$(O)
readpng2
$(O)
png
$(O)
pngerror
$(O)
pngget
$(O)
pngmem
$(O)
\
# Standard headres
PNGH
=
png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
# Machine generated headers
PNGCONF
=
pnglibconf.h
# Headers callers use
PNGINC
=
png.h pngconf.h pngusr.h
$(PNGCONF)
# Headers the PNG library uses
PNGHDRS
=
$(PNGH)
$(PNGCONF)
pngusr.h
PNGOBJS
=
png
$(O)
pngerror
$(O)
pngget
$(O)
pngmem
$(O)
\
pngpread
$(O)
pngread
$(O)
pngrio
$(O)
pngrtran
$(O)
pngrutil
$(O)
\
pngset
$(O)
pngtrans
$(O)
$(ZOBJS)
pngset
$(O)
pngtrans
$(O)
PROGSRCS
=
rpng2-x
$(C)
readpng2
$(C)
PROGHDRS
=
readpng2.h
PROGDOCS
=
COPYING LICENSE
PROGOBJS
=
rpng2-x
$(O)
readpng2
$(O)
OBJS
=
$(PROGOBJS)
$(PNGOBJS)
$(ZOBJS)
# implicit make rules -------------------------------------------------------
...
...
@@ -46,22 +95,67 @@ OBJS = rpng2-x$(O) readpng2$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
# dependencies
all
:
rpng2-x$(E)
all
:
$(PROGDOCS)
rpng2-x$(E)
rpng2-x$(E)
:
$(OBJS)
$(LD)
-o
rpng2-x
$(E)
$(OBJS)
$(LIBS)
strip rpng2-x
$(E)
pnglibconf.h
:
scripts/pnglibconf.mak scripts/pnglibconf.dfa scripts/options.awk pngusr.h
rm
-f
pnglibconf.h
$(MAKE)
$(MAKEFLAGS)
-f
scripts/pnglibconf.mak
CPPFLAGS
=
-DPNG_USER_CONFIG
$@
$(STRIP)
rpng2-x
$(E)
# The DFA_XTRA setting turns all libpng options off then
# turns on those required for this minimal build.
# The CPP_FLAGS setting causes pngusr.h to be included in
# both the build of pnglibconf.h and, subsequently, when
# building libpng itself.
$(PNGCONF)
:
$(PNGSRC)/scripts/pnglibconf.mak
\
$(PNGSRC)/scripts/pnglibconf.dfa
\
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
$(RM)
pnglibconf.h pnglibconf.dfn
$(MAKE)
$(MAKEFLAGS)
-f
$(PNGSRC)
/scripts/pnglibconf.mak
\
srcdir
=
$(PNGSRC)
CPPFLAGS
=
"-DPNG_USER_CONFIG"
\
DFA_XTRA
=
"pngusr.dfa"
$@
clean
:
$(MAKE)
$(MAKEFLAGS)
-f
scripts/pnglibconf.mak clean
$(MAKE)
$(MAKEFLAGS)
-f
$(PNGSRC)
/scripts/pnglibconf.mak
\
srcdir
=
$(PNGSRC)
clean
$(RM)
rpng2-x
$(O)
$(RM)
rpng2-x
$(E)
$(RM)
$(OBJS)
$(OBJS)
:
png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h readpng2.h pngusr.h zlib.h
# distclean also removes the copied source and headers
distclean
:
clean
$(RM)
-r
scripts
# historical reasons
$(RM)
$(PNGSRCS)
$(PNGH)
$(RM)
$(ZSRCS)
$(ZH)
$(ZCONF)
$(RM)
$(PROGSRCS)
$(PROGHDRS)
$(PROGDOCS)
# Header file dependencies:
$(PROGOBJS)
:
$(PROGHDRS) $(PNGINC) $(ZINC)
$(PNGOBJS)
:
$(PNGHDRS) $(ZINC)
$(ZOBJS)
:
$(ZHDRS)
# Gather the source code from the respective directories
$(PNGSRCS) $(PNGH)
:
$(PNGSRC)/$@
$(RM)
$@
$(COPY)
$(PNGSRC)
/
$@
$@
# No dependency on the ZLIBSRC target so that it only needs
# to be specified once.
$(ZSRCS) $(ZH)
:
$(RM)
$@
$(COPY)
$(ZLIBSRC)
/
$@
$@
# The unconfigured zconf.h varies in name according to the
# zlib release
$(ZCONF)
:
$(RM)
$@
@
for
f
in
zconf.h.in zconf.in.h zconf.h
;
do
\
test
-r
$(ZLIBSRC)
/
$$
f
&&
\
echo
$(COPY)
$(ZLIBSRC)
/
$$
f
$@
&&
\
$(COPY)
$(ZLIBSRC)
/
$$
f
$@
&&
exit
0
;
\
done
;
echo
copy:
$(ZLIBSRC)
/zconf.h not found
;
exit
1
$(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
:
$(PROGSRC)/$@
$(RM)
$@
$(COPY)
$(PROGSRC)
/
$@
$@
# End of makefile for rpng2-x
contrib/pngminim/preader/pngusr.dfa
0 → 100644
浏览文件 @
e3e8f6bf
# pngminim/preader/pngusr.dfa
#
# Copyright (c) 2010 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# First all the build options off:
everything = off
# Just switch on the progressive read code
option PROGRESSIVE_READ on
# You must choose fixed or floating point arithmetic:
option FLOATING_POINT on
# option FIXED_POINT on
# Your program will probably need other options. The example
# program here, rpng2-x, requires the following. Take a look
# at pnglibconf.h to find out the full set of what has to be
# enabled to make the following work.
option SETJMP on
option STDIO on
option READ_bKGD on
option READ_GAMMA on
option READ_EXPAND on
option READ_16_TO_8 on
option READ_GRAY_TO_RGB on
contrib/pngminim/preader/pngusr.h
浏览文件 @
e3e8f6bf
...
...
@@ -12,57 +12,17 @@
#ifndef MINPRDPNGCONF_H
#define MINPRDPNGCONF_H
#define PNG_USER_PRIVATEBUILD "PNG minimal build"
#define PNG_USER_DLLFNAME_POSTFIX "MN"
/* If pngusr.h is included during the build the following must
* be defined either here or in the .dfa file (pngusr.dfa in
* this case). To include pngusr.h set -DPNG_USER_CONFIG in
* CPPFLAGS
*/
#define PNG_USER_PRIVATEBUILD "libpng minimal conformant PNG progressive reader"
#define PNG_USER_DLLFNAME_POSTFIX "mp"
/* List options to turn off features of the build that do not
* affect the API (so are not recorded in pnglibconf.h)
*/
#define PNG_NO_WARNINGS
#define PNG_NO_ERROR_TEXT
#define PNG_NO_READ_INT_FUNCTIONS
#define PNG_NO_READ_BGR
#define PNG_NO_READ_QUANTIZE
#define PNG_NO_READ_INVERT
#define PNG_NO_READ_SHIFT
#define PNG_NO_READ_PACK
#define PNG_NO_READ_PACKSWAP
#define PNG_NO_READ_FILLER
#define PNG_NO_READ_SWAP
#define PNG_NO_READ_SWAP_ALPHA
#define PNG_NO_READ_INVERT_ALPHA
#define PNG_NO_READ_RGB_TO_GRAY
#define PNG_NO_READ_USER_TRANSFORM
#define PNG_NO_READ_cHRM
#define PNG_NO_READ_hIST
#define PNG_NO_READ_iCCP
#define PNG_NO_READ_pCAL
#define PNG_NO_READ_pHYs
#define PNG_NO_READ_sBIT
#define PNG_NO_READ_sCAL
#define PNG_NO_READ_sPLT
#define PNG_NO_READ_TEXT
#define PNG_NO_READ_tIME
#define PNG_NO_READ_UNKNOWN_CHUNKS
#define PNG_NO_READ_USER_CHUNKS
#define PNG_NO_READ_EMPTY_PLTE
#define PNG_NO_READ_OPT_PLTE
#define PNG_NO_READ_STRIP_ALPHA
#define PNG_NO_READ_oFFs
#define PNG_NO_WRITE_SUPPORTED
#define PNG_NO_INFO_IMAGE
#define PNG_NO_IO_STATE
#define PNG_NO_USER_MEM
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_MNG_FEATURES
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_HANDLE_AS_UNKNOWN
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
#define PNG_NO_TIME_RFC1123
#endif
/* MINPRDPNGCONF_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录