Add contrib/pngminim/preader files
(README, gather.sh, makefile.std, and pngusr.h)
This commit is contained in:
parent
ecf0bffb79
commit
6d65121993
6
contrib/pngminim/preader/README
Normal file
6
contrib/pngminim/preader/README
Normal file
@ -0,0 +1,6 @@
|
||||
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
|
||||
|
||||
To build a minimal read-only progressive decoder with X display, run
|
||||
gather.sh # to collect needed files from pngminus, libpng, and zlib
|
||||
make -f makefile.std
|
||||
|
9
contrib/pngminim/preader/gather.sh
Executable file
9
contrib/pngminim/preader/gather.sh
Executable file
@ -0,0 +1,9 @@
|
||||
cp ../../gregbook/rpng2-x.c ../../gregbook/readpng2.[ch] .
|
||||
cp ../../gregbook/COPYING ../../gregbook/LICENSE .
|
||||
cp ../../../*.h .
|
||||
cp ../../../*.c .
|
||||
rm example.c pnggccrd.c pngvcrd.c pngtest.c pngw*.c
|
||||
# change the following 2 lines if zlib is somewhere else
|
||||
cp ../../../../zlib/*.h .
|
||||
cp ../../../../zlib/*.c .
|
||||
rm minigzip.c example.c compress.c deflate.c
|
60
contrib/pngminim/preader/makefile.std
Normal file
60
contrib/pngminim/preader/makefile.std
Normal file
@ -0,0 +1,60 @@
|
||||
# Makefile for PngMinus (rpng2)
|
||||
# Linux / Unix
|
||||
|
||||
#CC=cc
|
||||
CC=gcc
|
||||
LD=$(CC)
|
||||
|
||||
RM=rm -f
|
||||
|
||||
#XINC = -I/usr/include # old-style, stock X distributions
|
||||
#XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
|
||||
|
||||
#XINC = -I/usr/openwin/include # Sun workstations (OpenWindows)
|
||||
#XLIB = -L/usr/openwin/lib -lX11
|
||||
|
||||
XINC = -I/usr/X11R6/include # new X distributions (X.org, etc.)
|
||||
XLIB = -L/usr/X11R6/lib -lX11
|
||||
#XLIB = -L/usr/X11R6/lib64 -lX11 # e.g., Red Hat on AMD64
|
||||
|
||||
#XINC = -I/usr/local/include # FreeBSD
|
||||
#XLIB = -L/usr/local/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
|
||||
|
||||
C=.c
|
||||
O=.o
|
||||
L=.a
|
||||
E=
|
||||
|
||||
ZOBJS = adler32$(O) crc32$(O) gzio$(O) \
|
||||
infback$(O) inffast$(O) inflate$(O) inftrees$(O) \
|
||||
trees$(O) uncompr$(O) zutil$(O)
|
||||
|
||||
OBJS = rpng2-x$(O) readpng2$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
|
||||
pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
|
||||
pngset$(O) pngtrans$(O) $(ZOBJS)
|
||||
|
||||
# implicit make rules -------------------------------------------------------
|
||||
|
||||
.c$(O): png.h pngconf.h readpng2.h pngusr.h zlib.h
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
|
||||
# dependencies
|
||||
|
||||
all: rpng2-x$(E)
|
||||
|
||||
rpng2-x$(E): $(OBJS)
|
||||
$(LD) -o rpng2-x$(E) $(OBJS) $(LIBS)
|
||||
strip rpng2-x$(E)
|
||||
|
||||
clean:
|
||||
$(RM) rpng2-x$(O)
|
||||
$(RM) rpng2-x$(E)
|
||||
$(RM) $(OBJS)
|
||||
|
||||
# End of makefile for rpng2-x
|
62
contrib/pngminim/preader/pngusr.h
Normal file
62
contrib/pngminim/preader/pngusr.h
Normal file
@ -0,0 +1,62 @@
|
||||
/* minrdpngconf.h: headers to make a minimal png-read-only library
|
||||
* For conditions of distribution and use, see copyright notice in png.h
|
||||
* Copyright (c) 2007 Glenn Randers-Pehrson
|
||||
* Derived from pngcrush.h, Copyright 1998-2007, Glenn Randers-Pehrson
|
||||
*/
|
||||
|
||||
#ifndef MINRDPNGCONF_H
|
||||
#define MINRDPNGCONF_H
|
||||
|
||||
#define PNG_NO_GLOBAL_ARRAYS
|
||||
|
||||
#define PNG_NO_WARNINGS
|
||||
#define png_warning(s1,s2) ""
|
||||
#define png_chunk_warning(s1,s2) ""
|
||||
#define PNG_NO_ERROR_TEXT
|
||||
#define png_error(s1,s2) png_err(s1)
|
||||
#define png_chunk_error(s1,s2) png_err(s1)
|
||||
|
||||
#define PNG_NO_ASSEMBLER_CODE
|
||||
#define PNG_NO_OPTIMIZED_CODE
|
||||
#define PNG_NO_READ_DITHER
|
||||
#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_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_WARN_UNINITIALIZED_ROW
|
||||
|
||||
#define PNG_NO_WRITE_SUPPORTED
|
||||
|
||||
#define PNG_NO_INFO_IMAGE
|
||||
#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
|
||||
|
||||
#endif /* MINRDPNGCONF_H */
|
Reference in New Issue
Block a user