Remove support for the MNG file format and the bundled libmng
The MNG file format is generally abandoned, and libmng has been unmaintained for several years. The MNG plugin and bundled libmng has been moved to the qtimageformats project on Gerrit. Task-number: QTBUG-21869 Change-Id: I946432347014ffde2b72307a5f8b166ca5553602 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
parent
c0d30db45c
commit
48f9ba388b
@ -1,54 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
** This file is part of the config.tests of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU Lesser
|
||||
** General Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License version 3.0 as published by the Free Software Foundation
|
||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU General
|
||||
** Public License version 3.0 requirements will be met:
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <libmng.h>
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
mng_handle hMNG;
|
||||
mng_cleanup(&hMNG);
|
||||
|
||||
#if MNG_VERSION_MAJOR < 1 || (MNG_VERSION_MAJOR == 1 && MNG_VERSION_MINOR == 0 && MNG_VERSION_RELEASE < 9)
|
||||
#error System libmng version is less than 1.0.9; using built-in version instead.
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
SOURCES = libmng.cpp
|
||||
CONFIG -= qt dylib
|
||||
mac:CONFIG -= app_bundle
|
||||
LIBS += -lmng
|
52
configure
vendored
52
configure
vendored
@ -665,8 +665,6 @@ CFG_PNG=yes
|
||||
CFG_LIBPNG=auto
|
||||
CFG_JPEG=auto
|
||||
CFG_LIBJPEG=auto
|
||||
CFG_MNG=auto
|
||||
CFG_LIBMNG=auto
|
||||
CFG_XCURSOR=runtime
|
||||
CFG_XRANDR=runtime
|
||||
CFG_XRENDER=auto
|
||||
@ -1806,14 +1804,6 @@ while [ "$#" -gt 0 ]; do
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
libmng)
|
||||
[ "$VAL" = "yes" ] && VAL=qt
|
||||
if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
|
||||
CFG_LIBMNG="$VAL"
|
||||
else
|
||||
UNKNOWN_OPT=yes
|
||||
fi
|
||||
;;
|
||||
libtiff)
|
||||
[ "$VAL" = "yes" ] && VAL=qt
|
||||
if [ "$VAL" = "qt" ] || [ "$VAL" = "no" ] || [ "$VAL" = "system" ]; then
|
||||
@ -3566,8 +3556,8 @@ Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir
|
||||
[-plugin-sql-<driver>] [-system-sqlite]
|
||||
[-platform] [-D <string>] [-I <string>] [-L <string>] [-help]
|
||||
[-qt-zlib] [-system-zlib] [-no-gif] [-no-libtiff] [-qt-libtiff] [-system-libtiff]
|
||||
[-no-libpng] [-qt-libpng] [-system-libpng] [-no-libmng] [-qt-libmng]
|
||||
[-system-libmng] [-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>]
|
||||
[-no-libpng] [-qt-libpng] [-system-libpng]
|
||||
[-no-libjpeg] [-qt-libjpeg] [-system-libjpeg] [-make <part>]
|
||||
[-nomake <part>] [-R <string>] [-l <string>] [-no-rpath] [-rpath] [-continue]
|
||||
[-verbose] [-v] [-silent] [-no-nis] [-nis] [-no-cups] [-cups] [-no-iconv]
|
||||
[-iconv] [-no-pch] [-pch] [-no-dbus] [-dbus] [-dbus-linked] [-no-gui]
|
||||
@ -3810,11 +3800,6 @@ Third Party Libraries:
|
||||
+ -system-libpng ..... Use libpng from the operating system.
|
||||
See http://www.libpng.org/pub/png
|
||||
|
||||
-no-libmng ......... Do not compile MNG support.
|
||||
-qt-libmng ......... Use the libmng bundled with Qt.
|
||||
+ -system-libmng ..... Use libmng from the operating system.
|
||||
See http://www.libmng.com
|
||||
|
||||
-no-libjpeg ........ Do not compile JPEG support.
|
||||
-qt-libjpeg ........ Use the libjpeg bundled with Qt.
|
||||
+ -system-libjpeg .... Use libjpeg from the operating system.
|
||||
@ -4965,23 +4950,6 @@ if [ "$CFG_LIBTIFF" = "auto" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# detect how mng should be built
|
||||
if [ "$CFG_MNG" = "auto" ]; then
|
||||
if [ "$CFG_SHARED" = "yes" ]; then
|
||||
CFG_MNG=plugin
|
||||
else
|
||||
CFG_MNG=yes
|
||||
fi
|
||||
fi
|
||||
# detect mng
|
||||
if [ "$CFG_LIBMNG" = "auto" ]; then
|
||||
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libmng "libmng" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
|
||||
CFG_LIBMNG=system
|
||||
else
|
||||
CFG_LIBMNG=qt
|
||||
fi
|
||||
fi
|
||||
|
||||
# detect png
|
||||
if [ "$CFG_LIBPNG" = "auto" ]; then
|
||||
if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/libpng "libpng" $L_FLAGS $I_FLAGS $l_FLAGS $MAC_CONFIG_TEST_COMMANDLINE; then
|
||||
@ -6765,16 +6733,6 @@ if [ "$CFG_JPEG" = "no" ]; then
|
||||
elif [ "$CFG_JPEG" = "yes" ]; then
|
||||
QT_CONFIG="$QT_CONFIG jpeg"
|
||||
fi
|
||||
if [ "$CFG_LIBMNG" = "no" ]; then
|
||||
CFG_MNG="no"
|
||||
elif [ "$CFG_LIBMNG" = "system" ]; then
|
||||
QT_CONFIG="$QT_CONFIG system-mng"
|
||||
fi
|
||||
if [ "$CFG_MNG" = "no" ]; then
|
||||
QT_CONFIG="$QT_CONFIG no-mng"
|
||||
elif [ "$CFG_MNG" = "yes" ]; then
|
||||
QT_CONFIG="$QT_CONFIG mng"
|
||||
fi
|
||||
if [ "$CFG_LIBPNG" = "no" ]; then
|
||||
CFG_PNG="no"
|
||||
fi
|
||||
@ -7550,7 +7508,6 @@ QMakeVar set sql-plugins "$SQL_PLUGINS"
|
||||
[ "$CFG_TIFF" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_TIFF"
|
||||
[ "$CFG_PNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_PNG"
|
||||
[ "$CFG_JPEG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_JPEG"
|
||||
[ "$CFG_MNG" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IMAGEFORMAT_MNG"
|
||||
[ "$CFG_ZLIB" != "yes" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ZLIB"
|
||||
[ "$CFG_EXCEPTIONS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_EXCEPTIONS"
|
||||
[ "$CFG_SXE" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_SXE"
|
||||
@ -8049,11 +8006,6 @@ if [ "$CFG_PNG" = "no" ]; then
|
||||
else
|
||||
echo "PNG support ............ $CFG_PNG ($CFG_LIBPNG)"
|
||||
fi
|
||||
if [ "$CFG_MNG" = "no" ]; then
|
||||
echo "MNG support ............ $CFG_MNG"
|
||||
else
|
||||
echo "MNG support ............ $CFG_MNG ($CFG_LIBMNG)"
|
||||
fi
|
||||
echo "zlib support ........... $CFG_ZLIB"
|
||||
echo "Session management ..... $CFG_SM"
|
||||
if [ "$PLATFORM_QWS" = "yes" ]; then
|
||||
|
@ -60,5 +60,5 @@ Q_IMPORT_PLUGIN(qjpeg)
|
||||
|
||||
//! [3]
|
||||
TEMPLATE = app
|
||||
QTPLUGIN += qjpeg qgif qmng # image formats
|
||||
QTPLUGIN += qjpeg qgif # image formats
|
||||
//! [3]
|
||||
|
@ -40,5 +40,5 @@
|
||||
|
||||
#! [3]
|
||||
TEMPLATE = app
|
||||
QTPLUGIN += qjpeg qgif qmng # image formats
|
||||
QTPLUGIN += qjpeg qgif # image formats
|
||||
#! [3]
|
||||
|
@ -12,7 +12,7 @@ INSTALLS += target sources
|
||||
#Symbian has built-in component named imageviewer so we use different target
|
||||
|
||||
wince*: {
|
||||
DEPLOYMENT_PLUGIN += qjpeg qmng qgif
|
||||
DEPLOYMENT_PLUGIN += qjpeg qgif
|
||||
}
|
||||
QT += widgets printsupport
|
||||
|
||||
|
BIN
examples/widgets/movie/animation.gif
Normal file
BIN
examples/widgets/movie/animation.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
Binary file not shown.
@ -4,16 +4,15 @@ SOURCES = main.cpp \
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/movie
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES movie.pro animation.mng
|
||||
sources.files = $$SOURCES $$HEADERS $$RESOURCES movie.pro animation.gif
|
||||
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/movie
|
||||
INSTALLS += target sources
|
||||
|
||||
|
||||
wince*: {
|
||||
addFiles.files += *.mng
|
||||
addFiles.files += *.gif
|
||||
addFiles.path = .
|
||||
DEPLOYMENT += addFiles
|
||||
DEPLOYMENT_PLUGIN += qmng
|
||||
}
|
||||
|
||||
QT += widgets
|
||||
|
@ -61,7 +61,7 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
|
||||
DECORATIONPLUGINS = qdecorationdefault qdecorationstyled qdecorationwindows
|
||||
GFXDRIVERPLUGINS = qgfxvnc qscreenvfb qgfxtransformed qgfxshadowfb qgfxpvregl qscreenlinuxfb qeglnullws qdirectfbscreen qahiscreen
|
||||
GRAPHICSSYSTEMPLUGINS = qmeegographicssystem qglgraphicssystem qvggraphicssystem qshivavggraphicssystem
|
||||
IMAGEPLUGINS = qgif qico qmng qjpeg qsvg qtiff
|
||||
IMAGEPLUGINS = qgif qico qjpeg qsvg qtiff
|
||||
INPUTPLUGINS = qimsw-multi
|
||||
KBDDRIVERPLUGINS = qlinuxinputkbddriver
|
||||
MOUSEDRIVERPLUGINS = qtslibmousehandler qpcmousedriver qlinuxtpmousedriver
|
||||
|
@ -86,8 +86,6 @@ mac {
|
||||
win32:!shared:CONFIG += static
|
||||
|
||||
win32-borland {
|
||||
mng:QMAKE_CFLAGS_WARN_ON += -w-par
|
||||
mng:QMAKE_CXXFLAGS_WARN_ON += -w-par
|
||||
# Keep the size of the .tds file for the Qt library smaller than
|
||||
# 34 Mbytes to avoid linking problems
|
||||
QMAKE_CFLAGS_DEBUG += -vi -y-
|
||||
|
@ -59,7 +59,6 @@ unix:!symbian {
|
||||
(cd config.tests/unix/ibase && $(MAKE) distclean); \
|
||||
(cd config.tests/unix/ipv6ifname && $(MAKE) distclean); \
|
||||
(cd config.tests/unix/zlib && $(MAKE) distclean); \
|
||||
(cd config.tests/unix/libmng && $(MAKE) distclean); \
|
||||
(cd config.tests/unix/sqlite2 && $(MAKE) distclean); \
|
||||
(cd config.tests/unix/libjpeg && $(MAKE) distclean); \
|
||||
(cd config.tests/unix/libpng && $(MAKE) distclean); \
|
||||
|
25
src/3rdparty/libmng.pri
vendored
25
src/3rdparty/libmng.pri
vendored
@ -1,25 +0,0 @@
|
||||
DEFINES += MNG_BUILD_SO
|
||||
DEFINES += MNG_NO_INCLUDE_JNG
|
||||
INCLUDEPATH += $$PWD/libmng
|
||||
SOURCES += \
|
||||
$$PWD/libmng/libmng_callback_xs.c \
|
||||
$$PWD/libmng/libmng_chunk_io.c \
|
||||
$$PWD/libmng/libmng_chunk_descr.c \
|
||||
$$PWD/libmng/libmng_chunk_prc.c \
|
||||
$$PWD/libmng/libmng_chunk_xs.c \
|
||||
$$PWD/libmng/libmng_cms.c \
|
||||
$$PWD/libmng/libmng_display.c \
|
||||
$$PWD/libmng/libmng_dither.c \
|
||||
$$PWD/libmng/libmng_error.c \
|
||||
$$PWD/libmng/libmng_filter.c \
|
||||
$$PWD/libmng/libmng_hlapi.c \
|
||||
$$PWD/libmng/libmng_jpeg.c \
|
||||
$$PWD/libmng/libmng_object_prc.c \
|
||||
$$PWD/libmng/libmng_pixels.c \
|
||||
$$PWD/libmng/libmng_prop_xs.c \
|
||||
$$PWD/libmng/libmng_read.c \
|
||||
$$PWD/libmng/libmng_trace.c \
|
||||
$$PWD/libmng/libmng_write.c \
|
||||
$$PWD/libmng/libmng_zlib.c
|
||||
|
||||
include($$PWD/zlib_dependency.pri)
|
1447
src/3rdparty/libmng/CHANGES
vendored
1447
src/3rdparty/libmng/CHANGES
vendored
File diff suppressed because it is too large
Load Diff
57
src/3rdparty/libmng/LICENSE
vendored
57
src/3rdparty/libmng/LICENSE
vendored
@ -1,57 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * COPYRIGHT NOTICE: * */
|
||||
/* * * */
|
||||
/* * Copyright (c) 2000-2007 Gerard Juyn (gerard@libmng.com) * */
|
||||
/* * [You may insert additional notices after this sentence if you modify * */
|
||||
/* * this source] * */
|
||||
/* * * */
|
||||
/* * For the purposes of this copyright and license, "Contributing Authors" * */
|
||||
/* * is defined as the following set of individuals: * */
|
||||
/* * * */
|
||||
/* * Gerard Juyn * */
|
||||
/* * Glenn Randers-Pehrson * */
|
||||
/* * * */
|
||||
/* * The MNG Library is supplied "AS IS". The Contributing Authors * */
|
||||
/* * disclaim all warranties, expressed or implied, including, without * */
|
||||
/* * limitation, the warranties of merchantability and of fitness for any * */
|
||||
/* * purpose. The Contributing Authors assume no liability for direct, * */
|
||||
/* * indirect, incidental, special, exemplary, or consequential damages, * */
|
||||
/* * which may result from the use of the MNG Library, even if advised of * */
|
||||
/* * the possibility of such damage. * */
|
||||
/* * * */
|
||||
/* * Permission is hereby granted to use, copy, modify, and distribute this * */
|
||||
/* * source code, or portions hereof, for any purpose, without fee, subject * */
|
||||
/* * to the following restrictions: * */
|
||||
/* * * */
|
||||
/* * 1. The origin of this source code must not be misrepresented; * */
|
||||
/* * you must not claim that you wrote the original software. * */
|
||||
/* * * */
|
||||
/* * 2. Altered versions must be plainly marked as such and must not be * */
|
||||
/* * misrepresented as being the original source. * */
|
||||
/* * * */
|
||||
/* * 3. This Copyright notice may not be removed or altered from any source * */
|
||||
/* * or altered source distribution. * */
|
||||
/* * * */
|
||||
/* * The Contributing Authors specifically permit, without fee, and * */
|
||||
/* * encourage the use of this source code as a component to supporting * */
|
||||
/* * the MNG and JNG file format in commercial products. If you use this * */
|
||||
/* * source code in a product, acknowledgment would be highly appreciated. * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Parts of this software have been adapted from the libpng package. * */
|
||||
/* * Although this library supports all features from the PNG specification * */
|
||||
/* * (as MNG descends from it) it does not require the libpng package. * */
|
||||
/* * It does require the zlib library and optionally the IJG jpeg library, * */
|
||||
/* * and/or the "little-cms" library by Marti Maria (depending on the * */
|
||||
/* * inclusion of support for JNG and Full-Color-Management respectively. * */
|
||||
/* * * */
|
||||
/* * This library's function is primarily to read and display MNG * */
|
||||
/* * animations. It is not meant as a full-featured image-editing * */
|
||||
/* * component! It does however offer creation and editing functionality * */
|
||||
/* * at the chunk level. * */
|
||||
/* * (future modifications may include some more support for creation * */
|
||||
/* * and or editing) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
36
src/3rdparty/libmng/README
vendored
36
src/3rdparty/libmng/README
vendored
@ -1,36 +0,0 @@
|
||||
libmng 1.0.10
|
||||
-------------
|
||||
|
||||
Added provisional ANG and anIM support, and made some minor bugfixes.
|
||||
|
||||
libmng 1.0.9
|
||||
------------
|
||||
|
||||
A number of optimizations in the chunk handling and reader/writer code.
|
||||
This saves over 20KB on binary footprint!
|
||||
|
||||
Also several bugfixes and a couple of patches bring it another step
|
||||
closer to perfection.... :-)
|
||||
|
||||
See CHANGELOG for details.
|
||||
|
||||
|
||||
Y.T.
|
||||
|
||||
Gerard
|
||||
|
||||
|
||||
For more information please visit:
|
||||
|
||||
The official libmng web-site:
|
||||
http://www.libmng.com/
|
||||
|
||||
Libmng's community on SourceForge:
|
||||
https://sourceforge.net/project/?group_id=5635
|
||||
|
||||
The official MNG homepage:
|
||||
http://www.libpng.org/pub/mng/
|
||||
|
||||
The official PNG homepage:
|
||||
http://www.libpng.org/pub/png/
|
||||
|
213
src/3rdparty/libmng/README.autoconf
vendored
213
src/3rdparty/libmng/README.autoconf
vendored
@ -1,213 +0,0 @@
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
|
||||
***** this is unmaintained *****
|
||||
|
||||
If you happen to find problems with autoconfiguration and building,
|
||||
I simply cannot help you. I'm looking for a maintainer that doesn't mind
|
||||
spending a few minutes every now and then on the next release to make sure
|
||||
things are still in working order.
|
||||
|
||||
For the moment all autoconf stuff ahs been moved into unmaintained!!
|
||||
|
||||
**********************************************************************
|
||||
**********************************************************************
|
||||
|
||||
|
||||
|
||||
|
||||
Configuration from CVS
|
||||
======================
|
||||
|
||||
If you're using source checked out from CVS, rather than a source
|
||||
distribution tarball, please be aware that you can use ./autogen.sh in
|
||||
place of ./configure below.
|
||||
|
||||
Because this is a cross-platform project, the source templates for
|
||||
the autoconf scripts are sequestered in the 'makefiles' directory.
|
||||
Running './autogen.sh' will copy them into their conventional places at
|
||||
the lop level. If you already see the files there, you don't need to
|
||||
worry about this step.
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
104
src/3rdparty/libmng/README.config
vendored
104
src/3rdparty/libmng/README.config
vendored
@ -1,104 +0,0 @@
|
||||
Configuration options in libmng
|
||||
===============================
|
||||
|
||||
The library is fairly configurable through the use of a number of defines.
|
||||
Please note however that certain defines are for internal use only.
|
||||
The following list gives a summary of options that can be used externally to
|
||||
define the functionality of the library:
|
||||
|
||||
========================================
|
||||
|
||||
#define MNG_BUILD_DLL
|
||||
|
||||
This is used to indicate that a "standard" DLL should result from compiling
|
||||
the library. Please note the remarks in README.dll if you intend to work
|
||||
with the library as a DLL. The purpose of this option is to ensure that
|
||||
DLL builds have the same set of functions.
|
||||
|
||||
#define MNG_BUILD_SO
|
||||
|
||||
This is used to indicate that a "standard" shared library (SO) should result
|
||||
from a compilation. The purpose of this option is to ensure that all
|
||||
shared libraries generated this way will have the same set of functions.
|
||||
|
||||
#define MNG_USE_DLL / #define MNG_USE_SO
|
||||
|
||||
These should be used when including the library header in the compilation
|
||||
of an application to indicate that the compiler/linker must take the
|
||||
necessary steps to make the binary executable to use the standard DLL
|
||||
or shared library (SO).
|
||||
|
||||
#define MNG_SKIP_ZLIB / #define MNG_SKIP_LCMS / #define MNG_SKIP_IJG6B
|
||||
|
||||
Use these in conjunction with MNG_USE_DLL / MNG_USE_SO. This is useful if
|
||||
you only need the external definitions of the MNG library and not the others,
|
||||
which will speed up the compilation process.
|
||||
|
||||
#define MNG_SUPPORT_FULL / #define MNG_SUPPORT_LC / #define MNG_SUPPORT_VLC
|
||||
|
||||
These can be used to indicate the level of MNG spec compliance required.
|
||||
Currently only full MNG compliance is supported.
|
||||
|
||||
#define MNG_SUPPORT_IJG6B
|
||||
|
||||
This can be used to indicate if JNG support is required. This option will
|
||||
include the IJG JPEG-library. Note that MNG_SUPPORT_FULL will automatically
|
||||
set this option. Use this only if you need JNG support with MNG-(V)LC.
|
||||
|
||||
#define MNG_FULL_CMS / #define MNG_GAMMA_ONLY / #define MNG_NO_CMS /
|
||||
#define MNG_APP_CMS
|
||||
|
||||
These indicate the color-correction support level of the library.
|
||||
If you are on a platform that supports lcms (Little CMS by Marti Maria Saguar)
|
||||
then it is highly recommended to define MNG_FULL_CMS.
|
||||
If your platform has it's own CMS then select MNG_APP_CMS and be sure to
|
||||
include the appropriate callbacks in your app.
|
||||
In all other cases it is recommended to define MNG_GAMMA_ONLY.
|
||||
|
||||
#define MNG_SUPPORT_READ / #define MNG_SUPPORT_WRITE /
|
||||
#define MNG_SUPPORT_DISPLAY
|
||||
|
||||
These indicate the high-level support for reading, writing and/or
|
||||
displaying files. Note that in order to display a file, you'll need to read
|
||||
it first. (yes, really!)
|
||||
|
||||
#define MNG_STORE_CHUNKS
|
||||
|
||||
This indicates that the library should store chunk-information when reading
|
||||
a file. This information can then be processed through the
|
||||
MNG_ITERATE_CHUNKS() function. Note that you must specify this option if
|
||||
you want to create and write a new file.
|
||||
|
||||
#define MNG_ACCESS_CHUNKS
|
||||
|
||||
This is used to indicate that the app may need access to internally stored
|
||||
chunk information. MNG_STORE_CHUNKS must be defined as well for this option
|
||||
to function properly.
|
||||
|
||||
#define MNG_INTERNAL_MEMMNGMT
|
||||
|
||||
You can use this to have the library handle it's own memory allocation and
|
||||
deallocation through the "standard" memory functions. This option is turned
|
||||
off by default, which means your app must define the memory callbacks.
|
||||
|
||||
#define MNG_ERROR_TELLTALE
|
||||
|
||||
Set this on to allow human-readable error-messages to be included in the
|
||||
library and the error function and callback.
|
||||
|
||||
#define MNG_BIGENDIAN_SUPPORTED
|
||||
|
||||
This option should be used to indicate the hardware is based on big endian
|
||||
integers.
|
||||
|
||||
#define MNG_SUPPORT_TRACE / #define MNG_TRACE_TELLTALE
|
||||
|
||||
These two can be used when debugging an app. You'll need to have the trace
|
||||
callback setup also. This allows for a rather thorough investigation of the
|
||||
libraries function paths.
|
||||
|
||||
========================================
|
||||
|
||||
Any other optional defines you may encounter are for internal use only.
|
||||
please do not specify them externally. In case of doubt, consult the
|
||||
support email lists. More info can be found on http://www.libmng.com
|
95
src/3rdparty/libmng/README.contrib
vendored
95
src/3rdparty/libmng/README.contrib
vendored
@ -1,95 +0,0 @@
|
||||
The contrib directory contains contributions made by fellow
|
||||
enthousiasts. (Check respective web-sites for the latest version)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
mngplg - A Netscape plugin for MNG - by Jason Summers
|
||||
|
||||
http://pobox.com/~jason1/imaging/mngplg/
|
||||
|
||||
The very first contribution, and what a start!
|
||||
GIF look out, MNG is on the prowl and ready to swat you like a fly!
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
mngplay - An SDL based MNG viewer - by Ralph Giles
|
||||
|
||||
http://snow.ashlu.bc.ca/~giles/mng/
|
||||
|
||||
Another nice contribution. View MNG files on practically any platform
|
||||
with this standalone viewer.
|
||||
Source-code only; Requires SDL library and libmng.so
|
||||
|
||||
(Modified by Greg Roelofs)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
mngview - A BCB port of the Delphi sample - by Andy Protano
|
||||
|
||||
I have added this nice little port to the BCB samples directory.
|
||||
It adds a nifty progressbar while reading a file. Excellent work!
|
||||
Requires libmng.dll
|
||||
(note: this is in the BCB samples directory)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
mngdump - A BCB GUI-based dump utility - by Andy Protano
|
||||
|
||||
Andy has sent me this fully functional MNG dump utility, that gives
|
||||
detailed information of the contents of any MNG file.
|
||||
Requires libmng.dll
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
mng-view - A GTK-based MNG viewer - by Vova Babin
|
||||
|
||||
Vova has been hacking away with the libmng code and has come up with
|
||||
this nice little sample how to write a MNG viewer using GTK.
|
||||
Thanks mate!
|
||||
Source-code only
|
||||
Requires GTK+ (1.2 or higher) and libmng (0.9.2 or higher)
|
||||
|
||||
(Modified by Greg Roelofs)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
mngview - Another MNG viewer; this one for MSVC - by Nicholaus Brennig
|
||||
|
||||
A welcome contribution from Nicholaus. Author of SlowView. A very nice
|
||||
image-handling utility for Windows. A welcome contribution since there
|
||||
have been numerous questions about linking libmng with MSVC.
|
||||
Well, look no further. Here it is!
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
MSVC libmng project - An MSVC project to build libmng.dll
|
||||
- by Chad Austin
|
||||
|
||||
Chad has contributed some project-files that you could use to build
|
||||
libmng.dll with MSVC. Please be sure to read the README file included.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
fbmngplay - A simple fbcon based mng player - by Stefan Reinauer
|
||||
|
||||
Stefan has contributed this little example, based on Ralph's
|
||||
SDL player. It uses the kernel framebuffer device to display mng
|
||||
animations through the libmng interface.
|
||||
(currently for 16-bit buffers only)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
xmngview - Lesstif/Motif standalone player for MNG files
|
||||
- by Winfried Szukalski
|
||||
|
||||
Winfried contributed this MNG player for X-based systems.
|
||||
(recently updated)
|
||||
|
||||
----------------------------------------------------------------------
|
||||
|
||||
makemng - A delta-MNG creation utility for MSVC - by Alex Volkov
|
||||
|
||||
Alex sent me this nice utility that will allow you to create highly
|
||||
optmized MNGs using the delta-PNG capabilities of MNG.
|
||||
|
||||
----------------------------------------------------------------------
|
41
src/3rdparty/libmng/README.dll
vendored
41
src/3rdparty/libmng/README.dll
vendored
@ -1,41 +0,0 @@
|
||||
Standard Windows DLL
|
||||
====================
|
||||
|
||||
The DLL provided in the BCB/win32dll directory is meant as the sole candidate
|
||||
for distributions, based on libmng.dll, that install the DLL into the public
|
||||
Windows system-directory. The outline herein defines the requirements to
|
||||
which such a distribution must comply. If you cannot comply with these
|
||||
requirements please install the dll in the same directory as your application
|
||||
and NOT in the Windows system-directory!!!
|
||||
|
||||
|
||||
1) Only the DLL already assembled in the libmng distribution may be used for
|
||||
other distributions!
|
||||
|
||||
2) Only stable public releases are eligible for distribution! A public release
|
||||
is one where the y-value of the x.y.z version-code is an even number.
|
||||
Eg. 1.0.0, 1.2.1, 2.4.7, etc.
|
||||
|
||||
3) The installation program MUST store the DLL in the Windows system-directory!
|
||||
Eg. C:\WinNT\System32, C:\Windows98\System
|
||||
(Note: InstallShield users can use the <SYSDIR> variable)
|
||||
|
||||
3) The installation program MUST flag the file as a shared library!
|
||||
|
||||
4) The installation program MUST NOT install the DLL if a newer version
|
||||
already exists in the Windows system-directory! The standard DLL provided
|
||||
contains the Windows-default version-numbering system. PLEASE USE IT!!
|
||||
DO NOT rely on the date or size of the files.
|
||||
|
||||
5) An uninstall procedure MAY NOT remove the DLL if other applications are
|
||||
still linked to it! Proper handling as a shared library is imperitive.
|
||||
|
||||
6) TEST IT, TEST IT, TEST IT!!! (I just can't stress this enough)
|
||||
If you don't have enough time, let someone else test it BEFORE you
|
||||
distribute!
|
||||
|
||||
|
||||
The penalty for violating these rules is inclusion of your name in the list
|
||||
of endangered but useless species (just below the GIF entry!), and on my
|
||||
blacklist. YOU HAVE BEEN FOREWARNED!
|
||||
|
48
src/3rdparty/libmng/README.examples
vendored
48
src/3rdparty/libmng/README.examples
vendored
@ -1,48 +0,0 @@
|
||||
The samples are in platform-specific directories.
|
||||
|
||||
!!! contributions are very welcome !!!
|
||||
|
||||
|
||||
bcb - Borland C++ Builder (3.0) (found under bcb/xxx)
|
||||
-----------------------------------------------------
|
||||
|
||||
win32dll - sample project to create a Windows dll. Requires zlib1.2.1,
|
||||
IJG jpgsrc6b and lcms1.0.14. The directories containing these
|
||||
libraries must be at the same level as the libmng directory.
|
||||
So if you're in the directory with this file and the libmng
|
||||
sources, they should be in ..\zlib , ..\jpgsrc6b and ..\lcms
|
||||
respectively.
|
||||
|
||||
!!! To run the other Win32 samples you need to copy the libmng.dll
|
||||
file from here into the sample's directory !!!
|
||||
|
||||
mngtree - sample project to create a little command-line tool that dumps
|
||||
the chunk-structure of a given file onto stdout.
|
||||
|
||||
bogus - a completely bogus example on how to create a perfectly valid
|
||||
(though slightly biased) MNG.
|
||||
|
||||
mngview - port of the Delphi mngview sample. contributed by Andy Protano.
|
||||
see also README.contrib
|
||||
|
||||
mngrepair- an example on how to fix invalid MNG files
|
||||
uses the new mng_copy_chunks() function and MNG_SOFTERRORS to
|
||||
'ignore' certain input-errors. This conditional *MUST* only be used
|
||||
for exactly this kind of software; eg. repair utilities.
|
||||
|
||||
|
||||
delphi - Borland Delphi (3.0+) (found under contrib/delphi/xxx)
|
||||
---------------------------------------------------------------
|
||||
|
||||
mngview - sample project for a simple mng-viewer. The general unit in
|
||||
the delphi directory was translated from libmng.h It can be
|
||||
used in other projects to access libmng.dll created with the
|
||||
win32dll example above.
|
||||
|
||||
|
||||
unix - Unix (found under contrib/gcc/xxx)
|
||||
-----------------------------------------
|
||||
|
||||
mngtree - basically a copy of the BCB sample. It includes a makefile for
|
||||
Linux and it's been tested on RedHat6.2
|
||||
|
46
src/3rdparty/libmng/README.footprint
vendored
46
src/3rdparty/libmng/README.footprint
vendored
@ -1,46 +0,0 @@
|
||||
/*
|
||||
You can use one or more of the following defines to
|
||||
reduce the size of the compiled library. Define the
|
||||
SKIPCANVAS macros for any canvas configurations that
|
||||
your application doesn't use. Define the SKIPCHUNK
|
||||
macros for any chunks that your application doesn't
|
||||
process. Define MNG_OPTIMIZE_FOOTPRINT to choose
|
||||
smaller code size over faster execution and less memory
|
||||
usage. These macros became available in version 1.0.6.
|
||||
*/
|
||||
|
||||
/* eliminate unused features from libmng */
|
||||
#define MNG_OPTIMIZE_FOOTPRINT
|
||||
#define MNG_OPTIMIZE_OBJCLEANUP
|
||||
#define MNG_OPTIMIZE_CHUNKINITFREE
|
||||
#define MNG_OPTIMIZE_CHUNKASSIGN
|
||||
#define MNG_OPTIMIZE_CHUNKREADER
|
||||
|
||||
#define MNG_SKIPCANVAS_ABGR8
|
||||
#define MNG_SKIPCANVAS_ARGB8
|
||||
#define MNG_SKIPCANVAS_BGR8
|
||||
#define MNG_SKIPCANVAS_BGRA8
|
||||
#define MNG_SKIPCANVAS_BGRA8_PM
|
||||
#define MNG_SKIPCANVAS_BGRX8
|
||||
#define MNG_SKIPCANVAS_RGBA8
|
||||
#define MNG_SKIPCANVAS_BGR565
|
||||
#define MNG_SKIPCANVAS_RGB565
|
||||
#define MNG_SKIPCANVAS_BGRA565
|
||||
#define MNG_SKIPCANVAS_RGBA565
|
||||
|
||||
#define MNG_SKIPCHUNK_iCCP
|
||||
#define MNG_SKIPCHUNK_tEXt
|
||||
#define MNG_SKIPCHUNK_zTXt
|
||||
#define MNG_SKIPCHUNK_iTXt
|
||||
#define MNG_SKIPCHUNK_bKGD
|
||||
#define MNG_SKIPCHUNK_pHYs
|
||||
#define MNG_SKIPCHUNK_sBIT
|
||||
#define MNG_SKIPCHUNK_sPLT
|
||||
#define MNG_SKIPCHUNK_hIST
|
||||
#define MNG_SKIPCHUNK_tIME
|
||||
#define MNG_SKIPCHUNK_eXPI
|
||||
#define MNG_SKIPCHUNK_fPRI
|
||||
#define MNG_SKIPCHUNK_nEED
|
||||
#define MNG_SKIPCHUNK_pHYg
|
||||
|
||||
|
24
src/3rdparty/libmng/README.packaging
vendored
24
src/3rdparty/libmng/README.packaging
vendored
@ -1,24 +0,0 @@
|
||||
Packaging Libmng for distribution
|
||||
---------------------------------
|
||||
|
||||
These are some notes for those building binaries for distribution.
|
||||
|
||||
We're interested to hear about anywhere libmng is helpful, so let us
|
||||
know if you're including it with your application or OS. Also, if your
|
||||
build is publicly accessible, we'd be happy to link to it from
|
||||
the libmng site.
|
||||
|
||||
However, We respectfully request that you *not* distribute binaries as a
|
||||
shared library (DLL) with any of the major features disabled. While
|
||||
there is support for this in terms of #ifdef directives (in
|
||||
libmng_conf.h) and autoconf switches they are intended for embedded
|
||||
application and testing. The default compilation options support the
|
||||
full MNG specification, and we wish to avoid the confusion among
|
||||
general users that partial support would engender.
|
||||
|
||||
|
||||
Platform specific notes:
|
||||
|
||||
We have a basic .spec file for generating rpms. Send us a note if you'd
|
||||
like to clean it up.
|
||||
|
BIN
src/3rdparty/libmng/doc/Plan1.png
vendored
BIN
src/3rdparty/libmng/doc/Plan1.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 8.8 KiB |
BIN
src/3rdparty/libmng/doc/Plan2.png
vendored
BIN
src/3rdparty/libmng/doc/Plan2.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 8.6 KiB |
19
src/3rdparty/libmng/doc/doc.readme
vendored
19
src/3rdparty/libmng/doc/doc.readme
vendored
@ -1,19 +0,0 @@
|
||||
This directory hosts the documentation for libmng.
|
||||
|
||||
You will find a lot of useful info on the web-site:
|
||||
http://www.libmng.com
|
||||
|
||||
Man-pages are in the man sub-directory
|
||||
|
||||
RPM specification files are in the RPM sub-directory
|
||||
|
||||
Files in this directory:
|
||||
|
||||
- libmng.txt
|
||||
|
||||
Description of the library proper and its usage
|
||||
|
||||
- Plan1.png & Plan2.png
|
||||
|
||||
Visual representation of the functional and technical
|
||||
design of the library (in PNG format of course!)
|
1107
src/3rdparty/libmng/doc/libmng.txt
vendored
1107
src/3rdparty/libmng/doc/libmng.txt
vendored
File diff suppressed because it is too large
Load Diff
37
src/3rdparty/libmng/doc/man/jng.5
vendored
37
src/3rdparty/libmng/doc/man/jng.5
vendored
@ -1,37 +0,0 @@
|
||||
.TH JNG 5 "July 26, 2000"
|
||||
.SH NAME
|
||||
jng \- JPEG Network Graphics (JNG) sub-format
|
||||
.SH DESCRIPTION
|
||||
JNG (JPEG Network Graphics) is a sub-format of the MNG (Multiple-image
|
||||
Network Graphics) format. As with MNG it extends on the features of the
|
||||
popular PNG (Portable Network Graphics) image-format.
|
||||
.br
|
||||
|
||||
This sub-format was designed to support a lossy compression-method.
|
||||
It is based completely on the JPEG specification. It adds the high-compression
|
||||
ratios of JPEG for photographic images.
|
||||
|
||||
As a member of the Network Graphics family, JNG was deemed adequate as a
|
||||
stand-alone format as it extends the JPEG format with color-correction and
|
||||
transparency features.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.IR png(5) ", " mng(5) ", " libmng(3)
|
||||
.LP
|
||||
MNG 1.00, February 9, 2001:
|
||||
.IP
|
||||
http://www.libpng.org/pub/mng
|
||||
|
||||
.SH AUTHORS
|
||||
This man page: Gerard Juyn
|
||||
.LP
|
||||
Multiple-image Network Graphics (MNG) Specification Version 1.00 (Februari 9, 2001):
|
||||
Glenn Randers-Pehrson and others (png-list@ccrc.wustl.edu).
|
||||
.LP
|
||||
|
||||
.SH COPYRIGHT NOTICE
|
||||
The MNG-1.00 specification is copyright (c) 1998-2001 Glenn Randers-Pehrson.
|
||||
See the specification for conditions of use and distribution.
|
||||
.LP
|
||||
.\" end of man page
|
||||
|
1146
src/3rdparty/libmng/doc/man/libmng.3
vendored
1146
src/3rdparty/libmng/doc/man/libmng.3
vendored
File diff suppressed because it is too large
Load Diff
42
src/3rdparty/libmng/doc/man/mng.5
vendored
42
src/3rdparty/libmng/doc/man/mng.5
vendored
@ -1,42 +0,0 @@
|
||||
.TH MNG 5 "July 25, 2000"
|
||||
.SH NAME
|
||||
mng \- Multiple-image Network Graphics (MNG) format
|
||||
.SH DESCRIPTION
|
||||
MNG (Multiple-image Network Graphics) is the animation extension of the
|
||||
popular PNG image-format. PNG (Portable Network Graphics) is an
|
||||
extensible file format for the lossless, portable, well-compressed
|
||||
storage of raster images.
|
||||
.br
|
||||
|
||||
MNG has advanced animation features which make it very useful as a full
|
||||
replacement for GIF animations. These features allow animations that
|
||||
are impossible with GIF or result in much smaller files as GIF.
|
||||
|
||||
As MNG builds on the same structure as PNG, it is robust, extensible and
|
||||
free of patents. It retains the same clever file integrity checks as in PNG.
|
||||
|
||||
MNG also embraces the lossy JPEG image-format in a sub-format named JNG,
|
||||
which allows for alpha-transparency and color-correction on highly
|
||||
compressed (photographic) images.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
.IR png(5) ", " jng(5) ", " libmng(3) ", " libpng(3) ", " zlib(3) ", "
|
||||
deflate(5) ", " zlib(5) ", " jpeg(5)
|
||||
.LP
|
||||
MNG 1.00, Februari 9, 2001:
|
||||
.IP
|
||||
.br
|
||||
http://www.libpng.org/pub/mng
|
||||
.SH AUTHORS
|
||||
This man page: Gerard Juyn
|
||||
.LP
|
||||
Multiple-image Network Graphics (MNG) Specification Version 1.00 (Februari 9, 2001):
|
||||
Glenn Randers-Pehrson and others (png-list@ccrc.wustl.edu).
|
||||
.LP
|
||||
|
||||
.SH COPYRIGHT NOTICE
|
||||
The MNG-1.00 specification is copyright (c) 1998-2001 Glenn Randers-Pehrson.
|
||||
See the specification for conditions of use and distribution.
|
||||
.LP
|
||||
.\" end of man page
|
||||
|
30
src/3rdparty/libmng/doc/misc/magic.dif
vendored
30
src/3rdparty/libmng/doc/misc/magic.dif
vendored
@ -1,30 +0,0 @@
|
||||
--- magic.orig Wed Aug 14 16:48:56 2002
|
||||
+++ magic Wed Aug 14 16:50:09 2002
|
||||
@@ -2544,6 +2544,27 @@
|
||||
>>28 byte 1 interlaced
|
||||
1 string PNG PNG image data, CORRUPTED
|
||||
|
||||
+#MNG
|
||||
+# 0x8a M N G 0x0d 0x0a 0x1a 0x0a [4-byte pad]
|
||||
+# M H D R [4-byte width][4-byte height][4-byte ticks][4-byte layers]
|
||||
+# [4-byte frame][4-byte time]
|
||||
+#
|
||||
+0 string \x8aMNG MNG image data,
|
||||
+>4 belong !0x0d0a1a0a CORRUPTED
|
||||
+>4 belong 0x0d0a1a0a
|
||||
+>>16 belong x %ld x
|
||||
+>>20 belong x %ld
|
||||
+
|
||||
+#JNG
|
||||
+# 0x8b J N G 0x0d 0x0a 0x1a 0x0a [4-byte pad]
|
||||
+# J H D R [4-byte width][4-byte height]
|
||||
+#
|
||||
+0 string \x8bJNG JNG image data,
|
||||
+>4 belong !0x0d0a1a0a CORRUPTED
|
||||
+>4 belong 0x0d0a1a0a
|
||||
+>>16 belong x %ld x
|
||||
+>>20 belong x %ld
|
||||
+
|
||||
# GIF
|
||||
0 string GIF8 GIF image data
|
||||
>4 string 7a \b, version 8%s,
|
@ -1,38 +0,0 @@
|
||||
--- libmng/makefiles/makefile.linux.orig Sat Jul 1 15:10:35 2000
|
||||
+++ libmng/makefiles/makefile.linux Sat Jul 1 15:14:52 2000
|
||||
@@ -13,19 +13,19 @@
|
||||
OPTIONS = -DMNG_BUILD_SO
|
||||
|
||||
# where "make install" puts libmng.a,libmng.so*,libmng.h,libmng_conf.h,libmng_types.h
|
||||
-prefix=/usr/local
|
||||
+prefix=/usr
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
-ZLIBLIB=../zlib
|
||||
-ZLIBINC=../zlib
|
||||
+ZLIBLIB=/usr/lib
|
||||
+ZLIBINC=/usr/include
|
||||
|
||||
# Where the jpeg library and include files are located
|
||||
-JPEGLIB=../jpgsrc
|
||||
-JPEGINC=../jpgsrc
|
||||
+JPEGLIB=/usr/lib
|
||||
+JPEGINC=/usr/include
|
||||
|
||||
# Where the lcms library and include files are located
|
||||
-LCMSLIB=../lcms/lib
|
||||
-LCMSINC=../lcms/source
|
||||
+LCMSLIB=/usr/lib
|
||||
+LCMSINC=/usr/include
|
||||
|
||||
ALIGN=
|
||||
# for i386:
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
||||
|
||||
-CFLAGS=-I$(ZLIBINC) -I$(JPEGINC) -I$(LCMSINC) -Wall -O3 -funroll-loops \
|
||||
+CFLAGS=-I$(ZLIBINC) -I$(JPEGINC) -I$(LCMSINC) -Wall $(RPM_OPT_FLAGS) \
|
||||
$(OPTIONS) $(ALIGN) # $(WARNMORE) -g
|
||||
LDFLAGS=-L. -Wl,-rpath,. \
|
||||
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
|
116
src/3rdparty/libmng/doc/rpm/libmng.spec
vendored
116
src/3rdparty/libmng/doc/rpm/libmng.spec
vendored
@ -1,116 +0,0 @@
|
||||
Summary: A library of functions for manipulating MNG format files.
|
||||
Name: libmng
|
||||
Version: 1.0.10
|
||||
Release: 2.1
|
||||
Copyright: AS IS
|
||||
Group: System Environment/Libraries
|
||||
Source0: libmng-%{PACKAGE_VERSION}.tar.gz
|
||||
Patch: libmng-%{PACKAGE_VERSION}-rhconf.patch
|
||||
URL: http://www.libmng.com/
|
||||
BuildRoot: /var/tmp/libmng-root
|
||||
BuildPrereq: libjpeg-devel, zlib-devel, lcms-devel
|
||||
|
||||
%description
|
||||
libmng - library for reading, writing, displaying and examing
|
||||
Multiple-Image Network Graphics. MNG is the animation extension to the
|
||||
popular PNG image-format.
|
||||
|
||||
%package devel
|
||||
Summary: Development tools for programs to manipulate MNG format files.
|
||||
Group: Development/Libraries
|
||||
Requires: libmng = %{PACKAGE_VERSION}
|
||||
%description devel
|
||||
The libmng-devel package contains the header files and static
|
||||
libraries necessary for developing programs using the MNG
|
||||
(Multiple-Image Network Graphics) library.
|
||||
|
||||
If you want to develop programs which will manipulate MNG image format
|
||||
files, you should install libmng-devel. You'll also need to install
|
||||
the libmng package.
|
||||
|
||||
%changelog
|
||||
* Fri Jul 13 2007 Glenn Randers-Pehrson <glennrp at users.sf.net>
|
||||
- updated to 1.0.10
|
||||
|
||||
* Thu Aug 5 2004 Gerard Juyn <gerard at libmng.com>
|
||||
* Sun Jan 30 2005 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.9
|
||||
|
||||
* Thu Aug 5 2004 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.8
|
||||
|
||||
* Sun Mar 21 2004 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.7
|
||||
|
||||
* Sun Oct 19 2003 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.6
|
||||
|
||||
* Tue Sep 24 2002 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.5
|
||||
|
||||
* Sun Jun 23 2002 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.4
|
||||
|
||||
* Mon Sep 18 2001 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.3
|
||||
|
||||
* Sat Jul 7 2001 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.2
|
||||
|
||||
* Wed May 2 2001 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.1
|
||||
|
||||
* Mon Feb 5 2001 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 1.0.0
|
||||
|
||||
* Fri Jan 19 2001 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 0.9.4
|
||||
|
||||
* Sat Oct 28 2000 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 0.9.3
|
||||
|
||||
* Tue Aug 15 2000 MATSUURA Takanori <t-matsuu at protein.osaka-u.ac.jp>
|
||||
- based on libmng-0.9.2/doc/rpm/libmng.spec
|
||||
- use %%configure and %%makeinstall
|
||||
|
||||
* Sat Aug 5 2000 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 0.9.2
|
||||
|
||||
* Wed Jul 26 2000 Gerard Juyn <gerard at libmng.com>
|
||||
- updated to 0.9.1
|
||||
|
||||
* Sat Jul 1 2000 MATSUURA Takanori <t-matsuu at protein.osaka-u.ac.jp>
|
||||
- updated to 0.9.0
|
||||
|
||||
* Sat Jun 24 2000 MATSUURA Takanori <t-matsuu at protein.osaka-u.ac.jp>
|
||||
- 1st release for RPM
|
||||
|
||||
%prep
|
||||
%setup
|
||||
%configure
|
||||
|
||||
%build
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
%makeinstall
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post -p /sbin/ldconfig
|
||||
|
||||
%postun -p /sbin/ldconfig
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc CHANGES LICENSE README doc
|
||||
/usr/lib/libmng.so.*
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
/usr/include/*
|
||||
/usr/lib/libmng.a
|
||||
/usr/lib/libmng.so
|
||||
|
2932
src/3rdparty/libmng/libmng.h
vendored
2932
src/3rdparty/libmng/libmng.h
vendored
File diff suppressed because it is too large
Load Diff
1239
src/3rdparty/libmng/libmng_callback_xs.c
vendored
1239
src/3rdparty/libmng/libmng_callback_xs.c
vendored
File diff suppressed because it is too large
Load Diff
6090
src/3rdparty/libmng/libmng_chunk_descr.c
vendored
6090
src/3rdparty/libmng/libmng_chunk_descr.c
vendored
File diff suppressed because it is too large
Load Diff
146
src/3rdparty/libmng/libmng_chunk_descr.h
vendored
146
src/3rdparty/libmng/libmng_chunk_descr.h
vendored
@ -1,146 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_chunk_descr.h copyright (c) 2007 G.Juyn * */
|
||||
/* * version : 1.0.10 * */
|
||||
/* * * */
|
||||
/* * purpose : Chunk descriptor functions (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : definition of the chunk- anf field-descriptor routines * */
|
||||
/* * * */
|
||||
/* * changes : 1.0.9 - 12/06/2004 - G.Juyn * */
|
||||
/* * - added conditional MNG_OPTIMIZE_CHUNKREADER * */
|
||||
/* * * */
|
||||
/* * 1.0.10 - 04/08/2007 - G.Juyn * */
|
||||
/* * - added support for mPNG proposal * */
|
||||
/* * 1.0.10 - 04/12/2007 - G.Juyn * */
|
||||
/* * - added support for ANG proposal * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_chunk_descr_h_
|
||||
#define _libmng_chunk_descr_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_OPTIMIZE_CHUNKREADER
|
||||
#if defined(MNG_INCLUDE_READ_PROCS) || defined(MNG_INCLUDE_WRITE_PROCS)
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mng_get_chunkheader (mng_chunkid iChunkname,
|
||||
mng_chunk_headerp pResult);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_F_SPECIALFUNC(n) mng_retcode n (mng_datap pData, \
|
||||
mng_chunkp pChunk, \
|
||||
mng_uint32* piRawlen, \
|
||||
mng_uint8p* ppRawdata)
|
||||
|
||||
MNG_F_SPECIALFUNC (mng_debunk_plte) ;
|
||||
MNG_F_SPECIALFUNC (mng_debunk_trns) ;
|
||||
MNG_F_SPECIALFUNC (mng_deflate_itxt) ;
|
||||
MNG_F_SPECIALFUNC (mng_splt_entries) ;
|
||||
MNG_F_SPECIALFUNC (mng_hist_entries) ;
|
||||
|
||||
MNG_F_SPECIALFUNC (mng_debunk_loop) ;
|
||||
MNG_F_SPECIALFUNC (mng_debunk_past) ;
|
||||
MNG_F_SPECIALFUNC (mng_disc_entries) ;
|
||||
MNG_F_SPECIALFUNC (mng_fram_remainder) ;
|
||||
MNG_F_SPECIALFUNC (mng_save_entries) ;
|
||||
MNG_F_SPECIALFUNC (mng_pplt_entries) ;
|
||||
MNG_F_SPECIALFUNC (mng_drop_entries) ;
|
||||
MNG_F_SPECIALFUNC (mng_ordr_entries) ;
|
||||
MNG_F_SPECIALFUNC (mng_debunk_magn) ;
|
||||
MNG_F_SPECIALFUNC (mng_evnt_entries) ;
|
||||
MNG_F_SPECIALFUNC (mng_adat_tiles) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_C_SPECIALFUNC(n) mng_retcode n (mng_datap pData, \
|
||||
mng_chunkp pChunk)
|
||||
|
||||
MNG_C_SPECIALFUNC (mng_special_ihdr) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_plte) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_idat) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_iend) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_trns) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_gama) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_chrm) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_srgb) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_iccp) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_text) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_ztxt) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_itxt) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_bkgd) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_phys) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_sbit) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_splt) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_hist) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_time) ;
|
||||
|
||||
MNG_C_SPECIALFUNC (mng_special_jhdr) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_jdaa) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_jdat) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_jsep) ;
|
||||
|
||||
MNG_C_SPECIALFUNC (mng_special_mhdr) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_mend) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_loop) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_endl) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_defi) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_basi) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_clon) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_past) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_disc) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_back) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_fram) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_move) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_clip) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_show) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_term) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_save) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_seek) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_expi) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_fpri) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_need) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_phyg) ;
|
||||
|
||||
MNG_C_SPECIALFUNC (mng_special_dhdr) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_prom) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_ipng) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_pplt) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_ijng) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_drop) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_dbyk) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_ordr) ;
|
||||
|
||||
MNG_C_SPECIALFUNC (mng_special_magn) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_evnt) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_mpng) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_ahdr) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_adat) ;
|
||||
MNG_C_SPECIALFUNC (mng_special_unknown) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_READ_PROCS) || MNG_INCLUDE_WRITE_PROCS */
|
||||
#endif /* MNG_OPTIMIZE_CHUNKREADER */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_chunk_descr_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
10740
src/3rdparty/libmng/libmng_chunk_io.c
vendored
10740
src/3rdparty/libmng/libmng_chunk_io.c
vendored
File diff suppressed because it is too large
Load Diff
415
src/3rdparty/libmng/libmng_chunk_io.h
vendored
415
src/3rdparty/libmng/libmng_chunk_io.h
vendored
@ -1,415 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_chunk_io.h copyright (c) 2000-2007 G.Juyn * */
|
||||
/* * version : 1.0.109 * */
|
||||
/* * * */
|
||||
/* * purpose : Chunk I/O routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the chunk input/output routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/04/2000 - G.Juyn * */
|
||||
/* * - changed CRC initialization to use dynamic structure * */
|
||||
/* * (wasn't thread-safe the old way !) * */
|
||||
/* * 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed write routines definition * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 08/26/2000 - G.Juyn * */
|
||||
/* * - added MAGN chunk * */
|
||||
/* * 0.9.3 - 10/16/2000 - G.Juyn * */
|
||||
/* * - added support for JDAA * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * 1.0.5 - 09/14/2002 - G.Juyn * */
|
||||
/* * - added event handling for dynamic MNG * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 07/07/2003 - G.R-P * */
|
||||
/* * - added SKIP_CHUNK and NO_DELTA_PNG support * */
|
||||
/* * 1.0.6 - 07/29/2003 - G.R-P * */
|
||||
/* * - added conditionals around PAST chunk support * */
|
||||
/* * * */
|
||||
/* * 1.0.7 - 03/24/2004 - G.R-P * */
|
||||
/* * - fixed SKIPCHUNK_itXT and SKIPCHUNK_ztXT typos * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/07/2004 - G.Juyn * */
|
||||
/* * - added conditional MNG_OPTIMIZE_CHUNKREADER * */
|
||||
/* * * */
|
||||
/* * 1.0.10 - 04/08/2007 - G.Juyn * */
|
||||
/* * - added support for mPNG proposal * */
|
||||
/* * 1.0.10 - 04/12/2007 - G.Juyn * */
|
||||
/* * - added support for ANG proposal * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_chunk_io_h_
|
||||
#define _libmng_chunk_io_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_uint32 mng_crc (mng_datap pData,
|
||||
mng_uint8p buf,
|
||||
mng_int32 len);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_READ_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_inflate_buffer (mng_datap pData,
|
||||
mng_uint8p pInbuf,
|
||||
mng_uint32 iInsize,
|
||||
mng_uint8p *pOutbuf,
|
||||
mng_uint32 *iOutsize,
|
||||
mng_uint32 *iRealsize);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define READ_CHUNK(n) mng_retcode n (mng_datap pData, \
|
||||
mng_chunkp pHeader, \
|
||||
mng_uint32 iRawlen, \
|
||||
mng_uint8p pRawdata, \
|
||||
mng_chunkp* ppChunk)
|
||||
|
||||
#ifdef MNG_OPTIMIZE_CHUNKREADER
|
||||
READ_CHUNK (mng_read_general) ;
|
||||
#endif
|
||||
|
||||
READ_CHUNK (mng_read_ihdr) ;
|
||||
READ_CHUNK (mng_read_plte) ;
|
||||
READ_CHUNK (mng_read_idat) ;
|
||||
READ_CHUNK (mng_read_iend) ;
|
||||
READ_CHUNK (mng_read_trns) ;
|
||||
READ_CHUNK (mng_read_gama) ;
|
||||
READ_CHUNK (mng_read_chrm) ;
|
||||
READ_CHUNK (mng_read_srgb) ;
|
||||
#ifndef MNG_SKIPCHUNK_iCCP
|
||||
READ_CHUNK (mng_read_iccp) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_tEXt
|
||||
READ_CHUNK (mng_read_text) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_zTXt
|
||||
READ_CHUNK (mng_read_ztxt) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_iTXt
|
||||
READ_CHUNK (mng_read_itxt) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_bKGD
|
||||
READ_CHUNK (mng_read_bkgd) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_pHYs
|
||||
READ_CHUNK (mng_read_phys) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_sBIT
|
||||
READ_CHUNK (mng_read_sbit) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_sPLT
|
||||
READ_CHUNK (mng_read_splt) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_hIST
|
||||
READ_CHUNK (mng_read_hist) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_tIME
|
||||
READ_CHUNK (mng_read_time) ;
|
||||
#endif
|
||||
READ_CHUNK (mng_read_mhdr) ;
|
||||
READ_CHUNK (mng_read_mend) ;
|
||||
READ_CHUNK (mng_read_loop) ;
|
||||
READ_CHUNK (mng_read_endl) ;
|
||||
READ_CHUNK (mng_read_defi) ;
|
||||
READ_CHUNK (mng_read_basi) ;
|
||||
READ_CHUNK (mng_read_clon) ;
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
READ_CHUNK (mng_read_past) ;
|
||||
#endif
|
||||
READ_CHUNK (mng_read_disc) ;
|
||||
READ_CHUNK (mng_read_back) ;
|
||||
READ_CHUNK (mng_read_fram) ;
|
||||
READ_CHUNK (mng_read_move) ;
|
||||
READ_CHUNK (mng_read_clip) ;
|
||||
READ_CHUNK (mng_read_show) ;
|
||||
READ_CHUNK (mng_read_term) ;
|
||||
READ_CHUNK (mng_read_save) ;
|
||||
READ_CHUNK (mng_read_seek) ;
|
||||
#ifndef MNG_SKIPCHUNK_eXPI
|
||||
READ_CHUNK (mng_read_expi) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_fPRI
|
||||
READ_CHUNK (mng_read_fpri) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_pHYg
|
||||
READ_CHUNK (mng_read_phyg) ;
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
READ_CHUNK (mng_read_jhdr) ;
|
||||
READ_CHUNK (mng_read_jdaa) ;
|
||||
READ_CHUNK (mng_read_jdat) ;
|
||||
READ_CHUNK (mng_read_jsep) ;
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
READ_CHUNK (mng_read_dhdr) ;
|
||||
READ_CHUNK (mng_read_prom) ;
|
||||
READ_CHUNK (mng_read_ipng) ;
|
||||
READ_CHUNK (mng_read_pplt) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
READ_CHUNK (mng_read_ijng) ;
|
||||
#endif
|
||||
READ_CHUNK (mng_read_drop) ;
|
||||
READ_CHUNK (mng_read_dbyk) ;
|
||||
READ_CHUNK (mng_read_ordr) ;
|
||||
#endif
|
||||
READ_CHUNK (mng_read_magn) ;
|
||||
#ifndef MNG_SKIPCHUNK_nEED
|
||||
READ_CHUNK (mng_read_need) ;
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
READ_CHUNK (mng_read_mpng) ;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_evNT
|
||||
READ_CHUNK (mng_read_evnt) ;
|
||||
#endif
|
||||
READ_CHUNK (mng_read_unknown) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#else /* MNG_INCLUDE_READ_PROCS */
|
||||
#define mng_read_ihdr 0
|
||||
#define mng_read_plte 0
|
||||
#define mng_read_idat 0
|
||||
#define mng_read_iend 0
|
||||
#define mng_read_trns 0
|
||||
#define mng_read_gama 0
|
||||
#define mng_read_chrm 0
|
||||
#define mng_read_srgb 0
|
||||
#define mng_read_iccp 0
|
||||
#define mng_read_text 0
|
||||
#define mng_read_ztxt 0
|
||||
#define mng_read_itxt 0
|
||||
#define mng_read_bkgd 0
|
||||
#define mng_read_phys 0
|
||||
#define mng_read_sbit 0
|
||||
#define mng_read_splt 0
|
||||
#define mng_read_hist 0
|
||||
#define mng_read_time 0
|
||||
#define mng_read_mhdr 0
|
||||
#define mng_read_mend 0
|
||||
#define mng_read_loop 0
|
||||
#define mng_read_endl 0
|
||||
#define mng_read_defi 0
|
||||
#define mng_read_basi 0
|
||||
#define mng_read_clon 0
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
#define mng_read_past 0
|
||||
#endif
|
||||
#define mng_read_disc 0
|
||||
#define mng_read_back 0
|
||||
#define mng_read_fram 0
|
||||
#define mng_read_move 0
|
||||
#define mng_read_clip 0
|
||||
#define mng_read_show 0
|
||||
#define mng_read_term 0
|
||||
#define mng_read_save 0
|
||||
#define mng_read_seek 0
|
||||
#define mng_read_expi 0
|
||||
#define mng_read_fpri 0
|
||||
#define mng_read_phyg 0
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
#define mng_read_jhdr 0
|
||||
#define mng_read_jdaa 0
|
||||
#define mng_read_jdat 0
|
||||
#define mng_read_jsep 0
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
#define mng_read_dhdr 0
|
||||
#define mng_read_prom 0
|
||||
#define mng_read_ipng 0
|
||||
#define mng_read_pplt 0
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
#define mng_read_ijng 0
|
||||
#endif
|
||||
#define mng_read_drop 0
|
||||
#define mng_read_dbyk 0
|
||||
#define mng_read_ordr 0
|
||||
#endif
|
||||
#define mng_read_magn 0
|
||||
#define mng_read_need 0
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
#define mng_read_mpng 0
|
||||
#endif
|
||||
#define mng_read_evnt 0
|
||||
#define mng_read_unknown 0
|
||||
#endif /* MNG_INCLUDE_READ_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_WRITE_PROCS
|
||||
|
||||
#define WRITE_CHUNK(n) mng_retcode n (mng_datap pData, \
|
||||
mng_chunkp pChunk)
|
||||
|
||||
WRITE_CHUNK (mng_write_ihdr) ;
|
||||
WRITE_CHUNK (mng_write_plte) ;
|
||||
WRITE_CHUNK (mng_write_idat) ;
|
||||
WRITE_CHUNK (mng_write_iend) ;
|
||||
WRITE_CHUNK (mng_write_trns) ;
|
||||
WRITE_CHUNK (mng_write_gama) ;
|
||||
WRITE_CHUNK (mng_write_chrm) ;
|
||||
WRITE_CHUNK (mng_write_srgb) ;
|
||||
WRITE_CHUNK (mng_write_iccp) ;
|
||||
WRITE_CHUNK (mng_write_text) ;
|
||||
WRITE_CHUNK (mng_write_ztxt) ;
|
||||
WRITE_CHUNK (mng_write_itxt) ;
|
||||
WRITE_CHUNK (mng_write_bkgd) ;
|
||||
WRITE_CHUNK (mng_write_phys) ;
|
||||
WRITE_CHUNK (mng_write_sbit) ;
|
||||
WRITE_CHUNK (mng_write_splt) ;
|
||||
WRITE_CHUNK (mng_write_hist) ;
|
||||
WRITE_CHUNK (mng_write_time) ;
|
||||
WRITE_CHUNK (mng_write_mhdr) ;
|
||||
WRITE_CHUNK (mng_write_mend) ;
|
||||
WRITE_CHUNK (mng_write_loop) ;
|
||||
WRITE_CHUNK (mng_write_endl) ;
|
||||
WRITE_CHUNK (mng_write_defi) ;
|
||||
WRITE_CHUNK (mng_write_basi) ;
|
||||
WRITE_CHUNK (mng_write_clon) ;
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
WRITE_CHUNK (mng_write_past) ;
|
||||
#endif
|
||||
WRITE_CHUNK (mng_write_disc) ;
|
||||
WRITE_CHUNK (mng_write_back) ;
|
||||
WRITE_CHUNK (mng_write_fram) ;
|
||||
WRITE_CHUNK (mng_write_move) ;
|
||||
WRITE_CHUNK (mng_write_clip) ;
|
||||
WRITE_CHUNK (mng_write_show) ;
|
||||
WRITE_CHUNK (mng_write_term) ;
|
||||
WRITE_CHUNK (mng_write_save) ;
|
||||
WRITE_CHUNK (mng_write_seek) ;
|
||||
WRITE_CHUNK (mng_write_expi) ;
|
||||
WRITE_CHUNK (mng_write_fpri) ;
|
||||
WRITE_CHUNK (mng_write_phyg) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
WRITE_CHUNK (mng_write_jhdr) ;
|
||||
WRITE_CHUNK (mng_write_jdaa) ;
|
||||
WRITE_CHUNK (mng_write_jdat) ;
|
||||
WRITE_CHUNK (mng_write_jsep) ;
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
WRITE_CHUNK (mng_write_dhdr) ;
|
||||
WRITE_CHUNK (mng_write_prom) ;
|
||||
WRITE_CHUNK (mng_write_ipng) ;
|
||||
WRITE_CHUNK (mng_write_pplt) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
WRITE_CHUNK (mng_write_ijng) ;
|
||||
#endif
|
||||
WRITE_CHUNK (mng_write_drop) ;
|
||||
WRITE_CHUNK (mng_write_dbyk) ;
|
||||
WRITE_CHUNK (mng_write_ordr) ;
|
||||
#endif
|
||||
WRITE_CHUNK (mng_write_magn) ;
|
||||
WRITE_CHUNK (mng_write_need) ;
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
WRITE_CHUNK (mng_write_mpng) ;
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_ANG_PROPOSAL
|
||||
WRITE_CHUNK (mng_write_ahdr) ;
|
||||
WRITE_CHUNK (mng_write_adat) ;
|
||||
#endif
|
||||
WRITE_CHUNK (mng_write_evnt) ;
|
||||
WRITE_CHUNK (mng_write_unknown) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#else /* MNG_INCLUDE_WRITE_PROCS */
|
||||
#define mng_write_ihdr 0
|
||||
#define mng_write_plte 0
|
||||
#define mng_write_idat 0
|
||||
#define mng_write_iend 0
|
||||
#define mng_write_trns 0
|
||||
#define mng_write_gama 0
|
||||
#define mng_write_chrm 0
|
||||
#define mng_write_srgb 0
|
||||
#define mng_write_iccp 0
|
||||
#define mng_write_text 0
|
||||
#define mng_write_ztxt 0
|
||||
#define mng_write_itxt 0
|
||||
#define mng_write_bkgd 0
|
||||
#define mng_write_phys 0
|
||||
#define mng_write_sbit 0
|
||||
#define mng_write_splt 0
|
||||
#define mng_write_hist 0
|
||||
#define mng_write_time 0
|
||||
#define mng_write_mhdr 0
|
||||
#define mng_write_mend 0
|
||||
#define mng_write_loop 0
|
||||
#define mng_write_endl 0
|
||||
#define mng_write_defi 0
|
||||
#define mng_write_basi 0
|
||||
#define mng_write_clon 0
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
#define mng_write_past 0
|
||||
#endif
|
||||
#define mng_write_disc 0
|
||||
#define mng_write_back 0
|
||||
#define mng_write_fram 0
|
||||
#define mng_write_move 0
|
||||
#define mng_write_clip 0
|
||||
#define mng_write_show 0
|
||||
#define mng_write_term 0
|
||||
#define mng_write_save 0
|
||||
#define mng_write_seek 0
|
||||
#define mng_write_expi 0
|
||||
#define mng_write_fpri 0
|
||||
#define mng_write_phyg 0
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
#define mng_write_jhdr 0
|
||||
#define mng_write_jdaa 0
|
||||
#define mng_write_jdat 0
|
||||
#define mng_write_jsep 0
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
#define mng_write_dhdr 0
|
||||
#define mng_write_prom 0
|
||||
#define mng_write_ipng 0
|
||||
#define mng_write_pplt 0
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
#define mng_write_ijng 0
|
||||
#endif
|
||||
#define mng_write_drop 0
|
||||
#define mng_write_dbyk 0
|
||||
#define mng_write_ordr 0
|
||||
#endif
|
||||
#define mng_write_magn 0
|
||||
#define mng_write_need 0
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
#define mng_write_mpng 0
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_ANG_PROPOSAL
|
||||
#define mng_write_adat 0
|
||||
#define mng_write_ahdr 0
|
||||
#endif
|
||||
#define mng_write_evnt 0
|
||||
#define mng_write_unknown 0
|
||||
#endif /* MNG_INCLUDE_WRITE_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_chunk_io_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
4452
src/3rdparty/libmng/libmng_chunk_prc.c
vendored
4452
src/3rdparty/libmng/libmng_chunk_prc.c
vendored
File diff suppressed because it is too large
Load Diff
381
src/3rdparty/libmng/libmng_chunk_prc.h
vendored
381
src/3rdparty/libmng/libmng_chunk_prc.h
vendored
@ -1,381 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_chunk_prc.h copyright (c) 2000-2007 G.Juyn * */
|
||||
/* * version : 1.0.10 * */
|
||||
/* * * */
|
||||
/* * purpose : Chunk initialization & cleanup (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : definition of the chunk initialization & cleanup routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 08/26/2000 - G.Juyn * */
|
||||
/* * - added MAGN chunk * */
|
||||
/* * 0.9.3 - 10/16/2000 - G.Juyn * */
|
||||
/* * - added support for JDAA * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * 1.0.5 - 09/14/2002 - G.Juyn * */
|
||||
/* * - added event handling for dynamic MNG * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 07/07/2003 - G.R-P * */
|
||||
/* * - added NO_DELTA_PNG support * */
|
||||
/* * 1.0.6 - 07/29/2003 - G.R-P * */
|
||||
/* * - added conditionals around PAST chunk support * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/05/2004 - G.Juyn * */
|
||||
/* * - added conditional MNG_OPTIMIZE_CHUNKINITFREE * */
|
||||
/* * 1.0.9 - 12/06/2004 - G.Juyn * */
|
||||
/* * - added conditional MNG_OPTIMIZE_CHUNKASSIGN * */
|
||||
/* * * */
|
||||
/* * 1.0.10 - 04/08/2007 - G.Juyn * */
|
||||
/* * - added support for mPNG proposal * */
|
||||
/* * 1.0.10 - 04/12/2007 - G.Juyn * */
|
||||
/* * - added support for ANG proposal * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_chunk_prc_h_
|
||||
#define _libmng_chunk_prc_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mng_add_chunk (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define INIT_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
|
||||
mng_chunkp pHeader, \
|
||||
mng_chunkp* ppChunk)
|
||||
|
||||
#ifdef MNG_OPTIMIZE_CHUNKINITFREE
|
||||
INIT_CHUNK_HDR (mng_init_general) ;
|
||||
#else
|
||||
INIT_CHUNK_HDR (mng_init_ihdr) ;
|
||||
INIT_CHUNK_HDR (mng_init_plte) ;
|
||||
INIT_CHUNK_HDR (mng_init_idat) ;
|
||||
INIT_CHUNK_HDR (mng_init_iend) ;
|
||||
INIT_CHUNK_HDR (mng_init_trns) ;
|
||||
INIT_CHUNK_HDR (mng_init_gama) ;
|
||||
INIT_CHUNK_HDR (mng_init_chrm) ;
|
||||
INIT_CHUNK_HDR (mng_init_srgb) ;
|
||||
INIT_CHUNK_HDR (mng_init_iccp) ;
|
||||
INIT_CHUNK_HDR (mng_init_text) ;
|
||||
INIT_CHUNK_HDR (mng_init_ztxt) ;
|
||||
INIT_CHUNK_HDR (mng_init_itxt) ;
|
||||
INIT_CHUNK_HDR (mng_init_bkgd) ;
|
||||
INIT_CHUNK_HDR (mng_init_phys) ;
|
||||
INIT_CHUNK_HDR (mng_init_sbit) ;
|
||||
INIT_CHUNK_HDR (mng_init_splt) ;
|
||||
INIT_CHUNK_HDR (mng_init_hist) ;
|
||||
INIT_CHUNK_HDR (mng_init_time) ;
|
||||
INIT_CHUNK_HDR (mng_init_mhdr) ;
|
||||
INIT_CHUNK_HDR (mng_init_mend) ;
|
||||
INIT_CHUNK_HDR (mng_init_loop) ;
|
||||
INIT_CHUNK_HDR (mng_init_endl) ;
|
||||
INIT_CHUNK_HDR (mng_init_defi) ;
|
||||
INIT_CHUNK_HDR (mng_init_basi) ;
|
||||
INIT_CHUNK_HDR (mng_init_clon) ;
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
INIT_CHUNK_HDR (mng_init_past) ;
|
||||
#endif
|
||||
INIT_CHUNK_HDR (mng_init_disc) ;
|
||||
INIT_CHUNK_HDR (mng_init_back) ;
|
||||
INIT_CHUNK_HDR (mng_init_fram) ;
|
||||
INIT_CHUNK_HDR (mng_init_move) ;
|
||||
INIT_CHUNK_HDR (mng_init_clip) ;
|
||||
INIT_CHUNK_HDR (mng_init_show) ;
|
||||
INIT_CHUNK_HDR (mng_init_term) ;
|
||||
INIT_CHUNK_HDR (mng_init_save) ;
|
||||
INIT_CHUNK_HDR (mng_init_seek) ;
|
||||
INIT_CHUNK_HDR (mng_init_expi) ;
|
||||
INIT_CHUNK_HDR (mng_init_fpri) ;
|
||||
INIT_CHUNK_HDR (mng_init_need) ;
|
||||
INIT_CHUNK_HDR (mng_init_phyg) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
INIT_CHUNK_HDR (mng_init_jhdr) ;
|
||||
INIT_CHUNK_HDR (mng_init_jdaa) ;
|
||||
INIT_CHUNK_HDR (mng_init_jdat) ;
|
||||
INIT_CHUNK_HDR (mng_init_jsep) ;
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
INIT_CHUNK_HDR (mng_init_dhdr) ;
|
||||
INIT_CHUNK_HDR (mng_init_prom) ;
|
||||
INIT_CHUNK_HDR (mng_init_ipng) ;
|
||||
INIT_CHUNK_HDR (mng_init_pplt) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
INIT_CHUNK_HDR (mng_init_ijng) ;
|
||||
#endif
|
||||
INIT_CHUNK_HDR (mng_init_drop) ;
|
||||
INIT_CHUNK_HDR (mng_init_dbyk) ;
|
||||
INIT_CHUNK_HDR (mng_init_ordr) ;
|
||||
#endif
|
||||
INIT_CHUNK_HDR (mng_init_magn) ;
|
||||
INIT_CHUNK_HDR (mng_init_evnt) ;
|
||||
INIT_CHUNK_HDR (mng_init_unknown) ;
|
||||
#endif /* MNG_OPTIMIZE_CHUNKINITFREE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define FREE_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
|
||||
mng_chunkp pHeader)
|
||||
|
||||
#ifdef MNG_OPTIMIZE_CHUNKINITFREE
|
||||
FREE_CHUNK_HDR (mng_free_general) ;
|
||||
#else /* MNG_OPTIMIZE_CHUNKINITFREE */
|
||||
FREE_CHUNK_HDR (mng_free_ihdr) ;
|
||||
FREE_CHUNK_HDR (mng_free_plte) ;
|
||||
FREE_CHUNK_HDR (mng_free_iend) ;
|
||||
FREE_CHUNK_HDR (mng_free_trns) ;
|
||||
FREE_CHUNK_HDR (mng_free_gama) ;
|
||||
FREE_CHUNK_HDR (mng_free_chrm) ;
|
||||
FREE_CHUNK_HDR (mng_free_srgb) ;
|
||||
FREE_CHUNK_HDR (mng_free_bkgd) ;
|
||||
FREE_CHUNK_HDR (mng_free_phys) ;
|
||||
FREE_CHUNK_HDR (mng_free_sbit) ;
|
||||
FREE_CHUNK_HDR (mng_free_hist) ;
|
||||
FREE_CHUNK_HDR (mng_free_time) ;
|
||||
FREE_CHUNK_HDR (mng_free_mhdr) ;
|
||||
FREE_CHUNK_HDR (mng_free_mend) ;
|
||||
FREE_CHUNK_HDR (mng_free_endl) ;
|
||||
FREE_CHUNK_HDR (mng_free_defi) ;
|
||||
FREE_CHUNK_HDR (mng_free_basi) ;
|
||||
FREE_CHUNK_HDR (mng_free_clon) ;
|
||||
FREE_CHUNK_HDR (mng_free_back) ;
|
||||
FREE_CHUNK_HDR (mng_free_move) ;
|
||||
FREE_CHUNK_HDR (mng_free_clip) ;
|
||||
FREE_CHUNK_HDR (mng_free_show) ;
|
||||
FREE_CHUNK_HDR (mng_free_term) ;
|
||||
FREE_CHUNK_HDR (mng_free_fpri) ;
|
||||
FREE_CHUNK_HDR (mng_free_phyg) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
FREE_CHUNK_HDR (mng_free_jhdr) ;
|
||||
FREE_CHUNK_HDR (mng_free_jsep) ;
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
FREE_CHUNK_HDR (mng_free_dhdr) ;
|
||||
FREE_CHUNK_HDR (mng_free_prom) ;
|
||||
FREE_CHUNK_HDR (mng_free_ipng) ;
|
||||
FREE_CHUNK_HDR (mng_free_pplt) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
FREE_CHUNK_HDR (mng_free_ijng) ;
|
||||
#endif
|
||||
#endif
|
||||
FREE_CHUNK_HDR (mng_free_magn) ;
|
||||
#endif /* MNG_OPTIMIZE_CHUNKINITFREE */
|
||||
|
||||
FREE_CHUNK_HDR (mng_free_idat) ;
|
||||
FREE_CHUNK_HDR (mng_free_iccp) ;
|
||||
FREE_CHUNK_HDR (mng_free_text) ;
|
||||
FREE_CHUNK_HDR (mng_free_ztxt) ;
|
||||
FREE_CHUNK_HDR (mng_free_itxt) ;
|
||||
FREE_CHUNK_HDR (mng_free_splt) ;
|
||||
FREE_CHUNK_HDR (mng_free_loop) ;
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
FREE_CHUNK_HDR (mng_free_past) ;
|
||||
#endif
|
||||
FREE_CHUNK_HDR (mng_free_disc) ;
|
||||
FREE_CHUNK_HDR (mng_free_fram) ;
|
||||
FREE_CHUNK_HDR (mng_free_save) ;
|
||||
FREE_CHUNK_HDR (mng_free_seek) ;
|
||||
FREE_CHUNK_HDR (mng_free_expi) ;
|
||||
FREE_CHUNK_HDR (mng_free_need) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
FREE_CHUNK_HDR (mng_free_jdaa) ;
|
||||
FREE_CHUNK_HDR (mng_free_jdat) ;
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
FREE_CHUNK_HDR (mng_free_drop) ;
|
||||
FREE_CHUNK_HDR (mng_free_dbyk) ;
|
||||
FREE_CHUNK_HDR (mng_free_ordr) ;
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
FREE_CHUNK_HDR (mng_free_mpng) ;
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_ANG_PROPOSAL
|
||||
FREE_CHUNK_HDR (mng_free_adat) ;
|
||||
#endif
|
||||
FREE_CHUNK_HDR (mng_free_evnt) ;
|
||||
FREE_CHUNK_HDR (mng_free_unknown) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_WRITE_PROCS
|
||||
|
||||
#define ASSIGN_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
|
||||
mng_chunkp pChunkto, \
|
||||
mng_chunkp pChunkfrom)
|
||||
|
||||
#ifdef MNG_OPTIMIZE_CHUNKASSIGN
|
||||
ASSIGN_CHUNK_HDR (mng_assign_general) ;
|
||||
#else /* MNG_OPTIMIZE_CHUNKASSIGN */
|
||||
ASSIGN_CHUNK_HDR (mng_assign_ihdr) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_plte) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_iend) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_trns) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_gama) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_chrm) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_srgb) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_bkgd) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_phys) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_sbit) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_hist) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_time) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_mhdr) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_mend) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_endl) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_defi) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_basi) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_clon) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_back) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_move) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_clip) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_show) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_term) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_fpri) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_phyg) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
ASSIGN_CHUNK_HDR (mng_assign_jhdr) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_jsep) ;
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
ASSIGN_CHUNK_HDR (mng_assign_dhdr) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_prom) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_ipng) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_pplt) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
ASSIGN_CHUNK_HDR (mng_assign_ijng) ;
|
||||
#endif
|
||||
#endif
|
||||
ASSIGN_CHUNK_HDR (mng_assign_magn) ;
|
||||
#endif /* MNG_OPTIMIZE_CHUNKASSIGN */
|
||||
|
||||
ASSIGN_CHUNK_HDR (mng_assign_idat) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_iccp) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_text) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_ztxt) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_itxt) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_splt) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_loop) ;
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
ASSIGN_CHUNK_HDR (mng_assign_past) ;
|
||||
#endif
|
||||
ASSIGN_CHUNK_HDR (mng_assign_disc) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_fram) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_save) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_seek) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_need) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_expi) ;
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
ASSIGN_CHUNK_HDR (mng_assign_jdaa) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_jdat) ;
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
ASSIGN_CHUNK_HDR (mng_assign_drop) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_dbyk) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_ordr) ;
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
ASSIGN_CHUNK_HDR (mng_assign_mpng) ;
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_ANG_PROPOSAL
|
||||
ASSIGN_CHUNK_HDR (mng_assign_ahdr) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_adat) ;
|
||||
#endif
|
||||
ASSIGN_CHUNK_HDR (mng_assign_evnt) ;
|
||||
ASSIGN_CHUNK_HDR (mng_assign_unknown) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#else /* MNG_INCLUDE_WRITE_PROCS */
|
||||
#define mng_assign_general 0
|
||||
#define mng_assign_ihdr 0
|
||||
#define mng_assign_plte 0
|
||||
#define mng_assign_idat 0
|
||||
#define mng_assign_iend 0
|
||||
#define mng_assign_trns 0
|
||||
#define mng_assign_gama 0
|
||||
#define mng_assign_chrm 0
|
||||
#define mng_assign_srgb 0
|
||||
#define mng_assign_iccp 0
|
||||
#define mng_assign_text 0
|
||||
#define mng_assign_ztxt 0
|
||||
#define mng_assign_itxt 0
|
||||
#define mng_assign_bkgd 0
|
||||
#define mng_assign_phys 0
|
||||
#define mng_assign_sbit 0
|
||||
#define mng_assign_splt 0
|
||||
#define mng_assign_hist 0
|
||||
#define mng_assign_time 0
|
||||
#define mng_assign_mhdr 0
|
||||
#define mng_assign_mend 0
|
||||
#define mng_assign_loop 0
|
||||
#define mng_assign_endl 0
|
||||
#define mng_assign_defi 0
|
||||
#define mng_assign_basi 0
|
||||
#define mng_assign_clon 0
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
#define mng_assign_past 0
|
||||
#endif
|
||||
#define mng_assign_disc 0
|
||||
#define mng_assign_back 0
|
||||
#define mng_assign_fram 0
|
||||
#define mng_assign_move 0
|
||||
#define mng_assign_clip 0
|
||||
#define mng_assign_show 0
|
||||
#define mng_assign_term 0
|
||||
#define mng_assign_save 0
|
||||
#define mng_assign_seek 0
|
||||
#define mng_assign_expi 0
|
||||
#define mng_assign_fpri 0
|
||||
#define mng_assign_phyg 0
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
#define mng_assign_jhdr 0
|
||||
#define mng_assign_jdaa 0
|
||||
#define mng_assign_jdat 0
|
||||
#define mng_assign_jsep 0
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
#define mng_assign_dhdr 0
|
||||
#define mng_assign_prom 0
|
||||
#define mng_assign_ipng 0
|
||||
#define mng_assign_pplt 0
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
#define mng_assign_ijng 0
|
||||
#endif
|
||||
#define mng_assign_drop 0
|
||||
#define mng_assign_dbyk 0
|
||||
#define mng_assign_ordr 0
|
||||
#endif
|
||||
#define mng_assign_magn 0
|
||||
#define mng_assign_need 0
|
||||
#define mng_assign_mpng 0
|
||||
#define mng_assign_ahdr 0
|
||||
#define mng_assign_adat 0
|
||||
#define mng_assign_evnt 0
|
||||
#define mng_assign_unknown 0
|
||||
#endif /* MNG_INCLUDE_WRITE_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_chunk_prc_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
7016
src/3rdparty/libmng/libmng_chunk_xs.c
vendored
7016
src/3rdparty/libmng/libmng_chunk_xs.c
vendored
File diff suppressed because it is too large
Load Diff
1026
src/3rdparty/libmng/libmng_chunks.h
vendored
1026
src/3rdparty/libmng/libmng_chunks.h
vendored
File diff suppressed because it is too large
Load Diff
758
src/3rdparty/libmng/libmng_cms.c
vendored
758
src/3rdparty/libmng/libmng_cms.c
vendored
@ -1,758 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_cms.c copyright (c) 2000-2004 G.Juyn * */
|
||||
/* * version : 1.0.9 * */
|
||||
/* * * */
|
||||
/* * purpose : color management routines (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the color management routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/01/2000 - G.Juyn * */
|
||||
/* * - B001(105795) - fixed a typo and misconception about * */
|
||||
/* * freeing allocated gamma-table. (reported by Marti Maria) * */
|
||||
/* * 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/09/2000 - G.Juyn * */
|
||||
/* * - filled application-based color-management routines * */
|
||||
/* * 0.5.1 - 05/11/2000 - G.Juyn * */
|
||||
/* * - added creatememprofile * */
|
||||
/* * - added callback error-reporting support * */
|
||||
/* * 0.5.1 - 05/12/2000 - G.Juyn * */
|
||||
/* * - changed trace to macro for callback error-reporting * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 06/10/2000 - G.Juyn * */
|
||||
/* * - fixed some compilation-warnings (contrib Jason Morris) * */
|
||||
/* * * */
|
||||
/* * 0.5.3 - 06/21/2000 - G.Juyn * */
|
||||
/* * - fixed problem with color-correction for stored images * */
|
||||
/* * 0.5.3 - 06/23/2000 - G.Juyn * */
|
||||
/* * - fixed problem with incorrect gamma-correction * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 08/31/2000 - G.Juyn * */
|
||||
/* * - fixed sRGB precedence for gamma_only corection * */
|
||||
/* * * */
|
||||
/* * 0.9.4 - 12/16/2000 - G.Juyn * */
|
||||
/* * - fixed mixup of data- & function-pointers (thanks Dimitri)* */
|
||||
/* * * */
|
||||
/* * 1.0.1 - 03/31/2001 - G.Juyn * */
|
||||
/* * - ignore gamma=0 (see png-list for more info) * */
|
||||
/* * 1.0.1 - 04/25/2001 - G.Juyn (reported by Gregg Kelly) * */
|
||||
/* * - fixed problem with cms profile being created multiple * */
|
||||
/* * times when both iCCP & cHRM/gAMA are present * */
|
||||
/* * 1.0.1 - 04/25/2001 - G.Juyn * */
|
||||
/* * - moved mng_clear_cms to libmng_cms * */
|
||||
/* * 1.0.1 - 05/02/2001 - G.Juyn * */
|
||||
/* * - added "default" sRGB generation (Thanks Marti!) * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * 1.0.5 - 09/19/2002 - G.Juyn * */
|
||||
/* * - optimized color-correction routines * */
|
||||
/* * 1.0.5 - 09/23/2002 - G.Juyn * */
|
||||
/* * - added in-memory color-correction of abstract images * */
|
||||
/* * 1.0.5 - 11/08/2002 - G.Juyn * */
|
||||
/* * - fixed issues in init_app_cms() * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 04/11/2003 - G.Juyn * */
|
||||
/* * - B719420 - fixed several MNG_APP_CMS problems * */
|
||||
/* * 1.0.6 - 07/11/2003 - G. R-P * */
|
||||
/* * - added conditional MNG_SKIPCHUNK_cHRM/iCCP * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/20/2004 - G.Juyn * */
|
||||
/* * - cleaned up macro-invocations (thanks to D. Airlie) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "libmng_data.h"
|
||||
#include "libmng_error.h"
|
||||
#include "libmng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "libmng_objects.h"
|
||||
#include "libmng_cms.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_DISPLAY_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Little CMS helper routines * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS
|
||||
|
||||
#define MNG_CMS_FLAGS 0
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mnglcms_initlibrary ()
|
||||
{
|
||||
cmsErrorAction (LCMS_ERROR_IGNORE); /* LCMS should ignore errors! */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_cmsprof mnglcms_createfileprofile (mng_pchar zFilename)
|
||||
{
|
||||
return cmsOpenProfileFromFile (zFilename, "r");
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_cmsprof mnglcms_creatememprofile (mng_uint32 iProfilesize,
|
||||
mng_ptr pProfile)
|
||||
{
|
||||
return cmsOpenProfileFromMem (pProfile, iProfilesize);
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_cmsprof mnglcms_createsrgbprofile (void)
|
||||
{
|
||||
cmsCIExyY D65;
|
||||
cmsCIExyYTRIPLE Rec709Primaries = {
|
||||
{0.6400, 0.3300, 1.0},
|
||||
{0.3000, 0.6000, 1.0},
|
||||
{0.1500, 0.0600, 1.0}
|
||||
};
|
||||
LPGAMMATABLE Gamma24[3];
|
||||
mng_cmsprof hsRGB;
|
||||
|
||||
cmsWhitePointFromTemp(6504, &D65);
|
||||
Gamma24[0] = Gamma24[1] = Gamma24[2] = cmsBuildGamma(256, 2.4);
|
||||
hsRGB = cmsCreateRGBProfile(&D65, &Rec709Primaries, Gamma24);
|
||||
cmsFreeGamma(Gamma24[0]);
|
||||
|
||||
return hsRGB;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mnglcms_freeprofile (mng_cmsprof hProf)
|
||||
{
|
||||
cmsCloseProfile (hProf);
|
||||
return;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mnglcms_freetransform (mng_cmstrans hTrans)
|
||||
{
|
||||
/* B001 start */
|
||||
cmsDeleteTransform (hTrans);
|
||||
/* B001 end */
|
||||
return;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_clear_cms (mng_datap pData)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_CLEAR_CMS, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (pData->hTrans) /* transformation still active ? */
|
||||
mnglcms_freetransform (pData->hTrans);
|
||||
|
||||
pData->hTrans = 0;
|
||||
|
||||
if (pData->hProf1) /* file profile still active ? */
|
||||
mnglcms_freeprofile (pData->hProf1);
|
||||
|
||||
pData->hProf1 = 0;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_CLEAR_CMS, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_LCMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Color-management initialization & correction routines * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS
|
||||
|
||||
mng_retcode mng_init_full_cms (mng_datap pData,
|
||||
mng_bool bGlobal,
|
||||
mng_bool bObject,
|
||||
mng_bool bRetrobj)
|
||||
{
|
||||
mng_cmsprof hProf;
|
||||
mng_cmstrans hTrans;
|
||||
mng_imagep pImage = MNG_NULL;
|
||||
mng_imagedatap pBuf = MNG_NULL;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_FULL_CMS, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (bObject) /* use object if present ? */
|
||||
{ /* current object ? */
|
||||
if ((mng_imagep)pData->pCurrentobj)
|
||||
pImage = (mng_imagep)pData->pCurrentobj;
|
||||
else /* if not; use object 0 */
|
||||
pImage = (mng_imagep)pData->pObjzero;
|
||||
}
|
||||
|
||||
if (bRetrobj) /* retrieving from an object ? */
|
||||
pImage = (mng_imagep)pData->pRetrieveobj;
|
||||
|
||||
if (pImage) /* are we using an object ? */
|
||||
pBuf = pImage->pImgbuf; /* then address the buffer */
|
||||
|
||||
if ((!pBuf) || (!pBuf->bCorrected)) /* is the buffer already corrected ? */
|
||||
{
|
||||
#ifndef MNG_SKIPCHUNK_iCCP
|
||||
if (((pBuf) && (pBuf->bHasICCP)) || ((bGlobal) && (pData->bHasglobalICCP)))
|
||||
{
|
||||
if (!pData->hProf2) /* output profile not defined ? */
|
||||
{ /* then assume sRGB !! */
|
||||
pData->hProf2 = mnglcms_createsrgbprofile ();
|
||||
|
||||
if (!pData->hProf2) /* handle error ? */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE);
|
||||
}
|
||||
|
||||
if ((pBuf) && (pBuf->bHasICCP)) /* generate a profile handle */
|
||||
hProf = cmsOpenProfileFromMem (pBuf->pProfile, pBuf->iProfilesize);
|
||||
else
|
||||
hProf = cmsOpenProfileFromMem (pData->pGlobalProfile, pData->iGlobalProfilesize);
|
||||
|
||||
pData->hProf1 = hProf; /* save for future use */
|
||||
|
||||
if (!hProf) /* handle error ? */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE);
|
||||
|
||||
#ifndef MNG_NO_16BIT_SUPPORT
|
||||
if (pData->bIsRGBA16) /* 16-bit intermediates ? */
|
||||
hTrans = cmsCreateTransform (hProf, TYPE_RGBA_16_SE,
|
||||
pData->hProf2, TYPE_RGBA_16_SE,
|
||||
INTENT_PERCEPTUAL, MNG_CMS_FLAGS);
|
||||
else
|
||||
#endif
|
||||
hTrans = cmsCreateTransform (hProf, TYPE_RGBA_8,
|
||||
pData->hProf2, TYPE_RGBA_8,
|
||||
INTENT_PERCEPTUAL, MNG_CMS_FLAGS);
|
||||
|
||||
pData->hTrans = hTrans; /* save for future use */
|
||||
|
||||
if (!hTrans) /* handle error ? */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOTRANS);
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_fptr)mng_correct_full_cms;
|
||||
|
||||
return MNG_NOERROR; /* and done */
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (((pBuf) && (pBuf->bHasSRGB)) || ((bGlobal) && (pData->bHasglobalSRGB)))
|
||||
{
|
||||
mng_uint8 iIntent;
|
||||
|
||||
if (pData->bIssRGB) /* sRGB system ? */
|
||||
return MNG_NOERROR; /* no conversion required */
|
||||
|
||||
if (!pData->hProf3) /* sRGB profile not defined ? */
|
||||
{ /* then create it implicitly !! */
|
||||
pData->hProf3 = mnglcms_createsrgbprofile ();
|
||||
|
||||
if (!pData->hProf3) /* handle error ? */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE);
|
||||
}
|
||||
|
||||
hProf = pData->hProf3; /* convert from sRGB profile */
|
||||
|
||||
if ((pBuf) && (pBuf->bHasSRGB)) /* determine rendering intent */
|
||||
iIntent = pBuf->iRenderingintent;
|
||||
else
|
||||
iIntent = pData->iGlobalRendintent;
|
||||
|
||||
if (pData->bIsRGBA16) /* 16-bit intermediates ? */
|
||||
hTrans = cmsCreateTransform (hProf, TYPE_RGBA_16_SE,
|
||||
pData->hProf2, TYPE_RGBA_16_SE,
|
||||
iIntent, MNG_CMS_FLAGS);
|
||||
else
|
||||
hTrans = cmsCreateTransform (hProf, TYPE_RGBA_8,
|
||||
pData->hProf2, TYPE_RGBA_8,
|
||||
iIntent, MNG_CMS_FLAGS);
|
||||
|
||||
pData->hTrans = hTrans; /* save for future use */
|
||||
|
||||
if (!hTrans) /* handle error ? */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOTRANS);
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_fptr)mng_correct_full_cms;
|
||||
|
||||
return MNG_NOERROR; /* and done */
|
||||
}
|
||||
else
|
||||
if ( (((pBuf) && (pBuf->bHasCHRM)) || ((bGlobal) && (pData->bHasglobalCHRM))) &&
|
||||
( ((pBuf) && (pBuf->bHasGAMA) && (pBuf->iGamma > 0)) ||
|
||||
((bGlobal) && (pData->bHasglobalGAMA) && (pData->iGlobalGamma > 0)) ) )
|
||||
{
|
||||
mng_CIExyY sWhitepoint;
|
||||
mng_CIExyYTRIPLE sPrimaries;
|
||||
mng_gammatabp pGammatable[3];
|
||||
mng_float dGamma;
|
||||
|
||||
if (!pData->hProf2) /* output profile not defined ? */
|
||||
{ /* then assume sRGB !! */
|
||||
pData->hProf2 = mnglcms_createsrgbprofile ();
|
||||
|
||||
if (!pData->hProf2) /* handle error ? */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE);
|
||||
}
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_cHRM
|
||||
if ((pBuf) && (pBuf->bHasCHRM)) /* local cHRM ? */
|
||||
{
|
||||
sWhitepoint.x = (mng_float)pBuf->iWhitepointx / 100000;
|
||||
sWhitepoint.y = (mng_float)pBuf->iWhitepointy / 100000;
|
||||
sPrimaries.Red.x = (mng_float)pBuf->iPrimaryredx / 100000;
|
||||
sPrimaries.Red.y = (mng_float)pBuf->iPrimaryredy / 100000;
|
||||
sPrimaries.Green.x = (mng_float)pBuf->iPrimarygreenx / 100000;
|
||||
sPrimaries.Green.y = (mng_float)pBuf->iPrimarygreeny / 100000;
|
||||
sPrimaries.Blue.x = (mng_float)pBuf->iPrimarybluex / 100000;
|
||||
sPrimaries.Blue.y = (mng_float)pBuf->iPrimarybluey / 100000;
|
||||
}
|
||||
else
|
||||
{
|
||||
sWhitepoint.x = (mng_float)pData->iGlobalWhitepointx / 100000;
|
||||
sWhitepoint.y = (mng_float)pData->iGlobalWhitepointy / 100000;
|
||||
sPrimaries.Red.x = (mng_float)pData->iGlobalPrimaryredx / 100000;
|
||||
sPrimaries.Red.y = (mng_float)pData->iGlobalPrimaryredy / 100000;
|
||||
sPrimaries.Green.x = (mng_float)pData->iGlobalPrimarygreenx / 100000;
|
||||
sPrimaries.Green.y = (mng_float)pData->iGlobalPrimarygreeny / 100000;
|
||||
sPrimaries.Blue.x = (mng_float)pData->iGlobalPrimarybluex / 100000;
|
||||
sPrimaries.Blue.y = (mng_float)pData->iGlobalPrimarybluey / 100000;
|
||||
}
|
||||
#endif
|
||||
|
||||
sWhitepoint.Y = /* Y component is always 1.0 */
|
||||
sPrimaries.Red.Y =
|
||||
sPrimaries.Green.Y =
|
||||
sPrimaries.Blue.Y = 1.0;
|
||||
|
||||
if ((pBuf) && (pBuf->bHasGAMA)) /* get the gamma value */
|
||||
dGamma = (mng_float)pBuf->iGamma / 100000;
|
||||
else
|
||||
dGamma = (mng_float)pData->iGlobalGamma / 100000;
|
||||
|
||||
dGamma = pData->dViewgamma / dGamma;
|
||||
|
||||
pGammatable [0] = /* and build the lookup tables */
|
||||
pGammatable [1] =
|
||||
pGammatable [2] = cmsBuildGamma (256, dGamma);
|
||||
|
||||
if (!pGammatable [0]) /* enough memory ? */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOMEM);
|
||||
/* create the profile */
|
||||
hProf = cmsCreateRGBProfile (&sWhitepoint, &sPrimaries, pGammatable);
|
||||
|
||||
cmsFreeGamma (pGammatable [0]); /* free the temporary gamma tables ? */
|
||||
/* yes! but just the one! */
|
||||
|
||||
pData->hProf1 = hProf; /* save for future use */
|
||||
|
||||
if (!hProf) /* handle error ? */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOHANDLE);
|
||||
|
||||
if (pData->bIsRGBA16) /* 16-bit intermediates ? */
|
||||
hTrans = cmsCreateTransform (hProf, TYPE_RGBA_16_SE,
|
||||
pData->hProf2, TYPE_RGBA_16_SE,
|
||||
INTENT_PERCEPTUAL, MNG_CMS_FLAGS);
|
||||
else
|
||||
hTrans = cmsCreateTransform (hProf, TYPE_RGBA_8,
|
||||
pData->hProf2, TYPE_RGBA_8,
|
||||
INTENT_PERCEPTUAL, MNG_CMS_FLAGS);
|
||||
|
||||
pData->hTrans = hTrans; /* save for future use */
|
||||
|
||||
if (!hTrans) /* handle error ? */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOTRANS);
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_fptr)mng_correct_full_cms;
|
||||
|
||||
return MNG_NOERROR; /* and done */
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_FULL_CMS, MNG_LC_END);
|
||||
#endif
|
||||
/* if we get here, we'll only do gamma */
|
||||
return mng_init_gamma_only (pData, bGlobal, bObject, bRetrobj);
|
||||
}
|
||||
#endif /* MNG_INCLUDE_LCMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS
|
||||
mng_retcode mng_correct_full_cms (mng_datap pData)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_CORRECT_FULL_CMS, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
cmsDoTransform (pData->hTrans, pData->pRGBArow, pData->pRGBArow, pData->iRowsamples);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_CORRECT_FULL_CMS, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_INCLUDE_LCMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_GAMMA_ONLY) || defined(MNG_FULL_CMS) || defined(MNG_APP_CMS)
|
||||
mng_retcode mng_init_gamma_only (mng_datap pData,
|
||||
mng_bool bGlobal,
|
||||
mng_bool bObject,
|
||||
mng_bool bRetrobj)
|
||||
{
|
||||
mng_float dGamma;
|
||||
mng_imagep pImage = MNG_NULL;
|
||||
mng_imagedatap pBuf = MNG_NULL;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_GAMMA_ONLY, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (bObject) /* use object if present ? */
|
||||
{ /* current object ? */
|
||||
if ((mng_imagep)pData->pCurrentobj)
|
||||
pImage = (mng_imagep)pData->pCurrentobj;
|
||||
else /* if not; use object 0 */
|
||||
pImage = (mng_imagep)pData->pObjzero;
|
||||
}
|
||||
|
||||
if (bRetrobj) /* retrieving from an object ? */
|
||||
pImage = (mng_imagep)pData->pRetrieveobj;
|
||||
|
||||
if (pImage) /* are we using an object ? */
|
||||
pBuf = pImage->pImgbuf; /* then address the buffer */
|
||||
|
||||
if ((!pBuf) || (!pBuf->bCorrected)) /* is the buffer already corrected ? */
|
||||
{
|
||||
if ((pBuf) && (pBuf->bHasSRGB)) /* get the gamma value */
|
||||
dGamma = 0.45455;
|
||||
else
|
||||
if ((pBuf) && (pBuf->bHasGAMA))
|
||||
dGamma = (mng_float)pBuf->iGamma / 100000;
|
||||
else
|
||||
if ((bGlobal) && (pData->bHasglobalSRGB))
|
||||
dGamma = 0.45455;
|
||||
else
|
||||
if ((bGlobal) && (pData->bHasglobalGAMA))
|
||||
dGamma = (mng_float)pData->iGlobalGamma / 100000;
|
||||
else
|
||||
dGamma = pData->dDfltimggamma;
|
||||
|
||||
if (dGamma > 0) /* ignore gamma=0 */
|
||||
{
|
||||
dGamma = pData->dViewgamma / (dGamma * pData->dDisplaygamma);
|
||||
|
||||
if (dGamma != pData->dLastgamma) /* lookup table needs to be computed ? */
|
||||
{
|
||||
mng_int32 iX;
|
||||
|
||||
pData->aGammatab [0] = 0;
|
||||
|
||||
for (iX = 1; iX <= 255; iX++)
|
||||
pData->aGammatab [iX] = (mng_uint8)(pow (iX / 255.0, dGamma) * 255 + 0.5);
|
||||
|
||||
pData->dLastgamma = dGamma; /* keep for next time */
|
||||
}
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_fptr)mng_correct_gamma_only;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_GAMMA_ONLY, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_GAMMA_ONLY || MNG_FULL_CMS || MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_GAMMA_ONLY) || defined(MNG_FULL_CMS) || defined(MNG_APP_CMS)
|
||||
mng_retcode mng_correct_gamma_only (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pWork;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_CORRECT_GAMMA_ONLY, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pWork = pData->pRGBArow; /* address intermediate row */
|
||||
|
||||
if (pData->bIsRGBA16) /* 16-bit intermediate row ? */
|
||||
{
|
||||
|
||||
|
||||
/* TODO: 16-bit precision gamma processing */
|
||||
/* we'll just do the high-order byte for now */
|
||||
|
||||
|
||||
/* convert all samples in the row */
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
{ /* using the precalculated gamma lookup table */
|
||||
*pWork = pData->aGammatab [*pWork];
|
||||
*(pWork+2) = pData->aGammatab [*(pWork+2)];
|
||||
*(pWork+4) = pData->aGammatab [*(pWork+4)];
|
||||
|
||||
pWork += 8;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ /* convert all samples in the row */
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
{ /* using the precalculated gamma lookup table */
|
||||
*pWork = pData->aGammatab [*pWork];
|
||||
*(pWork+1) = pData->aGammatab [*(pWork+1)];
|
||||
*(pWork+2) = pData->aGammatab [*(pWork+2)];
|
||||
|
||||
pWork += 4;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_CORRECT_GAMMA_ONLY, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_GAMMA_ONLY || MNG_FULL_CMS || MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_APP_CMS
|
||||
mng_retcode mng_init_app_cms (mng_datap pData,
|
||||
mng_bool bGlobal,
|
||||
mng_bool bObject,
|
||||
mng_bool bRetrobj)
|
||||
{
|
||||
mng_imagep pImage = MNG_NULL;
|
||||
mng_imagedatap pBuf = MNG_NULL;
|
||||
mng_bool bDone = MNG_FALSE;
|
||||
mng_retcode iRetcode;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_APP_CMS, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (bObject) /* use object if present ? */
|
||||
{ /* current object ? */
|
||||
if ((mng_imagep)pData->pCurrentobj)
|
||||
pImage = (mng_imagep)pData->pCurrentobj;
|
||||
else /* if not; use object 0 */
|
||||
pImage = (mng_imagep)pData->pObjzero;
|
||||
}
|
||||
|
||||
if (bRetrobj) /* retrieving from an object ? */
|
||||
pImage = (mng_imagep)pData->pRetrieveobj;
|
||||
|
||||
if (pImage) /* are we using an object ? */
|
||||
pBuf = pImage->pImgbuf; /* then address the buffer */
|
||||
|
||||
if ((!pBuf) || (!pBuf->bCorrected)) /* is the buffer already corrected ? */
|
||||
{
|
||||
#ifndef MNG_SKIPCHUNK_iCCP
|
||||
if ( (pData->fProcessiccp) &&
|
||||
(((pBuf) && (pBuf->bHasICCP)) || ((bGlobal) && (pData->bHasglobalICCP))) )
|
||||
{
|
||||
mng_uint32 iProfilesize;
|
||||
mng_ptr pProfile;
|
||||
|
||||
if ((pBuf) && (pBuf->bHasICCP)) /* get the right profile */
|
||||
{
|
||||
iProfilesize = pBuf->iProfilesize;
|
||||
pProfile = pBuf->pProfile;
|
||||
}
|
||||
else
|
||||
{
|
||||
iProfilesize = pData->iGlobalProfilesize;
|
||||
pProfile = pData->pGlobalProfile;
|
||||
}
|
||||
/* inform the app */
|
||||
if (!pData->fProcessiccp ((mng_handle)pData, iProfilesize, pProfile))
|
||||
MNG_ERROR (pData, MNG_APPCMSERROR);
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_fptr)mng_correct_app_cms;
|
||||
bDone = MNG_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( (pData->fProcesssrgb) &&
|
||||
(((pBuf) && (pBuf->bHasSRGB)) || ((bGlobal) && (pData->bHasglobalSRGB))) )
|
||||
{
|
||||
mng_uint8 iIntent;
|
||||
|
||||
if ((pBuf) && (pBuf->bHasSRGB)) /* determine rendering intent */
|
||||
iIntent = pBuf->iRenderingintent;
|
||||
else
|
||||
iIntent = pData->iGlobalRendintent;
|
||||
/* inform the app */
|
||||
if (!pData->fProcesssrgb ((mng_handle)pData, iIntent))
|
||||
MNG_ERROR (pData, MNG_APPCMSERROR);
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_fptr)mng_correct_app_cms;
|
||||
bDone = MNG_TRUE;
|
||||
}
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_cHRM
|
||||
if ( (pData->fProcesschroma) &&
|
||||
(((pBuf) && (pBuf->bHasCHRM)) || ((bGlobal) && (pData->bHasglobalCHRM))) )
|
||||
{
|
||||
mng_uint32 iWhitepointx, iWhitepointy;
|
||||
mng_uint32 iPrimaryredx, iPrimaryredy;
|
||||
mng_uint32 iPrimarygreenx, iPrimarygreeny;
|
||||
mng_uint32 iPrimarybluex, iPrimarybluey;
|
||||
|
||||
if ((pBuf) && (pBuf->bHasCHRM)) /* local cHRM ? */
|
||||
{
|
||||
iWhitepointx = pBuf->iWhitepointx;
|
||||
iWhitepointy = pBuf->iWhitepointy;
|
||||
iPrimaryredx = pBuf->iPrimaryredx;
|
||||
iPrimaryredy = pBuf->iPrimaryredy;
|
||||
iPrimarygreenx = pBuf->iPrimarygreenx;
|
||||
iPrimarygreeny = pBuf->iPrimarygreeny;
|
||||
iPrimarybluex = pBuf->iPrimarybluex;
|
||||
iPrimarybluey = pBuf->iPrimarybluey;
|
||||
}
|
||||
else
|
||||
{
|
||||
iWhitepointx = pData->iGlobalWhitepointx;
|
||||
iWhitepointy = pData->iGlobalWhitepointy;
|
||||
iPrimaryredx = pData->iGlobalPrimaryredx;
|
||||
iPrimaryredy = pData->iGlobalPrimaryredy;
|
||||
iPrimarygreenx = pData->iGlobalPrimarygreenx;
|
||||
iPrimarygreeny = pData->iGlobalPrimarygreeny;
|
||||
iPrimarybluex = pData->iGlobalPrimarybluex;
|
||||
iPrimarybluey = pData->iGlobalPrimarybluey;
|
||||
}
|
||||
/* inform the app */
|
||||
if (!pData->fProcesschroma ((mng_handle)pData, iWhitepointx, iWhitepointy,
|
||||
iPrimaryredx, iPrimaryredy,
|
||||
iPrimarygreenx, iPrimarygreeny,
|
||||
iPrimarybluex, iPrimarybluey))
|
||||
MNG_ERROR (pData, MNG_APPCMSERROR);
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_fptr)mng_correct_app_cms;
|
||||
bDone = MNG_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( (pData->fProcessgamma) &&
|
||||
(((pBuf) && (pBuf->bHasGAMA)) || ((bGlobal) && (pData->bHasglobalGAMA))) )
|
||||
{
|
||||
mng_uint32 iGamma;
|
||||
|
||||
if ((pBuf) && (pBuf->bHasGAMA)) /* get the gamma value */
|
||||
iGamma = pBuf->iGamma;
|
||||
else
|
||||
iGamma = pData->iGlobalGamma;
|
||||
/* inform the app */
|
||||
if (!pData->fProcessgamma ((mng_handle)pData, iGamma))
|
||||
{ /* app wants us to use internal routines ! */
|
||||
iRetcode = mng_init_gamma_only (pData, bGlobal, bObject, bRetrobj);
|
||||
if (iRetcode) /* on error bail out */
|
||||
return iRetcode;
|
||||
}
|
||||
else
|
||||
{ /* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_fptr)mng_correct_app_cms;
|
||||
}
|
||||
|
||||
bDone = MNG_TRUE;
|
||||
}
|
||||
|
||||
if (!bDone) /* no color-info at all ? */
|
||||
{
|
||||
/* then use default image gamma ! */
|
||||
if (!pData->fProcessgamma ((mng_handle)pData,
|
||||
(mng_uint32)((pData->dDfltimggamma * 100000) + 0.5)))
|
||||
{ /* app wants us to use internal routines ! */
|
||||
iRetcode = mng_init_gamma_only (pData, bGlobal, bObject, bRetrobj);
|
||||
if (iRetcode) /* on error bail out */
|
||||
return iRetcode;
|
||||
}
|
||||
else
|
||||
{ /* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_fptr)mng_correct_app_cms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_APP_CMS, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_APP_CMS
|
||||
mng_retcode mng_correct_app_cms (mng_datap pData)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_CORRECT_APP_CMS, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (pData->fProcessarow) /* let the app do something with our row */
|
||||
if (!pData->fProcessarow ((mng_handle)pData, pData->iRowsamples,
|
||||
pData->bIsRGBA16, pData->pRGBArow))
|
||||
MNG_ERROR (pData, MNG_APPCMSERROR);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_CORRECT_APP_CMS, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_DISPLAY_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
|
92
src/3rdparty/libmng/libmng_cms.h
vendored
92
src/3rdparty/libmng/libmng_cms.h
vendored
@ -1,92 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_cms.h copyright (c) 2000-2003 G.Juyn * */
|
||||
/* * version : 1.0.6 * */
|
||||
/* * * */
|
||||
/* * purpose : color management routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of color management routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/11/2000 - G.Juyn * */
|
||||
/* * - added creatememprofile * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 1.0.1 - 04/25/2001 - G.Juyn * */
|
||||
/* * - moved mng_clear_cms to libmng_cms * */
|
||||
/* * 1.0.1 - 05/02/2001 - G.Juyn * */
|
||||
/* * - added "default" sRGB generation (Thanks Marti!) * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * 1.0.5 - 09/19/2002 - G.Juyn * */
|
||||
/* * - optimized color-correction routines * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 04/11/2003 - G.Juyn * */
|
||||
/* * - B719420 - fixed several MNG_APP_CMS problems * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_cms_h_
|
||||
#define _libmng_cms_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS
|
||||
void mnglcms_initlibrary (void);
|
||||
mng_cmsprof mnglcms_createfileprofile (mng_pchar zFilename);
|
||||
mng_cmsprof mnglcms_creatememprofile (mng_uint32 iProfilesize,
|
||||
mng_ptr pProfile );
|
||||
mng_cmsprof mnglcms_createsrgbprofile (void);
|
||||
void mnglcms_freeprofile (mng_cmsprof hProf );
|
||||
void mnglcms_freetransform (mng_cmstrans hTrans );
|
||||
|
||||
mng_retcode mng_clear_cms (mng_datap pData );
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_FULL_CMS
|
||||
mng_retcode mng_init_full_cms (mng_datap pData,
|
||||
mng_bool bGlobal,
|
||||
mng_bool bObject,
|
||||
mng_bool bRetrobj);
|
||||
mng_retcode mng_correct_full_cms (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#if defined(MNG_FULL_CMS) || defined(MNG_GAMMA_ONLY) || defined(MNG_APP_CMS)
|
||||
mng_retcode mng_init_gamma_only (mng_datap pData,
|
||||
mng_bool bGlobal,
|
||||
mng_bool bObject,
|
||||
mng_bool bRetrobj);
|
||||
mng_retcode mng_correct_gamma_only (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#ifdef MNG_APP_CMS
|
||||
mng_retcode mng_init_app_cms (mng_datap pData,
|
||||
mng_bool bGlobal,
|
||||
mng_bool bObject,
|
||||
mng_bool bRetrobj);
|
||||
mng_retcode mng_correct_app_cms (mng_datap pData);
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_cms_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
295
src/3rdparty/libmng/libmng_conf.h
vendored
295
src/3rdparty/libmng/libmng_conf.h
vendored
@ -1,295 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_conf.h copyright (c) G.Juyn 2000-2004 * */
|
||||
/* * version : 1.0.9 * */
|
||||
/* * * */
|
||||
/* * purpose : main configuration file * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : The configuration file. Change this to include/exclude * */
|
||||
/* * the options you want or do not want in libmng. * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.2 - 06/02/2000 - G.Juyn * */
|
||||
/* * - separated configuration-options into this file * */
|
||||
/* * - changed to most likely configuration (?) * */
|
||||
/* * 0.5.2 - 06/03/2000 - G.Juyn * */
|
||||
/* * - changed options to create a standard so-library * */
|
||||
/* * with everything enabled * */
|
||||
/* * 0.5.2 - 06/04/2000 - G.Juyn * */
|
||||
/* * - changed options to create a standard win32-dll * */
|
||||
/* * with everything enabled * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 08/12/2000 - G.Juyn * */
|
||||
/* * - added workaround for faulty PhotoShop iCCP chunk * */
|
||||
/* * 0.9.3 - 09/16/2000 - G.Juyn * */
|
||||
/* * - removed trace-options from default SO/DLL builds * */
|
||||
/* * * */
|
||||
/* * 1.0.4 - 06/22/2002 - G.Juyn * */
|
||||
/* * - B526138 - returned IJGSRC6B calling convention to * */
|
||||
/* * default for MSVC * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 09/14/2002 - G.Juyn * */
|
||||
/* * - added event handling for dynamic MNG * */
|
||||
/* * - added 'supports' call to check function availability * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 06/22/2002 - G.R-P * */
|
||||
/* * - added MNG_NO_INCLUDE_JNG conditional * */
|
||||
/* * - added MNG_SKIPCHUNK_evNT conditional * */
|
||||
/* * 1.0.6 - 07/14/2002 - G.R-P * */
|
||||
/* * - added MNG_NO_SUPPORT_FUNCQUERY conditional * */
|
||||
/* * * */
|
||||
/* * 1.0.7 - 03/07/2004 - G.R-P * */
|
||||
/* * - added MNG_VERSION_QUERY_SUPPORT_ conditional * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 05/12/2004 - G.Juyn * */
|
||||
/* * - clearified MNG_BIGENDIAN_SUPPORTED conditional * */
|
||||
/* * - added MNG_LITTLEENDIAN_SUPPORTED conditional * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_conf_h_
|
||||
#define _libmng_conf_h_
|
||||
|
||||
#ifdef MNG_MOZILLA_CFG
|
||||
#include "special\mozcfg\mozlibmngconf.h"
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * User-selectable compile-time options * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable exactly one(1) of the MNG-(sub)set selectors */
|
||||
/* use this to select which (sub)set of the MNG specification you wish
|
||||
to support */
|
||||
/* generally you'll want full support as the library provides it automatically
|
||||
for you! if you're really strung on memory-requirements you can opt
|
||||
to enable less support (but it's just NOT a good idea!) */
|
||||
/* NOTE that this isn't actually implemented yet */
|
||||
|
||||
#if !defined(MNG_SUPPORT_FULL) && !defined(MNG_SUPPORT_LC) && !defined(MNG_SUPPORT_VLC)
|
||||
#define MNG_SUPPORT_FULL
|
||||
/* #define MNG_SUPPORT_LC */
|
||||
/* #define MNG_SUPPORT_VLC */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable JPEG support if required */
|
||||
/* use this to enable the JNG support routines */
|
||||
/* this requires an external jpeg package;
|
||||
currently only IJG's jpgsrc6b is supported! */
|
||||
/* NOTE that the IJG code can be either 8- or 12-bit (eg. not both);
|
||||
so choose the one you've defined in jconfig.h; if you don't know what
|
||||
the heck I'm talking about, just leave it at 8-bit support (thank you!) */
|
||||
|
||||
#ifndef MNG_NO_INCLUDE_JNG
|
||||
#ifdef MNG_SUPPORT_FULL /* full support includes JNG */
|
||||
#define MNG_SUPPORT_IJG6B
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SUPPORT_IJG6B
|
||||
#if defined(MNG_BUILD_SO) || defined(MNG_USE_SO) || defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_SUPPORT_IJG6B
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(MNG_SUPPORT_IJG6B) && !defined(MNG_SUPPORT_JPEG8) && !defined(MNG_SUPPORT_JPEG12)
|
||||
#define MNG_SUPPORT_JPEG8
|
||||
/* #define MNG_SUPPORT_JPEG12 */
|
||||
#endif
|
||||
|
||||
/* The following is required to export the IJG routines from the DLL in
|
||||
the Windows-standard calling convention;
|
||||
currently this only works for Borland C++ !!! */
|
||||
|
||||
#if defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#if defined(MNG_SUPPORT_IJG6B) && defined(__BORLANDC__)
|
||||
#define MNG_DEFINE_JPEG_STDCALL
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable required high-level functions */
|
||||
/* use this to select the high-level functions you require */
|
||||
/* if you only need to display a MNG, disable write support! */
|
||||
/* if you only need to examine a MNG, disable write & display support! */
|
||||
/* if you only need to copy a MNG, disable display support! */
|
||||
/* if you only need to create a MNG, disable read & display support! */
|
||||
/* NOTE that turning all options off will be very unuseful! */
|
||||
|
||||
#if !defined(MNG_SUPPORT_READ) && !defined(MNG_SUPPORT_WRITE) && !defined(MNG_SUPPORT_DISPLAY)
|
||||
#define MNG_SUPPORT_READ
|
||||
#if defined(MNG_BUILD_SO) || defined(MNG_USE_SO) || defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_SUPPORT_WRITE
|
||||
#endif
|
||||
#define MNG_SUPPORT_DISPLAY
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable chunk access functions */
|
||||
/* use this to select whether you need access to the individual chunks */
|
||||
/* useful if you want to examine a read MNG (you'll also need MNG_STORE_CHUNKS !)*/
|
||||
/* required if you need to create & write a new MNG! */
|
||||
|
||||
#ifndef MNG_ACCESS_CHUNKS
|
||||
#if defined(MNG_BUILD_SO) || defined(MNG_USE_SO) || defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_ACCESS_CHUNKS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable exactly one(1) of the color-management functionality selectors */
|
||||
/* use this to select the level of automatic color support */
|
||||
/* MNG_FULL_CMS requires the lcms (little cms) external package ! */
|
||||
/* if you want your own app (or the OS) to handle color-management
|
||||
select MNG_APP_CMS */
|
||||
|
||||
#define MNG_GAMMA_ONLY
|
||||
/* #define MNG_FULL_CMS */
|
||||
/* #define MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable automatic dithering */
|
||||
/* use this if you need dithering support to convert high-resolution
|
||||
images to a low-resolution output-device */
|
||||
/* NOTE that this is not supported yet */
|
||||
|
||||
/* #define MNG_AUTO_DITHER */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable whether chunks should be stored for reference later */
|
||||
/* use this if you need to examine the chunks of a MNG you have read,
|
||||
or (re-)write a MNG you have read */
|
||||
/* turn this off if you want to reduce memory-consumption */
|
||||
|
||||
#ifndef MNG_STORE_CHUNKS
|
||||
#if defined(MNG_BUILD_SO) || defined(MNG_USE_SO) || defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_STORE_CHUNKS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable internal memory management (if your compiler supports it) */
|
||||
/* use this if your compiler supports the 'standard' memory functions
|
||||
(calloc & free), and you want the library to use these functions and not
|
||||
bother your app with memory-callbacks */
|
||||
|
||||
/* #define MNG_INTERNAL_MEMMNGMT */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable internal tracing-functionality (manual debugging purposes) */
|
||||
/* use this if you have trouble location bugs or problems */
|
||||
/* NOTE that you'll need to specify the trace callback function! */
|
||||
|
||||
/* #define MNG_SUPPORT_TRACE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable extended error- and trace-telltaling */
|
||||
/* use this if you need explanatory messages with errors and/or tracing */
|
||||
|
||||
#if !defined(MNG_ERROR_TELLTALE) && !defined(MNG_TRACE_TELLTALE)
|
||||
#if defined(MNG_BUILD_SO) || defined(MNG_USE_SO) || defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_ERROR_TELLTALE
|
||||
#define MNG_TRACE_TELLTALE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable BIG/LITTLE endian optimizations */
|
||||
/* enable BIG if you're on an architecture that supports big-endian reads
|
||||
and writes that aren't word-aligned */
|
||||
/* according to reliable sources this only works for PowerPC (bigendian mode)
|
||||
and 680x0 */
|
||||
/* enable LITTLE if you're on an architecture that supports little-endian */
|
||||
/* when in doubt leave both off !!! */
|
||||
|
||||
/* #define MNG_BIGENDIAN_SUPPORTED */
|
||||
/* #define MNG_LITTLEENDIAN_SUPPORTED */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* enable 'version' functions */
|
||||
#if !defined(MNG_VERSION_QUERY_SUPPORT) && \
|
||||
!defined(MNG_NO_VERSION_QUERY_SUPPORT)
|
||||
#define MNG_VERSION_QUERY_SUPPORT
|
||||
#endif
|
||||
|
||||
/* enable 'supports' function */
|
||||
/* use this if you need to query the availability of functions at runtime;
|
||||
useful for apps that dynamically load the library and that need specific
|
||||
functions */
|
||||
|
||||
#if !defined(MNG_NO_SUPPORT_FUNCQUERY) && !defined(MNG_SUPPORT_FUNCQUERY)
|
||||
#if defined(MNG_BUILD_SO) || defined(MNG_USE_SO) || \
|
||||
defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_SUPPORT_FUNCQUERY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enable dynamic MNG features */
|
||||
/* use this if you would like to have dynamic support for specifically
|
||||
designed MNGs; eg. this is useful for 'rollover' effects such as common
|
||||
on the world wide web */
|
||||
|
||||
#ifndef MNG_SUPPORT_DYNAMICMNG
|
||||
#if defined(MNG_BUILD_SO) || defined(MNG_USE_SO) || defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_SUPPORT_DYNAMICMNG
|
||||
#endif
|
||||
#endif
|
||||
#ifndef MNG_SUPPORT_DYNAMICMNG
|
||||
#ifndef MNG_SKIPCHUNK_evNT
|
||||
#define MNG_SKIPCHUNK_evNT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
#ifndef MNG_NO_ACCESS_JPEG
|
||||
#ifndef MNG_ACCESS_JPEG
|
||||
#define MNG_ACCESS_JPEG
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_ZLIB
|
||||
#ifndef MNG_NO_ACCESS_ZLIB
|
||||
#ifndef MNG_ACCESS_ZLIB
|
||||
#define MNG_ACCESS_ZLIB
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * End of user-selectable compile-time options * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_conf_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
1032
src/3rdparty/libmng/libmng_data.h
vendored
1032
src/3rdparty/libmng/libmng_data.h
vendored
File diff suppressed because it is too large
Load Diff
7140
src/3rdparty/libmng/libmng_display.c
vendored
7140
src/3rdparty/libmng/libmng_display.c
vendored
File diff suppressed because it is too large
Load Diff
343
src/3rdparty/libmng/libmng_display.h
vendored
343
src/3rdparty/libmng/libmng_display.h
vendored
@ -1,343 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_display.h copyright (c) 2000-2007 G.Juyn * */
|
||||
/* * version : 1.0.10 * */
|
||||
/* * * */
|
||||
/* * purpose : Display management (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the display managament routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/20/2000 - G.Juyn * */
|
||||
/* * - added JNG support stuff * */
|
||||
/* * * */
|
||||
/* * 0.5.3 - 06/16/2000 - G.Juyn * */
|
||||
/* * - changed progressive-display processing * */
|
||||
/* * 0.5.3 - 06/22/2000 - G.Juyn * */
|
||||
/* * - added support for delta-image processing * */
|
||||
/* * - added support for PPLT chunk processing * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * 0.9.3 - 08/07/2000 - G.Juyn * */
|
||||
/* * - B111300 - fixup for improved portability * */
|
||||
/* * 0.9.3 - 08/26/2000 - G.Juyn * */
|
||||
/* * - added MAGN chunk * */
|
||||
/* * 0.9.3 - 10/16/2000 - G.Juyn * */
|
||||
/* * - added JDAA chunk * */
|
||||
/* * * */
|
||||
/* * 0.9.4 - 11/24/2000 - G.Juyn * */
|
||||
/* * - moved restore of object 0 to libmng_display * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * 1.0.5 - 09/13/2002 - G.Juyn * */
|
||||
/* * - fixed read/write of MAGN chunk * */
|
||||
/* * 1.0.5 - 09/20/2002 - G.Juyn * */
|
||||
/* * - added support for PAST * */
|
||||
/* * 1.0.5 - 10/07/2002 - G.Juyn * */
|
||||
/* * - added proposed change in handling of TERM- & if-delay * */
|
||||
/* * 1.0.5 - 10/20/2002 - G.Juyn * */
|
||||
/* * - fixed display of visible target of PAST operation * */
|
||||
/* * * */
|
||||
/* * 1.0.7 - 03/24/2004 - G.R-P. * */
|
||||
/* * - added some SKIPCHUNK conditionals * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/11/2004 - G.Juyn * */
|
||||
/* * - added conditional MNG_OPTIMIZE_DISPLAYCALLS * */
|
||||
/* * * */
|
||||
/* * 1.0.10 - 04/08/2007 - G.Juyn * */
|
||||
/* * - added support for mPNG proposal * */
|
||||
/* * 1.0.10 - 04/12/2007 - G.Juyn * */
|
||||
/* * - added support for ANG proposal * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_display_h_
|
||||
#define _libmng_display_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_DISPLAY_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_display_progressive_refresh (mng_datap pData,
|
||||
mng_uint32 iInterval);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_reset_objzero (mng_datap pData);
|
||||
|
||||
mng_retcode mng_display_image (mng_datap pData,
|
||||
mng_imagep pImage,
|
||||
mng_bool bLayeradvanced);
|
||||
|
||||
mng_retcode mng_execute_delta_image (mng_datap pData,
|
||||
mng_imagep pTarget,
|
||||
mng_imagep pDelta);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_process_display (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_OPTIMIZE_FOOTPRINT_INIT
|
||||
png_imgtype mng_png_imgtype (mng_uint8 colortype,
|
||||
mng_uint8 bitdepth);
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_OPTIMIZE_DISPLAYCALLS
|
||||
|
||||
mng_retcode mng_process_display_ihdr (mng_datap pData);
|
||||
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
mng_retcode mng_process_display_mpng (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_ANG_PROPOSAL
|
||||
mng_retcode mng_process_display_ang (mng_datap pData);
|
||||
#endif
|
||||
|
||||
mng_retcode mng_process_display_idat (mng_datap pData,
|
||||
mng_uint32 iRawlen,
|
||||
mng_uint8p pRawdata);
|
||||
|
||||
mng_retcode mng_process_display_iend (mng_datap pData);
|
||||
mng_retcode mng_process_display_mend (mng_datap pData);
|
||||
mng_retcode mng_process_display_mend2 (mng_datap pData);
|
||||
mng_retcode mng_process_display_defi (mng_datap pData);
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_BASI
|
||||
mng_retcode mng_process_display_basi (mng_datap pData,
|
||||
mng_uint16 iRed,
|
||||
mng_uint16 iGreen,
|
||||
mng_uint16 iBlue,
|
||||
mng_bool bHasalpha,
|
||||
mng_uint16 iAlpha,
|
||||
mng_uint8 iViewable);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_CLON
|
||||
mng_retcode mng_process_display_clon (mng_datap pData,
|
||||
mng_uint16 iSourceid,
|
||||
mng_uint16 iCloneid,
|
||||
mng_uint8 iClonetype,
|
||||
mng_bool bHasdonotshow,
|
||||
mng_uint8 iDonotshow,
|
||||
mng_uint8 iConcrete,
|
||||
mng_bool bHasloca,
|
||||
mng_uint8 iLocationtype,
|
||||
mng_int32 iLocationx,
|
||||
mng_int32 iLocationy);
|
||||
mng_retcode mng_process_display_clon2 (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_DISC
|
||||
mng_retcode mng_process_display_disc (mng_datap pData,
|
||||
mng_uint32 iCount,
|
||||
mng_uint16p pIds);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_FRAM
|
||||
mng_retcode mng_process_display_fram (mng_datap pData,
|
||||
mng_uint8 iFramemode,
|
||||
mng_uint8 iChangedelay,
|
||||
mng_uint32 iDelay,
|
||||
mng_uint8 iChangetimeout,
|
||||
mng_uint32 iTimeout,
|
||||
mng_uint8 iChangeclipping,
|
||||
mng_uint8 iCliptype,
|
||||
mng_int32 iClipl,
|
||||
mng_int32 iClipr,
|
||||
mng_int32 iClipt,
|
||||
mng_int32 iClipb);
|
||||
mng_retcode mng_process_display_fram2 (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_MOVE
|
||||
mng_retcode mng_process_display_move (mng_datap pData,
|
||||
mng_uint16 iFromid,
|
||||
mng_uint16 iToid,
|
||||
mng_uint8 iMovetype,
|
||||
mng_int32 iMovex,
|
||||
mng_int32 iMovey);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_CLIP
|
||||
mng_retcode mng_process_display_clip (mng_datap pData,
|
||||
mng_uint16 iFromid,
|
||||
mng_uint16 iToid,
|
||||
mng_uint8 iCliptype,
|
||||
mng_int32 iClipl,
|
||||
mng_int32 iClipr,
|
||||
mng_int32 iClipt,
|
||||
mng_int32 iClipb);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_SHOW
|
||||
mng_retcode mng_process_display_show (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_SAVE
|
||||
mng_retcode mng_process_display_save (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_SEEK
|
||||
mng_retcode mng_process_display_seek (mng_datap pData);
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
mng_retcode mng_process_display_jhdr (mng_datap pData);
|
||||
|
||||
mng_retcode mng_process_display_jdaa (mng_datap pData,
|
||||
mng_uint32 iRawlen,
|
||||
mng_uint8p pRawdata);
|
||||
|
||||
mng_retcode mng_process_display_jdat (mng_datap pData,
|
||||
mng_uint32 iRawlen,
|
||||
mng_uint8p pRawdata);
|
||||
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
mng_retcode mng_process_display_dhdr (mng_datap pData,
|
||||
mng_uint16 iObjectid,
|
||||
mng_uint8 iImagetype,
|
||||
mng_uint8 iDeltatype,
|
||||
mng_uint32 iBlockwidth,
|
||||
mng_uint32 iBlockheight,
|
||||
mng_uint32 iBlockx,
|
||||
mng_uint32 iBlocky);
|
||||
|
||||
mng_retcode mng_process_display_prom (mng_datap pData,
|
||||
mng_uint8 iBitdepth,
|
||||
mng_uint8 iColortype,
|
||||
mng_uint8 iFilltype);
|
||||
|
||||
mng_retcode mng_process_display_ipng (mng_datap pData);
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
mng_retcode mng_process_display_ijng (mng_datap pData);
|
||||
#endif
|
||||
|
||||
mng_retcode mng_process_display_pplt (mng_datap pData,
|
||||
mng_uint8 iType,
|
||||
mng_uint32 iCount,
|
||||
mng_palette8ep paIndexentries,
|
||||
mng_uint8p paAlphaentries,
|
||||
mng_uint8p paUsedentries);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_MAGN
|
||||
mng_retcode mng_process_display_magn (mng_datap pData,
|
||||
mng_uint16 iFirstid,
|
||||
mng_uint16 iLastid,
|
||||
mng_uint8 iMethodX,
|
||||
mng_uint16 iMX,
|
||||
mng_uint16 iMY,
|
||||
mng_uint16 iML,
|
||||
mng_uint16 iMR,
|
||||
mng_uint16 iMT,
|
||||
mng_uint16 iMB,
|
||||
mng_uint8 iMethodY);
|
||||
mng_retcode mng_process_display_magn2 (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
mng_retcode mng_process_display_past (mng_datap pData,
|
||||
mng_uint16 iTargetid,
|
||||
mng_uint8 iTargettype,
|
||||
mng_int32 iTargetx,
|
||||
mng_int32 iTargety,
|
||||
mng_uint32 iCount,
|
||||
mng_ptr pSources);
|
||||
mng_retcode mng_process_display_past2 (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#else /* MNG_OPTIMIZE_DISPLAYCALLS */
|
||||
|
||||
mng_retcode mng_process_display_ihdr (mng_datap pData);
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
mng_retcode mng_process_display_mpng (mng_datap pData);
|
||||
#endif
|
||||
mng_retcode mng_process_display_idat (mng_datap pData);
|
||||
mng_retcode mng_process_display_iend (mng_datap pData);
|
||||
mng_retcode mng_process_display_mend (mng_datap pData);
|
||||
mng_retcode mng_process_display_mend2 (mng_datap pData);
|
||||
mng_retcode mng_process_display_defi (mng_datap pData);
|
||||
#ifndef MNG_SKIPCHUNK_BASI
|
||||
mng_retcode mng_process_display_basi (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_CLON
|
||||
mng_retcode mng_process_display_clon (mng_datap pData);
|
||||
mng_retcode mng_process_display_clon2 (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_DISC
|
||||
mng_retcode mng_process_display_disc (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_FRAM
|
||||
mng_retcode mng_process_display_fram (mng_datap pData);
|
||||
mng_retcode mng_process_display_fram2 (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_MOVE
|
||||
mng_retcode mng_process_display_move (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_CLIP
|
||||
mng_retcode mng_process_display_clip (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_SHOW
|
||||
mng_retcode mng_process_display_show (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_SAVE
|
||||
mng_retcode mng_process_display_save (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_SEEK
|
||||
mng_retcode mng_process_display_seek (mng_datap pData);
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
mng_retcode mng_process_display_jhdr (mng_datap pData);
|
||||
mng_retcode mng_process_display_jdaa (mng_datap pData);
|
||||
mng_retcode mng_process_display_jdat (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
mng_retcode mng_process_display_dhdr (mng_datap pData);
|
||||
mng_retcode mng_process_display_prom (mng_datap pData);
|
||||
mng_retcode mng_process_display_ipng (mng_datap pData);
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
mng_retcode mng_process_display_ijng (mng_datap pData);
|
||||
#endif
|
||||
mng_retcode mng_process_display_pplt (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_MAGN
|
||||
mng_retcode mng_process_display_magn (mng_datap pData);
|
||||
mng_retcode mng_process_display_magn2 (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
mng_retcode mng_process_display_past (mng_datap pData);
|
||||
mng_retcode mng_process_display_past2 (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#endif /* MNG_OPTIMIZE_DISPLAYCALLS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_DISPLAY_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_display_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
58
src/3rdparty/libmng/libmng_dither.c
vendored
58
src/3rdparty/libmng/libmng_dither.c
vendored
@ -1,58 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_dither.c copyright (c) 2000-2004 G.Juyn * */
|
||||
/* * version : 1.0.9 * */
|
||||
/* * * */
|
||||
/* * purpose : Dithering routines (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the dithering routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/20/2004 - G.Juyn * */
|
||||
/* * - cleaned up macro-invocations (thanks to D. Airlie) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "libmng_data.h"
|
||||
#include "libmng_error.h"
|
||||
#include "libmng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "libmng_dither.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_dither_a_row (mng_datap pData,
|
||||
mng_uint8p pRow)
|
||||
{
|
||||
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
|
45
src/3rdparty/libmng/libmng_dither.h
vendored
45
src/3rdparty/libmng/libmng_dither.h
vendored
@ -1,45 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_dither.h copyright (c) 2000-2002 G.Juyn * */
|
||||
/* * version : 1.0.5 * */
|
||||
/* * * */
|
||||
/* * purpose : Dithering routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the dithering routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_dither_h_
|
||||
#define _libmng_dither_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_dither_a_row (mng_datap pData,
|
||||
mng_uint8p pRow);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_dither_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
326
src/3rdparty/libmng/libmng_error.c
vendored
326
src/3rdparty/libmng/libmng_error.c
vendored
@ -1,326 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_error.c copyright (c) 2000-2007 G.Juyn * */
|
||||
/* * version : 1.0.10 * */
|
||||
/* * * */
|
||||
/* * purpose : Error routines (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the general error handling routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/23/2000 - G.Juyn * */
|
||||
/* * - added error telltaling * */
|
||||
/* * 0.5.2 - 05/30/2000 - G.Juyn * */
|
||||
/* * - added errorstrings for delta-image processing * */
|
||||
/* * 0.5.2 - 05/31/2000 - G.Juyn * */
|
||||
/* * - fixed up punctuation (contributed by Tim Rowley) * */
|
||||
/* * 0.5.2 - 06/06/2000 - G.Juyn * */
|
||||
/* * - added errorstring for delayed buffer-processing * */
|
||||
/* * * */
|
||||
/* * 0.9.1 - 07/06/2000 - G.Juyn * */
|
||||
/* * - added MNG_NEEDTIMERWAIT errorstring * */
|
||||
/* * 0.9.1 - 07/15/2000 - G.Juyn * */
|
||||
/* * - added NEEDSECTIONWAIT errorstring * */
|
||||
/* * - added macro + routine to set returncode without * */
|
||||
/* * calling error callback * */
|
||||
/* * 0.9.1 - 07/19/2000 - G.Juyn * */
|
||||
/* * - added errorstring for updatemngheader if not a MNG * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 08/09/2000 - G.Juyn * */
|
||||
/* * - added check for simplicity-bits in MHDR * */
|
||||
/* * 0.9.3 - 10/11/2000 - G.Juyn * */
|
||||
/* * - fixed processing of unknown critical chunks * */
|
||||
/* * - added support for nEED * */
|
||||
/* * 0.9.3 - 10/20/2000 - G.Juyn * */
|
||||
/* * - added errorcode for delayed delta-processing * */
|
||||
/* * * */
|
||||
/* * 0.9.4 - 01/18/2001 - G.Juyn * */
|
||||
/* * - added errorcode for MAGN methods * */
|
||||
/* * * */
|
||||
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
|
||||
/* * - added optimization option for MNG-video playback * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 07/04/2002 - G.Juyn * */
|
||||
/* * - added errorcode for extreme chunk-sizes * */
|
||||
/* * 1.0.5 - 08/15/2002 - G.Juyn * */
|
||||
/* * - completed delta-image support * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * 1.0.5 - 09/14/2002 - G.Juyn * */
|
||||
/* * - added event handling for dynamic MNG * */
|
||||
/* * 1.0.5 - 09/15/2002 - G.Juyn * */
|
||||
/* * - fixed LOOP iteration=0 special case * */
|
||||
/* * 1.0.5 - 09/19/2002 - G.Juyn * */
|
||||
/* * - warnings are ignored by default now! * */
|
||||
/* * 1.0.5 - 09/20/2002 - G.Juyn * */
|
||||
/* * - added support for PAST * */
|
||||
/* * 1.0.5 - 10/07/2002 - G.Juyn * */
|
||||
/* * - added check for TERM placement during create/write * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 07/07/2003 - G. R-P * */
|
||||
/* * - added MNG_SKIPCHUNK_CHNK, MNG_NO_DELTA_PNG reductions. * */
|
||||
/* * - skipped more code when MNG_INCLUDE_JNG is not enabled. * */
|
||||
/* * 1.0.6 - 07/29/2003 - G.R-P * */
|
||||
/* * - added conditional around evNT chunk support * */
|
||||
/* * * */
|
||||
/* * 1.0.7 - 03/24/2004 - G.R-P * */
|
||||
/* * - fixed typo on SKIPCHUNK_evNT (->PAST) * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/20/2004 - G.Juyn * */
|
||||
/* * - cleaned up macro-invocations (thanks to D. Airlie) * */
|
||||
/* * * */
|
||||
/* * 1.0.10 - 04/08/2007 - G.Juyn * */
|
||||
/* * - added support for mPNG proposal * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "libmng_data.h"
|
||||
#include "libmng_error.h"
|
||||
#include "libmng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_ERROR_STRINGS
|
||||
MNG_LOCAL mng_error_entry const error_table [] =
|
||||
{
|
||||
{MNG_NOERROR, "No error"},
|
||||
{MNG_OUTOFMEMORY, "Out of memory"},
|
||||
{MNG_INVALIDHANDLE, "The handle is invalid"},
|
||||
{MNG_NOCALLBACK, "A required callback is not defined"},
|
||||
{MNG_UNEXPECTEDEOF, "Encountered unexpected end-of-file"},
|
||||
{MNG_ZLIBERROR, "zlib encountered an error"},
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
{MNG_JPEGERROR, "ijgsrc6b encountered an error"},
|
||||
#endif
|
||||
{MNG_LCMSERROR, "lcms encountered an error"},
|
||||
{MNG_NOOUTPUTPROFILE, "No output-profile defined for CMS"},
|
||||
{MNG_NOSRGBPROFILE, "No sRGB-profile defined for CMS"},
|
||||
{MNG_BUFOVERFLOW, "Internal buffer-overflow"},
|
||||
{MNG_FUNCTIONINVALID, "Function is invalid at this point"},
|
||||
{MNG_OUTPUTERROR, "Writing was unsuccessful; disk full?"},
|
||||
{MNG_JPEGBUFTOOSMALL, "Internal buffer for JPEG processing too small"},
|
||||
{MNG_NEEDMOREDATA, "Reading suspended; waiting for I/O to catch up"},
|
||||
{MNG_NEEDTIMERWAIT, "Timer suspension; normal animation delay"},
|
||||
{MNG_NEEDSECTIONWAIT, "SEEK suspension; application decides"},
|
||||
{MNG_LOOPWITHCACHEOFF, "LOOP encountered when playback cache is turned off"},
|
||||
|
||||
{MNG_APPIOERROR, "Application signalled I/O error"},
|
||||
{MNG_APPTIMERERROR, "Application signalled timing error"},
|
||||
{MNG_APPCMSERROR, "Application signalled CMS error"},
|
||||
{MNG_APPMISCERROR, "Application signalled an error"},
|
||||
{MNG_APPTRACEABORT, "Application signalled error during trace-callback"},
|
||||
|
||||
{MNG_INTERNALERROR, "Internal error in libmng"},
|
||||
|
||||
{MNG_INVALIDSIG, "The signature is invalid"},
|
||||
{MNG_INVALIDCRC, "The CRC for this chunk is invalid"},
|
||||
{MNG_INVALIDLENGTH, "Chunk-length is invalid"},
|
||||
{MNG_SEQUENCEERROR, "Chunk out of sequence"},
|
||||
{MNG_CHUNKNOTALLOWED, "Chunk not allowed at this point"},
|
||||
{MNG_MULTIPLEERROR, "Chunk cannot occur multiple times"},
|
||||
{MNG_PLTEMISSING, "Missing PLTE chunk"},
|
||||
{MNG_IDATMISSING, "Missing IDAT chunk(s)"},
|
||||
{MNG_CANNOTBEEMPTY, "Chunk cannot be empty"},
|
||||
{MNG_GLOBALLENGTHERR, "Global data length invalid"},
|
||||
{MNG_INVALIDBITDEPTH, "The bit_depth is invalid"},
|
||||
{MNG_INVALIDCOLORTYPE, "The color_type is invalid"},
|
||||
{MNG_INVALIDCOMPRESS, "The compression_method is invalid"},
|
||||
{MNG_INVALIDFILTER, "The filter_method or filter_type is invalid"},
|
||||
{MNG_INVALIDINTERLACE, "The interlace_method is invalid"},
|
||||
{MNG_NOTENOUGHIDAT, "There is not enough data in the IDAT chunk(s)"},
|
||||
{MNG_PLTEINDEXERROR, "Palette-index out of bounds"},
|
||||
{MNG_NULLNOTFOUND, "NULL separator not found"},
|
||||
{MNG_KEYWORDNULL, "Keyword cannot be zero-length"},
|
||||
{MNG_OBJECTUNKNOWN, "Object does not exist"},
|
||||
{MNG_OBJECTEXISTS, "Object already exists"},
|
||||
{MNG_TOOMUCHIDAT, "Too much data in IDAT chunk(s)"},
|
||||
{MNG_INVSAMPLEDEPTH, "The sample_depth is invalid"},
|
||||
{MNG_INVOFFSETSIZE, "The offset_type is invalid"},
|
||||
{MNG_INVENTRYTYPE, "The entry_type is invalid"},
|
||||
{MNG_ENDWITHNULL, "Chunk must not end with NULL byte"},
|
||||
{MNG_INVIMAGETYPE, "The image_type is invalid"},
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
{MNG_INVDELTATYPE, "The delta_type is invalid"},
|
||||
#endif
|
||||
{MNG_INVALIDINDEX, "Index-value out of bounds"},
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
{MNG_TOOMUCHJDAT, "Too much data in JDAT chunk(s)"},
|
||||
{MNG_JPEGPARMSERR, "JHDR parameters & JFIF-data do not match"},
|
||||
#endif
|
||||
{MNG_INVFILLMETHOD, "The fill_method is invalid"},
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
{MNG_OBJNOTCONCRETE, "Target object for DHDR must be concrete"},
|
||||
#endif
|
||||
{MNG_TARGETNOALPHA, "Target object must have alpha-channel"},
|
||||
{MNG_MNGTOOCOMPLEX, "MHDR simplicity indicates unsupported feature(s)"},
|
||||
{MNG_UNKNOWNCRITICAL, "Unknown critical chunk encountered"},
|
||||
#ifndef MNG_SKIPCHUNK_nEED
|
||||
{MNG_UNSUPPORTEDNEED, "Requested nEED resources are not supported"},
|
||||
#endif
|
||||
{MNG_INVALIDDELTA, "The delta operation is invalid (mismatched color_types?)"},
|
||||
{MNG_INVALIDMETHOD, "Method is invalid"},
|
||||
{MNG_IMPROBABLELENGTH, "Chunklength is incredibly large"},
|
||||
{MNG_INVALIDBLOCK, "Delta block width and or height invalid"},
|
||||
{MNG_INVALIDEVENT, "Event type is invalid"},
|
||||
{MNG_INVALIDMASK, "Mask type is invalid"},
|
||||
{MNG_NOMATCHINGLOOP, "ENDL without matching LOOP"},
|
||||
#ifndef MNG_SKIPCHUNK_evNT
|
||||
{MNG_SEEKNOTFOUND, "evNT points to unknown SEEK"},
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
{MNG_OBJNOTABSTRACT, "Destination object for PAST must be abstract"},
|
||||
#endif
|
||||
{MNG_TERMSEQERROR, "TERM misplaced during creation of MNG stream"},
|
||||
{MNG_INVALIDFIELDVAL, "invalid fieldvalue (generic)"},
|
||||
{MNG_INVALIDWIDTH, "invalid frame/image width"},
|
||||
{MNG_INVALIDHEIGHT, "invalid frame/image height"},
|
||||
|
||||
{MNG_INVALIDCNVSTYLE, "Canvas_style is invalid"},
|
||||
{MNG_WRONGCHUNK, "Attempt to access the wrong chunk"},
|
||||
{MNG_INVALIDENTRYIX, "Attempt to access an non-existing entry"},
|
||||
{MNG_NOHEADER, "No valid header-chunk"},
|
||||
{MNG_NOCORRCHUNK, "Parent chunk not found"},
|
||||
{MNG_NOMHDR, "No MNG header (MHDR) found"},
|
||||
|
||||
{MNG_IMAGETOOLARGE, "Image is larger than defined maximum"},
|
||||
{MNG_NOTANANIMATION, "Image is not an animation"},
|
||||
{MNG_FRAMENRTOOHIGH, "Framenr out of bounds"},
|
||||
{MNG_LAYERNRTOOHIGH, "Layernr out of bounds"},
|
||||
{MNG_PLAYTIMETOOHIGH, "Playtime out of bounds"},
|
||||
{MNG_FNNOTIMPLEMENTED, "Function not yet implemented"},
|
||||
{MNG_IMAGEFROZEN, "Image is frozen"},
|
||||
|
||||
{MNG_LCMS_NOHANDLE, "Handle could not be initialized"},
|
||||
{MNG_LCMS_NOMEM, "No memory for gamma-table(s)"},
|
||||
{MNG_LCMS_NOTRANS, "Transformation could not be initialized"}
|
||||
};
|
||||
#endif /* MNG_INCLUDE_ERROR_STRINGS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_bool mng_store_error (mng_datap pData,
|
||||
mng_retcode iError,
|
||||
mng_retcode iExtra1,
|
||||
mng_retcode iExtra2)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEB (pData, MNG_FN_STORE_ERROR, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (pData != 0)
|
||||
{
|
||||
pData->iErrorcode = iError; /* save also for getlasterror */
|
||||
pData->iErrorx1 = iExtra1;
|
||||
pData->iErrorx2 = iExtra2;
|
||||
|
||||
#ifdef MNG_INCLUDE_ERROR_STRINGS
|
||||
{ /* binary search variables */
|
||||
mng_int32 iTop, iLower, iUpper, iMiddle;
|
||||
mng_error_entryp pEntry; /* pointer to found entry */
|
||||
/* determine max index of table */
|
||||
iTop = (sizeof (error_table) / sizeof (error_table [0])) - 1;
|
||||
|
||||
iLower = 0; /* initialize binary search */
|
||||
iMiddle = iTop >> 1; /* start in the middle */
|
||||
iUpper = iTop;
|
||||
pEntry = 0; /* no goods yet! */
|
||||
|
||||
do /* the binary search itself */
|
||||
{
|
||||
if (error_table [iMiddle].iError < iError)
|
||||
iLower = iMiddle + 1;
|
||||
else if (error_table [iMiddle].iError > iError)
|
||||
iUpper = iMiddle - 1;
|
||||
else
|
||||
{
|
||||
pEntry = &error_table [iMiddle];
|
||||
break;
|
||||
}
|
||||
|
||||
iMiddle = (iLower + iUpper) >> 1;
|
||||
}
|
||||
while (iLower <= iUpper);
|
||||
|
||||
if (pEntry) /* found it ? */
|
||||
pData->zErrortext = pEntry->zErrortext;
|
||||
else
|
||||
pData->zErrortext = "Unknown error";
|
||||
}
|
||||
#else /* MNG_INCLUDE_ERROR_STRINGS */
|
||||
pData->zErrortext = 0;
|
||||
#endif /* MNG_INCLUDE_ERROR_STRINGS */
|
||||
|
||||
if (iError == 0) /* no error is not severe ! */
|
||||
{
|
||||
pData->iSeverity = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (iError&0x3C00) /* determine the severity */
|
||||
{
|
||||
case 0x0800 : { pData->iSeverity = 5; break; }
|
||||
case 0x1000 : { pData->iSeverity = 2; break; }
|
||||
case 0x2000 : { pData->iSeverity = 1; break; }
|
||||
default : { pData->iSeverity = 9; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEB (pData, MNG_FN_STORE_ERROR, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_TRUE;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_bool mng_process_error (mng_datap pData,
|
||||
mng_retcode iError,
|
||||
mng_retcode iExtra1,
|
||||
mng_retcode iExtra2)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEB (pData, MNG_FN_PROCESS_ERROR, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
mng_store_error (pData, iError, iExtra1, iExtra2);
|
||||
|
||||
if ((pData != MNG_NULL) && (pData->iMagic == MNG_MAGIC))
|
||||
{
|
||||
if (pData->fErrorproc) /* callback defined ? */
|
||||
return pData->fErrorproc (((mng_handle)pData), iError, pData->iSeverity,
|
||||
pData->iChunkname, pData->iChunkseq,
|
||||
pData->iErrorx1, pData->iErrorx2, pData->zErrortext);
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEB (pData, MNG_FN_PROCESS_ERROR, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_TRUE; /* warnings are ignored by default ! */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
119
src/3rdparty/libmng/libmng_error.h
vendored
119
src/3rdparty/libmng/libmng_error.h
vendored
@ -1,119 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_error.h copyright (c) 2000-2002 G.Juyn * */
|
||||
/* * version : 1.0.5 * */
|
||||
/* * * */
|
||||
/* * purpose : Error functions (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the generic error-codes and functions * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/06/2000 - G.Juyn * */
|
||||
/* * - added some errorcodes * */
|
||||
/* * 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - added some errorcodes * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/11/2000 - G.Juyn * */
|
||||
/* * - added application errorcodes (used with callbacks) * */
|
||||
/* * - moved chunk-access errorcodes to severity 5 * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/20/2000 - G.Juyn * */
|
||||
/* * - added JNG errorcodes * */
|
||||
/* * 0.5.2 - 05/23/2000 - G.Juyn * */
|
||||
/* * - added error tell-tale definition * */
|
||||
/* * 0.5.2 - 05/30/2000 - G.Juyn * */
|
||||
/* * - added errorcodes for delta-image processing * */
|
||||
/* * 0.5.2 - 06/06/2000 - G.Juyn * */
|
||||
/* * - added errorcode for delayed buffer-processing * */
|
||||
/* * - moved errorcodes to "libmng.h" * */
|
||||
/* * * */
|
||||
/* * 0.9.1 - 07/15/2000 - G.Juyn * */
|
||||
/* * - added macro + routine to set returncode without * */
|
||||
/* * calling error callback * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * 1.0.5 - 08/20/2002 - G.Juyn * */
|
||||
/* * - added option for soft-handling of errors * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_error_h_
|
||||
#define _libmng_error_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Default error routines * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_bool mng_store_error (mng_datap pData,
|
||||
mng_retcode iError,
|
||||
mng_retcode iExtra1,
|
||||
mng_retcode iExtra2);
|
||||
|
||||
mng_bool mng_process_error (mng_datap pData,
|
||||
mng_retcode iError,
|
||||
mng_retcode iExtra1,
|
||||
mng_retcode iExtra2);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Error handling macros * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SOFTERRORS
|
||||
#define MNG_ERROR(D,C) { if (!mng_process_error (D, C, 0, 0)) return C; }
|
||||
#define MNG_ERRORZ(D,Z) { if (!mng_process_error (D, MNG_ZLIBERROR, Z, 0)) return MNG_ZLIBERROR; }
|
||||
#define MNG_ERRORJ(D,J) { if (!mng_process_error (D, MNG_JPEGERROR, J, 0)) return MNG_JPEGERROR; }
|
||||
#define MNG_ERRORL(D,L) { if (!mng_process_error (D, MNG_LCMSERROR, L, 0)) return MNG_LCMSERROR; }
|
||||
#else
|
||||
#define MNG_ERROR(D,C) { mng_process_error (D, C, 0, 0); return C; }
|
||||
#define MNG_ERRORZ(D,Z) { mng_process_error (D, MNG_ZLIBERROR, Z, 0); return MNG_ZLIBERROR; }
|
||||
#define MNG_ERRORJ(D,J) { mng_process_error (D, MNG_JPEGERROR, J, 0); return MNG_JPEGERROR; }
|
||||
#define MNG_ERRORL(D,L) { mng_process_error (D, MNG_LCMSERROR, L, 0); return MNG_LCMSERROR; }
|
||||
#endif
|
||||
|
||||
#define MNG_RETURN(D,C) { mng_store_error (D, C, 0, 0); return C; }
|
||||
|
||||
#define MNG_WARNING(D,C) { if (!mng_process_error (D, C, 0, 0)) return C; }
|
||||
|
||||
#define MNG_VALIDHANDLE(H) { if ((H == 0) || (((mng_datap)H)->iMagic != MNG_MAGIC)) \
|
||||
return MNG_INVALIDHANDLE; }
|
||||
#define MNG_VALIDHANDLEX(H) { if ((H == 0) || (((mng_datap)H)->iMagic != MNG_MAGIC)) \
|
||||
return 0; }
|
||||
#define MNG_VALIDCB(D,C) { if (!((mng_datap)D)->C) \
|
||||
MNG_ERROR (((mng_datap)D), MNG_NOCALLBACK) }
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Error string-table entry * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct {
|
||||
mng_retcode iError;
|
||||
mng_pchar zErrortext;
|
||||
} mng_error_entry;
|
||||
typedef mng_error_entry const * mng_error_entryp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_error_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
978
src/3rdparty/libmng/libmng_filter.c
vendored
978
src/3rdparty/libmng/libmng_filter.c
vendored
@ -1,978 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_filter.c copyright (c) 2000-2004 G.Juyn * */
|
||||
/* * version : 1.0.9 * */
|
||||
/* * * */
|
||||
/* * purpose : Filtering routines (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the filtering routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/12/2000 - G.Juyn * */
|
||||
/* * - changed trace to macro for callback error-reporting * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 09/07/2000 - G.Juyn * */
|
||||
/* * - added support for new filter_types * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/07/2002 - G.Juyn * */
|
||||
/* * - added test-option for PNG filter method 193 (=no filter) * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 07/07/2003 - G.R-P * */
|
||||
/* * - reversed some loops to use decrementing counter * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/20/2004 - G.Juyn * */
|
||||
/* * - cleaned up macro-invocations (thanks to D. Airlie) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "libmng_data.h"
|
||||
#include "libmng_error.h"
|
||||
#include "libmng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "libmng_filter.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_FILTERS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
MNG_LOCAL mng_retcode filter_sub (mng_datap pData)
|
||||
{
|
||||
mng_uint32 iBpp;
|
||||
mng_uint8p pRawx;
|
||||
mng_uint8p pRawx_prev;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_SUB, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
iBpp = pData->iFilterbpp;
|
||||
pRawx = pData->pWorkrow + pData->iPixelofs + iBpp;
|
||||
pRawx_prev = pData->pWorkrow + pData->iPixelofs;
|
||||
|
||||
for (iX = iBpp; iX < pData->iRowsize; iX++)
|
||||
{
|
||||
*pRawx = (mng_uint8)(*pRawx + *pRawx_prev);
|
||||
pRawx++;
|
||||
pRawx_prev++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_SUB, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
MNG_LOCAL mng_retcode filter_up (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawx;
|
||||
mng_uint8p pPriorx;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_UP, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawx = pData->pWorkrow + pData->iPixelofs;
|
||||
pPriorx = pData->pPrevrow + pData->iPixelofs;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsize - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsize; iX++)
|
||||
#endif
|
||||
{
|
||||
*pRawx = (mng_uint8)(*pRawx + *pPriorx);
|
||||
pRawx++;
|
||||
pPriorx++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_UP, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
MNG_LOCAL mng_retcode filter_average (mng_datap pData)
|
||||
{
|
||||
mng_int32 iBpp;
|
||||
mng_uint8p pRawx;
|
||||
mng_uint8p pRawx_prev;
|
||||
mng_uint8p pPriorx;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_AVERAGE, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
iBpp = pData->iFilterbpp;
|
||||
pRawx = pData->pWorkrow + pData->iPixelofs;
|
||||
pPriorx = pData->pPrevrow + pData->iPixelofs;
|
||||
pRawx_prev = pData->pWorkrow + pData->iPixelofs;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = iBpp - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < iBpp; iX++)
|
||||
#endif
|
||||
{
|
||||
*pRawx = (mng_uint8)(*pRawx + ((*pPriorx) >> 1));
|
||||
pRawx++;
|
||||
pPriorx++;
|
||||
}
|
||||
|
||||
for (iX = iBpp; iX < pData->iRowsize; iX++)
|
||||
{
|
||||
*pRawx = (mng_uint8)(*pRawx + ((*pRawx_prev + *pPriorx) >> 1));
|
||||
pRawx++;
|
||||
pPriorx++;
|
||||
pRawx_prev++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_AVERAGE, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
MNG_LOCAL mng_retcode filter_paeth (mng_datap pData)
|
||||
{
|
||||
mng_int32 iBpp;
|
||||
mng_uint8p pRawx;
|
||||
mng_uint8p pRawx_prev;
|
||||
mng_uint8p pPriorx;
|
||||
mng_uint8p pPriorx_prev;
|
||||
mng_int32 iX;
|
||||
mng_uint32 iA, iB, iC;
|
||||
mng_uint32 iP;
|
||||
mng_uint32 iPa, iPb, iPc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_PAETH, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
iBpp = pData->iFilterbpp;
|
||||
pRawx = pData->pWorkrow + pData->iPixelofs;
|
||||
pPriorx = pData->pPrevrow + pData->iPixelofs;
|
||||
pRawx_prev = pData->pWorkrow + pData->iPixelofs;
|
||||
pPriorx_prev = pData->pPrevrow + pData->iPixelofs;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = iBpp - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < iBpp; iX++)
|
||||
#endif
|
||||
{
|
||||
*pRawx = (mng_uint8)(*pRawx + *pPriorx);
|
||||
|
||||
pRawx++;
|
||||
pPriorx++;
|
||||
}
|
||||
|
||||
for (iX = iBpp; iX < pData->iRowsize; iX++)
|
||||
{
|
||||
iA = (mng_uint32)*pRawx_prev;
|
||||
iB = (mng_uint32)*pPriorx;
|
||||
iC = (mng_uint32)*pPriorx_prev;
|
||||
iP = iA + iB - iC;
|
||||
iPa = abs (iP - iA);
|
||||
iPb = abs (iP - iB);
|
||||
iPc = abs (iP - iC);
|
||||
|
||||
if ((iPa <= iPb) && (iPa <= iPc))
|
||||
*pRawx = (mng_uint8)(*pRawx + iA);
|
||||
else
|
||||
if (iPb <= iPc)
|
||||
*pRawx = (mng_uint8)(*pRawx + iB);
|
||||
else
|
||||
*pRawx = (mng_uint8)(*pRawx + iC);
|
||||
|
||||
pRawx++;
|
||||
pPriorx++;
|
||||
pRawx_prev++;
|
||||
pPriorx_prev++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_PAETH, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_filter_a_row (mng_datap pData)
|
||||
{
|
||||
mng_retcode iRetcode;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_A_ROW, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
switch (*(pData->pWorkrow + pData->iFilterofs))
|
||||
{
|
||||
case 1 : {
|
||||
iRetcode = filter_sub (pData);
|
||||
break;
|
||||
}
|
||||
case 2 : {
|
||||
iRetcode = filter_up (pData);
|
||||
break;
|
||||
}
|
||||
case 3 : {
|
||||
iRetcode = filter_average (pData);
|
||||
break;
|
||||
}
|
||||
case 4 : {
|
||||
iRetcode = filter_paeth (pData);
|
||||
break;
|
||||
}
|
||||
|
||||
default : iRetcode = MNG_INVALIDFILTER;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_A_ROW, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return iRetcode;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef FILTER192
|
||||
mng_retcode mng_init_rowdiffering (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_ROWDIFFERING, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (pData->iFilter == 0xC0) /* has leveling parameters ? */
|
||||
{
|
||||
switch (pData->iColortype) /* salvage leveling parameters */
|
||||
{
|
||||
case 0 : { /* gray */
|
||||
if (pData->iBitdepth <= 8)
|
||||
pData->iLevel0 = (mng_uint16)*pData->pWorkrow;
|
||||
else
|
||||
pData->iLevel0 = mng_get_uint16 (pData->pWorkrow);
|
||||
|
||||
break;
|
||||
}
|
||||
case 2 : { /* rgb */
|
||||
if (pData->iBitdepth <= 8)
|
||||
{
|
||||
pData->iLevel0 = (mng_uint16)*pData->pWorkrow;
|
||||
pData->iLevel1 = (mng_uint16)*(pData->pWorkrow+1);
|
||||
pData->iLevel2 = (mng_uint16)*(pData->pWorkrow+2);
|
||||
}
|
||||
else
|
||||
{
|
||||
pData->iLevel0 = mng_get_uint16 (pData->pWorkrow);
|
||||
pData->iLevel1 = mng_get_uint16 (pData->pWorkrow+2);
|
||||
pData->iLevel2 = mng_get_uint16 (pData->pWorkrow+4);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 3 : { /* indexed */
|
||||
pData->iLevel0 = (mng_uint16)*pData->pWorkrow;
|
||||
break;
|
||||
}
|
||||
case 4 : { /* gray+alpha */
|
||||
if (pData->iBitdepth <= 8)
|
||||
{
|
||||
pData->iLevel0 = (mng_uint16)*pData->pWorkrow;
|
||||
pData->iLevel1 = (mng_uint16)*(pData->pWorkrow+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
pData->iLevel0 = mng_get_uint16 (pData->pWorkrow);
|
||||
pData->iLevel1 = mng_get_uint16 (pData->pWorkrow+2);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 6 : { /* rgb+alpha */
|
||||
if (pData->iBitdepth <= 8)
|
||||
{
|
||||
pData->iLevel0 = (mng_uint16)*pData->pWorkrow;
|
||||
pData->iLevel1 = (mng_uint16)*(pData->pWorkrow+1);
|
||||
pData->iLevel2 = (mng_uint16)*(pData->pWorkrow+2);
|
||||
pData->iLevel3 = (mng_uint16)*(pData->pWorkrow+3);
|
||||
}
|
||||
else
|
||||
{
|
||||
pData->iLevel0 = mng_get_uint16 (pData->pWorkrow);
|
||||
pData->iLevel1 = mng_get_uint16 (pData->pWorkrow+2);
|
||||
pData->iLevel2 = mng_get_uint16 (pData->pWorkrow+4);
|
||||
pData->iLevel3 = mng_get_uint16 (pData->pWorkrow+6);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* shift the entire row back in place */
|
||||
pRawi = pData->pWorkrow + pData->iFilterofs;
|
||||
pRawo = pData->pWorkrow;
|
||||
|
||||
for (iX = 0; iX < pData->iRowsize + pData->iPixelofs - pData->iFilterofs; iX++)
|
||||
*pRawo++ = *pRawi++;
|
||||
|
||||
pData->iFilterofs = 0; /* indicate so ! */
|
||||
|
||||
#ifdef FILTER193
|
||||
if (pData->iFilter == 0xC1) /* no adaptive filtering ? */
|
||||
pData->iPixelofs = pData->iFilterofs;
|
||||
else
|
||||
#endif
|
||||
pData->iPixelofs = pData->iFilterofs + 1;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_ROWDIFFERING, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_g1 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G1, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (pData->iLevel0 & 0x01) /* is it uneven level ? */
|
||||
{
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
/* just invert every bit */
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsize - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsize; iX++)
|
||||
#endif
|
||||
*pRawo++ = (mng_uint8)(~(*pRawi++));
|
||||
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G1, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_g2 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
mng_int32 iC, iS;
|
||||
mng_uint8 iB, iN, iQ;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G2, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
iC = 0;
|
||||
iB = 0;
|
||||
iN = 0;
|
||||
iS = 0;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
if (!iC)
|
||||
{
|
||||
iC = 4;
|
||||
iB = *pRawi++;
|
||||
iN = 0;
|
||||
iS = 8;
|
||||
}
|
||||
|
||||
iS -= 2;
|
||||
iQ = (mng_uint8)(((iB >> iS) + pData->iLevel0) & 0x03);
|
||||
iN = (mng_uint8)((iN << 2) + iQ);
|
||||
iC--;
|
||||
|
||||
if (!iC)
|
||||
*pRawo++ = iN;
|
||||
|
||||
}
|
||||
|
||||
if (iC)
|
||||
*pRawo = (mng_uint8)(iN << iS);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G2, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_g4 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
mng_int32 iC, iS;
|
||||
mng_uint8 iB, iN, iQ;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G4, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
iC = 0;
|
||||
iB = 0;
|
||||
iN = 0;
|
||||
iS = 0;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
if (!iC)
|
||||
{
|
||||
iC = 2;
|
||||
iB = *pRawi++;
|
||||
iN = 0;
|
||||
iS = 8;
|
||||
}
|
||||
|
||||
iS -= 4;
|
||||
iQ = (mng_uint8)(((iB >> iS) + pData->iLevel0) & 0x0F);
|
||||
iN = (mng_uint8)((iN << 4) + iQ);
|
||||
iC--;
|
||||
|
||||
if (!iC)
|
||||
*pRawo++ = iN;
|
||||
|
||||
}
|
||||
|
||||
if (iC)
|
||||
*pRawo = (mng_uint8)(iN << iS);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G4, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_g8 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G8, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
*pRawo++ = (mng_uint8)(((mng_uint16)*pRawi + pData->iLevel0) & 0xFF);
|
||||
|
||||
pRawi++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G8, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_g16 (mng_datap pData)
|
||||
{
|
||||
mng_uint16p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G16, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = (mng_uint16p)(pData->pWorkrow + pData->iPixelofs);
|
||||
pRawo = (mng_uint16p)(pData->pPrevrow + pData->iPixelofs);
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
*pRawo++ = (mng_uint16)(((mng_uint32)*pRawi + (mng_uint32)pData->iLevel0) & 0xFFFF);
|
||||
|
||||
pRawi++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_G16, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_rgb8 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_RGB8, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
*(pRawo+1) = (mng_uint8)(((mng_uint16)*(pRawi+1) + pData->iLevel1) & 0xFF);
|
||||
*pRawo = (mng_uint8)(((mng_uint16)*pRawi + pData->iLevel0 +
|
||||
(mng_uint16)*(pRawo+1)) & 0xFF);
|
||||
*(pRawo+2) = (mng_uint8)(((mng_uint16)*(pRawi+2) + pData->iLevel2 +
|
||||
(mng_uint16)*(pRawo+1)) & 0xFF);
|
||||
|
||||
pRawi += 3;
|
||||
pRawo += 3;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_RGB8, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_rgb16 (mng_datap pData)
|
||||
{
|
||||
mng_uint16p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_RGB16, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = (mng_uint16p)(pData->pWorkrow + pData->iPixelofs);
|
||||
pRawo = (mng_uint16p)(pData->pPrevrow + pData->iPixelofs);
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
*(pRawo+1) = (mng_uint16)(((mng_uint32)*(pRawi+1) + (mng_uint32)pData->iLevel1) & 0xFFFF);
|
||||
*pRawo = (mng_uint16)(((mng_uint32)*pRawi + (mng_uint32)pData->iLevel0 +
|
||||
(mng_uint32)*(pRawo+1)) & 0xFFFF);
|
||||
*(pRawo+2) = (mng_uint16)(((mng_uint32)*(pRawi+2) + (mng_uint32)pData->iLevel2 +
|
||||
(mng_uint32)*(pRawo+1)) & 0xFFFF);
|
||||
|
||||
pRawi += 3;
|
||||
pRawo += 3;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_RGB16, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_idx1 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_IDX1, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (pData->iLevel0 & 0x01) /* is it uneven level ? */
|
||||
{
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
/* just invert every bit */
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsize - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsize; iX++)
|
||||
#endif
|
||||
*pRawo++ = (mng_uint8)(~(*pRawi++));
|
||||
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_IDX1, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_idx2 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
mng_int32 iC, iS;
|
||||
mng_uint8 iB, iN, iQ;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_IDX2, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
iC = 0;
|
||||
iB = 0;
|
||||
iN = 0;
|
||||
iS = 0;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
if (!iC)
|
||||
{
|
||||
iC = 4;
|
||||
iB = *pRawi++;
|
||||
iN = 0;
|
||||
iS = 8;
|
||||
}
|
||||
|
||||
iS -= 2;
|
||||
iQ = (mng_uint8)(((iB >> iS) + pData->iLevel0) & 0x03);
|
||||
iN = (mng_uint8)((iN << 2) + iQ);
|
||||
iC--;
|
||||
|
||||
if (!iC)
|
||||
*pRawo++ = iN;
|
||||
|
||||
}
|
||||
|
||||
if (iC)
|
||||
*pRawo = (mng_uint8)(iN << iS);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_IDX2, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_idx4 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
mng_int32 iC, iS;
|
||||
mng_uint8 iB, iN, iQ;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_IDX4, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
iC = 0;
|
||||
iB = 0;
|
||||
iN = 0;
|
||||
iS = 0;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
if (!iC)
|
||||
{
|
||||
iC = 2;
|
||||
iB = *pRawi++;
|
||||
iN = 0;
|
||||
iS = 8;
|
||||
}
|
||||
|
||||
iS -= 4;
|
||||
iQ = (mng_uint8)(((iB >> iS) + pData->iLevel0) & 0x0F);
|
||||
iN = (mng_uint8)((iN << 4) + iQ);
|
||||
iC--;
|
||||
|
||||
if (!iC)
|
||||
*pRawo++ = iN;
|
||||
|
||||
}
|
||||
|
||||
if (iC)
|
||||
*pRawo = (mng_uint8)(iN << iS);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_IDX4, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_idx8 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_IDX8, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
*pRawo++ = (mng_uint8)(((mng_uint16)*pRawi + pData->iLevel0) & 0xFF);
|
||||
|
||||
pRawi++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_IDX8, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_ga8 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_GA8, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
*pRawo = (mng_uint8)(((mng_uint16)*pRawi + pData->iLevel0) & 0xFF);
|
||||
*(pRawo+1) = (mng_uint8)(((mng_uint16)*(pRawi+1) + pData->iLevel1) & 0xFF);
|
||||
|
||||
pRawi += 2;
|
||||
pRawo += 2;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_GA8, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_ga16 (mng_datap pData)
|
||||
{
|
||||
mng_uint16p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_GA16, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = (mng_uint16p)(pData->pWorkrow + pData->iPixelofs);
|
||||
pRawo = (mng_uint16p)(pData->pPrevrow + pData->iPixelofs);
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
*pRawo = (mng_uint16)(((mng_uint32)*pRawi + (mng_uint32)pData->iLevel0) & 0xFFFF);
|
||||
*(pRawo+1) = (mng_uint16)(((mng_uint32)*(pRawi+1) + (mng_uint32)pData->iLevel1) & 0xFFFF);
|
||||
|
||||
pRawi += 2;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_GA16, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_rgba8 (mng_datap pData)
|
||||
{
|
||||
mng_uint8p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_RGBA8, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = pData->pWorkrow + pData->iPixelofs;
|
||||
pRawo = pData->pPrevrow + pData->iPixelofs;
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
*(pRawo+1) = (mng_uint8)(((mng_uint16)*(pRawi+1) + pData->iLevel1) & 0xFF);
|
||||
*pRawo = (mng_uint8)(((mng_uint16)*pRawi + pData->iLevel0 +
|
||||
(mng_uint16)*(pRawo+1)) & 0xFF);
|
||||
*(pRawo+2) = (mng_uint8)(((mng_uint16)*(pRawi+2) + pData->iLevel2 +
|
||||
(mng_uint16)*(pRawo+1)) & 0xFF);
|
||||
*(pRawo+3) = (mng_uint8)(((mng_uint16)*(pRawi+3) + pData->iLevel3) & 0xFF);
|
||||
|
||||
pRawi += 4;
|
||||
pRawo += 4;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_RGBA8, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_differ_rgba16 (mng_datap pData)
|
||||
{
|
||||
mng_uint16p pRawi, pRawo;
|
||||
mng_int32 iX;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_RGBA16, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pRawi = (mng_uint16p)(pData->pWorkrow + pData->iPixelofs);
|
||||
pRawo = (mng_uint16p)(pData->pPrevrow + pData->iPixelofs);
|
||||
|
||||
#ifdef MNG_DECREMENT_LOOPS
|
||||
for (iX = pData->iRowsamples - 1; iX >= 0; iX--)
|
||||
#else
|
||||
for (iX = 0; iX < pData->iRowsamples; iX++)
|
||||
#endif
|
||||
{
|
||||
*(pRawo+1) = (mng_uint16)(((mng_uint32)*(pRawi+1) + (mng_uint32)pData->iLevel1) & 0xFFFF);
|
||||
*pRawo = (mng_uint16)(((mng_uint32)*pRawi + (mng_uint32)pData->iLevel0 +
|
||||
(mng_uint32)*(pRawo+1)) & 0xFFFF);
|
||||
*(pRawo+2) = (mng_uint16)(((mng_uint32)*(pRawi+2) + (mng_uint32)pData->iLevel2 +
|
||||
(mng_uint32)*(pRawo+1)) & 0xFFFF);
|
||||
*(pRawo+3) = (mng_uint16)(((mng_uint32)*(pRawi+3) + (mng_uint32)pData->iLevel3) & 0xFFFF);
|
||||
|
||||
pRawi += 4;
|
||||
pRawo += 4;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DIFFER_RGBA16, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* FILTER192 */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_FILTERS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
69
src/3rdparty/libmng/libmng_filter.h
vendored
69
src/3rdparty/libmng/libmng_filter.h
vendored
@ -1,69 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_filter.h copyright (c) 2000-2002 G.Juyn * */
|
||||
/* * version : 1.0.5 * */
|
||||
/* * * */
|
||||
/* * purpose : Filtering routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the filtering routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 09/07/2000 - G.Juyn * */
|
||||
/* * - added support for new filter_types * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_filter_h_
|
||||
#define _libmng_filter_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_filter_a_row (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef FILTER192
|
||||
mng_retcode mng_init_rowdiffering (mng_datap pData);
|
||||
|
||||
mng_retcode mng_differ_g1 (mng_datap pData);
|
||||
mng_retcode mng_differ_g2 (mng_datap pData);
|
||||
mng_retcode mng_differ_g4 (mng_datap pData);
|
||||
mng_retcode mng_differ_g8 (mng_datap pData);
|
||||
mng_retcode mng_differ_g16 (mng_datap pData);
|
||||
mng_retcode mng_differ_rgb8 (mng_datap pData);
|
||||
mng_retcode mng_differ_rgb16 (mng_datap pData);
|
||||
mng_retcode mng_differ_idx1 (mng_datap pData);
|
||||
mng_retcode mng_differ_idx2 (mng_datap pData);
|
||||
mng_retcode mng_differ_idx4 (mng_datap pData);
|
||||
mng_retcode mng_differ_idx8 (mng_datap pData);
|
||||
mng_retcode mng_differ_ga8 (mng_datap pData);
|
||||
mng_retcode mng_differ_ga16 (mng_datap pData);
|
||||
mng_retcode mng_differ_rgba8 (mng_datap pData);
|
||||
mng_retcode mng_differ_rgba16 (mng_datap pData);
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_filter_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
3001
src/3rdparty/libmng/libmng_hlapi.c
vendored
3001
src/3rdparty/libmng/libmng_hlapi.c
vendored
File diff suppressed because it is too large
Load Diff
1088
src/3rdparty/libmng/libmng_jpeg.c
vendored
1088
src/3rdparty/libmng/libmng_jpeg.c
vendored
File diff suppressed because it is too large
Load Diff
57
src/3rdparty/libmng/libmng_jpeg.h
vendored
57
src/3rdparty/libmng/libmng_jpeg.h
vendored
@ -1,57 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_jpeg.h copyright (c) 2000-2002 G.Juyn * */
|
||||
/* * version : 1.0.0 * */
|
||||
/* * * */
|
||||
/* * purpose : JPEG library interface (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the JPEG library interface * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 10/16/2000 - G.Juyn * */
|
||||
/* * - added support for JDAA * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_jpeg_h_
|
||||
#define _libmng_jpeg_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngjpeg_initialize (mng_datap pData);
|
||||
mng_retcode mngjpeg_cleanup (mng_datap pData);
|
||||
|
||||
mng_retcode mngjpeg_decompressinit (mng_datap pData);
|
||||
mng_retcode mngjpeg_decompressdata (mng_datap pData,
|
||||
mng_uint32 iRawsize,
|
||||
mng_uint8p pRawdata);
|
||||
mng_retcode mngjpeg_decompressfree (mng_datap pData);
|
||||
|
||||
mng_retcode mngjpeg_decompressinit2 (mng_datap pData);
|
||||
mng_retcode mngjpeg_decompressdata2 (mng_datap pData,
|
||||
mng_uint32 iRawsize,
|
||||
mng_uint8p pRawdata);
|
||||
mng_retcode mngjpeg_decompressfree2 (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_jpeg_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
64
src/3rdparty/libmng/libmng_memory.h
vendored
64
src/3rdparty/libmng/libmng_memory.h
vendored
@ -1,64 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_memory.h copyright (c) 2000-2003 G.Juyn * */
|
||||
/* * version : 1.0.0 * */
|
||||
/* * * */
|
||||
/* * purpose : Memory management (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of memory management functions * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.5.3 - 06/12/2000 - G.Juyn * */
|
||||
/* * - swapped MNG_COPY parameter-names * */
|
||||
/* * 0.5.3 - 06/27/2000 - G.Juyn * */
|
||||
/* * - changed size parameter to mng_size_t * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_memory_h_
|
||||
#define _libmng_memory_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Generic memory manager macros * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INTERNAL_MEMMNGMT
|
||||
#define MNG_ALLOC(H,P,L) { P = calloc (1, (mng_size_t)(L)); \
|
||||
if (P == 0) { MNG_ERROR (H, MNG_OUTOFMEMORY) } }
|
||||
#define MNG_ALLOCX(H,P,L) { P = calloc (1, (mng_size_t)(L)); }
|
||||
#define MNG_FREE(H,P,L) { if (P) { free (P); P = 0; } }
|
||||
#define MNG_FREEX(H,P,L) { if (P) free (P); }
|
||||
#else
|
||||
#define MNG_ALLOC(H,P,L) { P = H->fMemalloc ((mng_size_t)(L)); \
|
||||
if (P == 0) { MNG_ERROR (H, MNG_OUTOFMEMORY) } }
|
||||
#define MNG_ALLOCX(H,P,L) { P = H->fMemalloc ((mng_size_t)(L)); }
|
||||
#define MNG_FREE(H,P,L) { if (P) { H->fMemfree (P, (mng_size_t)(L)); P = 0; } }
|
||||
#define MNG_FREEX(H,P,L) { if (P) { H->fMemfree (P, (mng_size_t)(L)); } }
|
||||
#endif /* mng_internal_memmngmt */
|
||||
|
||||
#define MNG_COPY(D,S,L) { memcpy (D, S, (mng_size_t)(L)); }
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_memory_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
6998
src/3rdparty/libmng/libmng_object_prc.c
vendored
6998
src/3rdparty/libmng/libmng_object_prc.c
vendored
File diff suppressed because it is too large
Load Diff
690
src/3rdparty/libmng/libmng_object_prc.h
vendored
690
src/3rdparty/libmng/libmng_object_prc.h
vendored
@ -1,690 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_object_prc.h copyright (c) 2000-2007 G.Juyn * */
|
||||
/* * version : 1.0.10 * */
|
||||
/* * * */
|
||||
/* * purpose : Object processing routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the internal object processing routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/24/2000 - G.Juyn * */
|
||||
/* * - added support for global color-chunks in animation * */
|
||||
/* * - added support for global PLTE,tRNS,bKGD in animation * */
|
||||
/* * - added SAVE & SEEK animation objects * */
|
||||
/* * 0.5.2 - 05/29/2000 - G.Juyn * */
|
||||
/* * - changed ani_object create routines not to return the * */
|
||||
/* * created object (wasn't necessary) * */
|
||||
/* * - added compression/filter/interlace fields to * */
|
||||
/* * object-buffer for delta-image processing * */
|
||||
/* * * */
|
||||
/* * 0.5.3 - 06/22/2000 - G.Juyn * */
|
||||
/* * - added support for PPLT chunk * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 08/26/2000 - G.Juyn * */
|
||||
/* * - added MAGN chunk * */
|
||||
/* * 0.9.3 - 10/17/2000 - G.Juyn * */
|
||||
/* * - added routine to discard "invalid" objects * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * 1.0.5 - 09/13/2002 - G.Juyn * */
|
||||
/* * - fixed read/write of MAGN chunk * */
|
||||
/* * 1.0.5 - 09/15/2002 - G.Juyn * */
|
||||
/* * - added event handling for dynamic MNG * */
|
||||
/* * 1.0.5 - 09/20/2002 - G.Juyn * */
|
||||
/* * - added support for PAST * */
|
||||
/* * 1.0.5 - 09/23/2002 - G.Juyn * */
|
||||
/* * - added in-memory color-correction of abstract images * */
|
||||
/* * 1.0.5 - 10/07/2002 - G.Juyn * */
|
||||
/* * - fixed DISC support * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 07/07/2003 - G.R-P * */
|
||||
/* * - added conditionals around Delta-PNG code * */
|
||||
/* * - added SKIPCHUNK feature * */
|
||||
/* * 1.0.6 - 07/29/2003 - G.R-P * */
|
||||
/* * - added conditionals around PAST chunk support * */
|
||||
/* * * */
|
||||
/* * 1.0.7 - 03/24/2004 - G.R-P * */
|
||||
/* * - added more SKIPCHUNK conditionals * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/05/2004 - G.Juyn * */
|
||||
/* * - added conditional MNG_OPTIMIZE_OBJCLEANUP * */
|
||||
/* * * */
|
||||
/* * 1.0.10 - 04/08/2007 - G.Juyn * */
|
||||
/* * - added support for mPNG proposal * */
|
||||
/* * 1.0.10 - 04/12/2007 - G.Juyn * */
|
||||
/* * - added support for ANG proposal * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_object_prc_h_
|
||||
#define _libmng_object_prc_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_DISPLAY_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_drop_invalid_objects (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_create_imagedataobject (mng_datap pData,
|
||||
mng_bool bConcrete,
|
||||
mng_bool bViewable,
|
||||
mng_uint32 iWidth,
|
||||
mng_uint32 iHeight,
|
||||
mng_uint8 iBitdepth,
|
||||
mng_uint8 iColortype,
|
||||
mng_uint8 iCompression,
|
||||
mng_uint8 iFilter,
|
||||
mng_uint8 iInterlace,
|
||||
mng_imagedatap *ppObject);
|
||||
|
||||
mng_retcode mng_free_imagedataobject (mng_datap pData,
|
||||
mng_imagedatap pImagedata);
|
||||
|
||||
mng_retcode mng_clone_imagedataobject (mng_datap pData,
|
||||
mng_bool bConcrete,
|
||||
mng_imagedatap pSource,
|
||||
mng_imagedatap *ppClone);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_create_imageobject (mng_datap pData,
|
||||
mng_uint16 iId,
|
||||
mng_bool bConcrete,
|
||||
mng_bool bVisible,
|
||||
mng_bool bViewable,
|
||||
mng_uint32 iWidth,
|
||||
mng_uint32 iHeight,
|
||||
mng_uint8 iBitdepth,
|
||||
mng_uint8 iColortype,
|
||||
mng_uint8 iCompression,
|
||||
mng_uint8 iFilter,
|
||||
mng_uint8 iInterlace,
|
||||
mng_int32 iPosx,
|
||||
mng_int32 iPosy,
|
||||
mng_bool bClipped,
|
||||
mng_int32 iClipl,
|
||||
mng_int32 iClipr,
|
||||
mng_int32 iClipt,
|
||||
mng_int32 iClipb,
|
||||
mng_imagep *ppObject);
|
||||
|
||||
mng_retcode mng_free_imageobject (mng_datap pData,
|
||||
mng_imagep pImage);
|
||||
|
||||
mng_imagep mng_find_imageobject (mng_datap pData,
|
||||
mng_uint16 iId);
|
||||
|
||||
mng_retcode mng_clone_imageobject (mng_datap pData,
|
||||
mng_uint16 iId,
|
||||
mng_bool bPartial,
|
||||
mng_bool bVisible,
|
||||
mng_bool bAbstract,
|
||||
mng_bool bHasloca,
|
||||
mng_uint8 iLocationtype,
|
||||
mng_int32 iLocationx,
|
||||
mng_int32 iLocationy,
|
||||
mng_imagep pSource,
|
||||
mng_imagep *ppClone);
|
||||
|
||||
mng_retcode mng_renum_imageobject (mng_datap pData,
|
||||
mng_imagep pSource,
|
||||
mng_uint16 iId,
|
||||
mng_bool bVisible,
|
||||
mng_bool bAbstract,
|
||||
mng_bool bHasloca,
|
||||
mng_uint8 iLocationtype,
|
||||
mng_int32 iLocationx,
|
||||
mng_int32 iLocationy);
|
||||
|
||||
mng_retcode mng_reset_object_details (mng_datap pData,
|
||||
mng_imagep pImage,
|
||||
mng_uint32 iWidth,
|
||||
mng_uint32 iHeight,
|
||||
mng_uint8 iBitdepth,
|
||||
mng_uint8 iColortype,
|
||||
mng_uint8 iCompression,
|
||||
mng_uint8 iFilter,
|
||||
mng_uint8 iInterlace,
|
||||
mng_bool bResetall);
|
||||
|
||||
mng_retcode mng_promote_imageobject (mng_datap pData,
|
||||
mng_imagep pImage,
|
||||
mng_uint8 iBitdepth,
|
||||
mng_uint8 iColortype,
|
||||
mng_uint8 iFilltype);
|
||||
|
||||
mng_retcode mng_magnify_imageobject (mng_datap pData,
|
||||
mng_imagep pImage);
|
||||
|
||||
mng_retcode mng_colorcorrect_object (mng_datap pData,
|
||||
mng_imagep pImage);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_create_ani_image (mng_datap pData);
|
||||
|
||||
#ifndef MNG_OPTIMIZE_CHUNKREADER
|
||||
|
||||
mng_retcode mng_create_ani_plte (mng_datap pData,
|
||||
mng_uint32 iEntrycount,
|
||||
mng_palette8ep paEntries);
|
||||
|
||||
mng_retcode mng_create_ani_trns (mng_datap pData,
|
||||
mng_uint32 iRawlen,
|
||||
mng_uint8p pRawdata);
|
||||
|
||||
mng_retcode mng_create_ani_gama (mng_datap pData,
|
||||
mng_bool bEmpty,
|
||||
mng_uint32 iGamma);
|
||||
|
||||
mng_retcode mng_create_ani_chrm (mng_datap pData,
|
||||
mng_bool bEmpty,
|
||||
mng_uint32 iWhitepointx,
|
||||
mng_uint32 iWhitepointy,
|
||||
mng_uint32 iRedx,
|
||||
mng_uint32 iRedy,
|
||||
mng_uint32 iGreenx,
|
||||
mng_uint32 iGreeny,
|
||||
mng_uint32 iBluex,
|
||||
mng_uint32 iBluey);
|
||||
|
||||
mng_retcode mng_create_ani_srgb (mng_datap pData,
|
||||
mng_bool bEmpty,
|
||||
mng_uint8 iRenderinginent);
|
||||
|
||||
mng_retcode mng_create_ani_iccp (mng_datap pData,
|
||||
mng_bool bEmpty,
|
||||
mng_uint32 iProfilesize,
|
||||
mng_ptr pProfile);
|
||||
|
||||
mng_retcode mng_create_ani_bkgd (mng_datap pData,
|
||||
mng_uint16 iRed,
|
||||
mng_uint16 iGreen,
|
||||
mng_uint16 iBlue);
|
||||
|
||||
mng_retcode mng_create_ani_loop (mng_datap pData,
|
||||
mng_uint8 iLevel,
|
||||
mng_uint32 iRepeatcount,
|
||||
mng_uint8 iTermcond,
|
||||
mng_uint32 iItermin,
|
||||
mng_uint32 iItermax,
|
||||
mng_uint32 iCount,
|
||||
mng_uint32p pSignals);
|
||||
|
||||
mng_retcode mng_create_ani_endl (mng_datap pData,
|
||||
mng_uint8 iLevel);
|
||||
|
||||
mng_retcode mng_create_ani_defi (mng_datap pData);
|
||||
|
||||
mng_retcode mng_create_ani_basi (mng_datap pData,
|
||||
mng_uint16 iRed,
|
||||
mng_uint16 iGreen,
|
||||
mng_uint16 iBlue,
|
||||
mng_bool bHasalpha,
|
||||
mng_uint16 iAlpha,
|
||||
mng_uint8 iViewable);
|
||||
|
||||
mng_retcode mng_create_ani_clon (mng_datap pData,
|
||||
mng_uint16 iSourceid,
|
||||
mng_uint16 iCloneid,
|
||||
mng_uint8 iClonetype,
|
||||
mng_bool bHasdonotshow,
|
||||
mng_uint8 iDonotshow,
|
||||
mng_uint8 iConcrete,
|
||||
mng_bool bHasloca,
|
||||
mng_uint8 iLocatype,
|
||||
mng_int32 iLocax,
|
||||
mng_int32 iLocay);
|
||||
|
||||
mng_retcode mng_create_ani_back (mng_datap pData,
|
||||
mng_uint16 iRed,
|
||||
mng_uint16 iGreen,
|
||||
mng_uint16 iBlue,
|
||||
mng_uint8 iMandatory,
|
||||
mng_uint16 iImageid,
|
||||
mng_uint8 iTile);
|
||||
|
||||
mng_retcode mng_create_ani_fram (mng_datap pData,
|
||||
mng_uint8 iFramemode,
|
||||
mng_uint8 iChangedelay,
|
||||
mng_uint32 iDelay,
|
||||
mng_uint8 iChangetimeout,
|
||||
mng_uint32 iTimeout,
|
||||
mng_uint8 iChangeclipping,
|
||||
mng_uint8 iCliptype,
|
||||
mng_int32 iClipl,
|
||||
mng_int32 iClipr,
|
||||
mng_int32 iClipt,
|
||||
mng_int32 iClipb);
|
||||
|
||||
mng_retcode mng_create_ani_move (mng_datap pData,
|
||||
mng_uint16 iFirstid,
|
||||
mng_uint16 iLastid,
|
||||
mng_uint8 iType,
|
||||
mng_int32 iLocax,
|
||||
mng_int32 iLocay);
|
||||
|
||||
mng_retcode mng_create_ani_clip (mng_datap pData,
|
||||
mng_uint16 iFirstid,
|
||||
mng_uint16 iLastid,
|
||||
mng_uint8 iType,
|
||||
mng_int32 iClipl,
|
||||
mng_int32 iClipr,
|
||||
mng_int32 iClipt,
|
||||
mng_int32 iClipb);
|
||||
|
||||
mng_retcode mng_create_ani_show (mng_datap pData,
|
||||
mng_uint16 iFirstid,
|
||||
mng_uint16 iLastid,
|
||||
mng_uint8 iMode);
|
||||
|
||||
mng_retcode mng_create_ani_term (mng_datap pData,
|
||||
mng_uint8 iTermaction,
|
||||
mng_uint8 iIteraction,
|
||||
mng_uint32 iDelay,
|
||||
mng_uint32 iItermax);
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_SAVE
|
||||
mng_retcode mng_create_ani_save (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_SEEK
|
||||
mng_retcode mng_create_ani_seek (mng_datap pData,
|
||||
mng_uint32 iSegmentnamesize,
|
||||
mng_pchar zSegmentname);
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
mng_retcode mng_create_ani_dhdr (mng_datap pData,
|
||||
mng_uint16 iObjectid,
|
||||
mng_uint8 iImagetype,
|
||||
mng_uint8 iDeltatype,
|
||||
mng_uint32 iBlockwidth,
|
||||
mng_uint32 iBlockheight,
|
||||
mng_uint32 iBlockx,
|
||||
mng_uint32 iBlocky);
|
||||
|
||||
mng_retcode mng_create_ani_prom (mng_datap pData,
|
||||
mng_uint8 iBitdepth,
|
||||
mng_uint8 iColortype,
|
||||
mng_uint8 iFilltype);
|
||||
|
||||
mng_retcode mng_create_ani_ipng (mng_datap pData);
|
||||
mng_retcode mng_create_ani_ijng (mng_datap pData);
|
||||
|
||||
mng_retcode mng_create_ani_pplt (mng_datap pData,
|
||||
mng_uint8 iType,
|
||||
mng_uint32 iCount,
|
||||
mng_palette8ep paIndexentries,
|
||||
mng_uint8p paAlphaentries,
|
||||
mng_uint8p paUsedentries);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_MAGN
|
||||
mng_retcode mng_create_ani_magn (mng_datap pData,
|
||||
mng_uint16 iFirstid,
|
||||
mng_uint16 iLastid,
|
||||
mng_uint8 iMethodX,
|
||||
mng_uint16 iMX,
|
||||
mng_uint16 iMY,
|
||||
mng_uint16 iML,
|
||||
mng_uint16 iMR,
|
||||
mng_uint16 iMT,
|
||||
mng_uint16 iMB,
|
||||
mng_uint8 iMethodY);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
mng_retcode mng_create_ani_past (mng_datap pData,
|
||||
mng_uint16 iTargetid,
|
||||
mng_uint8 iTargettype,
|
||||
mng_int32 iTargetx,
|
||||
mng_int32 iTargety,
|
||||
mng_uint32 iCount,
|
||||
mng_ptr pSources);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_DISC
|
||||
mng_retcode mng_create_ani_disc (mng_datap pData,
|
||||
mng_uint32 iCount,
|
||||
mng_uint16p pIds);
|
||||
#endif
|
||||
|
||||
#else /* MNG_OPTIMIZE_CHUNKREADER */
|
||||
|
||||
mng_retcode mng_create_ani_plte (mng_datap pData);
|
||||
mng_retcode mng_create_ani_trns (mng_datap pData);
|
||||
mng_retcode mng_create_ani_gama (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_chrm (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_srgb (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_iccp (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_bkgd (mng_datap pData);
|
||||
mng_retcode mng_create_ani_loop (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_endl (mng_datap pData,
|
||||
mng_uint8 iLevel);
|
||||
mng_retcode mng_create_ani_defi (mng_datap pData);
|
||||
mng_retcode mng_create_ani_basi (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_clon (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_back (mng_datap pData);
|
||||
mng_retcode mng_create_ani_fram (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_move (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_clip (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_show (mng_datap pData);
|
||||
mng_retcode mng_create_ani_term (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
#ifndef MNG_SKIPCHUNK_SAVE
|
||||
mng_retcode mng_create_ani_save (mng_datap pData);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_SEEK
|
||||
mng_retcode mng_create_ani_seek (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
mng_retcode mng_create_ani_dhdr (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_prom (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
mng_retcode mng_create_ani_ipng (mng_datap pData);
|
||||
mng_retcode mng_create_ani_ijng (mng_datap pData);
|
||||
|
||||
mng_retcode mng_create_ani_pplt (mng_datap pData,
|
||||
mng_uint8 iType,
|
||||
mng_uint32 iCount,
|
||||
mng_palette8ep paIndexentries,
|
||||
mng_uint8p paAlphaentries,
|
||||
mng_uint8p paUsedentries);
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_MAGN
|
||||
mng_retcode mng_create_ani_magn (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
mng_retcode mng_create_ani_past (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_DISC
|
||||
mng_retcode mng_create_ani_disc (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
#endif
|
||||
|
||||
#endif /* MNG_OPTIMIZE_CHUNKREADER */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_free_ani_image (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
|
||||
#ifndef MNG_OPTIMIZE_OBJCLEANUP
|
||||
|
||||
mng_retcode mng_free_ani_plte (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_trns (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_gama (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#ifndef MNG_SKIPCHUNK_cHRM
|
||||
mng_retcode mng_free_ani_chrm (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_sRGB
|
||||
mng_retcode mng_free_ani_srgb (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_bKGD
|
||||
mng_retcode mng_free_ani_bkgd (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_LOOP
|
||||
mng_retcode mng_free_ani_endl (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
mng_retcode mng_free_ani_defi (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_basi (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_clon (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_back (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_fram (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_move (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_clip (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_show (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_term (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#ifndef MNG_SKIPCHUNK_SAVE
|
||||
mng_retcode mng_free_ani_save (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
mng_retcode mng_free_ani_dhdr (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_prom (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_ipng (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_ijng (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_free_ani_pplt (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_MAGN
|
||||
mng_retcode mng_free_ani_magn (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
|
||||
#endif /* MNG_OPTIMIZE_OBJCLEANUP */
|
||||
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_iCCP
|
||||
mng_retcode mng_free_ani_iccp (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_LOOP
|
||||
mng_retcode mng_free_ani_loop (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_SAVE
|
||||
mng_retcode mng_free_ani_seek (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
mng_retcode mng_free_ani_past (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
mng_retcode mng_free_ani_disc (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_process_ani_image (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
|
||||
mng_retcode mng_process_ani_plte (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_trns (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_gama (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#ifndef MNG_SKIPCHUNK_cHRM
|
||||
mng_retcode mng_process_ani_chrm (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_sRGB
|
||||
mng_retcode mng_process_ani_srgb (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_iCCP
|
||||
mng_retcode mng_process_ani_iccp (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_bKGD
|
||||
mng_retcode mng_process_ani_bkgd (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_LOOP
|
||||
mng_retcode mng_process_ani_loop (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_endl (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
mng_retcode mng_process_ani_defi (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_basi (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_clon (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_back (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_fram (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_move (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_clip (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_show (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_term (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#ifndef MNG_SKIPCHUNK_SAVE
|
||||
mng_retcode mng_process_ani_save (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_SEEK
|
||||
mng_retcode mng_process_ani_seek (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
mng_retcode mng_process_ani_dhdr (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_prom (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_ipng (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_ijng (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ani_pplt (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
mng_retcode mng_process_ani_magn (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
mng_retcode mng_process_ani_past (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
mng_retcode mng_process_ani_disc (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DYNAMICMNG
|
||||
#ifndef MNG_OPTIMIZE_CHUNKREADER
|
||||
mng_retcode mng_create_event (mng_datap pData,
|
||||
mng_uint8 iEventtype,
|
||||
mng_uint8 iMasktype,
|
||||
mng_int32 iLeft,
|
||||
mng_int32 iRight,
|
||||
mng_int32 iTop,
|
||||
mng_int32 iBottom,
|
||||
mng_uint16 iObjectid,
|
||||
mng_uint8 iIndex,
|
||||
mng_uint32 iSegmentnamesize,
|
||||
mng_pchar zSegmentname);
|
||||
#else
|
||||
mng_retcode mng_create_event (mng_datap pData,
|
||||
mng_ptr pEntry);
|
||||
#endif
|
||||
mng_retcode mng_free_event (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_event (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
#ifndef MNG_OPTIMIZE_CHUNKREADER
|
||||
mng_retcode mng_create_mpng_obj (mng_datap pData,
|
||||
mng_uint32 iFramewidth,
|
||||
mng_uint32 iFrameheight,
|
||||
mng_uint16 iNumplays,
|
||||
mng_uint16 iTickspersec,
|
||||
mng_uint32 iFramessize,
|
||||
mng_ptr pFrames);
|
||||
#else
|
||||
mng_retcode mng_create_mpng_obj (mng_datap pData,
|
||||
mng_ptr pEntry);
|
||||
#endif
|
||||
mng_retcode mng_free_mpng_obj (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_mpng_obj (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_ANG_PROPOSAL
|
||||
#ifndef MNG_OPTIMIZE_CHUNKREADER
|
||||
mng_retcode mng_create_ang_obj (mng_datap pData,
|
||||
mng_uint32 iNumframes,
|
||||
mng_uint32 iTickspersec,
|
||||
mng_uint32 iNumplays,
|
||||
mng_uint32 iTilewidth,
|
||||
mng_uint32 iTileheight,
|
||||
mng_uint8 iInterlace,
|
||||
mng_uint8 iStillused);
|
||||
#else
|
||||
mng_retcode mng_create_ang_obj (mng_datap pData,
|
||||
mng_ptr pEntry);
|
||||
#endif
|
||||
mng_retcode mng_free_ang_obj (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode mng_process_ang_obj (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_DISPLAY_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_object_prc_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
635
src/3rdparty/libmng/libmng_objects.h
vendored
635
src/3rdparty/libmng/libmng_objects.h
vendored
@ -1,635 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_objects.h copyright (c) 2000-2007 G.Juyn * */
|
||||
/* * version : 1.0.10 * */
|
||||
/* * * */
|
||||
/* * purpose : Internal object structures (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the internal object structures * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/23/2000 - G.Juyn * */
|
||||
/* * - changed inclusion to DISPLAY_PROCS * */
|
||||
/* * 0.5.2 - 05/24/2000 - G.Juyn * */
|
||||
/* * - added global color-chunks for animations * */
|
||||
/* * - added global PLTE,tRNS,bKGD chunks for animation * */
|
||||
/* * - added SAVE & SEEK animation objects * */
|
||||
/* * 0.5.2 - 05/29/2000 - G.Juyn * */
|
||||
/* * - added framenr/layernr/playtime to object header * */
|
||||
/* * 0.5.2 - 05/30/2000 - G.Juyn * */
|
||||
/* * - added ani-objects for delta-image processing * */
|
||||
/* * - added compression/filter/interlace fields to * */
|
||||
/* * object-buffer for delta-image processing * */
|
||||
/* * * */
|
||||
/* * 0.5.3 - 06/17/2000 - G.Juyn * */
|
||||
/* * - changed definition of aTRNSentries * */
|
||||
/* * 0.5.3 - 06/22/2000 - G.Juyn * */
|
||||
/* * - added definition for PPLT animation-processing * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 08/26/2000 - G.Juyn * */
|
||||
/* * - added MAGN chunk * */
|
||||
/* * 0.9.3 - 09/10/2000 - G.Juyn * */
|
||||
/* * - fixed DEFI behavior * */
|
||||
/* * 0.9.3 - 10/16/2000 - G.Juyn * */
|
||||
/* * - added support for delta-JNG * */
|
||||
/* * 0.9.3 - 10/17/2000 - G.Juyn * */
|
||||
/* * - added valid-flag to stored objects for read() / display()* */
|
||||
/* * 0.9.3 - 10/19/2000 - G.Juyn * */
|
||||
/* * - added storage for pixel-/alpha-sampledepth for delta's * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 09/13/2002 - G.Juyn * */
|
||||
/* * - fixed read/write of MAGN chunk * */
|
||||
/* * 1.0.5 - 09/15/2002 - G.Juyn * */
|
||||
/* * - added event handling for dynamic MNG * */
|
||||
/* * 1.0.5 - 09/20/2002 - G.Juyn * */
|
||||
/* * - added support for PAST * */
|
||||
/* * 1.0.5 - 09/23/2002 - G.Juyn * */
|
||||
/* * - added in-memory color-correction of abstract images * */
|
||||
/* * 1.0.5 - 10/07/2002 - G.Juyn * */
|
||||
/* * - fixed DISC support * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 10/07/2003 - G.R-P * */
|
||||
/* * - added SKIPCHUNK conditionals * */
|
||||
/* * * */
|
||||
/* * 1.0.7 - 03/24/2004 - G.R-P * */
|
||||
/* * - added more SKIPCHUNK conditionals * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/05/2004 - G.Juyn * */
|
||||
/* * - added conditional MNG_OPTIMIZE_OBJCLEANUP * */
|
||||
/* * * */
|
||||
/* * 1.0.10 - 04/08/2007 - G.Juyn * */
|
||||
/* * - added support for mPNG proposal * */
|
||||
/* * 1.0.10 - 04/12/2007 - G.Juyn * */
|
||||
/* * - added support for ANG proposal * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_objects_h_
|
||||
#define _libmng_objects_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_DISPLAY_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef mng_retcode (*mng_cleanupobject) (mng_datap pData,
|
||||
mng_objectp pHeader);
|
||||
|
||||
typedef mng_retcode (*mng_processobject) (mng_datap pData,
|
||||
mng_objectp pHeader);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct {
|
||||
mng_cleanupobject fCleanup;
|
||||
mng_processobject fProcess;
|
||||
mng_objectp pNext; /* for double-linked list */
|
||||
mng_objectp pPrev;
|
||||
mng_uint32 iFramenr;
|
||||
mng_uint32 iLayernr;
|
||||
mng_uint32 iPlaytime;
|
||||
#ifdef MNG_OPTIMIZE_OBJCLEANUP
|
||||
mng_size_t iObjsize;
|
||||
#endif
|
||||
} mng_object_header;
|
||||
typedef mng_object_header * mng_object_headerp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* MNG specification "object-buffer" */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint32 iRefcount; /* reference counter */
|
||||
mng_bool bFrozen; /* frozen flag */
|
||||
mng_bool bConcrete; /* concrete flag */
|
||||
mng_bool bViewable; /* viewable flag */
|
||||
mng_uint32 iWidth; /* image specifics */
|
||||
mng_uint32 iHeight;
|
||||
mng_uint8 iBitdepth;
|
||||
mng_uint8 iColortype;
|
||||
mng_uint8 iCompression;
|
||||
mng_uint8 iFilter;
|
||||
mng_uint8 iInterlace;
|
||||
|
||||
mng_bool bCorrected; /* indicates if an abstract image
|
||||
has already been color-corrected */
|
||||
|
||||
mng_uint8 iAlphabitdepth; /* used only for JNG images */
|
||||
mng_uint8 iJHDRcompression;
|
||||
mng_uint8 iJHDRinterlace;
|
||||
|
||||
mng_uint8 iPixelsampledepth; /* used with delta-images */
|
||||
mng_uint8 iAlphasampledepth;
|
||||
|
||||
mng_bool bHasPLTE; /* PLTE chunk present */
|
||||
mng_bool bHasTRNS; /* tRNS chunk present */
|
||||
mng_bool bHasGAMA; /* gAMA chunk present */
|
||||
mng_bool bHasCHRM; /* cHRM chunk present */
|
||||
mng_bool bHasSRGB; /* sRGB chunk present */
|
||||
mng_bool bHasICCP; /* iCCP chunk present */
|
||||
mng_bool bHasBKGD; /* bKGD chunk present */
|
||||
|
||||
mng_uint32 iPLTEcount; /* PLTE fields */
|
||||
mng_rgbpaltab aPLTEentries;
|
||||
|
||||
mng_uint16 iTRNSgray; /* tRNS fields */
|
||||
mng_uint16 iTRNSred;
|
||||
mng_uint16 iTRNSgreen;
|
||||
mng_uint16 iTRNSblue;
|
||||
mng_uint32 iTRNScount;
|
||||
mng_uint8arr aTRNSentries;
|
||||
|
||||
mng_uint32 iGamma; /* gAMA fields */
|
||||
|
||||
mng_uint32 iWhitepointx; /* cHRM fields */
|
||||
mng_uint32 iWhitepointy;
|
||||
mng_uint32 iPrimaryredx;
|
||||
mng_uint32 iPrimaryredy;
|
||||
mng_uint32 iPrimarygreenx;
|
||||
mng_uint32 iPrimarygreeny;
|
||||
mng_uint32 iPrimarybluex;
|
||||
mng_uint32 iPrimarybluey;
|
||||
|
||||
mng_uint8 iRenderingintent; /* sRGB fields */
|
||||
|
||||
mng_uint32 iProfilesize; /* iCCP fields */
|
||||
mng_ptr pProfile;
|
||||
|
||||
mng_uint8 iBKGDindex; /* bKGD fields */
|
||||
mng_uint16 iBKGDgray;
|
||||
mng_uint16 iBKGDred;
|
||||
mng_uint16 iBKGDgreen;
|
||||
mng_uint16 iBKGDblue;
|
||||
|
||||
mng_uint32 iSamplesize; /* size of a sample */
|
||||
mng_uint32 iRowsize; /* size of a row of samples */
|
||||
mng_uint32 iImgdatasize; /* size of the sample data buffer */
|
||||
mng_uint8p pImgdata; /* actual sample data buffer */
|
||||
|
||||
} mng_imagedata;
|
||||
typedef mng_imagedata * mng_imagedatap;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* MNG specification "object" */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iId; /* object-id */
|
||||
mng_bool bFrozen; /* frozen flag */
|
||||
mng_bool bVisible; /* potential visibility flag */
|
||||
mng_bool bViewable; /* viewable flag */
|
||||
mng_bool bValid; /* marks invalid when only reading */
|
||||
mng_int32 iPosx; /* location fields */
|
||||
mng_int32 iPosy;
|
||||
mng_bool bClipped; /* clipping fields */
|
||||
mng_int32 iClipl;
|
||||
mng_int32 iClipr;
|
||||
mng_int32 iClipt;
|
||||
mng_int32 iClipb;
|
||||
#ifndef MNG_SKIPCHUNK_MAGN
|
||||
mng_uint8 iMAGN_MethodX; /* magnification (MAGN) */
|
||||
mng_uint8 iMAGN_MethodY;
|
||||
mng_uint16 iMAGN_MX;
|
||||
mng_uint16 iMAGN_MY;
|
||||
mng_uint16 iMAGN_ML;
|
||||
mng_uint16 iMAGN_MR;
|
||||
mng_uint16 iMAGN_MT;
|
||||
mng_uint16 iMAGN_MB;
|
||||
#endif
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
mng_int32 iPastx; /* target x/y from previous PAST */
|
||||
mng_int32 iPasty;
|
||||
#endif
|
||||
mng_imagedatap pImgbuf; /* the image-data buffer */
|
||||
} mng_image;
|
||||
typedef mng_image * mng_imagep;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* "on-the-fly" image (= object 0) */
|
||||
typedef mng_image mng_ani_image; /* let's (ab)use the general "object" */
|
||||
typedef mng_ani_image * mng_ani_imagep; /* that's actualy crucial, so don't change it! */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* global PLTE object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint32 iEntrycount;
|
||||
mng_rgbpaltab aEntries;
|
||||
} mng_ani_plte;
|
||||
typedef mng_ani_plte * mng_ani_pltep;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* global tRNS object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint32 iRawlen;
|
||||
mng_uint8arr aRawdata;
|
||||
} mng_ani_trns;
|
||||
typedef mng_ani_trns * mng_ani_trnsp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* global gAMA object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_bool bEmpty;
|
||||
mng_uint32 iGamma;
|
||||
} mng_ani_gama;
|
||||
typedef mng_ani_gama * mng_ani_gamap;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_cHRM
|
||||
typedef struct { /* global cHRM object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_bool bEmpty;
|
||||
mng_uint32 iWhitepointx;
|
||||
mng_uint32 iWhitepointy;
|
||||
mng_uint32 iRedx;
|
||||
mng_uint32 iRedy;
|
||||
mng_uint32 iGreenx;
|
||||
mng_uint32 iGreeny;
|
||||
mng_uint32 iBluex;
|
||||
mng_uint32 iBluey;
|
||||
} mng_ani_chrm;
|
||||
typedef mng_ani_chrm * mng_ani_chrmp;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* global sRGB object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_bool bEmpty;
|
||||
mng_uint8 iRenderingintent;
|
||||
} mng_ani_srgb;
|
||||
typedef mng_ani_srgb * mng_ani_srgbp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_iCCP
|
||||
typedef struct { /* global iCCP object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_bool bEmpty;
|
||||
mng_uint32 iProfilesize;
|
||||
mng_ptr pProfile;
|
||||
} mng_ani_iccp;
|
||||
typedef mng_ani_iccp * mng_ani_iccpp;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* global bKGD object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iRed;
|
||||
mng_uint16 iGreen;
|
||||
mng_uint16 iBlue;
|
||||
} mng_ani_bkgd;
|
||||
typedef mng_ani_bkgd * mng_ani_bkgdp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* LOOP object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint8 iLevel;
|
||||
mng_uint32 iRepeatcount;
|
||||
mng_uint8 iTermcond;
|
||||
mng_uint32 iItermin;
|
||||
mng_uint32 iItermax;
|
||||
mng_uint32 iCount;
|
||||
mng_uint32p pSignals;
|
||||
|
||||
mng_uint32 iRunningcount; /* running counter */
|
||||
} mng_ani_loop;
|
||||
typedef mng_ani_loop * mng_ani_loopp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* ENDL object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint8 iLevel;
|
||||
|
||||
mng_ani_loopp pLOOP; /* matching LOOP */
|
||||
} mng_ani_endl;
|
||||
typedef mng_ani_endl * mng_ani_endlp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* DEFI object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iId;
|
||||
mng_bool bHasdonotshow;
|
||||
mng_uint8 iDonotshow;
|
||||
mng_bool bHasconcrete;
|
||||
mng_uint8 iConcrete;
|
||||
mng_bool bHasloca;
|
||||
mng_int32 iLocax;
|
||||
mng_int32 iLocay;
|
||||
mng_bool bHasclip;
|
||||
mng_int32 iClipl;
|
||||
mng_int32 iClipr;
|
||||
mng_int32 iClipt;
|
||||
mng_int32 iClipb;
|
||||
} mng_ani_defi;
|
||||
typedef mng_ani_defi * mng_ani_defip;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* BASI object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iRed;
|
||||
mng_uint16 iGreen;
|
||||
mng_uint16 iBlue;
|
||||
mng_bool bHasalpha;
|
||||
mng_uint16 iAlpha;
|
||||
mng_uint8 iViewable;
|
||||
} mng_ani_basi;
|
||||
typedef mng_ani_basi * mng_ani_basip;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* CLON object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iCloneid;
|
||||
mng_uint16 iSourceid;
|
||||
mng_uint8 iClonetype;
|
||||
mng_bool bHasdonotshow;
|
||||
mng_uint8 iDonotshow;
|
||||
mng_uint8 iConcrete;
|
||||
mng_bool bHasloca;
|
||||
mng_uint8 iLocatype;
|
||||
mng_int32 iLocax;
|
||||
mng_int32 iLocay;
|
||||
} mng_ani_clon;
|
||||
typedef mng_ani_clon * mng_ani_clonp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* BACK object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iRed;
|
||||
mng_uint16 iGreen;
|
||||
mng_uint16 iBlue;
|
||||
mng_uint8 iMandatory;
|
||||
mng_uint16 iImageid;
|
||||
mng_uint8 iTile;
|
||||
} mng_ani_back;
|
||||
typedef mng_ani_back * mng_ani_backp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* FRAM object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint8 iFramemode;
|
||||
mng_uint8 iChangedelay;
|
||||
mng_uint32 iDelay;
|
||||
mng_uint8 iChangetimeout;
|
||||
mng_uint32 iTimeout;
|
||||
mng_uint8 iChangeclipping;
|
||||
mng_uint8 iCliptype;
|
||||
mng_int32 iClipl;
|
||||
mng_int32 iClipr;
|
||||
mng_int32 iClipt;
|
||||
mng_int32 iClipb;
|
||||
} mng_ani_fram;
|
||||
typedef mng_ani_fram * mng_ani_framp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* MOVE object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iFirstid;
|
||||
mng_uint16 iLastid;
|
||||
mng_uint8 iType;
|
||||
mng_int32 iLocax;
|
||||
mng_int32 iLocay;
|
||||
} mng_ani_move;
|
||||
typedef mng_ani_move * mng_ani_movep;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* CLIP object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iFirstid;
|
||||
mng_uint16 iLastid;
|
||||
mng_uint8 iType;
|
||||
mng_int32 iClipl;
|
||||
mng_int32 iClipr;
|
||||
mng_int32 iClipt;
|
||||
mng_int32 iClipb;
|
||||
} mng_ani_clip;
|
||||
typedef mng_ani_clip * mng_ani_clipp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* SHOW object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iFirstid;
|
||||
mng_uint16 iLastid;
|
||||
mng_uint8 iMode;
|
||||
} mng_ani_show;
|
||||
typedef mng_ani_show * mng_ani_showp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* TERM object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint8 iTermaction;
|
||||
mng_uint8 iIteraction;
|
||||
mng_uint32 iDelay;
|
||||
mng_uint32 iItermax;
|
||||
} mng_ani_term;
|
||||
typedef mng_ani_term * mng_ani_termp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* SAVE object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
} mng_ani_save;
|
||||
typedef mng_ani_save * mng_ani_savep;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* SEEK object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint32 iSegmentnamesize;
|
||||
mng_pchar zSegmentname;
|
||||
} mng_ani_seek;
|
||||
typedef mng_ani_seek * mng_ani_seekp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
#ifndef MNG_NO_DELTA_PNG
|
||||
typedef struct { /* DHDR object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iObjectid;
|
||||
mng_uint8 iImagetype;
|
||||
mng_uint8 iDeltatype;
|
||||
mng_uint32 iBlockwidth;
|
||||
mng_uint32 iBlockheight;
|
||||
mng_uint32 iBlockx;
|
||||
mng_uint32 iBlocky;
|
||||
} mng_ani_dhdr;
|
||||
typedef mng_ani_dhdr * mng_ani_dhdrp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* PROM object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint8 iBitdepth;
|
||||
mng_uint8 iColortype;
|
||||
mng_uint8 iFilltype;
|
||||
} mng_ani_prom;
|
||||
typedef mng_ani_prom * mng_ani_promp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* IPNG object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
} mng_ani_ipng;
|
||||
typedef mng_ani_ipng * mng_ani_ipngp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* IJNG object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
} mng_ani_ijng;
|
||||
typedef mng_ani_ijng * mng_ani_ijngp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* PPLT object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint8 iType;
|
||||
mng_uint32 iCount;
|
||||
mng_rgbpaltab aIndexentries;
|
||||
mng_uint8arr aAlphaentries;
|
||||
mng_uint8arr aUsedentries;
|
||||
} mng_ani_pplt;
|
||||
typedef mng_ani_pplt * mng_ani_ppltp;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_MAGN
|
||||
typedef struct { /* MAGN object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iFirstid;
|
||||
mng_uint16 iLastid;
|
||||
mng_uint8 iMethodX;
|
||||
mng_uint16 iMX;
|
||||
mng_uint16 iMY;
|
||||
mng_uint16 iML;
|
||||
mng_uint16 iMR;
|
||||
mng_uint16 iMT;
|
||||
mng_uint16 iMB;
|
||||
mng_uint8 iMethodY;
|
||||
} mng_ani_magn;
|
||||
typedef mng_ani_magn * mng_ani_magnp;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_PAST
|
||||
typedef struct { /* PAST object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint16 iTargetid;
|
||||
mng_uint8 iTargettype;
|
||||
mng_int32 iTargetx;
|
||||
mng_int32 iTargety;
|
||||
mng_uint32 iCount;
|
||||
mng_ptr pSources;
|
||||
} mng_ani_past;
|
||||
typedef mng_ani_past * mng_ani_pastp;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_DISC
|
||||
typedef struct { /* DISC object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint32 iCount;
|
||||
mng_uint16p pIds;
|
||||
} mng_ani_disc;
|
||||
typedef mng_ani_disc * mng_ani_discp;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DYNAMICMNG
|
||||
typedef struct { /* event object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint8 iEventtype;
|
||||
mng_uint8 iMasktype;
|
||||
mng_int32 iLeft;
|
||||
mng_int32 iRight;
|
||||
mng_int32 iTop;
|
||||
mng_int32 iBottom;
|
||||
mng_uint16 iObjectid;
|
||||
mng_uint8 iIndex;
|
||||
mng_uint32 iSegmentnamesize;
|
||||
mng_pchar zSegmentname;
|
||||
|
||||
mng_ani_seekp pSEEK; /* SEEK ani object */
|
||||
mng_int32 iLastx; /* last X/Y coordinates */
|
||||
mng_int32 iLasty;
|
||||
} mng_event;
|
||||
typedef mng_event * mng_eventp;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
typedef struct { /* mPNG object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint32 iFramewidth;
|
||||
mng_uint32 iFrameheight;
|
||||
mng_uint32 iNumplays;
|
||||
mng_uint16 iTickspersec;
|
||||
mng_uint32 iFramessize;
|
||||
mng_ptr pFrames;
|
||||
} mng_mpng_obj;
|
||||
typedef mng_mpng_obj * mng_mpng_objp;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_ANG_PROPOSAL
|
||||
typedef struct { /* ANG object */
|
||||
mng_object_header sHeader; /* default header (DO NOT REMOVE) */
|
||||
mng_uint32 iNumframes;
|
||||
mng_uint32 iTickspersec;
|
||||
mng_uint32 iNumplays;
|
||||
mng_uint32 iTilewidth;
|
||||
mng_uint32 iTileheight;
|
||||
mng_uint8 iInterlace;
|
||||
mng_uint8 iStillused;
|
||||
mng_uint32 iTilessize;
|
||||
mng_ptr pTiles;
|
||||
} mng_ang_obj;
|
||||
typedef mng_ang_obj * mng_ang_objp;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_DISPLAY_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_objects_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
24610
src/3rdparty/libmng/libmng_pixels.c
vendored
24610
src/3rdparty/libmng/libmng_pixels.c
vendored
File diff suppressed because it is too large
Load Diff
1147
src/3rdparty/libmng/libmng_pixels.h
vendored
1147
src/3rdparty/libmng/libmng_pixels.h
vendored
File diff suppressed because it is too large
Load Diff
2799
src/3rdparty/libmng/libmng_prop_xs.c
vendored
2799
src/3rdparty/libmng/libmng_prop_xs.c
vendored
File diff suppressed because it is too large
Load Diff
1369
src/3rdparty/libmng/libmng_read.c
vendored
1369
src/3rdparty/libmng/libmng_read.c
vendored
File diff suppressed because it is too large
Load Diff
53
src/3rdparty/libmng/libmng_read.h
vendored
53
src/3rdparty/libmng/libmng_read.h
vendored
@ -1,53 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_read.h copyright (c) 2000-2004 G.Juyn * */
|
||||
/* * version : 1.0.8 * */
|
||||
/* * * */
|
||||
/* * purpose : Read management (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the read management routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 10/18/2000 - G.Juyn * */
|
||||
/* * - added closestream() processing for mng_cleanup() * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * * */
|
||||
/* * 1.0.8 - 04/12/2004 - G.Juyn * */
|
||||
/* * - added data-push mechanisms for specialized decoders * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_read_h_
|
||||
#define _libmng_read_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_process_eof (mng_datap pData);
|
||||
|
||||
mng_retcode mng_release_pushdata (mng_datap pData);
|
||||
|
||||
mng_retcode mng_release_pushchunk (mng_datap pData);
|
||||
|
||||
mng_retcode mng_read_graphic (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_read_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
1683
src/3rdparty/libmng/libmng_trace.c
vendored
1683
src/3rdparty/libmng/libmng_trace.c
vendored
File diff suppressed because it is too large
Load Diff
1474
src/3rdparty/libmng/libmng_trace.h
vendored
1474
src/3rdparty/libmng/libmng_trace.h
vendored
File diff suppressed because it is too large
Load Diff
574
src/3rdparty/libmng/libmng_types.h
vendored
574
src/3rdparty/libmng/libmng_types.h
vendored
@ -1,574 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_types.h copyright (c) 2000-2007 G.Juyn * */
|
||||
/* * version : 1.0.10 * */
|
||||
/* * * */
|
||||
/* * purpose : type specifications * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Specification of the types used by the library * */
|
||||
/* * Creates platform-independant structure * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/06/2000 - G.Juyn * */
|
||||
/* * - added iteratechunk callback definition * */
|
||||
/* * 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - improved definitions for DLL support * */
|
||||
/* * - added 8-bit palette definition * */
|
||||
/* * - added general array definitions * */
|
||||
/* * - added MNG_NULL definition * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/11/2000 - G.Juyn * */
|
||||
/* * - changed most callback prototypes to allow the app * */
|
||||
/* * to report errors during callback processing * */
|
||||
/* * 0.5.1 - 05/16/2000 - G.Juyn * */
|
||||
/* * - moved standard header includes into this file * */
|
||||
/* * (stdlib/mem for mem-mngmt & math for fp gamma-calc) * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/18/2000 - G.Juyn * */
|
||||
/* * - B003 - fixed problem with <mem.h> being proprietary * */
|
||||
/* * to Borland platform * */
|
||||
/* * - added helper definitions for JNG (IJG-based) * */
|
||||
/* * - fixed support for IJGSRC6B * */
|
||||
/* * 0.5.2 - 05/24/2000 - G.Juyn * */
|
||||
/* * - added default IJG compression parameters and such * */
|
||||
/* * 0.5.2 - 05/31/2000 - G.Juyn * */
|
||||
/* * - fixed inclusion for memcpy (contributed by Tim Rowley) * */
|
||||
/* * - added mng_int32p (contributed by Tim Rowley) * */
|
||||
/* * 0.5.2 - 06/02/2000 - G.Juyn * */
|
||||
/* * - removed SWAP_ENDIAN reference (contributed by Tim Rowley)* */
|
||||
/* * - added getalphaline callback for RGB8_A8 canvasstyle * */
|
||||
/* * * */
|
||||
/* * 0.5.3 - 06/21/2000 - G.Juyn * */
|
||||
/* * - added speedtype to facilitate testing * */
|
||||
/* * 0.5.3 - 06/27/2000 - G.Juyn * */
|
||||
/* * - added typedef for mng_size_t * */
|
||||
/* * - changed size parameter for memory callbacks to * */
|
||||
/* * mng_size_t * */
|
||||
/* * 0.5.3 - 06/28/2000 - G.Juyn * */
|
||||
/* * - changed definition of 32-bit ints (64-bit platforms) * */
|
||||
/* * - changed definition of mng_handle (64-bit platforms) * */
|
||||
/* * 0.5.3 - 06/29/2000 - G.Juyn * */
|
||||
/* * - changed definition of mng_handle (again) * */
|
||||
/* * - swapped refresh parameters * */
|
||||
/* * - added inclusion of stdlib.h for abs() * */
|
||||
/* * * */
|
||||
/* * 0.9.0 - 06/30/2000 - G.Juyn * */
|
||||
/* * - changed refresh parameters to 'x,y,width,height' * */
|
||||
/* * 0.9.1 - 07/10/2000 - G.Juyn * */
|
||||
/* * - added suspendbuffer constants * */
|
||||
/* * 0.9.1 - 07/15/2000 - G.Juyn * */
|
||||
/* * - added callbacks for SAVE/SEEK processing * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 08/07/2000 - G.Juyn * */
|
||||
/* * - B111300 - fixup for improved portability * */
|
||||
/* * 0.9.3 - 08/12/2000 - G.Juyn * */
|
||||
/* * - added workaround for faulty PhotoShop iCCP chunk * */
|
||||
/* * 0.9.3 - 09/11/2000 - G.Juyn * */
|
||||
/* * - added export of zlib functions from windows dll * */
|
||||
/* * - fixed inclusion parameters once again to make those * */
|
||||
/* * external libs work together * */
|
||||
/* * - re-fixed fixed inclusion parameters * */
|
||||
/* * (these freeking libraries make me mad) * */
|
||||
/* * 0.9.3 - 10/11/2000 - G.Juyn * */
|
||||
/* * - added support for nEED * */
|
||||
/* * 0.9.3 - 10/17/2000 - G.Juyn * */
|
||||
/* * - added callback to process non-critical unknown chunks * */
|
||||
/* * * */
|
||||
/* * 0.9.4 - 11/20/2000 - R.Giles * */
|
||||
/* * - fixed inclusion of lcms header for non-windows platforms * */
|
||||
/* * 0.9.4 - 12/12/2000 - G.Juyn * */
|
||||
/* * - changed callback convention for MSVC (Thanks Chad) * */
|
||||
/* * 0.9.4 - 12/16/2000 - G.Juyn * */
|
||||
/* * - fixed mixup of data- & function-pointers (thanks Dimitri)* */
|
||||
/* * * */
|
||||
/* * 1.0.1 - 02/08/2001 - G.Juyn * */
|
||||
/* * - added MEND processing callback * */
|
||||
/* * * */
|
||||
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
|
||||
/* * - added processterm callback * */
|
||||
/* * * */
|
||||
/* * 1.0.3 - 08/06/2001 - G.Juyn * */
|
||||
/* * - changed inclusion of lcms.h for Linux platforms * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 04/11/2003 - G.Juyn * */
|
||||
/* * - B719420 - fixed several MNG_APP_CMS problems * */
|
||||
/* * 1.0.6 - 06/15/2003 - R.Giles * */
|
||||
/* * - lcms.h inclusion is generally no longer prefixed * */
|
||||
/* * 1.0.6 - 07/07/2003 - G. R-P. * */
|
||||
/* * - added png_imgtypes enumeration * */
|
||||
/* * * */
|
||||
/* * 1.0.7 - 03/10/2004 - G.R-P * */
|
||||
/* * - added conditionals around openstream/closestream * */
|
||||
/* * * */
|
||||
/* * 1.0.8 - 04/11/2004 - G.Juyn * */
|
||||
/* * - added data-push mechanisms for specialized decoders * */
|
||||
/* * 1.0.8 - 08/01/2004 - G.Juyn * */
|
||||
/* * - added support for 3+byte pixelsize for JPEG's * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 12/05/2004 - G.Juyn * */
|
||||
/* * - inclusion of zlib/lcms/ijgsrc6b with <> instead of "" * */
|
||||
/* * 1.0.9 - 12/06/2004 - G.Juyn * */
|
||||
/* * - added conditional MNG_OPTIMIZE_CHUNKREADER * */
|
||||
/* * * */
|
||||
/* * 1.0.10 - 04/08/2007 - G.Juyn * */
|
||||
/* * - added support for mPNG proposal * */
|
||||
/* * 1.0.10 - 04/12/2007 - G.Juyn * */
|
||||
/* * - added support for ANG proposal * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef _libmng_types_h_
|
||||
#define _libmng_types_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma option -AT /* turn off strict ANSI-C for the moment */
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
#if defined(_WIN32) || defined(__WIN32__) || defined(_Windows) || defined(_WINDOWS)
|
||||
#define WIN32 /* gather them into a single define */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Here's where the external & standard libs are embedded * */
|
||||
/* * * */
|
||||
/* * (it can be a bit of a pain in the lower-back to get them to work * */
|
||||
/* * together) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef WIN32 /* only include needed stuff */
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MNG_USE_DLL
|
||||
#ifdef MNG_SKIP_ZLIB
|
||||
#undef MNG_INCLUDE_ZLIB
|
||||
#endif
|
||||
#ifdef MNG_SKIP_LCMS
|
||||
#undef MNG_INCLUDE_LCMS
|
||||
#endif
|
||||
#ifdef MNG_SKIP_IJG6B
|
||||
#undef MNG_INCLUDE_IJG6B
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_ZLIB /* zlib by Mark Adler & Jean-loup Gailly */
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS /* little cms by Marti Maria Saguer */
|
||||
#ifndef ZLIB_DLL
|
||||
#undef FAR
|
||||
#endif
|
||||
#include <lcms.h>
|
||||
#endif /* MNG_INCLUDE_LCMS */
|
||||
|
||||
#ifdef MNG_INCLUDE_IJG6B /* IJG's jpgsrc6b */
|
||||
#include <stdio.h>
|
||||
#ifdef MNG_USE_SETJMP
|
||||
#include <setjmp.h> /* needed for error-recovery (blergh) */
|
||||
#else
|
||||
#ifdef WIN32
|
||||
#define USE_WINDOWS_MESSAGEBOX /* display a messagebox under Windoze */
|
||||
#endif
|
||||
#endif /* MNG_USE_SETJMP */
|
||||
#ifdef FAR
|
||||
#undef FAR /* possibly defined by zlib or lcms */
|
||||
#endif
|
||||
#define JPEG_INTERNAL_OPTIONS /* for RGB_PIXELSIZE */
|
||||
#include <jpeglib.h> /* all that for JPEG support :-) */
|
||||
#endif /* MNG_INCLUDE_IJG6B */
|
||||
|
||||
#if defined(MNG_INTERNAL_MEMMNGMT) || defined(MNG_INCLUDE_FILTERS)
|
||||
#include <stdlib.h> /* "calloc" & "free" & "abs" */
|
||||
#endif
|
||||
|
||||
#include <limits.h> /* get proper integer widths */
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined __BORLANDC__
|
||||
#include <mem.h> /* defines "memcpy" for BCB */
|
||||
#else
|
||||
#include <memory.h> /* defines "memcpy" for other win32 platforms */
|
||||
#endif
|
||||
#include <string.h> /* "strncmp" + "strcmp" */
|
||||
#else /* WIN32 */
|
||||
#ifdef BSD
|
||||
#include <strings.h> /* defines "memcpy", etc for BSD (?) */
|
||||
#else
|
||||
#include <string.h> /* defines "memcpy", etc for all others (???) */
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
|
||||
#if defined(MNG_FULL_CMS) || defined(MNG_GAMMA_ONLY) || defined(MNG_APP_CMS)
|
||||
#include <math.h> /* fp gamma-calculation */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Platform-dependant stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* TODO: this may require some elaboration for other platforms;
|
||||
only works with BCB for now */
|
||||
|
||||
#ifndef MNG_DLL
|
||||
#if defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_DLL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MNG_LOCAL static
|
||||
|
||||
#if defined(MNG_DLL) && defined(WIN32) /* setup DLL calling conventions */
|
||||
#define MNG_DECL __stdcall
|
||||
#if defined(MNG_BUILD_DLL)
|
||||
#define MNG_EXT __declspec(dllexport)
|
||||
#elif defined(MNG_USE_DLL)
|
||||
#define MNG_EXT __declspec(dllimport)
|
||||
#else
|
||||
#define MNG_EXT
|
||||
#endif
|
||||
#ifdef MNG_STRICT_ANSI
|
||||
#undef MNG_STRICT_ANSI /* can't do strict-ANSI with this DLL-stuff */
|
||||
#endif
|
||||
#else
|
||||
#define MNG_DECL /* dummies for non-DLL */
|
||||
#define MNG_EXT
|
||||
#endif /* MNG_DLL && WIN32 */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* now force ANSI-C from here on */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if USHRT_MAX == 0xffffffffU /* get the proper 32-bit width !!! */
|
||||
typedef unsigned short mng_uint32;
|
||||
typedef signed short mng_int32;
|
||||
#elif UINT_MAX == 0xffffffffU
|
||||
typedef unsigned int mng_uint32;
|
||||
typedef signed int mng_int32;
|
||||
#elif ULONG_MAX == 0xffffffffU
|
||||
typedef unsigned long mng_uint32;
|
||||
typedef signed long mng_int32;
|
||||
#else
|
||||
#error "Sorry, I can't find any 32-bit integers on this platform."
|
||||
#endif
|
||||
|
||||
typedef signed short mng_int16; /* other basic integers */
|
||||
typedef unsigned short mng_uint16;
|
||||
typedef signed char mng_int8;
|
||||
typedef unsigned char mng_uint8;
|
||||
|
||||
typedef double mng_float; /* basic float */
|
||||
|
||||
typedef size_t mng_size_t; /* size field for memory allocation */
|
||||
|
||||
typedef char * mng_pchar; /* string */
|
||||
typedef void * mng_ptr; /* generic pointer */
|
||||
typedef void (*mng_fptr) (void); /* generic function pointer */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Platform-independant from here * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef mng_uint32 * mng_uint32p; /* pointer to unsigned longs */
|
||||
typedef mng_int32 * mng_int32p; /* pointer to longs */
|
||||
typedef mng_uint16 * mng_uint16p; /* pointer to unsigned words */
|
||||
typedef mng_uint8 * mng_uint8p; /* pointer to unsigned bytes */
|
||||
|
||||
typedef mng_int8 mng_bool; /* booleans */
|
||||
|
||||
struct mng_data_struct;
|
||||
typedef struct mng_data_struct * mng_handle; /* generic handle */
|
||||
|
||||
typedef mng_int32 mng_retcode; /* generic return code */
|
||||
typedef mng_int32 mng_chunkid; /* 4-byte chunkname identifier */
|
||||
typedef mng_ptr mng_chunkp; /* pointer to a chunk-structure */
|
||||
typedef mng_ptr mng_objectp; /* pointer to an object-structure */
|
||||
|
||||
typedef mng_chunkid * mng_chunkidp; /* pointer to chunkid */
|
||||
|
||||
typedef struct { /* 8-bit palette element */
|
||||
mng_uint8 iRed;
|
||||
mng_uint8 iGreen;
|
||||
mng_uint8 iBlue;
|
||||
} mng_palette8e;
|
||||
typedef mng_palette8e mng_palette8[256]; /* 8-bit palette */
|
||||
typedef mng_palette8e * mng_palette8ep;
|
||||
|
||||
typedef mng_uint8 mng_uint8arr[256]; /* generic arrays */
|
||||
typedef mng_uint8 mng_uint8arr4[4];
|
||||
typedef mng_uint16 mng_uint16arr[256];
|
||||
typedef mng_uint32 mng_uint32arr2[2];
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FALSE 0
|
||||
#define MNG_TRUE 1
|
||||
#define MNG_NULL 0
|
||||
|
||||
#define MNG_SUSPENDBUFFERSIZE 32768
|
||||
#define MNG_SUSPENDREQUESTSIZE 1024
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_ZLIB
|
||||
|
||||
/* size of temporary zlib buffer for deflate processing */
|
||||
#define MNG_ZLIB_MAXBUF 8192
|
||||
|
||||
/* default zlib compression parameters for deflateinit2 */
|
||||
#define MNG_ZLIB_LEVEL 9 /* level */
|
||||
#define MNG_ZLIB_METHOD Z_DEFLATED /* method */
|
||||
#define MNG_ZLIB_WINDOWBITS 15 /* window size */
|
||||
#define MNG_ZLIB_MEMLEVEL 9 /* memory level */
|
||||
#define MNG_ZLIB_STRATEGY Z_DEFAULT_STRATEGY /* strategy */
|
||||
|
||||
#define MNG_MAX_IDAT_SIZE 4096 /* maximum size of IDAT data */
|
||||
|
||||
#endif /* MNG_INCLUDE_ZLIB */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
|
||||
#ifdef MNG_INCLUDE_IJG6B /* IJG helper defs */
|
||||
typedef struct jpeg_compress_struct mngjpeg_comp;
|
||||
typedef struct jpeg_decompress_struct mngjpeg_decomp;
|
||||
typedef struct jpeg_error_mgr mngjpeg_error;
|
||||
typedef struct jpeg_source_mgr mngjpeg_source;
|
||||
|
||||
typedef mngjpeg_comp * mngjpeg_compp;
|
||||
typedef mngjpeg_decomp * mngjpeg_decompp;
|
||||
typedef mngjpeg_error * mngjpeg_errorp;
|
||||
typedef mngjpeg_source * mngjpeg_sourcep;
|
||||
|
||||
typedef J_DCT_METHOD mngjpeg_dctmethod;
|
||||
|
||||
/* default IJG parameters for compression */
|
||||
#define MNG_JPEG_DCT JDCT_DEFAULT /* DCT algorithm (JDCT_ISLOW) */
|
||||
#define MNG_JPEG_QUALITY 100 /* quality 0..100; 100=best */
|
||||
#define MNG_JPEG_SMOOTHING 0 /* default no smoothing */
|
||||
#define MNG_JPEG_PROGRESSIVE MNG_FALSE /* default is just baseline */
|
||||
#define MNG_JPEG_OPTIMIZED MNG_FALSE /* default is not optimized */
|
||||
#endif /* MNG_INCLUDE_IJG6B */
|
||||
|
||||
#define MNG_JPEG_MAXBUF 65500 /* max size of temp JPEG buffer */
|
||||
#define MNG_MAX_JDAT_SIZE 4096 /* maximum size of JDAT data */
|
||||
|
||||
#endif /* MNG_INCLUDE_JNG */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS
|
||||
typedef cmsHPROFILE mng_cmsprof; /* little CMS helper defs */
|
||||
typedef cmsHTRANSFORM mng_cmstrans;
|
||||
typedef cmsCIExyY mng_CIExyY;
|
||||
typedef cmsCIExyYTRIPLE mng_CIExyYTRIPLE;
|
||||
typedef LPGAMMATABLE mng_gammatabp;
|
||||
#endif /* MNG_INCLUDE_LCMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enumeration of known graphics types */
|
||||
enum mng_imgtypes {mng_it_unknown, mng_it_png, mng_it_mng, mng_it_jng
|
||||
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
|
||||
,mng_it_mpng
|
||||
#endif
|
||||
#ifdef MNG_INCLUDE_ANG_PROPOSAL
|
||||
,mng_it_ang
|
||||
#endif
|
||||
};
|
||||
typedef enum mng_imgtypes mng_imgtype;
|
||||
|
||||
/* enumeration of animation speed-types */
|
||||
enum mng_speedtypes {mng_st_normal, mng_st_fast, mng_st_slow, mng_st_slowest};
|
||||
typedef enum mng_speedtypes mng_speedtype;
|
||||
|
||||
#ifdef MNG_OPTIMIZE_CHUNKREADER
|
||||
/* enumeration object-creation indicators */
|
||||
enum mng_createobjtypes {mng_create_none, mng_create_always, mng_create_ifglobal};
|
||||
typedef enum mng_createobjtypes mng_createobjtype;
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* enumeration of PNG image types */
|
||||
#ifdef MNG_OPTIMIZE_FOOTPRINT_INIT
|
||||
enum png_imgtypes
|
||||
{
|
||||
png_g1,
|
||||
png_g2,
|
||||
png_g4,
|
||||
png_g8,
|
||||
png_rgb8,
|
||||
png_idx1,
|
||||
png_idx2,
|
||||
png_idx4,
|
||||
png_idx8,
|
||||
png_ga8,
|
||||
png_rgba8,
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
png_jpeg_a1,
|
||||
png_jpeg_a2,
|
||||
png_jpeg_a4,
|
||||
png_jpeg_a8,
|
||||
#endif
|
||||
#ifndef MNG_NO_16BIT_SUPPORT
|
||||
png_g16,
|
||||
png_ga16,
|
||||
png_rgb16,
|
||||
png_rgba16,
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
png_jpeg_a16,
|
||||
#endif
|
||||
#endif
|
||||
png_none
|
||||
};
|
||||
|
||||
typedef enum png_imgtypes png_imgtype;
|
||||
#endif
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* memory management callbacks */
|
||||
typedef mng_ptr (MNG_DECL *mng_memalloc) (mng_size_t iLen);
|
||||
typedef void (MNG_DECL *mng_memfree) (mng_ptr iPtr,
|
||||
mng_size_t iLen);
|
||||
|
||||
typedef void (MNG_DECL *mng_releasedata) (mng_ptr pUserdata,
|
||||
mng_ptr pData,
|
||||
mng_size_t iLength);
|
||||
|
||||
/* I/O management callbacks */
|
||||
#ifndef MNG_NO_OPEN_CLOSE_STREAM
|
||||
typedef mng_bool (MNG_DECL *mng_openstream) (mng_handle hHandle);
|
||||
typedef mng_bool (MNG_DECL *mng_closestream) (mng_handle hHandle);
|
||||
#endif
|
||||
typedef mng_bool (MNG_DECL *mng_readdata) (mng_handle hHandle,
|
||||
mng_ptr pBuf,
|
||||
mng_uint32 iBuflen,
|
||||
mng_uint32p pRead);
|
||||
typedef mng_bool (MNG_DECL *mng_writedata) (mng_handle hHandle,
|
||||
mng_ptr pBuf,
|
||||
mng_uint32 iBuflen,
|
||||
mng_uint32p pWritten);
|
||||
|
||||
/* error & trace processing callbacks */
|
||||
typedef mng_bool (MNG_DECL *mng_errorproc) (mng_handle hHandle,
|
||||
mng_int32 iErrorcode,
|
||||
mng_int8 iSeverity,
|
||||
mng_chunkid iChunkname,
|
||||
mng_uint32 iChunkseq,
|
||||
mng_int32 iExtra1,
|
||||
mng_int32 iExtra2,
|
||||
mng_pchar zErrortext);
|
||||
typedef mng_bool (MNG_DECL *mng_traceproc) (mng_handle hHandle,
|
||||
mng_int32 iFuncnr,
|
||||
mng_int32 iFuncseq,
|
||||
mng_pchar zFuncname);
|
||||
|
||||
/* read processing callbacks */
|
||||
typedef mng_bool (MNG_DECL *mng_processheader) (mng_handle hHandle,
|
||||
mng_uint32 iWidth,
|
||||
mng_uint32 iHeight);
|
||||
typedef mng_bool (MNG_DECL *mng_processtext) (mng_handle hHandle,
|
||||
mng_uint8 iType,
|
||||
mng_pchar zKeyword,
|
||||
mng_pchar zText,
|
||||
mng_pchar zLanguage,
|
||||
mng_pchar zTranslation);
|
||||
typedef mng_bool (MNG_DECL *mng_processsave) (mng_handle hHandle);
|
||||
typedef mng_bool (MNG_DECL *mng_processseek) (mng_handle hHandle,
|
||||
mng_pchar zName);
|
||||
typedef mng_bool (MNG_DECL *mng_processneed) (mng_handle hHandle,
|
||||
mng_pchar zKeyword);
|
||||
typedef mng_bool (MNG_DECL *mng_processmend) (mng_handle hHandle,
|
||||
mng_uint32 iIterationsdone,
|
||||
mng_uint32 iIterationsleft);
|
||||
typedef mng_bool (MNG_DECL *mng_processunknown) (mng_handle hHandle,
|
||||
mng_chunkid iChunkid,
|
||||
mng_uint32 iRawlen,
|
||||
mng_ptr pRawdata);
|
||||
typedef mng_bool (MNG_DECL *mng_processterm) (mng_handle hHandle,
|
||||
mng_uint8 iTermaction,
|
||||
mng_uint8 iIteraction,
|
||||
mng_uint32 iDelay,
|
||||
mng_uint32 iItermax);
|
||||
|
||||
/* display processing callbacks */
|
||||
typedef mng_ptr (MNG_DECL *mng_getcanvasline) (mng_handle hHandle,
|
||||
mng_uint32 iLinenr);
|
||||
typedef mng_ptr (MNG_DECL *mng_getbkgdline) (mng_handle hHandle,
|
||||
mng_uint32 iLinenr);
|
||||
typedef mng_ptr (MNG_DECL *mng_getalphaline) (mng_handle hHandle,
|
||||
mng_uint32 iLinenr);
|
||||
typedef mng_bool (MNG_DECL *mng_refresh) (mng_handle hHandle,
|
||||
mng_uint32 iX,
|
||||
mng_uint32 iY,
|
||||
mng_uint32 iWidth,
|
||||
mng_uint32 iHeight);
|
||||
|
||||
/* timer management callbacks */
|
||||
typedef mng_uint32 (MNG_DECL *mng_gettickcount) (mng_handle hHandle);
|
||||
typedef mng_bool (MNG_DECL *mng_settimer) (mng_handle hHandle,
|
||||
mng_uint32 iMsecs);
|
||||
|
||||
/* color management callbacks */
|
||||
typedef mng_bool (MNG_DECL *mng_processgamma) (mng_handle hHandle,
|
||||
mng_uint32 iGamma);
|
||||
typedef mng_bool (MNG_DECL *mng_processchroma) (mng_handle hHandle,
|
||||
mng_uint32 iWhitepointx,
|
||||
mng_uint32 iWhitepointy,
|
||||
mng_uint32 iRedx,
|
||||
mng_uint32 iRedy,
|
||||
mng_uint32 iGreenx,
|
||||
mng_uint32 iGreeny,
|
||||
mng_uint32 iBluex,
|
||||
mng_uint32 iBluey);
|
||||
typedef mng_bool (MNG_DECL *mng_processsrgb) (mng_handle hHandle,
|
||||
mng_uint8 iRenderingintent);
|
||||
typedef mng_bool (MNG_DECL *mng_processiccp) (mng_handle hHandle,
|
||||
mng_uint32 iProfilesize,
|
||||
mng_ptr pProfile);
|
||||
typedef mng_bool (MNG_DECL *mng_processarow) (mng_handle hHandle,
|
||||
mng_uint32 iRowsamples,
|
||||
mng_bool bIsRGBA16,
|
||||
mng_ptr pRow);
|
||||
|
||||
/* chunk access callback(s) */
|
||||
typedef mng_bool (MNG_DECL *mng_iteratechunk) (mng_handle hHandle,
|
||||
mng_handle hChunk,
|
||||
mng_chunkid iChunkid,
|
||||
mng_uint32 iChunkseq);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_types_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
198
src/3rdparty/libmng/libmng_write.c
vendored
198
src/3rdparty/libmng/libmng_write.c
vendored
@ -1,198 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_write.c copyright (c) 2000-2004 G.Juyn * */
|
||||
/* * version : 1.0.9 * */
|
||||
/* * * */
|
||||
/* * purpose : Write management (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the write management routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/12/2000 - G.Juyn * */
|
||||
/* * - changed trace to macro for callback error-reporting * */
|
||||
/* * 0.5.1 - 05/16/2000 - G.Juyn * */
|
||||
/* * - moved the actual write_graphic functionality from * */
|
||||
/* * mng_hlapi to its appropriate function here * */
|
||||
/* * * */
|
||||
/* * 0.9.1 - 07/19/2000 - G.Juyn * */
|
||||
/* * - fixed writing of signature * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * * */
|
||||
/* * 1.0.8 - 07/06/2004 - G.R-P * */
|
||||
/* * - added conditionals around openstream/closestream * */
|
||||
/* * - defend against using undefined Open/Closestream function * */
|
||||
/* * 1.0.8 - 08/02/2004 - G.Juyn * */
|
||||
/* * - added conditional to allow easier writing of large MNG's * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 09/25/2004 - G.Juyn * */
|
||||
/* * - replaced MNG_TWEAK_LARGE_FILES with permanent solution * */
|
||||
/* * 1.0.9 - 12/20/2004 - G.Juyn * */
|
||||
/* * - cleaned up macro-invocations (thanks to D. Airlie) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "libmng_data.h"
|
||||
#include "libmng_error.h"
|
||||
#include "libmng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "libmng_memory.h"
|
||||
#include "libmng_chunks.h"
|
||||
#include "libmng_chunk_io.h"
|
||||
#include "libmng_write.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)
|
||||
mng_retcode mng_drop_chunks (mng_datap pData)
|
||||
{
|
||||
mng_chunkp pChunk;
|
||||
mng_chunkp pNext;
|
||||
mng_cleanupchunk fCleanup;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DROP_CHUNKS, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pChunk = pData->pFirstchunk; /* and get first stored chunk (if any) */
|
||||
|
||||
while (pChunk) /* more chunks to discard ? */
|
||||
{
|
||||
pNext = ((mng_chunk_headerp)pChunk)->pNext;
|
||||
/* call appropriate cleanup */
|
||||
fCleanup = ((mng_chunk_headerp)pChunk)->fCleanup;
|
||||
fCleanup (pData, pChunk);
|
||||
|
||||
pChunk = pNext; /* neeeext */
|
||||
}
|
||||
|
||||
pData->pFirstchunk = MNG_NULL;
|
||||
pData->pLastchunk = MNG_NULL;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_DROP_CHUNKS, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ || MNG_SUPPORT_WRITE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_WRITE_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_write_graphic (mng_datap pData)
|
||||
{
|
||||
mng_chunkp pChunk;
|
||||
mng_retcode iRetcode;
|
||||
mng_uint32 iWritten;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_WRITE_GRAPHIC, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pChunk = pData->pFirstchunk; /* we'll start with the first, thank you */
|
||||
|
||||
if (pChunk) /* is there anything to write ? */
|
||||
{ /* open the file */
|
||||
if (!pData->bWriting)
|
||||
{
|
||||
#ifndef MNG_NO_OPEN_CLOSE_STREAM
|
||||
if (pData->fOpenstream && !pData->fOpenstream ((mng_handle)pData))
|
||||
MNG_ERROR (pData, MNG_APPIOERROR);
|
||||
#endif
|
||||
{
|
||||
pData->bWriting = MNG_TRUE; /* indicate writing */
|
||||
pData->iWritebufsize = 32768; /* get a temporary write buffer */
|
||||
/* reserve 12 bytes for length, chunkname & crc */
|
||||
MNG_ALLOC (pData, pData->pWritebuf, pData->iWritebufsize+12);
|
||||
|
||||
/* write the signature */
|
||||
if (((mng_chunk_headerp)pChunk)->iChunkname == MNG_UINT_IHDR)
|
||||
mng_put_uint32 (pData->pWritebuf, PNG_SIG);
|
||||
else
|
||||
if (((mng_chunk_headerp)pChunk)->iChunkname == MNG_UINT_JHDR)
|
||||
mng_put_uint32 (pData->pWritebuf, JNG_SIG);
|
||||
else
|
||||
mng_put_uint32 (pData->pWritebuf, MNG_SIG);
|
||||
|
||||
mng_put_uint32 (pData->pWritebuf+4, POST_SIG);
|
||||
|
||||
if (!pData->fWritedata ((mng_handle)pData, pData->pWritebuf, 8, &iWritten))
|
||||
{
|
||||
MNG_FREE (pData, pData->pWritebuf, pData->iWritebufsize+12);
|
||||
MNG_ERROR (pData, MNG_APPIOERROR);
|
||||
}
|
||||
|
||||
if (iWritten != 8) /* disk full ? */
|
||||
{
|
||||
MNG_FREE (pData, pData->pWritebuf, pData->iWritebufsize+12);
|
||||
MNG_ERROR (pData, MNG_OUTPUTERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (pChunk) /* so long as there's something to write */
|
||||
{ /* let's call its output routine */
|
||||
iRetcode = ((mng_chunk_headerp)pChunk)->fWrite (pData, pChunk);
|
||||
if (iRetcode) /* on error bail out */
|
||||
return iRetcode;
|
||||
/* neeeext */
|
||||
pChunk = ((mng_chunk_headerp)pChunk)->pNext;
|
||||
}
|
||||
|
||||
if (!pData->bCreating)
|
||||
{ /* free the temporary buffer */
|
||||
MNG_FREE (pData, pData->pWritebuf, pData->iWritebufsize+12);
|
||||
|
||||
pData->bWriting = MNG_FALSE; /* done writing */
|
||||
/* close the stream now */
|
||||
#ifndef MNG_NO_OPEN_CLOSE_STREAM
|
||||
if (pData->fClosestream && !pData->fClosestream ((mng_handle)pData))
|
||||
MNG_ERROR (pData, MNG_APPIOERROR);
|
||||
#endif
|
||||
|
||||
} else {
|
||||
/* cleanup the written chunks */
|
||||
iRetcode = mng_drop_chunks (pData);
|
||||
if (iRetcode) /* on error bail out */
|
||||
return iRetcode;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_WRITE_GRAPHIC, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_WRITE_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
49
src/3rdparty/libmng/libmng_write.h
vendored
49
src/3rdparty/libmng/libmng_write.h
vendored
@ -1,49 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_write.h copyright (c) 2000-2004 G.Juyn * */
|
||||
/* * version : 1.0.9 * */
|
||||
/* * * */
|
||||
/* * purpose : Write management (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the write management routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 09/25/2004 - G.Juyn * */
|
||||
/* * - replaced MNG_TWEAK_LARGE_FILES with permanent solution * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_write_h_
|
||||
#define _libmng_write_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_drop_chunks (mng_datap pData);
|
||||
|
||||
mng_retcode mng_write_graphic (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_write_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
607
src/3rdparty/libmng/libmng_zlib.c
vendored
607
src/3rdparty/libmng/libmng_zlib.c
vendored
@ -1,607 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_zlib.c copyright (c) 2000-2004 G.Juyn * */
|
||||
/* * version : 1.0.9 * */
|
||||
/* * * */
|
||||
/* * purpose : ZLIB library interface (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the ZLIB library interface * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/11/2000 - G.Juyn * */
|
||||
/* * - filled the deflatedata routine * */
|
||||
/* * 0.5.1 - 05/12/2000 - G.Juyn * */
|
||||
/* * - changed trace to macro for callback error-reporting * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/20/2000 - G.Juyn * */
|
||||
/* * - fixed for JNG alpha handling * */
|
||||
/* * 0.5.2 - 05/24/2000 - G.Juyn * */
|
||||
/* * - moved init of default zlib parms from here to * */
|
||||
/* * "mng_hlapi.c" * */
|
||||
/* * * */
|
||||
/* * 0.5.3 - 06/16/2000 - G.Juyn * */
|
||||
/* * - changed progressive-display processing * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* * 0.9.3 - 08/08/2000 - G.Juyn * */
|
||||
/* * - fixed compiler-warnings from Mozilla * */
|
||||
/* * 0.9.3 - 09/07/2000 - G.Juyn * */
|
||||
/* * - added support for new filter_types * */
|
||||
/* * * */
|
||||
/* * 1.0.5 - 08/07/2002 - G.Juyn * */
|
||||
/* * - added test-option for PNG filter method 193 (=no filter) * */
|
||||
/* * 1.0.5 - 08/19/2002 - G.Juyn * */
|
||||
/* * - B597134 - libmng pollutes the linker namespace * */
|
||||
/* * 1.0.5 - 09/19/2002 - G.Juyn * */
|
||||
/* * - added warning for too much IDAT data * */
|
||||
/* * * */
|
||||
/* * 1.0.6 - 07/07/2003 - G.R-P * */
|
||||
/* * - added MNG_NO_16BIT_SUPPORT support * */
|
||||
/* * * */
|
||||
/* * 1.0.9 - 10/09/2004 - G.R-P * */
|
||||
/* * - added MNG_NO_1_2_4BIT_SUPPORT support * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "libmng_data.h"
|
||||
#include "libmng_error.h"
|
||||
#include "libmng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "libmng_memory.h"
|
||||
#include "libmng_pixels.h"
|
||||
#include "libmng_filter.h"
|
||||
#include "libmng_zlib.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_ZLIB
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
voidpf mngzlib_alloc (voidpf pData,
|
||||
uInt iCount,
|
||||
uInt iSize)
|
||||
{
|
||||
voidpf pPtr; /* temporary space */
|
||||
|
||||
#ifdef MNG_INTERNAL_MEMMNGMT
|
||||
pPtr = calloc (iCount, iSize); /* local allocation */
|
||||
#else
|
||||
if (((mng_datap)pData)->fMemalloc) /* callback function set ? */
|
||||
pPtr = ((mng_datap)pData)->fMemalloc (iCount * iSize);
|
||||
else
|
||||
pPtr = Z_NULL; /* can't allocate! */
|
||||
#endif
|
||||
|
||||
return pPtr; /* return the result */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mngzlib_free (voidpf pData,
|
||||
voidpf pAddress)
|
||||
{
|
||||
#ifdef MNG_INTERNAL_MEMMNGMT
|
||||
free (pAddress); /* free locally */
|
||||
#else
|
||||
if (((mng_datap)pData)->fMemfree) /* callback set? */
|
||||
((mng_datap)pData)->fMemfree (pAddress, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_initialize (mng_datap pData)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INITIALIZE, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INTERNAL_MEMMNGMT
|
||||
pData->sZlib.zalloc = Z_NULL; /* let zlib figure out memory management */
|
||||
pData->sZlib.zfree = Z_NULL;
|
||||
pData->sZlib.opaque = Z_NULL;
|
||||
#else /* use user-provided callbacks */
|
||||
pData->sZlib.zalloc = mngzlib_alloc;
|
||||
pData->sZlib.zfree = mngzlib_free;
|
||||
pData->sZlib.opaque = (voidpf)pData;
|
||||
#endif
|
||||
|
||||
pData->bInflating = MNG_FALSE; /* not performing any action yet */
|
||||
pData->bDeflating = MNG_FALSE;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INITIALIZE, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR; /* done */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_cleanup (mng_datap pData)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_CLEANUP, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
if (pData->bInflating) /* force zlib cleanup */
|
||||
mngzlib_inflatefree (pData);
|
||||
if (pData->bDeflating)
|
||||
mngzlib_deflatefree (pData);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_CLEANUP, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR; /* done */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_inflateinit (mng_datap pData)
|
||||
{
|
||||
int iZrslt;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEINIT, MNG_LC_START);
|
||||
#endif
|
||||
/* initialize zlib structures and such */
|
||||
iZrslt = inflateInit (&pData->sZlib);
|
||||
|
||||
if (iZrslt != Z_OK) /* on error bail out */
|
||||
MNG_ERRORZ (pData, (mng_uint32)iZrslt);
|
||||
|
||||
pData->bInflating = MNG_TRUE; /* really inflating something now */
|
||||
pData->sZlib.next_out = 0; /* force JIT initialization */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEINIT, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR; /* done */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_retcode mngzlib_inflaterows (mng_datap pData,
|
||||
mng_uint32 iInlen,
|
||||
mng_uint8p pIndata)
|
||||
{
|
||||
int iZrslt;
|
||||
mng_retcode iRslt;
|
||||
mng_ptr pSwap;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEROWS, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pData->sZlib.next_in = pIndata; /* let zlib know where to get stuff */
|
||||
pData->sZlib.avail_in = (uInt)iInlen;
|
||||
|
||||
if (pData->sZlib.next_out == 0) /* initialize output variables ? */
|
||||
{ /* let zlib know where to store stuff */
|
||||
pData->sZlib.next_out = pData->pWorkrow;
|
||||
pData->sZlib.avail_out = (uInt)(pData->iRowsize + pData->iPixelofs);
|
||||
#ifdef MNG_NO_1_2_4BIT_SUPPORT
|
||||
if (pData->iPNGdepth < 8)
|
||||
pData->sZlib.avail_out = (uInt)((pData->iPNGdepth*pData->iRowsize + 7)/8
|
||||
+ pData->iPixelofs);
|
||||
#endif
|
||||
#ifdef MNG_NO_16BIT_SUPPORT
|
||||
if (pData->iPNGdepth > 8)
|
||||
pData->sZlib.avail_out = (uInt)(2*pData->iRowsize + pData->iPixelofs);
|
||||
#endif
|
||||
}
|
||||
|
||||
do
|
||||
{ /* now inflate a row */
|
||||
iZrslt = inflate (&pData->sZlib, Z_SYNC_FLUSH);
|
||||
/* produced a full row ? */
|
||||
if (((iZrslt == Z_OK) || (iZrslt == Z_STREAM_END)) &&
|
||||
(pData->sZlib.avail_out == 0))
|
||||
{ /* image not completed yet ? */
|
||||
if (pData->iRow < (mng_int32)pData->iDataheight)
|
||||
{
|
||||
#ifdef MNG_NO_1_2_4BIT_SUPPORT
|
||||
if (pData->iPNGdepth == 1)
|
||||
{
|
||||
/* Inflate Workrow to 8-bit */
|
||||
mng_int32 iX;
|
||||
mng_uint8p pSrc = pData->pWorkrow+1;
|
||||
mng_uint8p pDest = pSrc + pData->iRowsize - (pData->iRowsize+7)/8;
|
||||
|
||||
for (iX = ((pData->iRowsize+7)/8) ; iX > 0 ; iX--)
|
||||
*pDest++ = *pSrc++;
|
||||
|
||||
pDest = pData->pWorkrow+1;
|
||||
pSrc = pDest + pData->iRowsize - (pData->iRowsize+7)/8;
|
||||
for (iX = pData->iRowsize; ;)
|
||||
{
|
||||
*pDest++ = (((*pSrc)>>7)&1);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc)>>6)&1);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc)>>5)&1);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc)>>4)&1);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc)>>3)&1);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc)>>2)&1);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc)>>1)&1);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc) )&1);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
pSrc++;
|
||||
}
|
||||
}
|
||||
else if (pData->iPNGdepth == 2)
|
||||
{
|
||||
/* Inflate Workrow to 8-bit */
|
||||
mng_int32 iX;
|
||||
mng_uint8p pSrc = pData->pWorkrow+1;
|
||||
mng_uint8p pDest = pSrc + pData->iRowsize - (2*pData->iRowsize+7)/8;
|
||||
|
||||
for (iX = ((2*pData->iRowsize+7)/8) ; iX > 0 ; iX--)
|
||||
*pDest++ = *pSrc++;
|
||||
|
||||
pDest = pData->pWorkrow+1;
|
||||
pSrc = pDest + pData->iRowsize - (2*pData->iRowsize+7)/8;
|
||||
for (iX = pData->iRowsize; ;)
|
||||
{
|
||||
*pDest++ = (((*pSrc)>>6)&3);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc)>>4)&3);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc)>>2)&3);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc) )&3);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
pSrc++;
|
||||
}
|
||||
}
|
||||
else if (pData->iPNGdepth == 4)
|
||||
{
|
||||
/* Inflate Workrow to 8-bit */
|
||||
mng_int32 iX;
|
||||
mng_uint8p pSrc = pData->pWorkrow+1;
|
||||
mng_uint8p pDest = pSrc + pData->iRowsize - (4*pData->iRowsize+7)/8;
|
||||
|
||||
for (iX = ((4*pData->iRowsize+7)/8) ; iX > 0 ; iX--)
|
||||
*pDest++ = *pSrc++;
|
||||
|
||||
pDest = pData->pWorkrow+1;
|
||||
pSrc = pDest + pData->iRowsize - (4*pData->iRowsize+7)/8;
|
||||
for (iX = pData->iRowsize; ;)
|
||||
{
|
||||
*pDest++ = (((*pSrc)>>4)&0x0f);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
*pDest++ = (((*pSrc) )&0x0f);
|
||||
if (iX-- <= 0)
|
||||
break;
|
||||
pSrc++;
|
||||
}
|
||||
}
|
||||
if (pData->iPNGdepth < 8 && pData->iColortype == 0)
|
||||
{
|
||||
/* Expand samples to 8-bit by LBR */
|
||||
mng_int32 iX;
|
||||
mng_uint8p pSrc = pData->pWorkrow+1;
|
||||
mng_uint8 multiplier[]={0,255,85,0,17,0,0,0,1};
|
||||
|
||||
for (iX = pData->iRowsize; iX > 0; iX--)
|
||||
*pSrc++ *= multiplier[pData->iPNGdepth];
|
||||
}
|
||||
#endif
|
||||
#ifdef MNG_NO_16BIT_SUPPORT
|
||||
if (pData->iPNGdepth > 8)
|
||||
{
|
||||
/* Reduce Workrow to 8-bit */
|
||||
mng_int32 iX;
|
||||
mng_uint8p pSrc = pData->pWorkrow+1;
|
||||
mng_uint8p pDest = pSrc;
|
||||
|
||||
for (iX = pData->iRowsize; iX > 0; iX--)
|
||||
{
|
||||
*pDest = *pSrc;
|
||||
pDest++;
|
||||
pSrc+=2;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FILTER192 /* has leveling info ? */
|
||||
if (pData->iFilterofs == MNG_FILTER_DIFFERING)
|
||||
iRslt = init_rowdiffering (pData);
|
||||
else
|
||||
#endif
|
||||
iRslt = MNG_NOERROR;
|
||||
/* filter the row if necessary */
|
||||
if ((!iRslt) && (pData->iFilterofs < pData->iPixelofs ) &&
|
||||
(*(pData->pWorkrow + pData->iFilterofs)) )
|
||||
iRslt = mng_filter_a_row (pData);
|
||||
else
|
||||
iRslt = MNG_NOERROR;
|
||||
/* additional leveling/differing ? */
|
||||
if ((!iRslt) && (pData->fDifferrow))
|
||||
{
|
||||
iRslt = ((mng_differrow)pData->fDifferrow) (pData);
|
||||
|
||||
pSwap = pData->pWorkrow;
|
||||
pData->pWorkrow = pData->pPrevrow;
|
||||
pData->pPrevrow = pSwap; /* make sure we're processing the right data */
|
||||
}
|
||||
|
||||
if (!iRslt)
|
||||
{
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
if (pData->bHasJHDR) /* is JNG alpha-channel ? */
|
||||
{ /* just store in object ? */
|
||||
if ((!iRslt) && (pData->fStorerow))
|
||||
iRslt = ((mng_storerow)pData->fStorerow) (pData);
|
||||
}
|
||||
else
|
||||
#endif /* MNG_INCLUDE_JNG */
|
||||
{ /* process this row */
|
||||
if ((!iRslt) && (pData->fProcessrow))
|
||||
iRslt = ((mng_processrow)pData->fProcessrow) (pData);
|
||||
/* store in object ? */
|
||||
if ((!iRslt) && (pData->fStorerow))
|
||||
iRslt = ((mng_storerow)pData->fStorerow) (pData);
|
||||
/* color correction ? */
|
||||
if ((!iRslt) && (pData->fCorrectrow))
|
||||
iRslt = ((mng_correctrow)pData->fCorrectrow) (pData);
|
||||
/* slap onto canvas ? */
|
||||
if ((!iRslt) && (pData->fDisplayrow))
|
||||
{
|
||||
iRslt = ((mng_displayrow)pData->fDisplayrow) (pData);
|
||||
|
||||
if (!iRslt) /* check progressive display refresh */
|
||||
iRslt = mng_display_progressive_check (pData);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (iRslt) /* on error bail out */
|
||||
MNG_ERROR (pData, iRslt);
|
||||
|
||||
if (!pData->fDifferrow) /* swap row-pointers */
|
||||
{
|
||||
pSwap = pData->pWorkrow;
|
||||
pData->pWorkrow = pData->pPrevrow;
|
||||
pData->pPrevrow = pSwap; /* so prev points to the processed row! */
|
||||
}
|
||||
|
||||
iRslt = mng_next_row (pData); /* adjust variables for next row */
|
||||
|
||||
if (iRslt) /* on error bail out */
|
||||
MNG_ERROR (pData, iRslt);
|
||||
}
|
||||
/* let zlib know where to store next output */
|
||||
pData->sZlib.next_out = pData->pWorkrow;
|
||||
pData->sZlib.avail_out = (uInt)(pData->iRowsize + pData->iPixelofs);
|
||||
#ifdef MNG_NO_1_2_4BIT_SUPPORT
|
||||
if (pData->iPNGdepth < 8)
|
||||
pData->sZlib.avail_out = (uInt)((pData->iPNGdepth*pData->iRowsize + 7)/8
|
||||
+ pData->iPixelofs);
|
||||
#endif
|
||||
#ifdef MNG_NO_16BIT_SUPPORT
|
||||
if (pData->iPNGdepth > 8)
|
||||
pData->sZlib.avail_out = (uInt)(2*pData->iRowsize + pData->iPixelofs);
|
||||
#endif
|
||||
}
|
||||
} /* until some error or EOI
|
||||
or all pixels received */
|
||||
while ( (iZrslt == Z_OK) && (pData->sZlib.avail_in > 0) &&
|
||||
( (pData->iRow < (mng_int32)pData->iDataheight) ||
|
||||
( (pData->iPass >= 0) && (pData->iPass < 7) ) ) );
|
||||
/* on error bail out */
|
||||
if ((iZrslt != Z_OK) && (iZrslt != Z_STREAM_END))
|
||||
MNG_ERRORZ (pData, (mng_uint32)iZrslt);
|
||||
/* too much data ? */
|
||||
if ((iZrslt == Z_OK) && (pData->sZlib.avail_in > 0))
|
||||
MNG_WARNING (pData, MNG_TOOMUCHIDAT);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEROWS, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_inflatedata (mng_datap pData,
|
||||
mng_uint32 iInlen,
|
||||
mng_uint8p pIndata)
|
||||
{
|
||||
int iZrslt;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEDATA, MNG_LC_START);
|
||||
#endif
|
||||
/* let zlib know where to get stuff */
|
||||
pData->sZlib.next_in = pIndata;
|
||||
pData->sZlib.avail_in = (uInt)iInlen;
|
||||
/* now inflate the data in one go! */
|
||||
iZrslt = inflate (&pData->sZlib, Z_FINISH);
|
||||
/* not enough room in output-buffer ? */
|
||||
if ((iZrslt == Z_BUF_ERROR) || (pData->sZlib.avail_in > 0))
|
||||
return MNG_BUFOVERFLOW;
|
||||
/* on error bail out */
|
||||
if ((iZrslt != Z_OK) && (iZrslt != Z_STREAM_END))
|
||||
MNG_ERRORZ (pData, (mng_uint32)iZrslt);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEDATA, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_inflatefree (mng_datap pData)
|
||||
{
|
||||
int iZrslt;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEFREE, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pData->bInflating = MNG_FALSE; /* stopped it */
|
||||
|
||||
iZrslt = inflateEnd (&pData->sZlib); /* let zlib cleanup its own stuff */
|
||||
|
||||
if (iZrslt != Z_OK) /* on error bail out */
|
||||
MNG_ERRORZ (pData, (mng_uint32)iZrslt);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_INFLATEFREE, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR; /* done */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_deflateinit (mng_datap pData)
|
||||
{
|
||||
int iZrslt;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEINIT, MNG_LC_START);
|
||||
#endif
|
||||
/* initialize zlib structures and such */
|
||||
iZrslt = deflateInit2 (&pData->sZlib, pData->iZlevel, pData->iZmethod,
|
||||
pData->iZwindowbits, pData->iZmemlevel,
|
||||
pData->iZstrategy);
|
||||
|
||||
if (iZrslt != Z_OK) /* on error bail out */
|
||||
MNG_ERRORZ (pData, (mng_uint32)iZrslt);
|
||||
|
||||
pData->bDeflating = MNG_TRUE; /* really deflating something now */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEINIT, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR; /* done */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_deflaterows (mng_datap pData,
|
||||
mng_uint32 iInlen,
|
||||
mng_uint8p pIndata)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEROWS, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEROWS, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_deflatedata (mng_datap pData,
|
||||
mng_uint32 iInlen,
|
||||
mng_uint8p pIndata)
|
||||
{
|
||||
int iZrslt;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEDATA, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
pData->sZlib.next_in = pIndata; /* let zlib know where to get stuff */
|
||||
pData->sZlib.avail_in = (uInt)iInlen;
|
||||
/* now deflate the data in one go! */
|
||||
iZrslt = deflate (&pData->sZlib, Z_FINISH);
|
||||
/* not enough room in output-buffer ? */
|
||||
if ((iZrslt == Z_BUF_ERROR) || (pData->sZlib.avail_in > 0))
|
||||
return MNG_BUFOVERFLOW;
|
||||
/* on error bail out */
|
||||
if ((iZrslt != Z_OK) && (iZrslt != Z_STREAM_END))
|
||||
MNG_ERRORZ (pData, (mng_uint32)iZrslt);
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEDATA, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_deflatefree (mng_datap pData)
|
||||
{
|
||||
int iZrslt;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEFREE, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
iZrslt = deflateEnd (&pData->sZlib); /* let zlib cleanup its own stuff */
|
||||
|
||||
if (iZrslt != Z_OK) /* on error bail out */
|
||||
MNG_ERRORZ (pData, (mng_uint32)iZrslt);
|
||||
|
||||
pData->bDeflating = MNG_FALSE; /* stopped it */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEFREE, MNG_LC_END);
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR; /* done */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_ZLIB */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
60
src/3rdparty/libmng/libmng_zlib.h
vendored
60
src/3rdparty/libmng/libmng_zlib.h
vendored
@ -1,60 +0,0 @@
|
||||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : libmng_zlib.h copyright (c) 2000-2002 G.Juyn * */
|
||||
/* * version : 1.0.0 * */
|
||||
/* * * */
|
||||
/* * purpose : ZLIB package interface (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the ZLIB package interface * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.9.2 - 08/05/2000 - G.Juyn * */
|
||||
/* * - changed file-prefixes * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _libmng_zlib_h_
|
||||
#define _libmng_zlib_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngzlib_initialize (mng_datap pData);
|
||||
mng_retcode mngzlib_cleanup (mng_datap pData);
|
||||
|
||||
mng_retcode mngzlib_inflateinit (mng_datap pData);
|
||||
mng_retcode mngzlib_inflaterows (mng_datap pData,
|
||||
mng_uint32 iInlen,
|
||||
mng_uint8p pIndata);
|
||||
mng_retcode mngzlib_inflatedata (mng_datap pData,
|
||||
mng_uint32 iInlen,
|
||||
mng_uint8p pIndata);
|
||||
mng_retcode mngzlib_inflatefree (mng_datap pData);
|
||||
|
||||
mng_retcode mngzlib_deflateinit (mng_datap pData);
|
||||
mng_retcode mngzlib_deflaterows (mng_datap pData,
|
||||
mng_uint32 iInlen,
|
||||
mng_uint8p pIndata);
|
||||
mng_retcode mngzlib_deflatedata (mng_datap pData,
|
||||
mng_uint32 iInlen,
|
||||
mng_uint8p pIndata);
|
||||
mng_retcode mngzlib_deflatefree (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _libmng_zlib_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
29
src/3rdparty/libmng/makefiles/Makefile.am
vendored
29
src/3rdparty/libmng/makefiles/Makefile.am
vendored
@ -1,29 +0,0 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.3 foreign no-dependencies
|
||||
|
||||
# include the app subdirectories in the distribution
|
||||
EXTRA_DIST = makefiles doc contrib
|
||||
|
||||
|
||||
# libmng release @VERSION@
|
||||
libmng_la_LDFLAGS = -version-info 1:0:0
|
||||
|
||||
lib_LTLIBRARIES = libmng.la
|
||||
|
||||
include_HEADERS = libmng.h libmng_conf.h libmng_types.h
|
||||
noinst_HEADERS = libmng_chunk_io.h libmng_chunk_prc.h libmng_chunks.h \
|
||||
libmng_cms.h libmng_data.h libmng_display.h libmng_dither.h \
|
||||
libmng_error.h libmng_filter.h libmng_jpeg.h libmng_memory.h \
|
||||
libmng_object_prc.h libmng_objects.h libmng_pixels.h \
|
||||
libmng_read.h libmng_trace.h libmng_write.h libmng_zlib.h
|
||||
|
||||
libmng_la_SOURCES = libmng_callback_xs.c libmng_chunk_io.c \
|
||||
libmng_chunk_prc.c libmng_chunk_xs.c libmng_cms.c \
|
||||
libmng_display.c libmng_dither.c libmng_error.c \
|
||||
libmng_filter.c libmng_hlapi.c libmng_jpeg.c \
|
||||
libmng_object_prc.c libmng_pixels.c libmng_prop_xs.c \
|
||||
libmng_read.c libmng_trace.c libmng_write.c libmng_zlib.c
|
||||
|
||||
man_MANS = doc/man/libmng.3 doc/man/jng.5 doc/man/mng.5
|
||||
|
27
src/3rdparty/libmng/makefiles/README
vendored
27
src/3rdparty/libmng/makefiles/README
vendored
@ -1,27 +0,0 @@
|
||||
For conditions of distribution and use, see copyright notice in libmng.h
|
||||
or the file LICENSE in the top-level directory of the source distribution.
|
||||
|
||||
This directory hosts the makefiles for a number of supported platforms.
|
||||
|
||||
If you're using a system with POSIX shell capabilities, you can use the
|
||||
'configure' script in the top-level directory, or generate it by running
|
||||
'autogen.sh' if you have the necessary tools installed.
|
||||
|
||||
Otherwise, copy the module for your environment (or the closest thing)
|
||||
into the libmng source-directory and change it to your needs. If you
|
||||
create a new file for a platform not on the list send it to me (gerard @
|
||||
libmng.com) and I'll be happy to include it in the next release!
|
||||
|
||||
|
||||
Current files:
|
||||
|
||||
makefile.bcb3 - Borland C++ Builder
|
||||
makefile.vcwin32 - Microsoft Visual C++
|
||||
makefile.unix - generic Unix
|
||||
makefile.linux - Linux ELF (builds shared library)
|
||||
makefile.dj - DJGPP
|
||||
makefile.mingw - builds a static library for mingw32
|
||||
makefile.mingwdll - builds a dynamic library for mingw32
|
||||
makefile.irix - builds a static library for SGI/IRIX (6.5.21)
|
||||
|
||||
Makefile.am, configure.in and acinclude.m4 (if present) - automake/autoconf source
|
193
src/3rdparty/libmng/makefiles/configure.in
vendored
193
src/3rdparty/libmng/makefiles/configure.in
vendored
@ -1,193 +0,0 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR([libmng.h])
|
||||
AC_PREREQ(2.52)
|
||||
|
||||
dnl this call will define PACKAGE and VERSION
|
||||
dnl please use this as the primary reference for the version number
|
||||
AM_INIT_AUTOMAKE(libmng, 1.0.9)
|
||||
|
||||
dnl pass the version string on the the makefiles
|
||||
AC_SUBST(PACKAGE)
|
||||
AC_SUBST(VERSION)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_ISC_POSIX
|
||||
AM_C_PROTOTYPES
|
||||
if test "x$U" != "x"; then
|
||||
AC_MSG_ERROR(Compiler not ANSI compliant)
|
||||
fi
|
||||
AM_PROG_LIBTOOL
|
||||
AC_PROG_INSTALL
|
||||
|
||||
dnl support for files >2GB
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
dnl Check for required header files
|
||||
AC_HEADER_STDC
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
|
||||
dnl need pow and fabs
|
||||
AC_CHECK_FUNC(pow, , AC_CHECK_LIB(m, pow, LIBS="$LIBS -lm"))
|
||||
|
||||
|
||||
dnl what functionality we want to add (read, write, display).
|
||||
dnl all on by default. see libmng_conf.h for full descriptions
|
||||
|
||||
dnl not building a standard shared object?
|
||||
AC_ARG_ENABLE(buildso,
|
||||
[ --disable-buildso disable building standard shared object])
|
||||
if test "x$enable_buildso" != "xno"; then
|
||||
AC_DEFINE(MNG_BUILD_SO)
|
||||
fi
|
||||
|
||||
dnl we only support the full mng spec for now (no LC or VLC)
|
||||
AC_DEFINE(MNG_SUPPORT_FULL)
|
||||
|
||||
dnl remove support in library to read images?
|
||||
AC_ARG_ENABLE(read,
|
||||
[ --disable-read remove read support from library])
|
||||
if test "x$enable_read" != "xno"; then
|
||||
AC_DEFINE(MNG_SUPPORT_READ)
|
||||
fi
|
||||
|
||||
dnl remove support in library to write images?
|
||||
AC_ARG_ENABLE(write,
|
||||
[ --disable-write remove write support from library])
|
||||
if test "x$enable_write" != "xno"; then
|
||||
AC_DEFINE(MNG_SUPPORT_WRITE)
|
||||
fi
|
||||
|
||||
dnl remove support in library to display images?
|
||||
AC_ARG_ENABLE(display,
|
||||
[ --disable-display remove display support from library])
|
||||
if test "x$enable_display" != "xno"; then
|
||||
AC_DEFINE(MNG_SUPPORT_DISPLAY)
|
||||
fi
|
||||
|
||||
dnl remove support for 'dynamic' MNG?
|
||||
AC_ARG_ENABLE(dynamic,
|
||||
[ --disable-dynamic remove dynamic MNG support from library])
|
||||
if test "x$enable_dynamic" != "xno"; then
|
||||
AC_DEFINE(MNG_SUPPORT_DYNAMICMNG)
|
||||
fi
|
||||
|
||||
dnl remove support in library to access chunks?
|
||||
AC_ARG_ENABLE(chunks,
|
||||
[ --disable-chunks remove support for chunk access])
|
||||
if test "x$enable_chunks" != "xno"; then
|
||||
AC_DEFINE(MNG_ACCESS_CHUNKS)
|
||||
fi
|
||||
|
||||
dnl disable support for accessing chunks that have been previously read?
|
||||
AC_ARG_ENABLE(storechunks,
|
||||
[ --disable-storechunks remove support for access of previous chunks])
|
||||
if test "x$enable_storechunks" != "xno"; then
|
||||
AC_DEFINE(MNG_STORE_CHUNKS)
|
||||
fi
|
||||
|
||||
dnl enable support for debug tracing callbacks and messages?
|
||||
AC_ARG_ENABLE(trace,
|
||||
[ --enable-trace include support for debug tracing callbacks],[
|
||||
if test "x$enable_trace" = "xyes"; then
|
||||
AC_DEFINE(MNG_SUPPORT_TRACE)
|
||||
AC_DEFINE(MNG_TRACE_TELLTALE)
|
||||
fi
|
||||
])
|
||||
|
||||
dnl verbose error text
|
||||
dnl this should always be on
|
||||
AC_DEFINE(MNG_ERROR_TELLTALE)
|
||||
|
||||
|
||||
dnl libz is required.
|
||||
AC_ARG_WITH(zlib,
|
||||
[ --with-zlib[=DIR] use zlib include/library files in DIR],[
|
||||
if test -d "$withval"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$withval/include"
|
||||
LDFLAGS="$LDFLAGS -L$withval/lib"
|
||||
fi
|
||||
])
|
||||
AC_CHECK_HEADER(zlib.h,
|
||||
AC_CHECK_LIB(z, gzread, , AC_MSG_ERROR(zlib library not found)),
|
||||
AC_MSG_ERROR(zlib header not found)
|
||||
)
|
||||
|
||||
dnl check for jpeg library
|
||||
AC_ARG_WITH(jpeg,
|
||||
[ --with-jpeg[=DIR] use jpeg include/library files in DIR],
|
||||
[with_jpeg=$withval],[with_jpeg=_auto])
|
||||
|
||||
if test "x$with_jpeg" != "xno" -a "x$with_jpeg" != "xyes" -a \
|
||||
"x$with_jpeg" != "x_auto"; then
|
||||
# Save in case test with directory specified fails
|
||||
_cppflags=${CPPFLAGS}
|
||||
_ldflags=${LDFLAGS}
|
||||
_restore=1
|
||||
|
||||
CPPFLAGS="${CPPFLAGS} -I$withval/include"
|
||||
LDFLAGS="${LDFLAGS} -L$withval/lib"
|
||||
else
|
||||
_restore=0
|
||||
fi
|
||||
|
||||
if test "x$with_jpeg" != "xno"; then
|
||||
AC_CHECK_HEADER(jpeglib.h,
|
||||
AC_CHECK_LIB(jpeg, jpeg_read_header, [
|
||||
LIBS="$LIBS -ljpeg"
|
||||
AC_DEFINE(HAVE_LIBJPEG)
|
||||
_restore=0
|
||||
],
|
||||
AC_MSG_WARN(jpeg library not found)),
|
||||
AC_MSG_WARN(jpeg header not found)
|
||||
)
|
||||
fi
|
||||
|
||||
test $_restore -eq 1 && CPPFLAGS=$_cppflags LDFLAGS=$_ldflags
|
||||
|
||||
dnl check for lcms library
|
||||
AC_ARG_WITH(lcms,
|
||||
[ --with-lcms[=DIR] use lcms include/library files in DIR],
|
||||
[with_lcms=$withval],[with_lcms=_auto])
|
||||
|
||||
if test "x$with_lcms" != "xno" -a "x$with_lcms" != "xyes" -a \
|
||||
"x$with_lcms" != "x_auto"; then
|
||||
# Save in case test with directory specified fails
|
||||
_cppflags=$CPPFLAGS
|
||||
_ldflags=$LDFLAGS
|
||||
_restore=1
|
||||
|
||||
CPPFLAGS="$CPPFLAGS -I$withval/include"
|
||||
LDFLAGS="$LDFLAGS -L$withval/lib"
|
||||
else
|
||||
_restore=0
|
||||
fi
|
||||
|
||||
if test "x$with_lcms" != "xno"; then
|
||||
AC_CHECK_HEADER(lcms.h, [
|
||||
have_lcms=yes
|
||||
AC_CHECK_LIB(lcms, cmsCreateRGBProfile, [
|
||||
LIBS="$LIBS -llcms"
|
||||
AC_DEFINE(HAVE_LIBLCMS)
|
||||
dnl for now this implies MNG_INCLUDE_LCMS in the headers:
|
||||
AC_DEFINE(MNG_FULL_CMS)
|
||||
_restore=0
|
||||
have_lcms=yes
|
||||
],[
|
||||
have_lcms=no
|
||||
])
|
||||
])
|
||||
dnl give feedback only if the user asked specifically for lcms
|
||||
if test "x$with_lcms" != "x_auto" -a "x$have_lcms" != "xyes"; then
|
||||
AC_MSG_WARN([lcms not found... disabling CMS support])
|
||||
fi
|
||||
fi
|
||||
|
||||
test $_restore -eq 1 && CPPFLAGS=$_cppflags LDFLAGS=$_ldflags
|
||||
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
108
src/3rdparty/libmng/makefiles/makefile.bcb3
vendored
108
src/3rdparty/libmng/makefiles/makefile.bcb3
vendored
@ -1,108 +0,0 @@
|
||||
#
|
||||
# For conditions of distribution and use, see copyright notice in libmng.h
|
||||
#
|
||||
# makefile for libmng - THE MNG library
|
||||
# this makefile is suitable for Borland C++ Builder.
|
||||
# it works (at least) with Borland C++ Builder v3
|
||||
|
||||
# Configuration options are now in mng_conf.h
|
||||
# this option forces dll compatibility
|
||||
MNGOPT = -DMNG_BUILD_DLL
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= bcc32
|
||||
|
||||
# compiler options:
|
||||
CFLAGS= -WD -O2 -Hc -w-par -k -y -v -vi -c -tWD \
|
||||
-wuse -wucp -wstv -wstu -wsig -wpin -wnod -wnak -wdef -wcln -wbbf -wasm -wamp \
|
||||
-wamb -Tkh30000 -ff -5 -I.;..\zlib;..\jpgsrc6b;..\lcms\include $(MNGOPT)
|
||||
|
||||
# source files
|
||||
SOURCES= libmng_hlapi.c libmng_callback_xs.c libmng_prop_xs.c libmng_chunk_xs.c \
|
||||
libmng_chunk_descr.c libmng_read.c libmng_write.c libmng_display.c \
|
||||
libmng_object_prc.c libmng_chunk_prc.c libmng_chunk_io.c libmng_error.c \
|
||||
libmng_trace.c libmng_pixels.c libmng_filter.c libmng_dither.c \
|
||||
libmng_zlib.c libmng_jpeg.c libmng_cms.c
|
||||
|
||||
# object files
|
||||
OBJECTS= libmng_hlapi.obj libmng_callback_xs.obj libmng_prop_xs.obj libmng_chunk_xs.obj \
|
||||
libmng_chunk_descr.obj libmng_read.obj libmng_write.obj libmng_display.obj \
|
||||
libmng_object_prc.obj libmng_chunk_prc.obj libmng_chunk_io.obj libmng_error.obj \
|
||||
libmng_trace.obj libmng_pixels.obj libmng_filter.obj libmng_dither.obj \
|
||||
libmng_zlib.obj libmng_jpeg.obj libmng_cms.obj
|
||||
|
||||
# type dependancies
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) -c{ $<}
|
||||
|
||||
# make options
|
||||
all: libmng.lib
|
||||
|
||||
clean:
|
||||
- del *.obj
|
||||
- del libmng.lib
|
||||
|
||||
# file dependancies
|
||||
libmng.lib: $(OBJECTS)
|
||||
- del libmng.lib
|
||||
tlib libmng.lib /E /C @&&|
|
||||
+libmng_hlapi.obj +libmng_callback_xs.obj +libmng_prop_xs.obj +libmng_chunk_xs.obj &
|
||||
+libmng_read.obj +libmng_write.obj +libmng_display.obj &
|
||||
+libmng_object_prc.obj +libmng_chunk_prc.obj +libmng_chunk_io.obj +libmng_error.obj &
|
||||
+libmng_trace.obj +libmng_pixels.obj +libmng_filter.obj +libmng_dither.obj &
|
||||
+libmng_zlib.obj +libmng_jpeg.obj +libmng_cms.obj
|
||||
|
|
||||
|
||||
libmng_hlapi.obj: libmng_hlapi.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_memory.h libmng_error.h libmng_trace.h libmng_read.h \
|
||||
libmng_write.h libmng_display.h libmng_zlib.h libmng_cms.h libmng_zlib.h
|
||||
libmng_callback_xs.obj: libmng_callback_xs.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_prop_xs.obj: libmng_prop_xs.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
libmng_chunk_xs.obj: libmng_chunk_xs.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_chunks.h libmng_chunk_prc.h libmng_error.h libmng_trace.h
|
||||
libmng_read.obj: libmng_read.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_prc.h libmng_chunk_io.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_read.h libmng_display.h
|
||||
libmng_write.obj: libmng_write.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_write.h
|
||||
libmng_display.obj: libmng_display.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_zlib.h libmng_cms.h \
|
||||
libmng_pixels.h libmng_display.h
|
||||
libmng_object_prc.obj: libmng_object_prc.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_display.h libmng_pixels.h
|
||||
libmng_chunk_descr.obj: libmng_chunk_descr.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_chunks.h libmng_chunk_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_chunk_prc.obj: libmng_chunk_prc.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_chunks.h libmng_chunk_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_chunk_io.obj: libmng_chunk_io.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h libmng_chunks.h \
|
||||
libmng_chunk_io.h libmng_chunk_prc libmng_memory.h libmng_error.h \
|
||||
libmng_trace.h libmng_display.h libmng_zlib.h libmng_pixels.h
|
||||
libmng_error.obj: libmng_error.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_trace.obj: libmng_trace.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_pixels.obj: libmng_pixels.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_memory.h libmng_error.h libmng_trace.h \
|
||||
libmng_cms.h libmng_filter.h libmng_pixels.h
|
||||
libmng_filter.obj: libmng_filter.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_filter.h
|
||||
libmng_dither.obj: libmng_dither.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_dither.h
|
||||
libmng_zlib.obj: libmng_zlib.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h \
|
||||
libmng_filter.h libmng_zlib.h
|
||||
libmng_jpeg.obj: libmng_jpeg.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h \
|
||||
libmng_pixels.h libmng_jpeg.h
|
||||
libmng_cms.obj: libmng_cms.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
|
155
src/3rdparty/libmng/makefiles/makefile.dj
vendored
155
src/3rdparty/libmng/makefiles/makefile.dj
vendored
@ -1,155 +0,0 @@
|
||||
#
|
||||
# For conditions of distribution and use, see copyright notice in libmng.h
|
||||
#
|
||||
# makefile for libmng - THE MNG library
|
||||
# This makefile have been tested on DJGPP v2
|
||||
# (Based on makefile.linux since both are GNU compilers)
|
||||
#
|
||||
# By Silvio Fonseca - gissi@sti.com.br
|
||||
|
||||
#compiler
|
||||
CC=gcc
|
||||
|
||||
#default build options
|
||||
OPTIONS=
|
||||
|
||||
#DJGPP directory
|
||||
prefix=C:/DJGPP
|
||||
installprefix=C:\DJGPP
|
||||
|
||||
#ZLIB Library and includes
|
||||
ZLIBLIB=$(prefix)/lib
|
||||
#ZLIBLIB=../zlib
|
||||
ZLIBINC=$(prefix)/include
|
||||
#ZLIBINC=../zlib
|
||||
|
||||
#Jpeg library and includes
|
||||
JPEGLIB=$(prefix)/lib
|
||||
#JPEGLIB=../jpgsrc
|
||||
JPEGINC=$(prefix)/include
|
||||
#JPEGINC=../jpgsrc
|
||||
|
||||
#Lcms library and includes
|
||||
LCMSLIB=$(prefix)/lib
|
||||
#LCMSLIB=../lcms
|
||||
LCMSINC=$(prefix)/include
|
||||
#LCMSINC=../lcms
|
||||
|
||||
ALIGN=
|
||||
# for i386:
|
||||
#ALIGN=-malign-loops=2 -malign-functions=2
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
|
||||
CFLAGS=-I$(ZLIBINC) -I$(JPEGINC) -I$(LCMSINC) -Wall -O3 -funroll-loops \
|
||||
$(OPTIONS) $(ALIGN) # $(WARNMORE) -g
|
||||
LDFLAGS=-L. -Wl,-rpath,. \
|
||||
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
|
||||
-L$(JPEGLIB) -Wl,-rpath,$(JPEGLIB) \
|
||||
-L$(LCMSLIB) -Wl,-rpath,$(LCMSLIB) \
|
||||
-lmng -lz -ljpeg -llcms -lm
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
OBJS = \
|
||||
libmng_callback_xs.o \
|
||||
libmng_chunk_io.o \
|
||||
libmng_chunk_descr.o \
|
||||
libmng_chunk_prc.o \
|
||||
libmng_chunk_xs.o \
|
||||
libmng_cms.o \
|
||||
libmng_display.o \
|
||||
libmng_dither.o \
|
||||
libmng_error.o \
|
||||
libmng_filter.o \
|
||||
libmng_hlapi.o \
|
||||
libmng_jpeg.o \
|
||||
libmng_object_prc.o \
|
||||
libmng_pixels.o \
|
||||
libmng_prop_xs.o \
|
||||
libmng_read.o \
|
||||
libmng_trace.o \
|
||||
libmng_write.o \
|
||||
libmng_zlib.o
|
||||
|
||||
OBJSDLL = $(OBJS:.0=.pic.o)
|
||||
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
||||
all: libmng.a
|
||||
|
||||
libmng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
ranlib $@
|
||||
|
||||
install: libmng.a
|
||||
-@md $(installprefix)\include $(installprefix)\lib
|
||||
copy libmng.h $(installprefix)\include
|
||||
copy libmng_conf.h $(installprefix)\include
|
||||
copy libmng_types.h $(installprefix)\include
|
||||
copy libmng.a $(installprefix)\lib
|
||||
|
||||
clean:
|
||||
del *.o
|
||||
del libmng.a
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
libmng_hlapi.o libmng_hlapi.pic.o: libmng_hlapi.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_memory.h libmng_error.h libmng_trace.h libmng_read.h \
|
||||
libmng_write.h libmng_display.h libmng_zlib.h libmng_cms.h libmng_zlib.h
|
||||
libmng_callback_xs.o libmng_callback_xs.pic.o: libmng_callback_xs.c libmng.h \
|
||||
libmng_conf.h libmng_types.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_prop_xs.o libmng_prop_xs.pic.o: libmng_prop_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
libmng_chunk_xs.o libmng_chunk_xs.pic.o: libmng_chunk_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_read.o libmng_read.pic.o: libmng_read.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_prc.h libmng_chunk_io.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_read.h libmng_display.h
|
||||
libmng_write.o libmng_write.pic.o: libmng_write.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_write.h
|
||||
libmng_display.o libmng_display.pic.o: libmng_display.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_zlib.h libmng_cms.h libmng_pixels.h \
|
||||
libmng_display.h
|
||||
libmng_object_prc.o libmng_object_prc.pic.o: libmng_object_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_display.h libmng_pixels.h
|
||||
libmng_chunk_descr.o libmng_chunk_descr.pic.o: libmng_chunk_descr.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_descr.h \
|
||||
libmng_chunk_prc.h libmng_memory.h libmng_error.h libmng_trace.h
|
||||
libmng_chunk_prc.o libmng_chunk_prc.pic.o: libmng_chunk_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_chunk_io.o libmng_chunk_io.pic.o: libmng_chunk_io.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_io.h libmng_chunk_prc.h libmng_memory.h libmng_error.h \
|
||||
libmng_trace.h libmng_display.h libmng_zlib.h libmng_pixels.h
|
||||
libmng_error.o libmng_error.pic.o: libmng_error.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_trace.o libmng_trace.pic.o: libmng_trace.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_pixels.o libmng_pixels.pic.o: libmng_pixels.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_memory.h libmng_error.h libmng_trace.h \
|
||||
libmng_cms.h libmng_filter.h libmng_pixels.h
|
||||
libmng_filter.o libmng_filter.pic.o: libmng_filter.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_filter.h
|
||||
libmng_dither.o libmng_dither.pic.o: libmng_dither.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_dither.h
|
||||
libmng_zlib.o libmng_zlib.pic.o: libmng_zlib.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h \
|
||||
libmng_filter.h libmng_zlib.h
|
||||
libmng_jpeg.o libmng_jpeg.pic.o: libmng_jpeg.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h libmng_jpeg.h
|
||||
libmng_cms.o libmng_cms.pic.o: libmng_cms.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
|
180
src/3rdparty/libmng/makefiles/makefile.linux
vendored
180
src/3rdparty/libmng/makefiles/makefile.linux
vendored
@ -1,180 +0,0 @@
|
||||
#
|
||||
# For conditions of distribution and use, see copyright notice in libmng.h
|
||||
#
|
||||
# makefile for libmng - THE MNG library
|
||||
# this makefile is suitable for Linux ELF with gcc
|
||||
#
|
||||
# (this file is heavily copied from makefile.linux in the libpng package)
|
||||
|
||||
# compiler
|
||||
CC=gcc
|
||||
|
||||
# default build options (this forces shared library compatibility!!)
|
||||
#OPTIONS = -DMNG_BUILD_SO
|
||||
OPTIONS = -DMNG_BUILD_SO -DMNG_FULL_CMS
|
||||
|
||||
# where "make install" puts libmng.a,libmng.so*,libmng.h,libmng_conf.h,libmng_types.h
|
||||
prefix=/usr/local
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
#ZLIBLIB=../zlib
|
||||
#ZLIBINC=../zlib
|
||||
ZLIBLIB=/usr/local/lib
|
||||
ZLIBINC=/usr/local/include
|
||||
|
||||
# Where the jpeg library and include files are located
|
||||
#JPEGLIB=../jpgsrc
|
||||
#JPEGINC=../jpgsrc
|
||||
JPEGLIB=/usr/local/lib
|
||||
JPEGINC=/usr/local/include
|
||||
|
||||
# Where the lcms library and include files are located
|
||||
#LCMSLIB=../lcms/lib
|
||||
#LCMSINC=../lcms/source
|
||||
LCMSLIB=/usr/local/lib
|
||||
LCMSINC=/usr/local/include
|
||||
|
||||
ALIGN=
|
||||
# for i386:
|
||||
#ALIGN=-malign-loops=2 -malign-functions=2
|
||||
|
||||
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
||||
-Wmissing-declarations -Wtraditional -Wcast-align \
|
||||
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
|
||||
|
||||
# for pgcc version 2.95.1, -O3 is buggy; don't use it.
|
||||
|
||||
CFLAGS=-I$(ZLIBINC) -I$(JPEGINC) -I$(LCMSINC) -Wall -O3 -funroll-loops \
|
||||
$(OPTIONS) $(ALIGN) # $(WARNMORE) -g
|
||||
LDFLAGS=-L. -Wl,-rpath,. \
|
||||
-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
|
||||
-L$(JPEGLIB) -Wl,-rpath,$(JPEGLIB) \
|
||||
-L$(LCMSLIB) -Wl,-rpath,$(LCMSLIB) \
|
||||
-lmng -lz -ljpeg -llcms -lm
|
||||
|
||||
RANLIB=ranlib
|
||||
#RANLIB=echo
|
||||
|
||||
# current version numbers
|
||||
MNGMAJ = 1
|
||||
MNGMIN = 1.0.9
|
||||
MNGVER = $(MNGMAJ).$(MNGMIN)
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
OBJS = \
|
||||
libmng_callback_xs.o \
|
||||
libmng_chunk_io.o \
|
||||
libmng_chunk_descr.o \
|
||||
libmng_chunk_prc.o \
|
||||
libmng_chunk_xs.o \
|
||||
libmng_cms.o \
|
||||
libmng_display.o \
|
||||
libmng_dither.o \
|
||||
libmng_error.o \
|
||||
libmng_filter.o \
|
||||
libmng_hlapi.o \
|
||||
libmng_jpeg.o \
|
||||
libmng_object_prc.o \
|
||||
libmng_pixels.o \
|
||||
libmng_prop_xs.o \
|
||||
libmng_read.o \
|
||||
libmng_trace.o \
|
||||
libmng_write.o \
|
||||
libmng_zlib.o
|
||||
|
||||
OBJSDLL = $(OBJS:.0=.pic.o)
|
||||
|
||||
.SUFFIXES: .c .o .pic.o
|
||||
|
||||
.c.pic.o:
|
||||
$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
|
||||
|
||||
all: libmng.a libmng.so
|
||||
|
||||
libmng.a: $(OBJS)
|
||||
ar rc $@ $(OBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
libmng.so: libmng.so.$(MNGMAJ)
|
||||
ln -sf libmng.so.$(MNGMAJ) libmng.so
|
||||
|
||||
libmng.so.$(MNGMAJ): libmng.so.$(MNGVER)
|
||||
ln -sf libmng.so.$(MNGVER) libmng.so.$(MNGMAJ)
|
||||
|
||||
libmng.so.$(MNGVER): $(OBJSDLL)
|
||||
# $(CC) -shared -Wl,-soname,libmng.so.$(MNGMAJ) -o libmng.so.$(MNGVER) \
|
||||
# $(OBJSDLL) -L$(ZLIBLIB) -L$(JPEGLIB) -L$(LCMSLIB) -lz -lm -lc
|
||||
$(CC) -shared -Wl,-soname,libmng.so.$(MNGMAJ) -o libmng.so.$(MNGVER) \
|
||||
$(OBJSDLL) -L$(ZLIBLIB) -L$(JPEGLIB) -ljpeg -L$(LCMSLIB) -llcms \
|
||||
-lz -lm -lc
|
||||
|
||||
install: libmng.a libmng.so.$(MNGVER)
|
||||
-@mkdir $(INCPATH) $(LIBPATH)
|
||||
cp libmng.h libmng_conf.h libmng_types.h $(INCPATH)
|
||||
chmod 644 $(INCPATH)/libmng.h $(INCPATH)/libmng_conf.h $(INCPATH)/libmng_types.h
|
||||
cp libmng.a libmng.so.$(MNGVER) $(LIBPATH)
|
||||
chmod 755 $(LIBPATH)/libmng.so.$(MNGVER)
|
||||
-@/bin/rm -f $(LIBPATH)/libmng.so.$(MNGMAJ) $(LIBPATH)/libmng.so
|
||||
(cd $(LIBPATH); ln -sf libmng.so.$(MNGVER) libmng.so.$(MNGMAJ); \
|
||||
ln -sf libmng.so.$(MNGMAJ) libmng.so)
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o libmng.a libmng.so*
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
libmng_hlapi.o libmng_hlapi.pic.o: libmng_hlapi.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_memory.h libmng_error.h libmng_trace.h libmng_read.h \
|
||||
libmng_write.h libmng_display.h libmng_zlib.h libmng_cms.h libmng_zlib.h
|
||||
libmng_callback_xs.o libmng_callback_xs.pic.o: libmng_callback_xs.c libmng.h \
|
||||
libmng_conf.h libmng_types.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_prop_xs.o libmng_prop_xs.pic.o: libmng_prop_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
libmng_chunk_xs.o libmng_chunk_xs.pic.o: libmng_chunk_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_read.o libmng_read.pic.o: libmng_read.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_prc.h libmng_chunk_io.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_read.h libmng_display.h
|
||||
libmng_write.o libmng_write.pic.o: libmng_write.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_write.h
|
||||
libmng_display.o libmng_display.pic.o: libmng_display.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_zlib.h libmng_cms.h libmng_pixels.h \
|
||||
libmng_display.h
|
||||
libmng_object_prc.o libmng_object_prc.pic.o: libmng_object_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_display.h libmng_pixels.h
|
||||
libmng_chunk_descr.o libmng_chunk_descr.pic.o: libmng_chunk_descr.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_descr.h libmng_memory.h \
|
||||
libmng_chunk_prc.h libmng_error.h libmng_trace.h
|
||||
libmng_chunk_prc.o libmng_chunk_prc.pic.o: libmng_chunk_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_chunk_io.o libmng_chunk_io.pic.o: libmng_chunk_io.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_io.h libmng_chunk_prc.h libmng_memory.h libmng_error.h \
|
||||
libmng_trace.h libmng_display.h libmng_zlib.h libmng_pixels.h
|
||||
libmng_error.o libmng_error.pic.o: libmng_error.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_trace.o libmng_trace.pic.o: libmng_trace.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_pixels.o libmng_pixels.pic.o: libmng_pixels.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_memory.h libmng_error.h libmng_trace.h \
|
||||
libmng_cms.h libmng_filter.h libmng_pixels.h
|
||||
libmng_filter.o libmng_filter.pic.o: libmng_filter.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_filter.h
|
||||
libmng_dither.o libmng_dither.pic.o: libmng_dither.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_dither.h
|
||||
libmng_zlib.o libmng_zlib.pic.o: libmng_zlib.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h \
|
||||
libmng_filter.h libmng_zlib.h
|
||||
libmng_jpeg.o libmng_jpeg.pic.o: libmng_jpeg.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h libmng_jpeg.h
|
||||
libmng_cms.o libmng_cms.pic.o: libmng_cms.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
|
164
src/3rdparty/libmng/makefiles/makefile.mingw
vendored
164
src/3rdparty/libmng/makefiles/makefile.mingw
vendored
@ -1,164 +0,0 @@
|
||||
#
|
||||
# For conditions of distribution and use, see copyright notice in libmng.h
|
||||
#
|
||||
# makefile for libmng - THE MNG library
|
||||
# this makefile is for MinGW32, it have been tested with gcc 2.95.3,
|
||||
# binutils 2.11.90 and mingw-runtime 1.0
|
||||
#
|
||||
# By Benoit Blanchon - benoit.blanchon@laposte.net
|
||||
#
|
||||
# Note : this makefile builds a static library; although it's seems to be
|
||||
# possible to build working DLL and import lib, I didn't manage do to it.
|
||||
# If you do, please let me know.
|
||||
|
||||
# outputs
|
||||
LIBMNG_A = libmng.a
|
||||
INSTALL_PREFIX = C:/MinGW/
|
||||
# maybe you sould replace with anti-slashes
|
||||
|
||||
# default build options
|
||||
OPTIONS = -DMNG_NO_CMS -DMNG_ACCESS_CHUNKS -DMNG_STORE_CHUNKS
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
ZLIBLIB=-lz
|
||||
#ZLIBLIB=-L../zlib -lz
|
||||
#ZLIBINC=-I../zlib
|
||||
|
||||
# Where the jpeg library and include files are located
|
||||
JPEGLIB=-ljpeg
|
||||
#JPEGLIB=-L../jpgsrc -ljpeg
|
||||
#JPEGINC=-I../jpgsrc
|
||||
|
||||
# Where the lcms library and include files are located
|
||||
#LCMSLIB=-llcms
|
||||
#LCMSLIB=-L../lcms/lib -llcms
|
||||
#LCMSINC=-I../lcms/source
|
||||
|
||||
# file deletion command
|
||||
RM=rm -f
|
||||
#RM=del
|
||||
|
||||
# directory creation command
|
||||
MKDIR=mkdir -p
|
||||
|
||||
# file copy command
|
||||
COPY=cp
|
||||
#COPY=copy
|
||||
|
||||
# compiler
|
||||
CC=gcc
|
||||
|
||||
ALIGN=
|
||||
# for i386:
|
||||
#ALIGN=-malign-loops=2 -malign-functions=2
|
||||
|
||||
CFLAGS=$(ZLIBINC) $(JPEGINC) $(LCMSINC) -Wall -O3 -funroll-loops $(OPTIONS) $(ALIGN)
|
||||
LDFLAGS=-L. -lmng $(ZLIBLIB) $(JPEGLIB) $(LCMSLIB) -lm
|
||||
|
||||
# library (.a) file creation command
|
||||
AR= ar rc
|
||||
# second step in .a creation (use "touch" if not needed)
|
||||
AR2= ranlib
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
OBJS = \
|
||||
libmng_callback_xs.o \
|
||||
libmng_chunk_io.o \
|
||||
libmng_chunk_descr.o \
|
||||
libmng_chunk_prc.o \
|
||||
libmng_chunk_xs.o \
|
||||
libmng_cms.o \
|
||||
libmng_display.o \
|
||||
libmng_dither.o \
|
||||
libmng_error.o \
|
||||
libmng_filter.o \
|
||||
libmng_hlapi.o \
|
||||
libmng_jpeg.o \
|
||||
libmng_object_prc.o \
|
||||
libmng_pixels.o \
|
||||
libmng_prop_xs.o \
|
||||
libmng_read.o \
|
||||
libmng_trace.o \
|
||||
libmng_write.o \
|
||||
libmng_zlib.o
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: $(LIBMNG_A)
|
||||
|
||||
$(LIBMNG_A) : $(OBJS)
|
||||
$(RM) $@
|
||||
$(AR) $@ $(OBJS)
|
||||
$(AR2) $@
|
||||
|
||||
install : $(LIBMNG_A)
|
||||
$(MKDIR) $(INSTALL_PREFIX)include
|
||||
$(COPY) libmng.h $(INSTALL_PREFIX)include
|
||||
$(COPY) libmng_conf.h $(INSTALL_PREFIX)include
|
||||
$(COPY) libmng_types.h $(INSTALL_PREFIX)include
|
||||
$(MKDIR) $(INSTALL_PREFIX)lib
|
||||
$(COPY) $(LIBMNG_A) $(INSTALL_PREFIX)lib
|
||||
|
||||
clean:
|
||||
$(RM) *.o
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
libmng_hlapi.o : libmng_hlapi.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_memory.h libmng_error.h libmng_trace.h libmng_read.h \
|
||||
libmng_write.h libmng_display.h libmng_zlib.h libmng_cms.h libmng_zlib.h
|
||||
libmng_callback_xs.o : libmng_callback_xs.c libmng.h \
|
||||
libmng_conf.h libmng_types.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_prop_xs.o : libmng_prop_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
libmng_chunk_xs.o : libmng_chunk_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_read.o : libmng_read.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_prc.h libmng_chunk_io.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_read.h libmng_display.h
|
||||
libmng_write.o : libmng_write.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_write.h
|
||||
libmng_display.o : libmng_display.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_zlib.h libmng_cms.h libmng_pixels.h \
|
||||
libmng_display.h
|
||||
libmng_object_prc.o : libmng_object_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_display.h libmng_pixels.h
|
||||
libmng_chunk_descr.o : libmng_chunk_descr.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_descr.h \
|
||||
libmng_chunk_prc.h libmng_memory.h libmng_error.h libmng_trace.h
|
||||
libmng_chunk_prc.o : libmng_chunk_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_chunk_io.o : libmng_chunk_io.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_io.h libmng_chunk_prc.h libmng_memory.h libmng_error.h \
|
||||
libmng_trace.h libmng_display.h libmng_zlib.h libmng_pixels.h
|
||||
libmng_error.o : libmng_error.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_trace.o : libmng_trace.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_pixels.o : libmng_pixels.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_memory.h libmng_error.h libmng_trace.h \
|
||||
libmng_cms.h libmng_filter.h libmng_pixels.h
|
||||
libmng_filter.o : libmng_filter.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_filter.h
|
||||
libmng_dither.o : libmng_dither.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_dither.h
|
||||
libmng_zlib.o : libmng_zlib.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h \
|
||||
libmng_filter.h libmng_zlib.h
|
||||
libmng_jpeg.o : libmng_jpeg.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h libmng_jpeg.h
|
||||
libmng_cms.o : libmng_cms.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
|
158
src/3rdparty/libmng/makefiles/makefile.mingwdll
vendored
158
src/3rdparty/libmng/makefiles/makefile.mingwdll
vendored
@ -1,158 +0,0 @@
|
||||
#
|
||||
# For conditions of distribution and use, see copyright notice in libmng.h
|
||||
#
|
||||
# makefile for libmng - THE MNG library
|
||||
# this makefile is for MinGW32, it has been tested with gcc 3.1,
|
||||
# binutils 2.12.90 and mingw-runtime 2.0
|
||||
#
|
||||
# By Benoit Blanchon - benoit.blanchon@laposte.net
|
||||
# DLL mods by F. Richter <frichter@gmx.li>
|
||||
#
|
||||
|
||||
# outputs
|
||||
LIBMNG_A = libmng.a
|
||||
LIBMNG_DLL = libmng.1.dll
|
||||
INSTALL_PREFIX = C:/MinGW/
|
||||
# maybe you sould replace with anti-slashes
|
||||
|
||||
# default build options
|
||||
OPTIONS = -DMNG_BUILD_DLL -DMNG_ACCESS_CHUNKS -DMNG_STORE_CHUNKS
|
||||
|
||||
# Where the zlib library and include files are located
|
||||
ZLIBLIB=-lz
|
||||
#ZLIBLIB=-L../zlib -lz
|
||||
#ZLIBINC=-I../zlib
|
||||
|
||||
# Where the jpeg library and include files are located
|
||||
JPEGLIB=-ljpeg
|
||||
#JPEGLIB=-L../jpgsrc -ljpeg
|
||||
#JPEGINC=-I../jpgsrc
|
||||
|
||||
# Where the lcms library and include files are located
|
||||
#LCMSLIB=-llcms
|
||||
LCMSLIB=-L../lcms/lib -llcms
|
||||
LCMSINC=-I../lcms/source
|
||||
|
||||
# file deletion command
|
||||
RM=rm -f
|
||||
#RM=del
|
||||
|
||||
# directory creation command
|
||||
MKDIR=mkdir -p
|
||||
|
||||
# file copy command
|
||||
COPY=cp
|
||||
#COPY=copy
|
||||
|
||||
# compiler
|
||||
CC=gcc
|
||||
|
||||
ALIGN=
|
||||
# for i386:
|
||||
#ALIGN=-malign-loops=2 -malign-functions=2
|
||||
|
||||
CFLAGS=$(ZLIBINC) $(JPEGINC) $(LCMSINC) -Wall -O3 -funroll-loops $(OPTIONS) $(ALIGN) -s
|
||||
LDFLAGS=-L. -lmng $(ZLIBLIB) $(JPEGLIB) $(LCMSLIB) -lm -s
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
OBJS = \
|
||||
libmng_callback_xs.o \
|
||||
libmng_chunk_io.o \
|
||||
libmng_chunk_descr.o \
|
||||
libmng_chunk_prc.o \
|
||||
libmng_chunk_xs.o \
|
||||
libmng_cms.o \
|
||||
libmng_display.o \
|
||||
libmng_dither.o \
|
||||
libmng_error.o \
|
||||
libmng_filter.o \
|
||||
libmng_hlapi.o \
|
||||
libmng_jpeg.o \
|
||||
libmng_object_prc.o \
|
||||
libmng_pixels.o \
|
||||
libmng_prop_xs.o \
|
||||
libmng_read.o \
|
||||
libmng_trace.o \
|
||||
libmng_write.o \
|
||||
libmng_zlib.o
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
|
||||
.c.o:
|
||||
$(CC) -c $(CFLAGS) -o $@ $*.c
|
||||
|
||||
all: $(LIBMNG_A)
|
||||
|
||||
$(LIBMNG_A): $(LIBMNG_DLL)
|
||||
|
||||
$(LIBMNG_DLL) : $(OBJS)
|
||||
dllwrap --implib=$(LIBMNG_A) --dllname=$(LIBMNG_DLL) $(OBJS) $(LDFLAGS)
|
||||
|
||||
install : $(LIBMNG_A)
|
||||
$(MKDIR) $(INSTALL_PREFIX)include
|
||||
$(COPY) libmng.h $(INSTALL_PREFIX)include
|
||||
$(COPY) libmng_conf.h $(INSTALL_PREFIX)include
|
||||
$(COPY) libmng_types.h $(INSTALL_PREFIX)include
|
||||
$(MKDIR) $(INSTALL_PREFIX)lib
|
||||
$(COPY) $(LIBMNG_A) $(INSTALL_PREFIX)lib
|
||||
|
||||
clean:
|
||||
$(RM) *.o
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
libmng_hlapi.o : libmng_hlapi.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_memory.h libmng_error.h libmng_trace.h libmng_read.h \
|
||||
libmng_write.h libmng_display.h libmng_zlib.h libmng_cms.h libmng_zlib.h
|
||||
libmng_callback_xs.o : libmng_callback_xs.c libmng.h \
|
||||
libmng_conf.h libmng_types.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_prop_xs.o : libmng_prop_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
libmng_chunk_xs.o : libmng_chunk_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_read.o : libmng_read.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_prc.h libmng_chunk_io.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_read.h libmng_display.h
|
||||
libmng_write.o : libmng_write.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_write.h
|
||||
libmng_display.o : libmng_display.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_zlib.h libmng_cms.h libmng_pixels.h \
|
||||
libmng_display.h
|
||||
libmng_object_prc.o : libmng_object_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_display.h libmng_pixels.h
|
||||
libmng_chunk_descr.o : libmng_chunk_descr.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_descr.h \
|
||||
libmng_chunk_prc.h libmng_memory.h libmng_error.h libmng_trace.h
|
||||
libmng_chunk_prc.o : libmng_chunk_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_chunk_io.o : libmng_chunk_io.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_io.h libmng_chunk_prc.h libmng_memory.h libmng_error.h \
|
||||
libmng_trace.h libmng_display.h libmng_zlib.h libmng_pixels.h
|
||||
libmng_error.o : libmng_error.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_trace.o : libmng_trace.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_pixels.o : libmng_pixels.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_memory.h libmng_error.h libmng_trace.h \
|
||||
libmng_cms.h libmng_filter.h libmng_pixels.h
|
||||
libmng_filter.o : libmng_filter.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_filter.h
|
||||
libmng_dither.o : libmng_dither.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_dither.h
|
||||
libmng_zlib.o : libmng_zlib.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h \
|
||||
libmng_filter.h libmng_zlib.h
|
||||
libmng_jpeg.o : libmng_jpeg.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h libmng_jpeg.h
|
||||
libmng_cms.o : libmng_cms.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
|
160
src/3rdparty/libmng/makefiles/makefile.qnx
vendored
160
src/3rdparty/libmng/makefiles/makefile.qnx
vendored
@ -1,160 +0,0 @@
|
||||
#
|
||||
# For conditions of distribution and use, see copyright notice in libmng.h
|
||||
#
|
||||
# makefile for libmng - THE MNG library
|
||||
# this makefile is suitable for QNX Neutrino
|
||||
|
||||
# Configuration options are now in libmng_conf.h
|
||||
|
||||
# The architecture of your target
|
||||
# one of arm, mips, ppc, sh, x86
|
||||
ARCH = mips
|
||||
|
||||
# The name of the library
|
||||
LIBNAME = libmng
|
||||
ARNAME = $(LIBNAME).a
|
||||
SONAME = $(LIBNAME).so
|
||||
|
||||
# current version numbers
|
||||
MNGMAJ = 1
|
||||
MNGMIN = 0.9
|
||||
MNGVER = $(MNGMAJ).$(MNGMIN)
|
||||
|
||||
# The artefact output folder
|
||||
OBJDIR = bin
|
||||
|
||||
# Location of jpeg header files
|
||||
JPEG_INC = $(QNX_TARGET)/usr/include/jpeg
|
||||
|
||||
# Location of zlib header files
|
||||
ZLIB_INC = $(QNX_TARGET)/usr/include
|
||||
|
||||
# Location of lcms header files
|
||||
# (switch on MNG_FULL_CMS in libmng_conf.h if you want to use this)
|
||||
LCMS_INC = $(QNX_TARGET)/usr/include/lcms
|
||||
|
||||
# default build defines
|
||||
DEF =
|
||||
DEF_SO = -DMNG_BUILD_SO
|
||||
|
||||
# compiler options:
|
||||
CFLAGS = -O2 -funroll-loops
|
||||
|
||||
# include paths
|
||||
INC = -I$(ZLIB_INC) -I$(JPEG_INC)
|
||||
|
||||
# The name of your C compiler:
|
||||
CC = nto$(ARCH)-gcc
|
||||
|
||||
# source files
|
||||
SRC= \
|
||||
libmng_callback_xs.c \
|
||||
libmng_chunk_io.c \
|
||||
libmng_chunk_descr.c \
|
||||
libmng_chunk_prc.c \
|
||||
libmng_chunk_xs.c \
|
||||
libmng_cms.c \
|
||||
libmng_display.c \
|
||||
libmng_dither.c \
|
||||
libmng_error.c \
|
||||
libmng_filter.c \
|
||||
libmng_hlapi.c \
|
||||
libmng_jpeg.c \
|
||||
libmng_object_prc.c \
|
||||
libmng_pixels.c \
|
||||
libmng_prop_xs.c \
|
||||
libmng_read.c \
|
||||
libmng_trace.c \
|
||||
libmng_write.c \
|
||||
libmng_zlib.c
|
||||
|
||||
# object files
|
||||
OBJ=$(addprefix $(OBJDIR)/$(ARCH)/, $(SRC:%.c=%.o))
|
||||
|
||||
# object files for shared object
|
||||
OBJ_SO=$(addprefix $(OBJDIR)/$(ARCH)/, $(SRC:%.c=%.pic.o))
|
||||
|
||||
# type dependancies
|
||||
$(OBJDIR)/$(ARCH)/%.o: %.c
|
||||
$(CC) $(CFLAGS) $(INC) $(DEF) -o $@ -c $<
|
||||
|
||||
$(OBJDIR)/$(ARCH)/%.pic.o: %.c
|
||||
$(CC) $(CFLAGS) $(INC) $(DEF_SO) -fPIC -o $@ -c $<
|
||||
|
||||
all: init $(ARNAME) $(SONAME)
|
||||
|
||||
init:
|
||||
if [ ! -d $(OBJDIR)/$(ARCH) ]; then mkdir -p $(OBJDIR)/$(ARCH); fi
|
||||
|
||||
$(ARNAME): $(OBJ)
|
||||
ar r $(OBJDIR)/$(ARCH)/$(ARNAME) $(OBJ)
|
||||
|
||||
$(SONAME): $(SONAME).$(MNGMAJ)
|
||||
ln -sf $(OBJDIR)/$(ARCH)/$(SONAME).$(MNGMAJ) $(OBJDIR)/$(ARCH)/$(SONAME)
|
||||
|
||||
$(SONAME).$(MNGMAJ): $(SONAME).$(MNGVER)
|
||||
ln -sf $(OBJDIR)/$(ARCH)/$(SONAME).$(MNGVER) $(OBJDIR)/$(ARCH)/$(SONAME).$(MNGMAJ)
|
||||
|
||||
$(SONAME).$(MNGVER): $(OBJ_SO)
|
||||
$(CC) -shared -Wl,-soname,$(SONAME).$(MNGMAJ) -o $(OBJDIR)/$(ARCH)/$(SONAME).$(MNGVER) $(OBJ_SO) \
|
||||
-lz -lm -ljpeg
|
||||
# -lz -lm -ljpeg -llcms
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(OBJ_SO)
|
||||
rm -f $(OBJDIR)/$(ARCH)/$(ARNAME) $(OBJDIR)/$(ARCH)/$(SONAME)*
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
libmng_hlapi.o libmng_hlapi.pic.o: libmng_hlapi.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_memory.h libmng_error.h libmng_trace.h libmng_read.h \
|
||||
libmng_write.h libmng_display.h libmng_zlib.h libmng_cms.h libmng_zlib.h
|
||||
libmng_callback_xs.o libmng_callback_xs.pic.o: libmng_callback_xs.c libmng.h \
|
||||
libmng_conf.h libmng_types.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_prop_xs.o libmng_prop_xs.pic.o: libmng_prop_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_error.h libmng_trace.h libmng_cms.h
|
||||
libmng_chunk_xs.o libmng_chunk_xs.pic.o: libmng_chunk_xs.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_read.o libmng_read.pic.o: libmng_read.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_prc.h libmng_chunk_io.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_read.h libmng_display.h
|
||||
libmng_write.o libmng_write.pic.o: libmng_write.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_write.h
|
||||
libmng_display.o libmng_display.pic.o: libmng_display.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_zlib.h libmng_cms.h libmng_pixels.h \
|
||||
libmng_display.h
|
||||
libmng_object_prc.o libmng_object_prc.pic.o: libmng_object_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h libmng_display.h libmng_pixels.h
|
||||
libmng_chunk_descr.o libmng_chunk_descr.pic.o: libmng_chunk_descr.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_descr.h libmng_memory.h \
|
||||
libmng_chunk_prc.h libmng_error.h libmng_trace.h
|
||||
libmng_chunk_prc.o libmng_chunk_prc.pic.o: libmng_chunk_prc.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_chunks.h libmng_chunk_prc.h libmng_memory.h \
|
||||
libmng_error.h libmng_trace.h
|
||||
libmng_chunk_io.o libmng_chunk_io.pic.o: libmng_chunk_io.c libmng.h libmng_conf.h \
|
||||
libmng_types.h libmng_data.h libmng_objects.h libmng_object_prc.h \
|
||||
libmng_chunks.h libmng_chunk_io.h libmng_chunk_prc.h libmng_memory.h libmng_error.h \
|
||||
libmng_trace.h libmng_display.h libmng_zlib.h libmng_pixels.h
|
||||
libmng_error.o libmng_error.pic.o: libmng_error.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_trace.o libmng_trace.pic.o: libmng_trace.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h
|
||||
libmng_pixels.o libmng_pixels.pic.o: libmng_pixels.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_memory.h libmng_error.h libmng_trace.h \
|
||||
libmng_cms.h libmng_filter.h libmng_pixels.h
|
||||
libmng_filter.o libmng_filter.pic.o: libmng_filter.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_filter.h
|
||||
libmng_dither.o libmng_dither.pic.o: libmng_dither.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_error.h libmng_trace.h libmng_dither.h
|
||||
libmng_zlib.o libmng_zlib.pic.o: libmng_zlib.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h \
|
||||
libmng_filter.h libmng_zlib.h
|
||||
libmng_jpeg.o libmng_jpeg.pic.o: libmng_jpeg.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_memory.h libmng_error.h libmng_trace.h libmng_pixels.h libmng_jpeg.h
|
||||
libmng_cms.o libmng_cms.pic.o: libmng_cms.c libmng.h libmng_conf.h libmng_types.h \
|
||||
libmng_data.h libmng_objects.h libmng_error.h libmng_trace.h libmng_cms.h
|
67
src/3rdparty/libmng/makefiles/makefile.unix
vendored
67
src/3rdparty/libmng/makefiles/makefile.unix
vendored
@ -1,67 +0,0 @@
|
||||
#
|
||||
# For conditions of distribution and use, see copyright notice in libmng.h
|
||||
#
|
||||
# makefile for libmng - THE MNG library
|
||||
# this makefile is suitable for generic unix
|
||||
|
||||
# Configuration options are now in libmng_conf.h
|
||||
|
||||
# The name of your C compiler:
|
||||
CC= cc
|
||||
|
||||
# Location of jpeg header files
|
||||
JPEG_INC= /cs/include/jpeg
|
||||
|
||||
# Location of zlib header files
|
||||
ZLIB_INC= /cs/include
|
||||
|
||||
# Location of lcms header files
|
||||
# (switch on MNG_FULL_CMS in libmng_conf.h if you want to use this)
|
||||
LCMS_INC= /ltmp/lcms-1.06/source
|
||||
|
||||
# compiler options:
|
||||
CFLAGS= -O -I. -I$(ZLIB_INC) -I$(JPEG_INC) -I$(LCMS_INC)
|
||||
|
||||
# source files
|
||||
SOURCES= \
|
||||
libmng_callback_xs.c \
|
||||
libmng_chunk_io.c \
|
||||
libmng_chunk_descr.c \
|
||||
libmng_chunk_prc.c \
|
||||
libmng_chunk_xs.c \
|
||||
libmng_cms.c \
|
||||
libmng_display.c \
|
||||
libmng_dither.c \
|
||||
libmng_error.c \
|
||||
libmng_filter.c \
|
||||
libmng_hlapi.c \
|
||||
libmng_jpeg.c \
|
||||
libmng_object_prc.c \
|
||||
libmng_pixels.c \
|
||||
libmng_prop_xs.c \
|
||||
libmng_read.c \
|
||||
libmng_trace.c \
|
||||
libmng_write.c \
|
||||
libmng_zlib.c
|
||||
|
||||
# object files
|
||||
OBJECTS= $(SOURCES:%.c=%.o)
|
||||
|
||||
# type dependancies
|
||||
.c.o:
|
||||
$(CC) $(CFLAGS) -c $<
|
||||
|
||||
all: libmng.a
|
||||
|
||||
clean:
|
||||
/bin/rm -f $(OBJECTS)
|
||||
/bin/rm -f libmng.a
|
||||
/bin/rm -f *~ core
|
||||
|
||||
libmng.a: $(OBJECTS)
|
||||
ar r libmng.a $(OBJECTS)
|
||||
|
||||
depend:
|
||||
makedepend -- $(CFLAGS) $(IFLAGS) -- *.c
|
||||
|
||||
# DO NOT DELETE
|
99
src/3rdparty/libmng/makefiles/makefile.vcwin32
vendored
99
src/3rdparty/libmng/makefiles/makefile.vcwin32
vendored
@ -1,99 +0,0 @@
|
||||
# makefile for libmng
|
||||
# Copyright (C) 2000 AM(s98t269@stmail.eng.kagawa-u.ac.jp)
|
||||
# For conditions of distribution and use, see copyright notice in libmng.h
|
||||
# Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib
|
||||
# Assumes that libjpeg.lib, *.h have been copied to ..\jpgsrc6b
|
||||
# Assumes that lcmsdll.lib and lcmsstat.lib have been copied to ..\lcms\lib\msvc
|
||||
# To use, do "nmake /f makefiles\makefile.vcwin32"
|
||||
|
||||
# -------- Microsoft Visual C++ 4.0 and later, no assembler code --------
|
||||
|
||||
CFLAGS= -Ox -GA3s -nologo -W3 -I..\zlib -I..\jpgsrc6b -I..\lcms\include
|
||||
|
||||
CC=cl
|
||||
LD=link
|
||||
LDFLAGS=
|
||||
O=.obj
|
||||
|
||||
#uncomment next to put error messages in a file
|
||||
#ERRFILE= >> mngerrs
|
||||
|
||||
# variables
|
||||
OBJS1 = libmng_callback_xs$(O) libmng_chunk_io$(O) libmng_chunk_prc$(O) libmng_chunk_descr$(0)
|
||||
OBJS2 = libmng_chunk_xs$(O) libmng_cms$(O) libmng_display$(O) libmng_dither$(O)
|
||||
OBJS3 = libmng_error$(O) libmng_filter$(O) libmng_hlapi$(O) libmng_jpeg$(O)
|
||||
OBJS4 = libmng_object_prc$(O) libmng_pixels$(O) libmng_prop_xs$(O)
|
||||
OBJS5 = libmng_read$(O) libmng_trace$(O) libmng_write$(O) libmng_zlib$(O)
|
||||
|
||||
all: libmng.lib
|
||||
|
||||
libmng_callback_xs$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_chunk_io$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_chunk_descr$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_chunk_prc$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_chunk_xs$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_cms$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_display$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_dither$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_error$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_filter$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_hlapi$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_jpeg$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_object_prc$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_pixels$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_prop_xs$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_read$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_trace$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_write$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng_zlib$(O): libmng.h libmng_data.h libmng_error.h libmng_trace.h
|
||||
$(CC) -c $(CFLAGS) $*.c $(ERRFILE)
|
||||
|
||||
libmng.lib: $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5)
|
||||
echo something to del > libmng.lib
|
||||
del libmng.lib
|
||||
lib /OUT:libmng.lib $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4) $(OBJS5)
|
||||
|
||||
mngtest.exe: mngtest.obj libmng.lib
|
||||
$(LD) $(LDFLAGS) mngtest.obj libmng.lib ..\zlib\zlib.lib /OUT:mngtest.exe /SUBSYSTEM:CONSOLE
|
||||
|
||||
test: mngtest.exe
|
||||
mngtest
|
||||
|
||||
# End of makefile for libmng
|
||||
|
50
src/3rdparty/libmng/unmaintained/autogen.sh
vendored
50
src/3rdparty/libmng/unmaintained/autogen.sh
vendored
@ -1,50 +0,0 @@
|
||||
# autogen.sh
|
||||
#
|
||||
# invoke the auto* tools to create the configureation system
|
||||
|
||||
# move out configure.in
|
||||
if ! test -f configure.in; then
|
||||
echo "copying configure.in"
|
||||
ln -s makefiles/configure.in .
|
||||
fi
|
||||
|
||||
# move out the macros and run aclocal
|
||||
if test ! -f acinclude.m4 -a -r makefiles/acinclude.m4; then
|
||||
echo "copying configure macros"
|
||||
ln -s makefiles/acinclude.m4 .
|
||||
fi
|
||||
|
||||
# copy up our Makefile template
|
||||
if ! test -f Makefile.am; then
|
||||
echo "copying automake template"
|
||||
ln -s makefiles/Makefile.am .
|
||||
fi
|
||||
|
||||
echo "running aclocal"
|
||||
aclocal
|
||||
|
||||
# libtool is named glibtool on MacOS X
|
||||
for LIBTOOLIZE in libtoolize glibtoolize nope; do
|
||||
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
|
||||
done
|
||||
if test x$LIBTOOLIZE = xnope; then
|
||||
echo "error: Could not find libtoolize in the path!"
|
||||
echo " You'll need to install a copy of libtool before continuing"
|
||||
echo " with the generation of the build system."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "running $LIBTOOLIZE"
|
||||
$LIBTOOLIZE --automake
|
||||
|
||||
echo "running automake"
|
||||
automake --foreign --add-missing
|
||||
|
||||
echo "building configure script"
|
||||
autoconf
|
||||
|
||||
# and finally invoke our new configure
|
||||
./configure $*
|
||||
|
||||
# end
|
@ -1,65 +0,0 @@
|
||||
--- libmng_data.h.orig 2007-04-20 10:41:58.000000000 +0200
|
||||
+++ libmng_data.h 2007-07-14 00:00:00.000000000 +0200
|
||||
@@ -658,6 +658,9 @@
|
||||
mng_int32 iFrameclipb;
|
||||
|
||||
mng_uint32 iNextdelay; /* delay *after* next image */
|
||||
+
|
||||
+ mng_bool bForcedelay;
|
||||
+ mng_uint32 iAccumdelay;
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_SHOW
|
||||
--- libmng_display.c.orig 2007-04-20 10:41:58.000000000 +0200
|
||||
+++ libmng_display.c 2007-07-14 00:00:00.000000000 +0200
|
||||
@@ -384,8 +384,9 @@
|
||||
|
||||
{
|
||||
#ifndef MNG_SKIPCHUNK_FRAM
|
||||
- if (pData->iFramedelay > 0) /* real delay ? */
|
||||
+ if (pData->iFramedelay > 0 || pData->bForcedelay) /* real delay ? */
|
||||
{ /* let the app refresh first ? */
|
||||
+ pData->bForcedelay = MNG_FALSE;
|
||||
if ((pData->bRunning) && (!pData->bSkipping) &&
|
||||
(pData->iUpdatetop < pData->iUpdatebottom) && (pData->iUpdateleft < pData->iUpdateright))
|
||||
if (!pData->fRefresh (((mng_handle)pData),
|
||||
@@ -455,6 +456,7 @@
|
||||
pData->iFrametime = pData->iFrametime + iWaitfor;
|
||||
/* setup for next delay */
|
||||
pData->iFramedelay = pData->iNextdelay;
|
||||
+ pData->iAccumdelay += pData->iFramedelay;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3340,6 +3342,9 @@
|
||||
MNG_TRACE (pData, MNG_FN_PROCESS_DISPLAY_MEND, MNG_LC_START);
|
||||
#endif
|
||||
|
||||
+ pData->bForcedelay = pData->iAccumdelay ? MNG_FALSE : MNG_TRUE;
|
||||
+ pData->iAccumdelay = 0;
|
||||
+
|
||||
#ifdef MNG_SUPPORT_DYNAMICMNG
|
||||
if (pData->bStopafterseek) /* need to stop after this ? */
|
||||
{
|
||||
--- libmng_hlapi.c.orig 2007-07-06 18:23:04.000000000 +0200
|
||||
+++ libmng_hlapi.c 2007-07-14 00:00:00.000000000 +0200
|
||||
@@ -446,6 +446,9 @@
|
||||
pData->iFrameclipb = 0;
|
||||
|
||||
pData->iNextdelay = 1;
|
||||
+
|
||||
+ pData->bForcedelay = MNG_FALSE;
|
||||
+ pData->iAccumdelay = 0;
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_SHOW
|
||||
@@ -1737,6 +1740,9 @@
|
||||
pData->iFrameclipb = 0;
|
||||
|
||||
pData->iNextdelay = 1;
|
||||
+
|
||||
+ pData->bForcedelay = MNG_FALSE;
|
||||
+ pData->iAccumdelay = 0;
|
||||
#endif
|
||||
|
||||
#ifndef MNG_SKIPCHUNK_SHOW
|
@ -67,7 +67,6 @@ SOURCES += \
|
||||
else:DEFINES *= QT_NO_IMAGEFORMAT_PNG
|
||||
|
||||
contains(QT_CONFIG, jpeg):include($$PWD/qjpeghandler.pri)
|
||||
contains(QT_CONFIG, mng):include($$PWD/qmnghandler.pri)
|
||||
contains(QT_CONFIG, tiff):include($$PWD/qtiffhandler.pri)
|
||||
contains(QT_CONFIG, gif):include($$PWD/qgifhandler.pri)
|
||||
|
||||
|
@ -144,9 +144,6 @@
|
||||
#ifndef QT_NO_IMAGEFORMAT_JPEG
|
||||
#include <private/qjpeghandler_p.h>
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_MNG
|
||||
#include <private/qmnghandler_p.h>
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_TIFF
|
||||
#include <private/qtiffhandler_p.h>
|
||||
#endif
|
||||
@ -168,9 +165,6 @@ enum _qt_BuiltInFormatType {
|
||||
#ifndef QT_NO_IMAGEFORMAT_JPEG
|
||||
_qt_JpgFormat,
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_MNG
|
||||
_qt_MngFormat,
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_TIFF
|
||||
_qt_TifFormat,
|
||||
#endif
|
||||
@ -206,9 +200,6 @@ static const _qt_BuiltInFormatStruct _qt_BuiltInFormats[] = {
|
||||
#ifndef QT_NO_IMAGEFORMAT_JPEG
|
||||
{_qt_JpgFormat, "jpg"},
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_MNG
|
||||
{_qt_MngFormat, "mng"},
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_TIFF
|
||||
{_qt_TifFormat, "tif"},
|
||||
#endif
|
||||
@ -344,10 +335,6 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
|
||||
} else if (testFormat == "jpg" || testFormat == "jpeg") {
|
||||
handler = new QJpegHandler;
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_MNG
|
||||
} else if (testFormat == "mng") {
|
||||
handler = new QMngHandler;
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_TIFF
|
||||
} else if (testFormat == "tif" || testFormat == "tiff") {
|
||||
handler = new QTiffHandler;
|
||||
@ -440,12 +427,6 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device,
|
||||
handler = new QJpegHandler;
|
||||
break;
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_MNG
|
||||
case _qt_MngFormat:
|
||||
if (QMngHandler::canRead(device))
|
||||
handler = new QMngHandler;
|
||||
break;
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_TIFF
|
||||
case _qt_TifFormat:
|
||||
if (QTiffHandler::canRead(device))
|
||||
@ -1466,7 +1447,6 @@ QByteArray QImageReader::imageFormat(QIODevice *device)
|
||||
\row \o GIF \o Graphic Interchange Format (optional)
|
||||
\row \o JPG \o Joint Photographic Experts Group
|
||||
\row \o JPEG \o Joint Photographic Experts Group
|
||||
\row \o MNG \o Multiple-image Network Graphics
|
||||
\row \o PNG \o Portable Network Graphics
|
||||
\row \o PBM \o Portable Bitmap
|
||||
\row \o PGM \o Portable Graymap
|
||||
|
@ -117,9 +117,6 @@
|
||||
#ifndef QT_NO_IMAGEFORMAT_JPEG
|
||||
#include <private/qjpeghandler_p.h>
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_MNG
|
||||
#include <private/qmnghandler_p.h>
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_TIFF
|
||||
#include <private/qtiffhandler_p.h>
|
||||
#endif
|
||||
@ -186,10 +183,6 @@ static QImageIOHandler *createWriteHandlerHelper(QIODevice *device,
|
||||
} else if (testFormat == "jpg" || testFormat == "jpeg") {
|
||||
handler = new QJpegHandler;
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_MNG
|
||||
} else if (testFormat == "mng") {
|
||||
handler = new QMngHandler;
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_TIFF
|
||||
} else if (testFormat == "tif" || testFormat == "tiff") {
|
||||
handler = new QTiffHandler;
|
||||
@ -705,9 +698,6 @@ QList<QByteArray> QImageWriter::supportedImageFormats()
|
||||
#ifndef QT_NO_IMAGEFORMAT_JPEG
|
||||
formats << "jpg" << "jpeg";
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_MNG
|
||||
formats << "mng";
|
||||
#endif
|
||||
#ifndef QT_NO_IMAGEFORMAT_TIFF
|
||||
formats << "tif" << "tiff";
|
||||
#endif
|
||||
|
@ -1,497 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU Lesser
|
||||
** General Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License version 3.0 as published by the Free Software Foundation
|
||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU General
|
||||
** Public License version 3.0 requirements will be met:
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "qmnghandler_p.h"
|
||||
|
||||
#include "qimage.h"
|
||||
#include "qvariant.h"
|
||||
#include "qcolor.h"
|
||||
|
||||
#define MNG_USE_SO
|
||||
#include <libmng.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QMngHandlerPrivate
|
||||
{
|
||||
Q_DECLARE_PUBLIC(QMngHandler)
|
||||
public:
|
||||
bool haveReadNone;
|
||||
bool haveReadAll;
|
||||
mng_handle hMNG;
|
||||
QImage image;
|
||||
int elapsed;
|
||||
int nextDelay;
|
||||
int iterCount;
|
||||
int frameIndex;
|
||||
int nextIndex;
|
||||
int frameCount;
|
||||
mng_uint32 iStyle;
|
||||
mng_bool readData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead);
|
||||
mng_bool writeData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten);
|
||||
mng_bool processHeader(mng_uint32 iWidth, mng_uint32 iHeight);
|
||||
QMngHandlerPrivate(QMngHandler *q_ptr);
|
||||
~QMngHandlerPrivate();
|
||||
bool getNextImage(QImage *result);
|
||||
bool writeImage(const QImage &image);
|
||||
int currentImageNumber() const;
|
||||
int imageCount() const;
|
||||
bool jumpToImage(int imageNumber);
|
||||
bool jumpToNextImage();
|
||||
int nextImageDelay() const;
|
||||
bool setBackgroundColor(const QColor &color);
|
||||
QColor backgroundColor() const;
|
||||
QMngHandler *q_ptr;
|
||||
};
|
||||
|
||||
static mng_bool myerror(mng_handle /*hMNG*/,
|
||||
mng_int32 iErrorcode,
|
||||
mng_int8 /*iSeverity*/,
|
||||
mng_chunkid iChunkname,
|
||||
mng_uint32 /*iChunkseq*/,
|
||||
mng_int32 iExtra1,
|
||||
mng_int32 iExtra2,
|
||||
mng_pchar zErrortext)
|
||||
{
|
||||
qWarning("MNG error %d: %s; chunk %c%c%c%c; subcode %d:%d",
|
||||
iErrorcode,zErrortext,
|
||||
(iChunkname>>24)&0xff,
|
||||
(iChunkname>>16)&0xff,
|
||||
(iChunkname>>8)&0xff,
|
||||
(iChunkname>>0)&0xff,
|
||||
iExtra1,iExtra2);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static mng_ptr myalloc(mng_size_t iSize)
|
||||
{
|
||||
#if defined(Q_OS_WINCE)
|
||||
mng_ptr ptr = malloc(iSize);
|
||||
memset(ptr, 0, iSize);
|
||||
return ptr;
|
||||
#else
|
||||
return (mng_ptr)calloc(1, iSize);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void myfree(mng_ptr pPtr, mng_size_t /*iSize*/)
|
||||
{
|
||||
free(pPtr);
|
||||
}
|
||||
|
||||
static mng_bool myopenstream(mng_handle)
|
||||
{
|
||||
return MNG_TRUE;
|
||||
}
|
||||
|
||||
static mng_bool myclosestream(mng_handle hMNG)
|
||||
{
|
||||
QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
|
||||
pMydata->haveReadAll = true;
|
||||
return MNG_TRUE;
|
||||
}
|
||||
|
||||
static mng_bool myreaddata(mng_handle hMNG,
|
||||
mng_ptr pBuf,
|
||||
mng_uint32 iSize,
|
||||
mng_uint32p pRead)
|
||||
{
|
||||
QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
|
||||
return pMydata->readData(pBuf, iSize, pRead);
|
||||
}
|
||||
|
||||
static mng_bool mywritedata(mng_handle hMNG,
|
||||
mng_ptr pBuf,
|
||||
mng_uint32 iSize,
|
||||
mng_uint32p pWritten)
|
||||
{
|
||||
QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
|
||||
return pMydata->writeData(pBuf, iSize, pWritten);
|
||||
}
|
||||
|
||||
static mng_bool myprocessheader(mng_handle hMNG,
|
||||
mng_uint32 iWidth,
|
||||
mng_uint32 iHeight)
|
||||
{
|
||||
QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
|
||||
return pMydata->processHeader(iWidth, iHeight);
|
||||
}
|
||||
|
||||
static mng_ptr mygetcanvasline(mng_handle hMNG,
|
||||
mng_uint32 iLinenr)
|
||||
{
|
||||
QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
|
||||
return (mng_ptr)pMydata->image.scanLine(iLinenr);
|
||||
}
|
||||
|
||||
static mng_bool myrefresh(mng_handle /*hMNG*/,
|
||||
mng_uint32 /*iX*/,
|
||||
mng_uint32 /*iY*/,
|
||||
mng_uint32 /*iWidth*/,
|
||||
mng_uint32 /*iHeight*/)
|
||||
{
|
||||
return MNG_TRUE;
|
||||
}
|
||||
|
||||
static mng_uint32 mygettickcount(mng_handle hMNG)
|
||||
{
|
||||
QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
|
||||
return pMydata->elapsed++;
|
||||
}
|
||||
|
||||
static mng_bool mysettimer(mng_handle hMNG,
|
||||
mng_uint32 iMsecs)
|
||||
{
|
||||
QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
|
||||
pMydata->elapsed += iMsecs;
|
||||
pMydata->nextDelay = iMsecs;
|
||||
return MNG_TRUE;
|
||||
}
|
||||
|
||||
static mng_bool myprocessterm(mng_handle hMNG,
|
||||
mng_uint8 iTermaction,
|
||||
mng_uint8 /*iIteraction*/,
|
||||
mng_uint32 /*iDelay*/,
|
||||
mng_uint32 iItermax)
|
||||
{
|
||||
QMngHandlerPrivate *pMydata = reinterpret_cast<QMngHandlerPrivate *>(mng_get_userdata(hMNG));
|
||||
if (iTermaction == 3)
|
||||
pMydata->iterCount = iItermax;
|
||||
return MNG_TRUE;
|
||||
}
|
||||
|
||||
static mng_bool mytrace(mng_handle,
|
||||
mng_int32 iFuncnr,
|
||||
mng_int32 iFuncseq,
|
||||
mng_pchar zFuncname)
|
||||
{
|
||||
qDebug("mng trace: iFuncnr: %d iFuncseq: %d zFuncname: %s", iFuncnr, iFuncseq, zFuncname);
|
||||
return MNG_TRUE;
|
||||
}
|
||||
|
||||
QMngHandlerPrivate::QMngHandlerPrivate(QMngHandler *q_ptr)
|
||||
: haveReadNone(true), haveReadAll(false), elapsed(0), nextDelay(0), iterCount(1),
|
||||
frameIndex(-1), nextIndex(0), frameCount(0), q_ptr(q_ptr)
|
||||
{
|
||||
iStyle = (QSysInfo::ByteOrder == QSysInfo::LittleEndian) ? MNG_CANVAS_BGRA8 : MNG_CANVAS_ARGB8;
|
||||
// Initialize libmng
|
||||
hMNG = mng_initialize((mng_ptr)this, myalloc, myfree, mytrace);
|
||||
if (hMNG) {
|
||||
// Set callback functions
|
||||
mng_setcb_errorproc(hMNG, myerror);
|
||||
mng_setcb_openstream(hMNG, myopenstream);
|
||||
mng_setcb_closestream(hMNG, myclosestream);
|
||||
mng_setcb_readdata(hMNG, myreaddata);
|
||||
mng_setcb_writedata(hMNG, mywritedata);
|
||||
mng_setcb_processheader(hMNG, myprocessheader);
|
||||
mng_setcb_getcanvasline(hMNG, mygetcanvasline);
|
||||
mng_setcb_refresh(hMNG, myrefresh);
|
||||
mng_setcb_gettickcount(hMNG, mygettickcount);
|
||||
mng_setcb_settimer(hMNG, mysettimer);
|
||||
mng_setcb_processterm(hMNG, myprocessterm);
|
||||
mng_set_doprogressive(hMNG, MNG_FALSE);
|
||||
mng_set_suspensionmode(hMNG, MNG_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
QMngHandlerPrivate::~QMngHandlerPrivate()
|
||||
{
|
||||
mng_cleanup(&hMNG);
|
||||
}
|
||||
|
||||
mng_bool QMngHandlerPrivate::readData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pRead)
|
||||
{
|
||||
Q_Q(QMngHandler);
|
||||
*pRead = q->device()->read((char *)pBuf, iSize);
|
||||
return (*pRead > 0) ? MNG_TRUE : MNG_FALSE;
|
||||
}
|
||||
|
||||
mng_bool QMngHandlerPrivate::writeData(mng_ptr pBuf, mng_uint32 iSize, mng_uint32p pWritten)
|
||||
{
|
||||
Q_Q(QMngHandler);
|
||||
*pWritten = q->device()->write((char *)pBuf, iSize);
|
||||
return MNG_TRUE;
|
||||
}
|
||||
|
||||
mng_bool QMngHandlerPrivate::processHeader(mng_uint32 iWidth, mng_uint32 iHeight)
|
||||
{
|
||||
if (mng_set_canvasstyle(hMNG, iStyle) != MNG_NOERROR)
|
||||
return MNG_FALSE;
|
||||
image = QImage(iWidth, iHeight, QImage::Format_ARGB32);
|
||||
image.fill(0);
|
||||
return MNG_TRUE;
|
||||
}
|
||||
|
||||
bool QMngHandlerPrivate::getNextImage(QImage *result)
|
||||
{
|
||||
mng_retcode ret;
|
||||
if (haveReadNone) {
|
||||
haveReadNone = false;
|
||||
ret = mng_readdisplay(hMNG);
|
||||
} else {
|
||||
ret = mng_display_resume(hMNG);
|
||||
}
|
||||
if ((MNG_NOERROR == ret) || (MNG_NEEDTIMERWAIT == ret)) {
|
||||
*result = image;
|
||||
frameIndex = nextIndex++;
|
||||
if (haveReadAll && (frameCount == 0))
|
||||
frameCount = nextIndex;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QMngHandlerPrivate::writeImage(const QImage &image)
|
||||
{
|
||||
mng_reset(hMNG);
|
||||
if (mng_create(hMNG) != MNG_NOERROR)
|
||||
return false;
|
||||
|
||||
this->image = image.convertToFormat(QImage::Format_ARGB32);
|
||||
int w = image.width();
|
||||
int h = image.height();
|
||||
|
||||
if (
|
||||
// width, height, ticks, layercount, framecount, playtime, simplicity
|
||||
(mng_putchunk_mhdr(hMNG, w, h, 1000, 0, 0, 0, 7) == MNG_NOERROR) &&
|
||||
// termination_action, action_after_iterations, delay, iteration_max
|
||||
(mng_putchunk_term(hMNG, 3, 0, 1, 0x7FFFFFFF) == MNG_NOERROR) &&
|
||||
// width, height, bitdepth, colortype, compression, filter, interlace
|
||||
(mng_putchunk_ihdr(hMNG, w, h, 8, 6, 0, 0, 0) == MNG_NOERROR) &&
|
||||
// width, height, colortype, bitdepth, compression, filter, interlace, canvasstyle, getcanvasline
|
||||
(mng_putimgdata_ihdr(hMNG, w, h, 6, 8, 0, 0, 0, iStyle, mygetcanvasline) == MNG_NOERROR) &&
|
||||
(mng_putchunk_iend(hMNG) == MNG_NOERROR) &&
|
||||
(mng_putchunk_mend(hMNG) == MNG_NOERROR) &&
|
||||
(mng_write(hMNG) == MNG_NOERROR)
|
||||
)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
int QMngHandlerPrivate::currentImageNumber() const
|
||||
{
|
||||
// return mng_get_currentframe(hMNG) % imageCount(); not implemented, apparently
|
||||
return frameIndex;
|
||||
}
|
||||
|
||||
int QMngHandlerPrivate::imageCount() const
|
||||
{
|
||||
// return mng_get_totalframes(hMNG); not implemented, apparently
|
||||
if (haveReadAll)
|
||||
return frameCount;
|
||||
return 0; // Don't know
|
||||
}
|
||||
|
||||
bool QMngHandlerPrivate::jumpToImage(int imageNumber)
|
||||
{
|
||||
if (imageNumber == nextIndex)
|
||||
return true;
|
||||
|
||||
if ((imageNumber == 0) && haveReadAll && (nextIndex == frameCount)) {
|
||||
// Loop!
|
||||
nextIndex = 0;
|
||||
return true;
|
||||
}
|
||||
if (mng_display_freeze(hMNG) == MNG_NOERROR) {
|
||||
if (mng_display_goframe(hMNG, imageNumber) == MNG_NOERROR) {
|
||||
nextIndex = imageNumber;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool QMngHandlerPrivate::jumpToNextImage()
|
||||
{
|
||||
return jumpToImage((currentImageNumber()+1) % imageCount());
|
||||
}
|
||||
|
||||
int QMngHandlerPrivate::nextImageDelay() const
|
||||
{
|
||||
return nextDelay;
|
||||
}
|
||||
|
||||
bool QMngHandlerPrivate::setBackgroundColor(const QColor &color)
|
||||
{
|
||||
mng_uint16 iRed = (mng_uint16)(color.red() << 8);
|
||||
mng_uint16 iBlue = (mng_uint16)(color.blue() << 8);
|
||||
mng_uint16 iGreen = (mng_uint16)(color.green() << 8);
|
||||
return (mng_set_bgcolor(hMNG, iRed, iBlue, iGreen) == MNG_NOERROR);
|
||||
}
|
||||
|
||||
QColor QMngHandlerPrivate::backgroundColor() const
|
||||
{
|
||||
mng_uint16 iRed;
|
||||
mng_uint16 iBlue;
|
||||
mng_uint16 iGreen;
|
||||
if (mng_get_bgcolor(hMNG, &iRed, &iBlue, &iGreen) == MNG_NOERROR)
|
||||
return QColor((iRed >> 8) & 0xFF, (iGreen >> 8) & 0xFF, (iBlue >> 8) & 0xFF);
|
||||
return QColor();
|
||||
}
|
||||
|
||||
QMngHandler::QMngHandler()
|
||||
: d_ptr(new QMngHandlerPrivate(this))
|
||||
{
|
||||
}
|
||||
|
||||
QMngHandler::~QMngHandler()
|
||||
{
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
bool QMngHandler::canRead() const
|
||||
{
|
||||
Q_D(const QMngHandler);
|
||||
if ((!d->haveReadNone
|
||||
&& (!d->haveReadAll || (d->haveReadAll && (d->nextIndex < d->frameCount))))
|
||||
|| canRead(device()))
|
||||
{
|
||||
setFormat("mng");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*! \internal */
|
||||
bool QMngHandler::canRead(QIODevice *device)
|
||||
{
|
||||
if (!device) {
|
||||
qWarning("QMngHandler::canRead() called with no device");
|
||||
return false;
|
||||
}
|
||||
|
||||
return device->peek(8) == "\x8A\x4D\x4E\x47\x0D\x0A\x1A\x0A";
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
QByteArray QMngHandler::name() const
|
||||
{
|
||||
return "mng";
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
bool QMngHandler::read(QImage *image)
|
||||
{
|
||||
Q_D(QMngHandler);
|
||||
return canRead() ? d->getNextImage(image) : false;
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
bool QMngHandler::write(const QImage &image)
|
||||
{
|
||||
Q_D(QMngHandler);
|
||||
return d->writeImage(image);
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
int QMngHandler::currentImageNumber() const
|
||||
{
|
||||
Q_D(const QMngHandler);
|
||||
return d->currentImageNumber();
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
int QMngHandler::imageCount() const
|
||||
{
|
||||
Q_D(const QMngHandler);
|
||||
return d->imageCount();
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
bool QMngHandler::jumpToImage(int imageNumber)
|
||||
{
|
||||
Q_D(QMngHandler);
|
||||
return d->jumpToImage(imageNumber);
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
bool QMngHandler::jumpToNextImage()
|
||||
{
|
||||
Q_D(QMngHandler);
|
||||
return d->jumpToNextImage();
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
int QMngHandler::loopCount() const
|
||||
{
|
||||
Q_D(const QMngHandler);
|
||||
if (d->iterCount == 0x7FFFFFFF)
|
||||
return -1; // infinite loop
|
||||
return d->iterCount-1;
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
int QMngHandler::nextImageDelay() const
|
||||
{
|
||||
Q_D(const QMngHandler);
|
||||
return d->nextImageDelay();
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
QVariant QMngHandler::option(ImageOption option) const
|
||||
{
|
||||
Q_D(const QMngHandler);
|
||||
if (option == QImageIOHandler::Animation)
|
||||
return true;
|
||||
else if (option == QImageIOHandler::BackgroundColor)
|
||||
return d->backgroundColor();
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
void QMngHandler::setOption(ImageOption option, const QVariant & value)
|
||||
{
|
||||
Q_D(QMngHandler);
|
||||
if (option == QImageIOHandler::BackgroundColor)
|
||||
d->setBackgroundColor(qvariant_cast<QColor>(value));
|
||||
}
|
||||
|
||||
/*! \reimp */
|
||||
bool QMngHandler::supportsOption(ImageOption option) const
|
||||
{
|
||||
if (option == QImageIOHandler::Animation)
|
||||
return true;
|
||||
else if (option == QImageIOHandler::BackgroundColor)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
QT_END_NAMESPACE
|
@ -1,10 +0,0 @@
|
||||
# common to plugin and built-in forms
|
||||
INCLUDEPATH *= $$PWD
|
||||
HEADERS += $$PWD/qmnghandler_p.h
|
||||
SOURCES += $$PWD/qmnghandler.cpp
|
||||
contains(QT_CONFIG, system-mng) {
|
||||
if(unix|win32-g++*):LIBS += -lmng
|
||||
else:win32: LIBS += libmng.lib
|
||||
} else {
|
||||
include($$PWD/../../3rdparty/libmng.pri)
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU Lesser
|
||||
** General Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License version 3.0 as published by the Free Software Foundation
|
||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU General
|
||||
** Public License version 3.0 requirements will be met:
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QMNGHANDLER_P_H
|
||||
#define QMNGHANDLER_P_H
|
||||
|
||||
#include <QtCore/qscopedpointer.h>
|
||||
#include <QtGui/qimageiohandler.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QImage;
|
||||
class QByteArray;
|
||||
class QIODevice;
|
||||
class QVariant;
|
||||
class QMngHandlerPrivate;
|
||||
|
||||
class QMngHandler : public QImageIOHandler
|
||||
{
|
||||
public:
|
||||
QMngHandler();
|
||||
~QMngHandler();
|
||||
virtual bool canRead() const;
|
||||
virtual QByteArray name() const;
|
||||
virtual bool read(QImage *image);
|
||||
virtual bool write(const QImage &image);
|
||||
virtual int currentImageNumber() const;
|
||||
virtual int imageCount() const;
|
||||
virtual bool jumpToImage(int imageNumber);
|
||||
virtual bool jumpToNextImage();
|
||||
virtual int loopCount() const;
|
||||
virtual int nextImageDelay() const;
|
||||
static bool canRead(QIODevice *device);
|
||||
virtual QVariant option(ImageOption option) const;
|
||||
virtual void setOption(ImageOption option, const QVariant & value);
|
||||
virtual bool supportsOption(ImageOption option) const;
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE(QMngHandler)
|
||||
QScopedPointer<QMngHandlerPrivate> d_ptr;
|
||||
};
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QMNGHANDLER_P_H
|
@ -2,6 +2,5 @@ TEMPLATE = subdirs
|
||||
|
||||
!contains(QT_CONFIG, no-jpeg):!contains(QT_CONFIG, jpeg):SUBDIRS += jpeg
|
||||
!contains(QT_CONFIG, no-gif):!contains(QT_CONFIG, gif):SUBDIRS += gif
|
||||
!contains(QT_CONFIG, no-mng):!contains(QT_CONFIG, mng):SUBDIRS += mng
|
||||
!contains(QT_CONFIG, no-tiff):!contains(QT_CONFIG, tiff):SUBDIRS += tiff
|
||||
!contains(QT_CONFIG, no-ico):SUBDIRS += ico
|
||||
|
@ -1,98 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||
** All rights reserved.
|
||||
** Contact: http://www.qt-project.org/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser General Public
|
||||
** License version 2.1 as published by the Free Software Foundation and
|
||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU Lesser
|
||||
** General Public License version 2.1 requirements will be met:
|
||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** In addition, as a special exception, Nokia gives you certain additional
|
||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU General
|
||||
** Public License version 3.0 as published by the Free Software Foundation
|
||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||
** file. Please review the following information to ensure the GNU General
|
||||
** Public License version 3.0 requirements will be met:
|
||||
** http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** Other Usage
|
||||
** Alternatively, this file may be used in accordance with the terms and
|
||||
** conditions contained in a signed written agreement between you and Nokia.
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <qimageiohandler.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
#ifndef QT_NO_IMAGEFORMATPLUGIN
|
||||
|
||||
#ifdef QT_NO_IMAGEFORMAT_MNG
|
||||
#undef QT_NO_IMAGEFORMAT_MNG
|
||||
#endif
|
||||
#include <qmnghandler_p.h>
|
||||
|
||||
#include <qiodevice.h>
|
||||
#include <qbytearray.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class QMngPlugin : public QImageIOPlugin
|
||||
{
|
||||
public:
|
||||
QStringList keys() const;
|
||||
Capabilities capabilities(QIODevice *device, const QByteArray &format) const;
|
||||
QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const;
|
||||
};
|
||||
|
||||
QStringList QMngPlugin::keys() const
|
||||
{
|
||||
return QStringList() << QLatin1String("mng");
|
||||
}
|
||||
|
||||
QImageIOPlugin::Capabilities QMngPlugin::capabilities(QIODevice *device, const QByteArray &format) const
|
||||
{
|
||||
if (format == "mng")
|
||||
return Capabilities(CanRead);
|
||||
if (!format.isEmpty())
|
||||
return 0;
|
||||
if (!device->isOpen())
|
||||
return 0;
|
||||
|
||||
Capabilities cap;
|
||||
if (device->isReadable() && QMngHandler::canRead(device))
|
||||
cap |= CanRead;
|
||||
return cap;
|
||||
}
|
||||
|
||||
QImageIOHandler *QMngPlugin::create(QIODevice *device, const QByteArray &format) const
|
||||
{
|
||||
QMngHandler *hand = new QMngHandler();
|
||||
hand->setDevice(device);
|
||||
hand->setFormat(format);
|
||||
return hand;
|
||||
}
|
||||
|
||||
Q_EXPORT_STATIC_PLUGIN(QMngPlugin)
|
||||
Q_EXPORT_PLUGIN2(qmng, QMngPlugin)
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // !QT_NO_IMAGEFORMATPLUGIN
|
@ -1,11 +0,0 @@
|
||||
TARGET = qmng
|
||||
load(qt_plugin)
|
||||
|
||||
QTDIR_build:REQUIRES = "!contains(QT_CONFIG, no-mng)"
|
||||
|
||||
include(../../../gui/image/qmnghandler.pri)
|
||||
SOURCES += main.cpp
|
||||
|
||||
DESTDIR = $$QT.gui.plugins/imageformats
|
||||
target.path += $$[QT_INSTALL_PLUGINS]/imageformats
|
||||
INSTALLS += target
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -6,7 +6,6 @@
|
||||
<file>images/YCbCr_cmyk.png</file>
|
||||
<file>images/YCbCr_rgb.jpg</file>
|
||||
<file>images/away.png</file>
|
||||
<file>images/ball.mng</file>
|
||||
<file>images/bat1.gif</file>
|
||||
<file>images/bat2.gif</file>
|
||||
<file>images/beavis.jpg</file>
|
||||
@ -18,12 +17,10 @@
|
||||
<file>images/corrupt.bmp</file>
|
||||
<file>images/corrupt.gif</file>
|
||||
<file>images/corrupt.jpg</file>
|
||||
<file>images/corrupt.mng</file>
|
||||
<file>images/corrupt.png</file>
|
||||
<file>images/corrupt.xbm</file>
|
||||
<file>images/crash-signed-char.bmp</file>
|
||||
<file>images/earth.gif</file>
|
||||
<file>images/fire.mng</file>
|
||||
<file>images/font.bmp</file>
|
||||
<file>images/gnus.xbm</file>
|
||||
<file>images/image.pbm</file>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user