зеркало из https://github.com/mozilla/pjs.git
Snapshot v0.5.2 of libmng (http://www.libmng.com/).
Not in default build. a=brendan
This commit is contained in:
Родитель
3485ce173b
Коммит
c96c134058
|
@ -0,0 +1,7 @@
|
|||
#
|
||||
# This is a list of local files which get copied to the mozilla:dist directory
|
||||
#
|
||||
|
||||
libmng.h
|
||||
mng_conf.h
|
||||
mng_types.h
|
|
@ -0,0 +1,63 @@
|
|||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = mng
|
||||
LIBRARY_NAME = mng
|
||||
|
||||
CSRCS = \
|
||||
mng_callback_xs.c \
|
||||
mng_chunk_io.c \
|
||||
mng_chunk_prc.c \
|
||||
mng_chunk_xs.c \
|
||||
mng_cms.c \
|
||||
mng_display.c \
|
||||
mng_dither.c \
|
||||
mng_error.c \
|
||||
mng_filter.c \
|
||||
mng_hlapi.c \
|
||||
mng_jpeg.c \
|
||||
mng_object_prc.c \
|
||||
mng_pixels.c \
|
||||
mng_prop_xs.c \
|
||||
mng_read.c \
|
||||
mng_trace.c \
|
||||
mng_write.c \
|
||||
mng_zlib.c \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = libmng.h mng_conf.h mng_types.h
|
||||
|
||||
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))
|
||||
|
||||
LOCAL_INCLUDES = -I$(srcdir)
|
||||
|
||||
override NO_SHARED_LIB=1
|
||||
override NO_STATIC_LIB=
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,57 @@
|
|||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * COPYRIGHT NOTICE: * */
|
||||
/* * * */
|
||||
/* * Copyright (c) 2000 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 * */
|
||||
/* * (hopefully some more to come...) * */
|
||||
/* * * */
|
||||
/* * 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) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,93 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public
|
||||
# License Version 1.1 (the "License"); you may not use this file
|
||||
# except in compliance with the License. You may obtain a copy of
|
||||
# the License at http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS
|
||||
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
# implied. See the License for the specific language governing
|
||||
# rights and limitations under the License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1998 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
|
||||
|
||||
#
|
||||
|
||||
#-----------------------------------------
|
||||
# makefile to build libpng.lib for wintel
|
||||
#-----------------------------------------
|
||||
|
||||
MAKE_OBJ_TYPE=LIB
|
||||
|
||||
!ifdef BUILD_DEBUG_GC
|
||||
LCFLAGS = $(LCFLAGS) -DDEBUG_GC
|
||||
!endif
|
||||
|
||||
EXPORTS = libmng.h mng_conf.h mng_types.h
|
||||
|
||||
MODULE=mng
|
||||
DEPTH=..\..\..
|
||||
LOCAL_INCLUDES=-I.
|
||||
LIBRARY_NAME=mng
|
||||
CSRCS=\
|
||||
mng_callback_xs.c \
|
||||
mng_chunk_io.c \
|
||||
mng_chunk_prc.c \
|
||||
mng_chunk_xs.c \
|
||||
mng_cms.c \
|
||||
mng_display.c \
|
||||
mng_dither.c \
|
||||
mng_error.c \
|
||||
mng_filter.c \
|
||||
mng_hlapi.c \
|
||||
mng_jpeg.c \
|
||||
mng_object_prc.c \
|
||||
mng_pixels.c \
|
||||
mng_prop_xs.c \
|
||||
mng_read.c \
|
||||
mng_trace.c \
|
||||
mng_write.c \
|
||||
mng_zlib.c \
|
||||
$(NULL)
|
||||
REQUIRES=util nspr zlib jpeg
|
||||
C_OBJS=\
|
||||
.\$(OBJDIR)\mng_callback_xs.c \
|
||||
.\$(OBJDIR)\mng_chunk_io.c \
|
||||
.\$(OBJDIR)\mng_chunk_prc.c \
|
||||
.\$(OBJDIR)\mng_chunk_xs.c \
|
||||
.\$(OBJDIR)\mng_cms.c \
|
||||
.\$(OBJDIR)\mng_display.c \
|
||||
.\$(OBJDIR)\mng_dither.c \
|
||||
.\$(OBJDIR)\mng_error.c \
|
||||
.\$(OBJDIR)\mng_filter.c \
|
||||
.\$(OBJDIR)\mng_hlapi.c \
|
||||
.\$(OBJDIR)\mng_jpeg.c \
|
||||
.\$(OBJDIR)\mng_object_prc.c \
|
||||
.\$(OBJDIR)\mng_pixels.c \
|
||||
.\$(OBJDIR)\mng_prop_xs.c \
|
||||
.\$(OBJDIR)\mng_read.c \
|
||||
.\$(OBJDIR)\mng_trace.c \
|
||||
.\$(OBJDIR)\mng_write.c \
|
||||
.\$(OBJDIR)\mng_zlib.c \
|
||||
$(NULL)
|
||||
!if "$(MOZ_BITS)" != "16"
|
||||
LINCS=-I$(XPDIST)\public\util -I$(XPDIST)\public\nspr \
|
||||
-I$(XPDIST)\public\zlib -I$(XPDIST)\public\jpeg
|
||||
!endif
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
#export:: $(LIBRARY)
|
||||
install:: $(LIBRARY)
|
||||
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib\
|
||||
|
||||
#install:: export
|
|
@ -0,0 +1,890 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_callback_xs.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : callback get/set interface (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the callback get/set functions * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - fixed calling convention * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/12/2000 - G.Juyn * */
|
||||
/* * - changed trace to macro for callback error-reporting * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/31/2000 - G.Juyn * */
|
||||
/* * - fixed up punctuation (contribution by Tim Rowley) * */
|
||||
/* * 0.5.2 - 06/02/2000 - G.Juyn * */
|
||||
/* * - added getalphaline callback for RGB8_A8 canvasstyle * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Callback set functions * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_INTERNAL_MEMMNGMT
|
||||
mng_retcode MNG_DECL mng_setcb_memalloc (mng_handle hHandle,
|
||||
mng_memalloc fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_MEMALLOC, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fMemalloc = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_MEMALLOC, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_INTERNAL_MEMMNGMT */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_INTERNAL_MEMMNGMT
|
||||
mng_retcode MNG_DECL mng_setcb_memfree (mng_handle hHandle,
|
||||
mng_memfree fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_MEMFREE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fMemfree = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_MEMFREE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_INTERNAL_MEMMNGMT */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)
|
||||
mng_retcode MNG_DECL mng_setcb_openstream (mng_handle hHandle,
|
||||
mng_openstream fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_OPENSTREAM, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fOpenstream = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_OPENSTREAM, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ || MNG_SUPPORT_WRITE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)
|
||||
mng_retcode MNG_DECL mng_setcb_closestream (mng_handle hHandle,
|
||||
mng_closestream fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_CLOSESTREAM, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fClosestream = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_CLOSESTREAM, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ || MNG_SUPPORT_WRITE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_READ
|
||||
mng_retcode MNG_DECL mng_setcb_readdata (mng_handle hHandle,
|
||||
mng_readdata fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_READDATA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fReaddata = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_READDATA, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_WRITE
|
||||
mng_retcode MNG_DECL mng_setcb_writedata (mng_handle hHandle,
|
||||
mng_writedata fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_WRITEDATA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fWritedata = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_WRITEDATA, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_WRITE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode MNG_DECL mng_setcb_errorproc (mng_handle hHandle,
|
||||
mng_errorproc fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_ERRORPROC, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fErrorproc = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_ERRORPROC, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
mng_retcode MNG_DECL mng_setcb_traceproc (mng_handle hHandle,
|
||||
mng_traceproc fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_TRACEPROC, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fTraceproc = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_TRACEPROC, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_TRACE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_READ
|
||||
mng_retcode MNG_DECL mng_setcb_processheader (mng_handle hHandle,
|
||||
mng_processheader fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSHEADER, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fProcessheader = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSHEADER, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_READ
|
||||
mng_retcode MNG_DECL mng_setcb_processtext (mng_handle hHandle,
|
||||
mng_processtext fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSTEXT, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fProcesstext = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSTEXT, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_retcode MNG_DECL mng_setcb_getcanvasline (mng_handle hHandle,
|
||||
mng_getcanvasline fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_GETCANVASLINE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fGetcanvasline = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_GETCANVASLINE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_retcode MNG_DECL mng_setcb_getbkgdline (mng_handle hHandle,
|
||||
mng_getbkgdline fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_GETBKGDLINE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fGetbkgdline = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_GETBKGDLINE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_retcode MNG_DECL mng_setcb_getalphaline (mng_handle hHandle,
|
||||
mng_getalphaline fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_GETALPHALINE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fGetalphaline = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_GETALPHALINE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_retcode MNG_DECL mng_setcb_refresh (mng_handle hHandle,
|
||||
mng_refresh fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_REFRESH, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fRefresh = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_REFRESH, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_retcode MNG_DECL mng_setcb_gettickcount (mng_handle hHandle,
|
||||
mng_gettickcount fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_GETTICKCOUNT, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fGettickcount = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_GETTICKCOUNT, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_retcode MNG_DECL mng_setcb_settimer (mng_handle hHandle,
|
||||
mng_settimer fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_SETTIMER, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fSettimer = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_SETTIMER, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_retcode MNG_DECL mng_setcb_processgamma (mng_handle hHandle,
|
||||
mng_processgamma fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSGAMA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fProcessgamma = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSGAMA, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_retcode MNG_DECL mng_setcb_processchroma (mng_handle hHandle,
|
||||
mng_processchroma fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSCHROMA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fProcesschroma = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSCHROMA, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_retcode MNG_DECL mng_setcb_processsrgb (mng_handle hHandle,
|
||||
mng_processsrgb fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSSRGB, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fProcesssrgb = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSSRGB, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_retcode MNG_DECL mng_setcb_processiccp (mng_handle hHandle,
|
||||
mng_processiccp fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSICCP, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fProcessiccp = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSICCP, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_retcode MNG_DECL mng_setcb_processarow (mng_handle hHandle,
|
||||
mng_processarow fProc)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSAROW, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->fProcessarow = fProc;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSAROW, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Callback get functions * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_INTERNAL_MEMMNGMT
|
||||
mng_memalloc MNG_DECL mng_getcb_memalloc (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_MEMALLOC, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_MEMALLOC, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fMemalloc;
|
||||
}
|
||||
#endif /* MNG_INTERNAL_MEMMNGMT */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_INTERNAL_MEMMNGMT
|
||||
mng_memfree MNG_DECL mng_getcb_memfree (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_MEMFREE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_MEMFREE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fMemfree;
|
||||
}
|
||||
#endif /* MNG_INTERNAL_MEMMNGMT */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_READ
|
||||
mng_readdata MNG_DECL mng_getcb_readdata (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_READDATA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_READDATA, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fReaddata;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)
|
||||
mng_openstream MNG_DECL mng_getcb_openstream (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_OPENSTREAM, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_OPENSTREAM, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fOpenstream;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ || MNG_SUPPORT_WRITE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)
|
||||
mng_closestream MNG_DECL mng_getcb_closestream (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_CLOSESTREAM, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_CLOSESTREAM, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fClosestream;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ || MNG_SUPPORT_WRITE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_WRITE
|
||||
mng_writedata MNG_DECL mng_getcb_writedata (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_WRITEDATA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_WRITEDATA, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fWritedata;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_WRITE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_errorproc MNG_DECL mng_getcb_errorproc (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_ERRORPROC, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_ERRORPROC, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fErrorproc;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
mng_traceproc MNG_DECL mng_getcb_traceproc (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_TRACEPROC, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_TRACEPROC, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fTraceproc;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_TRACE */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_READ
|
||||
mng_processheader MNG_DECL mng_getcb_processheader (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSHEADER, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSHEADER, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fProcessheader;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_READ
|
||||
mng_processtext MNG_DECL mng_getcb_processtext (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSTEXT, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSTEXT, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fProcesstext;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_getcanvasline MNG_DECL mng_getcb_getcanvasline (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_GETCANVASLINE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_GETCANVASLINE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fGetcanvasline;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_getbkgdline MNG_DECL mng_getcb_getbkgdline (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_GETBKGDLINE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_GETBKGDLINE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fGetbkgdline;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_getalphaline MNG_DECL mng_getcb_getalphaline (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_GETALPHALINE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_GETALPHALINE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fGetalphaline;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_refresh MNG_DECL mng_getcb_refresh (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_REFRESH, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_REFRESH, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fRefresh;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_gettickcount MNG_DECL mng_getcb_gettickcount (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_GETTICKCOUNT, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_GETTICKCOUNT, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fGettickcount;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_settimer MNG_DECL mng_getcb_settimer (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_SETTIMER, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_SETTIMER, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fSettimer;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_processgamma MNG_DECL mng_getcb_processgamma (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSGAMMA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSGAMMA, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fProcessgamma;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_processchroma MNG_DECL mng_getcb_processchroma (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSCHROMA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSCHROMA, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fProcesschroma;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_processsrgb MNG_DECL mng_getcb_processsrgb (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSSRGB, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSSRGB, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fProcesssrgb;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_processiccp MNG_DECL mng_getcb_processiccp (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSICCP, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSICCP, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fProcessiccp;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_APP_CMS)
|
||||
mng_processarow MNG_DECL mng_getcb_processarow (mng_handle hHandle)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSAROW, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSAROW, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return ((mng_datap)hHandle)->fProcessarow;
|
||||
}
|
||||
#endif /* MNG_SUPPORT_DISPLAY && MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,283 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_chunk_io.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Chunk I/O routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the chunk input/output routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/04/2000 - G.Juyn * */
|
||||
/* * - changed CRC initializtion 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 * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_chunk_io_h_
|
||||
#define _mng_chunk_io_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_chunks.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_uint32 crc (mng_datap pData,
|
||||
mng_uint8p buf,
|
||||
mng_int32 len);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_READ_PROCS
|
||||
|
||||
#define READ_CHUNK(n) mng_retcode n (mng_datap pData, \
|
||||
mng_chunkp pHeader, \
|
||||
mng_uint32 iRawlen, \
|
||||
mng_uint8p pRawdata, \
|
||||
mng_chunkp* ppChunk)
|
||||
|
||||
READ_CHUNK (read_ihdr) ;
|
||||
READ_CHUNK (read_plte) ;
|
||||
READ_CHUNK (read_idat) ;
|
||||
READ_CHUNK (read_iend) ;
|
||||
READ_CHUNK (read_trns) ;
|
||||
READ_CHUNK (read_gama) ;
|
||||
READ_CHUNK (read_chrm) ;
|
||||
READ_CHUNK (read_srgb) ;
|
||||
READ_CHUNK (read_iccp) ;
|
||||
READ_CHUNK (read_text) ;
|
||||
READ_CHUNK (read_ztxt) ;
|
||||
READ_CHUNK (read_itxt) ;
|
||||
READ_CHUNK (read_bkgd) ;
|
||||
READ_CHUNK (read_phys) ;
|
||||
READ_CHUNK (read_sbit) ;
|
||||
READ_CHUNK (read_splt) ;
|
||||
READ_CHUNK (read_hist) ;
|
||||
READ_CHUNK (read_time) ;
|
||||
READ_CHUNK (read_mhdr) ;
|
||||
READ_CHUNK (read_mend) ;
|
||||
READ_CHUNK (read_loop) ;
|
||||
READ_CHUNK (read_endl) ;
|
||||
READ_CHUNK (read_defi) ;
|
||||
READ_CHUNK (read_basi) ;
|
||||
READ_CHUNK (read_clon) ;
|
||||
READ_CHUNK (read_past) ;
|
||||
READ_CHUNK (read_disc) ;
|
||||
READ_CHUNK (read_back) ;
|
||||
READ_CHUNK (read_fram) ;
|
||||
READ_CHUNK (read_move) ;
|
||||
READ_CHUNK (read_clip) ;
|
||||
READ_CHUNK (read_show) ;
|
||||
READ_CHUNK (read_term) ;
|
||||
READ_CHUNK (read_save) ;
|
||||
READ_CHUNK (read_seek) ;
|
||||
READ_CHUNK (read_expi) ;
|
||||
READ_CHUNK (read_fpri) ;
|
||||
READ_CHUNK (read_phyg) ;
|
||||
READ_CHUNK (read_jhdr) ;
|
||||
READ_CHUNK (read_jdat) ;
|
||||
READ_CHUNK (read_jsep) ;
|
||||
READ_CHUNK (read_dhdr) ;
|
||||
READ_CHUNK (read_prom) ;
|
||||
READ_CHUNK (read_ipng) ;
|
||||
READ_CHUNK (read_pplt) ;
|
||||
READ_CHUNK (read_ijng) ;
|
||||
READ_CHUNK (read_drop) ;
|
||||
READ_CHUNK (read_dbyk) ;
|
||||
READ_CHUNK (read_ordr) ;
|
||||
READ_CHUNK (read_need) ;
|
||||
READ_CHUNK (read_unknown) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#else /* MNG_INCLUDE_READ_PROCS */
|
||||
#define read_ihdr 0
|
||||
#define read_plte 0
|
||||
#define read_idat 0
|
||||
#define read_iend 0
|
||||
#define read_trns 0
|
||||
#define read_gama 0
|
||||
#define read_chrm 0
|
||||
#define read_srgb 0
|
||||
#define read_iccp 0
|
||||
#define read_text 0
|
||||
#define read_ztxt 0
|
||||
#define read_itxt 0
|
||||
#define read_bkgd 0
|
||||
#define read_phys 0
|
||||
#define read_sbit 0
|
||||
#define read_splt 0
|
||||
#define read_hist 0
|
||||
#define read_time 0
|
||||
#define read_mhdr 0
|
||||
#define read_mend 0
|
||||
#define read_loop 0
|
||||
#define read_endl 0
|
||||
#define read_defi 0
|
||||
#define read_basi 0
|
||||
#define read_clon 0
|
||||
#define read_past 0
|
||||
#define read_disc 0
|
||||
#define read_back 0
|
||||
#define read_fram 0
|
||||
#define read_move 0
|
||||
#define read_clip 0
|
||||
#define read_show 0
|
||||
#define read_term 0
|
||||
#define read_save 0
|
||||
#define read_seek 0
|
||||
#define read_expi 0
|
||||
#define read_fpri 0
|
||||
#define read_phyg 0
|
||||
#define read_jhdr 0
|
||||
#define read_jdat 0
|
||||
#define read_jsep 0
|
||||
#define read_dhdr 0
|
||||
#define read_prom 0
|
||||
#define read_ipng 0
|
||||
#define read_pplt 0
|
||||
#define read_ijng 0
|
||||
#define read_drop 0
|
||||
#define read_dbyk 0
|
||||
#define read_ordr 0
|
||||
#define read_need 0
|
||||
#define 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 (write_ihdr) ;
|
||||
WRITE_CHUNK (write_plte) ;
|
||||
WRITE_CHUNK (write_idat) ;
|
||||
WRITE_CHUNK (write_iend) ;
|
||||
WRITE_CHUNK (write_trns) ;
|
||||
WRITE_CHUNK (write_gama) ;
|
||||
WRITE_CHUNK (write_chrm) ;
|
||||
WRITE_CHUNK (write_srgb) ;
|
||||
WRITE_CHUNK (write_iccp) ;
|
||||
WRITE_CHUNK (write_text) ;
|
||||
WRITE_CHUNK (write_ztxt) ;
|
||||
WRITE_CHUNK (write_itxt) ;
|
||||
WRITE_CHUNK (write_bkgd) ;
|
||||
WRITE_CHUNK (write_phys) ;
|
||||
WRITE_CHUNK (write_sbit) ;
|
||||
WRITE_CHUNK (write_splt) ;
|
||||
WRITE_CHUNK (write_hist) ;
|
||||
WRITE_CHUNK (write_time) ;
|
||||
WRITE_CHUNK (write_mhdr) ;
|
||||
WRITE_CHUNK (write_mend) ;
|
||||
WRITE_CHUNK (write_loop) ;
|
||||
WRITE_CHUNK (write_endl) ;
|
||||
WRITE_CHUNK (write_defi) ;
|
||||
WRITE_CHUNK (write_basi) ;
|
||||
WRITE_CHUNK (write_clon) ;
|
||||
WRITE_CHUNK (write_past) ;
|
||||
WRITE_CHUNK (write_disc) ;
|
||||
WRITE_CHUNK (write_back) ;
|
||||
WRITE_CHUNK (write_fram) ;
|
||||
WRITE_CHUNK (write_move) ;
|
||||
WRITE_CHUNK (write_clip) ;
|
||||
WRITE_CHUNK (write_show) ;
|
||||
WRITE_CHUNK (write_term) ;
|
||||
WRITE_CHUNK (write_save) ;
|
||||
WRITE_CHUNK (write_seek) ;
|
||||
WRITE_CHUNK (write_expi) ;
|
||||
WRITE_CHUNK (write_fpri) ;
|
||||
WRITE_CHUNK (write_phyg) ;
|
||||
WRITE_CHUNK (write_jhdr) ;
|
||||
WRITE_CHUNK (write_jdat) ;
|
||||
WRITE_CHUNK (write_jsep) ;
|
||||
WRITE_CHUNK (write_dhdr) ;
|
||||
WRITE_CHUNK (write_prom) ;
|
||||
WRITE_CHUNK (write_ipng) ;
|
||||
WRITE_CHUNK (write_pplt) ;
|
||||
WRITE_CHUNK (write_ijng) ;
|
||||
WRITE_CHUNK (write_drop) ;
|
||||
WRITE_CHUNK (write_dbyk) ;
|
||||
WRITE_CHUNK (write_ordr) ;
|
||||
WRITE_CHUNK (write_need) ;
|
||||
WRITE_CHUNK (write_unknown) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#else /* MNG_INCLUDE_WRITE_PROCS */
|
||||
#define write_ihdr 0
|
||||
#define write_plte 0
|
||||
#define write_idat 0
|
||||
#define write_iend 0
|
||||
#define write_trns 0
|
||||
#define write_gama 0
|
||||
#define write_chrm 0
|
||||
#define write_srgb 0
|
||||
#define write_iccp 0
|
||||
#define write_text 0
|
||||
#define write_ztxt 0
|
||||
#define write_itxt 0
|
||||
#define write_bkgd 0
|
||||
#define write_phys 0
|
||||
#define write_sbit 0
|
||||
#define write_splt 0
|
||||
#define write_hist 0
|
||||
#define write_time 0
|
||||
#define write_mhdr 0
|
||||
#define write_mend 0
|
||||
#define write_loop 0
|
||||
#define write_endl 0
|
||||
#define write_defi 0
|
||||
#define write_basi 0
|
||||
#define write_clon 0
|
||||
#define write_past 0
|
||||
#define write_disc 0
|
||||
#define write_back 0
|
||||
#define write_fram 0
|
||||
#define write_move 0
|
||||
#define write_clip 0
|
||||
#define write_show 0
|
||||
#define write_term 0
|
||||
#define write_save 0
|
||||
#define write_seek 0
|
||||
#define write_expi 0
|
||||
#define write_fpri 0
|
||||
#define write_phyg 0
|
||||
#define write_jhdr 0
|
||||
#define write_jdat 0
|
||||
#define write_jsep 0
|
||||
#define write_dhdr 0
|
||||
#define write_prom 0
|
||||
#define write_ipng 0
|
||||
#define write_pplt 0
|
||||
#define write_ijng 0
|
||||
#define write_drop 0
|
||||
#define write_dbyk 0
|
||||
#define write_ordr 0
|
||||
#define write_need 0
|
||||
#define write_unknown 0
|
||||
#endif /* MNG_INCLUDE_WRITE_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_chunk_io_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,160 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_chunk_prc.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Chunk initialization & cleanup (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : definition of the chunk initialization & cleanup routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_chunk_prc_h_
|
||||
#define _mng_chunk_prc_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_chunks.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void 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)
|
||||
|
||||
INIT_CHUNK_HDR (init_ihdr) ;
|
||||
INIT_CHUNK_HDR (init_plte) ;
|
||||
INIT_CHUNK_HDR (init_idat) ;
|
||||
INIT_CHUNK_HDR (init_iend) ;
|
||||
INIT_CHUNK_HDR (init_trns) ;
|
||||
INIT_CHUNK_HDR (init_gama) ;
|
||||
INIT_CHUNK_HDR (init_chrm) ;
|
||||
INIT_CHUNK_HDR (init_srgb) ;
|
||||
INIT_CHUNK_HDR (init_iccp) ;
|
||||
INIT_CHUNK_HDR (init_text) ;
|
||||
INIT_CHUNK_HDR (init_ztxt) ;
|
||||
INIT_CHUNK_HDR (init_itxt) ;
|
||||
INIT_CHUNK_HDR (init_bkgd) ;
|
||||
INIT_CHUNK_HDR (init_phys) ;
|
||||
INIT_CHUNK_HDR (init_sbit) ;
|
||||
INIT_CHUNK_HDR (init_splt) ;
|
||||
INIT_CHUNK_HDR (init_hist) ;
|
||||
INIT_CHUNK_HDR (init_time) ;
|
||||
INIT_CHUNK_HDR (init_mhdr) ;
|
||||
INIT_CHUNK_HDR (init_mend) ;
|
||||
INIT_CHUNK_HDR (init_loop) ;
|
||||
INIT_CHUNK_HDR (init_endl) ;
|
||||
INIT_CHUNK_HDR (init_defi) ;
|
||||
INIT_CHUNK_HDR (init_basi) ;
|
||||
INIT_CHUNK_HDR (init_clon) ;
|
||||
INIT_CHUNK_HDR (init_past) ;
|
||||
INIT_CHUNK_HDR (init_disc) ;
|
||||
INIT_CHUNK_HDR (init_back) ;
|
||||
INIT_CHUNK_HDR (init_fram) ;
|
||||
INIT_CHUNK_HDR (init_move) ;
|
||||
INIT_CHUNK_HDR (init_clip) ;
|
||||
INIT_CHUNK_HDR (init_show) ;
|
||||
INIT_CHUNK_HDR (init_term) ;
|
||||
INIT_CHUNK_HDR (init_save) ;
|
||||
INIT_CHUNK_HDR (init_seek) ;
|
||||
INIT_CHUNK_HDR (init_expi) ;
|
||||
INIT_CHUNK_HDR (init_fpri) ;
|
||||
INIT_CHUNK_HDR (init_need) ;
|
||||
INIT_CHUNK_HDR (init_phyg) ;
|
||||
INIT_CHUNK_HDR (init_jhdr) ;
|
||||
INIT_CHUNK_HDR (init_jdat) ;
|
||||
INIT_CHUNK_HDR (init_jsep) ;
|
||||
INIT_CHUNK_HDR (init_dhdr) ;
|
||||
INIT_CHUNK_HDR (init_prom) ;
|
||||
INIT_CHUNK_HDR (init_ipng) ;
|
||||
INIT_CHUNK_HDR (init_pplt) ;
|
||||
INIT_CHUNK_HDR (init_ijng) ;
|
||||
INIT_CHUNK_HDR (init_drop) ;
|
||||
INIT_CHUNK_HDR (init_dbyk) ;
|
||||
INIT_CHUNK_HDR (init_ordr) ;
|
||||
INIT_CHUNK_HDR (init_unknown) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define FREE_CHUNK_HDR(n) mng_retcode n (mng_datap pData, \
|
||||
mng_chunkp pHeader)
|
||||
|
||||
FREE_CHUNK_HDR (free_ihdr) ;
|
||||
FREE_CHUNK_HDR (free_plte) ;
|
||||
FREE_CHUNK_HDR (free_idat) ;
|
||||
FREE_CHUNK_HDR (free_iend) ;
|
||||
FREE_CHUNK_HDR (free_trns) ;
|
||||
FREE_CHUNK_HDR (free_gama) ;
|
||||
FREE_CHUNK_HDR (free_chrm) ;
|
||||
FREE_CHUNK_HDR (free_srgb) ;
|
||||
FREE_CHUNK_HDR (free_iccp) ;
|
||||
FREE_CHUNK_HDR (free_text) ;
|
||||
FREE_CHUNK_HDR (free_ztxt) ;
|
||||
FREE_CHUNK_HDR (free_itxt) ;
|
||||
FREE_CHUNK_HDR (free_bkgd) ;
|
||||
FREE_CHUNK_HDR (free_phys) ;
|
||||
FREE_CHUNK_HDR (free_sbit) ;
|
||||
FREE_CHUNK_HDR (free_splt) ;
|
||||
FREE_CHUNK_HDR (free_hist) ;
|
||||
FREE_CHUNK_HDR (free_time) ;
|
||||
FREE_CHUNK_HDR (free_mhdr) ;
|
||||
FREE_CHUNK_HDR (free_mend) ;
|
||||
FREE_CHUNK_HDR (free_loop) ;
|
||||
FREE_CHUNK_HDR (free_endl) ;
|
||||
FREE_CHUNK_HDR (free_defi) ;
|
||||
FREE_CHUNK_HDR (free_basi) ;
|
||||
FREE_CHUNK_HDR (free_clon) ;
|
||||
FREE_CHUNK_HDR (free_past) ;
|
||||
FREE_CHUNK_HDR (free_disc) ;
|
||||
FREE_CHUNK_HDR (free_back) ;
|
||||
FREE_CHUNK_HDR (free_fram) ;
|
||||
FREE_CHUNK_HDR (free_move) ;
|
||||
FREE_CHUNK_HDR (free_clip) ;
|
||||
FREE_CHUNK_HDR (free_show) ;
|
||||
FREE_CHUNK_HDR (free_term) ;
|
||||
FREE_CHUNK_HDR (free_save) ;
|
||||
FREE_CHUNK_HDR (free_seek) ;
|
||||
FREE_CHUNK_HDR (free_expi) ;
|
||||
FREE_CHUNK_HDR (free_fpri) ;
|
||||
FREE_CHUNK_HDR (free_need) ;
|
||||
FREE_CHUNK_HDR (free_phyg) ;
|
||||
FREE_CHUNK_HDR (free_jhdr) ;
|
||||
FREE_CHUNK_HDR (free_jdat) ;
|
||||
FREE_CHUNK_HDR (free_jsep) ;
|
||||
FREE_CHUNK_HDR (free_dhdr) ;
|
||||
FREE_CHUNK_HDR (free_prom) ;
|
||||
FREE_CHUNK_HDR (free_ipng) ;
|
||||
FREE_CHUNK_HDR (free_pplt) ;
|
||||
FREE_CHUNK_HDR (free_ijng) ;
|
||||
FREE_CHUNK_HDR (free_drop) ;
|
||||
FREE_CHUNK_HDR (free_dbyk) ;
|
||||
FREE_CHUNK_HDR (free_ordr) ;
|
||||
FREE_CHUNK_HDR (free_unknown) ;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_chunk_prc_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,725 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_chunks.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Chunk structures (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of known chunk structures * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/04/2000 - G.Juyn * */
|
||||
/* * - put in some extra comments * */
|
||||
/* * 0.5.1 - 05/06/2000 - G.Juyn * */
|
||||
/* * - fixed layout for sBIT, PPLT * */
|
||||
/* * 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed write callback definition * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/11/2000 - G.Juyn * */
|
||||
/* * - fixed layout for PPLT again (missed deltatype ?!?) * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/31/2000 - G.Juyn * */
|
||||
/* * - removed useless definition (contributed by Tim Rowley) * */
|
||||
/* * 0.5.2 - 06/03/2000 - G.Juyn * */
|
||||
/* * - fixed makeup for Linux gcc compile * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_chunks_h_
|
||||
#define _mng_chunks_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_SWAP_ENDIAN
|
||||
#define PNG_SIG 0x474e5089L
|
||||
#define JNG_SIG 0x474e4a8bL
|
||||
#define MNG_SIG 0x474e4d8aL
|
||||
#define POST_SIG 0x0a1a0a0dL
|
||||
#else
|
||||
#define PNG_SIG 0x89504e47L
|
||||
#define JNG_SIG 0x8b4a4e47L
|
||||
#define MNG_SIG 0x8a4d4e47L
|
||||
#define POST_SIG 0x0d0a1a0aL
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef mng_retcode (*mng_createchunk) (mng_datap pData,
|
||||
mng_chunkp pHeader,
|
||||
mng_chunkp* ppChunk);
|
||||
|
||||
typedef mng_retcode (*mng_cleanupchunk) (mng_datap pData,
|
||||
mng_chunkp pHeader);
|
||||
|
||||
typedef mng_retcode (*mng_readchunk) (mng_datap pData,
|
||||
mng_chunkp pHeader,
|
||||
mng_uint32 iRawlen,
|
||||
mng_uint8p pRawdata,
|
||||
mng_chunkp* pChunk);
|
||||
|
||||
typedef mng_retcode (*mng_writechunk) (mng_datap pData,
|
||||
mng_chunkp pChunk);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* generic header */
|
||||
mng_chunkid iChunkname;
|
||||
mng_createchunk fCreate;
|
||||
mng_cleanupchunk fCleanup;
|
||||
mng_readchunk fRead;
|
||||
mng_writechunk fWrite;
|
||||
mng_chunkp pNext; /* for double-linked list */
|
||||
mng_chunkp pPrev;
|
||||
} mng_chunk_header;
|
||||
typedef mng_chunk_header * mng_chunk_headerp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* IHDR */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iWidth;
|
||||
mng_uint32 iHeight;
|
||||
mng_uint8 iBitdepth;
|
||||
mng_uint8 iColortype;
|
||||
mng_uint8 iCompression;
|
||||
mng_uint8 iFilter;
|
||||
mng_uint8 iInterlace;
|
||||
} mng_ihdr;
|
||||
typedef mng_ihdr * mng_ihdrp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* PLTE */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint32 iEntrycount;
|
||||
mng_rgbpaltab aEntries;
|
||||
} mng_plte;
|
||||
typedef mng_plte * mng_pltep;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* IDAT */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint32 iDatasize;
|
||||
mng_ptr pData;
|
||||
} mng_idat;
|
||||
typedef mng_idat * mng_idatp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* IEND */
|
||||
mng_chunk_header sHeader;
|
||||
} mng_iend;
|
||||
typedef mng_iend * mng_iendp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* tRNS */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_bool bGlobal;
|
||||
mng_uint8 iType; /* colortype (0,2,3) */
|
||||
mng_uint32 iCount;
|
||||
mng_uint8arr aEntries;
|
||||
mng_uint16 iGray;
|
||||
mng_uint16 iRed;
|
||||
mng_uint16 iGreen;
|
||||
mng_uint16 iBlue;
|
||||
mng_uint32 iRawlen;
|
||||
mng_uint8arr aRawdata;
|
||||
} mng_trns;
|
||||
typedef mng_trns * mng_trnsp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* gAMA */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint32 iGamma;
|
||||
} mng_gama;
|
||||
typedef mng_gama * mng_gamap;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* cHRM */
|
||||
mng_chunk_header sHeader;
|
||||
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_chrm;
|
||||
typedef mng_chrm * mng_chrmp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* sRGB */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint8 iRenderingintent;
|
||||
} mng_srgb;
|
||||
typedef mng_srgb * mng_srgbp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* iCCP */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint32 iNamesize;
|
||||
mng_pchar zName;
|
||||
mng_uint8 iCompression;
|
||||
mng_uint32 iProfilesize;
|
||||
mng_ptr pProfile;
|
||||
} mng_iccp;
|
||||
typedef mng_iccp * mng_iccpp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* tEXt */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iKeywordsize;
|
||||
mng_pchar zKeyword;
|
||||
mng_uint32 iTextsize;
|
||||
mng_pchar zText;
|
||||
} mng_text;
|
||||
typedef mng_text * mng_textp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* zTXt */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iKeywordsize;
|
||||
mng_pchar zKeyword;
|
||||
mng_uint8 iCompression;
|
||||
mng_uint32 iTextsize;
|
||||
mng_pchar zText;
|
||||
} mng_ztxt;
|
||||
typedef mng_ztxt * mng_ztxtp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* iTXt */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iKeywordsize;
|
||||
mng_pchar zKeyword;
|
||||
mng_uint8 iCompressionflag;
|
||||
mng_uint8 iCompressionmethod;
|
||||
mng_uint32 iLanguagesize;
|
||||
mng_pchar zLanguage;
|
||||
mng_uint32 iTranslationsize;
|
||||
mng_pchar zTranslation;
|
||||
mng_uint32 iTextsize;
|
||||
mng_pchar zText;
|
||||
} mng_itxt;
|
||||
typedef mng_itxt * mng_itxtp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* bKGD */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint8 iType; /* 3=indexed, 0=gray, 2=rgb */
|
||||
mng_uint8 iIndex;
|
||||
mng_uint16 iGray;
|
||||
mng_uint16 iRed;
|
||||
mng_uint16 iGreen;
|
||||
mng_uint16 iBlue;
|
||||
} mng_bkgd;
|
||||
typedef mng_bkgd * mng_bkgdp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* pHYs */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint32 iSizex;
|
||||
mng_uint32 iSizey;
|
||||
mng_uint8 iUnit;
|
||||
} mng_phys;
|
||||
typedef mng_phys * mng_physp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* sBIT */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint8 iType; /* colortype (0,2,3,4,6,10,12,14,16) */
|
||||
mng_uint8arr4 aBits;
|
||||
} mng_sbit;
|
||||
typedef mng_sbit * mng_sbitp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* sPLT */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint32 iNamesize;
|
||||
mng_pchar zName;
|
||||
mng_uint8 iSampledepth;
|
||||
mng_uint32 iEntrycount;
|
||||
mng_ptr pEntries;
|
||||
} mng_splt;
|
||||
typedef mng_splt * mng_spltp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* hIST */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iEntrycount;
|
||||
mng_uint16arr aEntries;
|
||||
} mng_hist;
|
||||
typedef mng_hist * mng_histp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* tIME */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint16 iYear;
|
||||
mng_uint8 iMonth;
|
||||
mng_uint8 iDay;
|
||||
mng_uint8 iHour;
|
||||
mng_uint8 iMinute;
|
||||
mng_uint8 iSecond;
|
||||
} mng_time;
|
||||
typedef mng_time * mng_timep;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* MHDR */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iWidth;
|
||||
mng_uint32 iHeight;
|
||||
mng_uint32 iTicks;
|
||||
mng_uint32 iLayercount;
|
||||
mng_uint32 iFramecount;
|
||||
mng_uint32 iPlaytime;
|
||||
mng_uint32 iSimplicity;
|
||||
} mng_mhdr;
|
||||
typedef mng_mhdr * mng_mhdrp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* MEND */
|
||||
mng_chunk_header sHeader;
|
||||
} mng_mend;
|
||||
typedef mng_mend * mng_mendp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* LOOP */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint8 iLevel;
|
||||
mng_uint32 iRepeat;
|
||||
mng_uint8 iTermination;
|
||||
mng_uint32 iItermin;
|
||||
mng_uint32 iItermax;
|
||||
mng_uint32 iCount;
|
||||
mng_uint32p pSignals;
|
||||
} mng_loop;
|
||||
typedef mng_loop * mng_loopp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* ENDL */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint8 iLevel;
|
||||
} mng_endl;
|
||||
typedef mng_endl * mng_endlp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* DEFI */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint16 iObjectid;
|
||||
mng_uint8 iDonotshow;
|
||||
mng_uint8 iConcrete;
|
||||
mng_bool bHasloca;
|
||||
mng_int32 iXlocation;
|
||||
mng_int32 iYlocation;
|
||||
mng_bool bHasclip;
|
||||
mng_int32 iLeftcb;
|
||||
mng_int32 iRightcb;
|
||||
mng_int32 iTopcb;
|
||||
mng_int32 iBottomcb;
|
||||
} mng_defi;
|
||||
typedef mng_defi * mng_defip;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* BASI */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iWidth;
|
||||
mng_uint32 iHeight;
|
||||
mng_uint8 iBitdepth;
|
||||
mng_uint8 iColortype;
|
||||
mng_uint8 iCompression;
|
||||
mng_uint8 iFilter;
|
||||
mng_uint8 iInterlace;
|
||||
mng_uint16 iRed;
|
||||
mng_uint16 iGreen;
|
||||
mng_uint16 iBlue;
|
||||
mng_uint16 iAlpha;
|
||||
mng_uint8 iViewable;
|
||||
} mng_basi;
|
||||
typedef mng_basi * mng_basip;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* CLON */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint16 iSourceid;
|
||||
mng_uint16 iCloneid;
|
||||
mng_uint8 iClonetype;
|
||||
mng_uint8 iDonotshow;
|
||||
mng_uint8 iConcrete;
|
||||
mng_bool bHasloca;
|
||||
mng_uint8 iLocationtype;
|
||||
mng_int32 iLocationx;
|
||||
mng_int32 iLocationy;
|
||||
} mng_clon;
|
||||
typedef mng_clon * mng_clonp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* PAST source */
|
||||
mng_uint16 iSourceid;
|
||||
mng_uint8 iComposition;
|
||||
mng_uint8 iOrientation;
|
||||
mng_uint8 iOffsettype;
|
||||
mng_int32 iOffsetx;
|
||||
mng_int32 iOffsety;
|
||||
mng_uint8 iBoundarytype;
|
||||
mng_int32 iBoundaryl;
|
||||
mng_int32 iBoundaryr;
|
||||
mng_int32 iBoundaryt;
|
||||
mng_int32 iBoundaryb;
|
||||
} mng_past_source;
|
||||
typedef mng_past_source * mng_past_sourcep;
|
||||
|
||||
typedef struct { /* PAST */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint16 iDestid;
|
||||
mng_uint8 iTargettype;
|
||||
mng_int32 iTargetx;
|
||||
mng_int32 iTargety;
|
||||
mng_uint32 iCount;
|
||||
mng_past_sourcep pSources;
|
||||
} mng_past;
|
||||
typedef mng_past * mng_pastp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* DISC */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iCount;
|
||||
mng_uint16p pObjectids;
|
||||
} mng_disc;
|
||||
typedef mng_disc * mng_discp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* BACK */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint16 iRed;
|
||||
mng_uint16 iGreen;
|
||||
mng_uint16 iBlue;
|
||||
mng_uint8 iMandatory;
|
||||
mng_uint16 iImageid;
|
||||
mng_uint8 iTile;
|
||||
} mng_back;
|
||||
typedef mng_back * mng_backp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* FRAM */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint8 iMode;
|
||||
mng_uint32 iNamesize;
|
||||
mng_pchar zName;
|
||||
mng_uint8 iChangedelay;
|
||||
mng_uint8 iChangetimeout;
|
||||
mng_uint8 iChangeclipping;
|
||||
mng_uint8 iChangesyncid;
|
||||
mng_uint32 iDelay;
|
||||
mng_uint32 iTimeout;
|
||||
mng_uint8 iBoundarytype;
|
||||
mng_int32 iBoundaryl;
|
||||
mng_int32 iBoundaryr;
|
||||
mng_int32 iBoundaryt;
|
||||
mng_int32 iBoundaryb;
|
||||
mng_uint32 iCount;
|
||||
mng_uint32p pSyncids;
|
||||
} mng_fram;
|
||||
typedef mng_fram * mng_framp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* MOVE */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint16 iFirstid;
|
||||
mng_uint16 iLastid;
|
||||
mng_uint8 iMovetype;
|
||||
mng_int32 iMovex;
|
||||
mng_int32 iMovey;
|
||||
} mng_move;
|
||||
typedef mng_move * mng_movep;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* CLIP */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint16 iFirstid;
|
||||
mng_uint16 iLastid;
|
||||
mng_uint8 iCliptype;
|
||||
mng_int32 iClipl;
|
||||
mng_int32 iClipr;
|
||||
mng_int32 iClipt;
|
||||
mng_int32 iClipb;
|
||||
} mng_clip;
|
||||
typedef mng_clip * mng_clipp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* SHOW */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint16 iFirstid;
|
||||
mng_uint16 iLastid;
|
||||
mng_uint8 iMode;
|
||||
} mng_show;
|
||||
typedef mng_show * mng_showp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* TERM */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint8 iTermaction;
|
||||
mng_uint8 iIteraction;
|
||||
mng_uint32 iDelay;
|
||||
mng_uint32 iItermax;
|
||||
} mng_term;
|
||||
typedef mng_term * mng_termp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* SAVE entry */
|
||||
mng_uint8 iEntrytype;
|
||||
mng_uint32arr2 iOffset; /* 0=MSI, 1=LSI */
|
||||
mng_uint32arr2 iStarttime; /* 0=MSI, 1=LSI */
|
||||
mng_uint32 iLayernr;
|
||||
mng_uint32 iFramenr;
|
||||
mng_uint32 iNamesize;
|
||||
mng_pchar zName;
|
||||
} mng_save_entry;
|
||||
typedef mng_save_entry * mng_save_entryp;
|
||||
|
||||
typedef struct { /* SAVE */
|
||||
mng_chunk_header sHeader;
|
||||
mng_bool bEmpty;
|
||||
mng_uint8 iOffsettype;
|
||||
mng_uint32 iCount;
|
||||
mng_save_entryp pEntries;
|
||||
} mng_save;
|
||||
typedef mng_save * mng_savep;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* SEEK */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iNamesize;
|
||||
mng_pchar zName;
|
||||
} mng_seek;
|
||||
typedef mng_seek * mng_seekp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* eXPI */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint16 iSnapshotid;
|
||||
mng_uint32 iNamesize;
|
||||
mng_pchar zName;
|
||||
} mng_expi;
|
||||
typedef mng_expi * mng_expip;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* fPRI */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint8 iDeltatype;
|
||||
mng_uint8 iPriority;
|
||||
} mng_fpri;
|
||||
typedef mng_fpri * mng_fprip;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* nEED */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iKeywordssize;
|
||||
mng_pchar zKeywords;
|
||||
} mng_need;
|
||||
typedef mng_need * mng_needp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef mng_phys mng_phyg; /* pHYg */
|
||||
typedef mng_phyg * mng_phygp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
|
||||
typedef struct { /* JHDR */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iWidth;
|
||||
mng_uint32 iHeight;
|
||||
mng_uint8 iColortype;
|
||||
mng_uint8 iImagesampledepth;
|
||||
mng_uint8 iImagecompression;
|
||||
mng_uint8 iImageinterlace;
|
||||
mng_uint8 iAlphasampledepth;
|
||||
mng_uint8 iAlphacompression;
|
||||
mng_uint8 iAlphafilter;
|
||||
mng_uint8 iAlphainterlace;
|
||||
} mng_jhdr;
|
||||
typedef mng_jhdr * mng_jhdrp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef mng_idat mng_jdat; /* JDAT */
|
||||
typedef mng_jdat * mng_jdatp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* JSEP */
|
||||
mng_chunk_header sHeader;
|
||||
} mng_jsep;
|
||||
typedef mng_jsep * mng_jsepp;
|
||||
|
||||
#endif /* MNG_INCLUDE_JNG */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* DHDR */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint16 iObjectid;
|
||||
mng_uint8 iImagetype;
|
||||
mng_uint8 iDeltatype;
|
||||
mng_uint32 iBlockwidth;
|
||||
mng_uint32 iBlockheight;
|
||||
mng_uint32 iBlockx;
|
||||
mng_uint32 iBlocky;
|
||||
} mng_dhdr;
|
||||
typedef mng_dhdr * mng_dhdrp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* PROM */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint8 iColortype;
|
||||
mng_uint8 iSampledepth;
|
||||
mng_uint8 iFilltype;
|
||||
} mng_prom;
|
||||
typedef mng_prom * mng_promp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* IPNG */
|
||||
mng_chunk_header sHeader;
|
||||
} mng_ipng;
|
||||
typedef mng_ipng *mng_ipngp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* PPLT entry */
|
||||
mng_uint8 iRed;
|
||||
mng_uint8 iGreen;
|
||||
mng_uint8 iBlue;
|
||||
mng_uint8 iAlpha;
|
||||
mng_bool bUsed;
|
||||
} mng_pplt_entry;
|
||||
typedef mng_pplt_entry * mng_pplt_entryp;
|
||||
|
||||
typedef struct { /* PPLT */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint8 iDeltatype;
|
||||
mng_uint32 iCount;
|
||||
mng_pplt_entry aEntries [256];
|
||||
} mng_pplt;
|
||||
typedef mng_pplt * mng_ppltp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* IJNG */
|
||||
mng_chunk_header sHeader;
|
||||
} mng_ijng;
|
||||
typedef mng_ijng *mng_ijngp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* DROP */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iCount;
|
||||
mng_chunkidp pChunknames;
|
||||
} mng_drop;
|
||||
typedef mng_drop * mng_dropp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* DBYK */
|
||||
mng_chunk_header sHeader;
|
||||
mng_chunkid iChunkname;
|
||||
mng_uint8 iPolarity;
|
||||
mng_uint32 iKeywordssize;
|
||||
mng_pchar zKeywords;
|
||||
} mng_dbyk;
|
||||
typedef mng_dbyk * mng_dbykp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* ORDR entry */
|
||||
mng_chunkid iChunkname;
|
||||
mng_uint8 iOrdertype;
|
||||
} mng_ordr_entry;
|
||||
typedef mng_ordr_entry * mng_ordr_entryp;
|
||||
|
||||
typedef struct mng_ordr_struct { /* ORDR */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iCount;
|
||||
mng_ordr_entryp pEntries;
|
||||
} mng_ordr;
|
||||
typedef mng_ordr * mng_ordrp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* unknown chunk */
|
||||
mng_chunk_header sHeader;
|
||||
mng_uint32 iDatasize;
|
||||
mng_ptr pData;
|
||||
} mng_unknown_chunk;
|
||||
typedef mng_unknown_chunk * mng_unknown_chunkp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_chunks_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,799 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_cms.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : color management routines (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "mng_objects.h"
|
||||
#include "mng_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);
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mnglcms_freeprofile (mng_cmsprof hProf)
|
||||
{
|
||||
cmsCloseProfile (hProf);
|
||||
return;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mnglcms_freetransform (mng_cmstrans hTrans)
|
||||
{
|
||||
/* B001 start */
|
||||
cmsDeleteTransform (hTrans);
|
||||
/* B001 end */
|
||||
return;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_LCMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Color-management initialization & correction routines * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS
|
||||
|
||||
mng_retcode init_full_cms (mng_datap pData)
|
||||
{
|
||||
mng_cmsprof hProf;
|
||||
mng_cmstrans hTrans;
|
||||
mng_imagedatap pBuf = ((mng_imagep)pData->pObjzero)->pImgbuf;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_FULL_CMS, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
if ((pBuf->bHasICCP) || (pData->bHasglobalICCP))
|
||||
{
|
||||
if (!pData->hProf2) /* output profile defined ? */
|
||||
MNG_ERROR (pData, MNG_NOOUTPUTPROFILE);
|
||||
|
||||
if (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)
|
||||
|
||||
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_ptr)correct_full_cms;
|
||||
|
||||
return MNG_NOERROR; /* and done */
|
||||
}
|
||||
|
||||
if ((pBuf->bHasSRGB) || (pData->bHasglobalSRGB))
|
||||
{
|
||||
mng_uint8 iIntent;
|
||||
|
||||
if (pData->bIssRGB) /* sRGB system ? */
|
||||
return MNG_NOERROR; /* no conversion required */
|
||||
|
||||
if (!pData->hProf3) /* sRGB profile defined ? */
|
||||
MNG_ERROR (pData, MNG_NOSRGBPROFILE)
|
||||
|
||||
hProf = pData->hProf3; /* convert from sRGB profile */
|
||||
|
||||
if (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_ptr)correct_full_cms;
|
||||
|
||||
return MNG_NOERROR; /* and done */
|
||||
}
|
||||
|
||||
if ( ((pBuf->bHasCHRM) || (pData->bHasglobalCHRM)) &&
|
||||
((pBuf->bHasGAMA) || (pData->bHasglobalGAMA)) )
|
||||
{
|
||||
mng_CIExyY sWhitepoint;
|
||||
mng_CIExyYTRIPLE sPrimaries;
|
||||
mng_gammatabp pGammatable[3];
|
||||
mng_float dGamma;
|
||||
|
||||
if (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;
|
||||
}
|
||||
|
||||
sWhitepoint.Y = /* Y component is always 1.0 */
|
||||
sPrimaries.Red.Y =
|
||||
sPrimaries.Green.Y =
|
||||
sPrimaries.Blue.Y = 1.0;
|
||||
|
||||
if (pBuf->bHasGAMA) /* get the gamma value */
|
||||
dGamma = (mng_float)pBuf->iGamma / 100000;
|
||||
else
|
||||
dGamma = (mng_float)pData->iGlobalGamma / 100000;
|
||||
|
||||
/* dGamma = pData->dViewgamma / (dGamma * pData->dDisplaygamma); ??? */
|
||||
dGamma = pData->dViewgamma / dGamma;
|
||||
|
||||
pGammatable [0] = /* and build the lookup tables */
|
||||
pGammatable [1] =
|
||||
pGammatable [2] = cmsBuildGamma (256, dGamma);
|
||||
|
||||
/* B001 start */
|
||||
if (!pGammatable [0]) /* enough memory ? */
|
||||
/* B001 end */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOMEM)
|
||||
/* create the profile */
|
||||
hProf = cmsCreateRGBProfile (&sWhitepoint, &sPrimaries, pGammatable);
|
||||
|
||||
/* B001 start */
|
||||
cmsFreeGamma (pGammatable [0]); /* free the temporary gamma tables ? */
|
||||
/* yes! but just the one! */
|
||||
/* B001 end */
|
||||
|
||||
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_ptr)correct_full_cms;
|
||||
|
||||
return MNG_NOERROR; /* and done */
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_FULL_CMS, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return init_gamma_only (pData); /* if we get here, we'll only do gamma */
|
||||
}
|
||||
#endif /* MNG_INCLUDE_LCMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS
|
||||
|
||||
mng_retcode init_full_cms_object (mng_datap pData)
|
||||
{
|
||||
mng_cmsprof hProf;
|
||||
mng_cmstrans hTrans;
|
||||
mng_imagedatap pBuf;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_FULL_CMS_OBJ, MNG_LC_START)
|
||||
#endif
|
||||
/* address the object-buffer */
|
||||
pBuf = ((mng_imagep)pData->pRetrieveobj)->pImgbuf;
|
||||
|
||||
if (pBuf->bHasICCP)
|
||||
{
|
||||
if (!pData->hProf2) /* output profile defined ? */
|
||||
MNG_ERROR (pData, MNG_NOOUTPUTPROFILE);
|
||||
|
||||
/* generate a profile handle */
|
||||
hProf = cmsOpenProfileFromMem (pBuf->pProfile, pBuf->iProfilesize);
|
||||
|
||||
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_ptr)correct_full_cms;
|
||||
|
||||
return MNG_NOERROR; /* and done */
|
||||
}
|
||||
|
||||
if (pBuf->bHasSRGB)
|
||||
{
|
||||
if (pData->bIssRGB) /* sRGB system ? */
|
||||
return MNG_NOERROR; /* no conversion required */
|
||||
|
||||
if (!pData->hProf3) /* sRGB profile defined ? */
|
||||
MNG_ERROR (pData, MNG_NOSRGBPROFILE)
|
||||
|
||||
hProf = pData->hProf3; /* convert from sRGB profile */
|
||||
|
||||
if (pData->bIsRGBA16) /* 16-bit intermediates ? */
|
||||
hTrans = cmsCreateTransform (hProf, TYPE_RGBA_16_SE,
|
||||
pData->hProf2, TYPE_RGBA_16_SE,
|
||||
pBuf->iRenderingintent, MNG_CMS_FLAGS);
|
||||
else
|
||||
hTrans = cmsCreateTransform (hProf, TYPE_RGBA_8,
|
||||
pData->hProf2, TYPE_RGBA_8,
|
||||
pBuf->iRenderingintent, 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_ptr)correct_full_cms;
|
||||
|
||||
return MNG_NOERROR; /* and done */
|
||||
}
|
||||
|
||||
if ((pBuf->bHasCHRM) && (pBuf->bHasGAMA))
|
||||
{
|
||||
mng_CIExyY sWhitepoint;
|
||||
mng_CIExyYTRIPLE sPrimaries;
|
||||
mng_gammatabp pGammatable[3];
|
||||
mng_float dGamma;
|
||||
|
||||
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;
|
||||
|
||||
sWhitepoint.Y = /* Y component is always 1.0 */
|
||||
sPrimaries.Red.Y =
|
||||
sPrimaries.Green.Y =
|
||||
sPrimaries.Blue.Y = 1.0;
|
||||
|
||||
dGamma = (mng_float)pBuf->iGamma / 100000;
|
||||
|
||||
/* dGamma = pData->dViewgamma / (dGamma * pData->dDisplaygamma); ??? */
|
||||
dGamma = pData->dViewgamma / dGamma;
|
||||
|
||||
pGammatable [0] = /* and build the lookup tables */
|
||||
pGammatable [1] =
|
||||
pGammatable [2] = cmsBuildGamma (256, dGamma);
|
||||
|
||||
/* B001 start */
|
||||
if (!pGammatable [0]) /* enough memory ? */
|
||||
/* B001 end */
|
||||
MNG_ERRORL (pData, MNG_LCMS_NOMEM)
|
||||
|
||||
/* create the profile */
|
||||
hProf = cmsCreateRGBProfile (&sWhitepoint, &sPrimaries, pGammatable);
|
||||
|
||||
/* B001 start */
|
||||
cmsFreeGamma (pGammatable [0]); /* free the temporary gamma tables ? */
|
||||
/* yes! but just the one! */
|
||||
/* B001 end */
|
||||
|
||||
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_ptr)correct_full_cms;
|
||||
|
||||
return MNG_NOERROR; /* and done */
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_FULL_CMS_OBJ, MNG_LC_END)
|
||||
#endif
|
||||
/* if we get here, we'll only do gamma */
|
||||
return init_gamma_only_object (pData);
|
||||
}
|
||||
#endif /* MNG_INCLUDE_LCMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS
|
||||
mng_retcode 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)
|
||||
mng_retcode init_gamma_only (mng_datap pData)
|
||||
{
|
||||
mng_float dGamma;
|
||||
mng_imagedatap pBuf = ((mng_imagep)pData->pObjzero)->pImgbuf;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_GAMMA_ONLY, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
if (pBuf->bHasGAMA) /* get the gamma value */
|
||||
dGamma = (mng_float)pBuf->iGamma / 100000;
|
||||
else
|
||||
if (pData->bHasglobalGAMA)
|
||||
dGamma = (mng_float)pData->iGlobalGamma / 100000;
|
||||
else
|
||||
dGamma = pData->dDfltimggamma;
|
||||
|
||||
if (dGamma) /* lets not divide by zero, shall we... */
|
||||
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_ptr)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 */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_GAMMA_ONLY) || defined(MNG_FULL_CMS)
|
||||
mng_retcode init_gamma_only_object (mng_datap pData)
|
||||
{
|
||||
mng_float dGamma;
|
||||
mng_imagedatap pBuf;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_GAMMA_ONLY_OBJ, MNG_LC_START)
|
||||
#endif
|
||||
/* address the object-buffer */
|
||||
pBuf = ((mng_imagep)pData->pRetrieveobj)->pImgbuf;
|
||||
|
||||
if (pBuf->bHasGAMA) /* get the gamma value */
|
||||
dGamma = (mng_float)pBuf->iGamma / 100000;
|
||||
else
|
||||
dGamma = pData->dDfltimggamma;
|
||||
|
||||
if (dGamma) /* lets not divide by zero, shall we... */
|
||||
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_ptr)correct_gamma_only;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_GAMMA_ONLY_OBJ, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_GAMMA_ONLY || MNG_FULL_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(MNG_GAMMA_ONLY) || defined(MNG_FULL_CMS)
|
||||
mng_retcode 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 */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_APP_CMS
|
||||
mng_retcode init_app_cms (mng_datap pData)
|
||||
{
|
||||
mng_imagedatap pBuf = ((mng_imagep)pData->pObjzero)->pImgbuf;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_APP_CMS, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
if ( (pData->fProcessiccp) &&
|
||||
((pBuf->bHasICCP) || (pData->bHasglobalICCP)) )
|
||||
{
|
||||
mng_uint32 iProfilesize;
|
||||
mng_ptr pProfile;
|
||||
|
||||
if (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_ptr)correct_app_cms;
|
||||
}
|
||||
|
||||
if ( (pData->fProcesssrgb) &&
|
||||
((pBuf->bHasSRGB) || (pData->bHasglobalSRGB)) )
|
||||
{
|
||||
mng_uint8 iIntent;
|
||||
|
||||
if (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_ptr)correct_app_cms;
|
||||
}
|
||||
|
||||
if ( (pData->fProcesschroma) &&
|
||||
( ((pBuf->bHasCHRM) || (pData->bHasglobalCHRM)) ) )
|
||||
{
|
||||
mng_uint32 iWhitepointx, iWhitepointy;
|
||||
mng_uint32 iPrimaryredx, iPrimaryredy;
|
||||
mng_uint32 iPrimarygreenx, iPrimarygreeny;
|
||||
mng_uint32 iPrimarybluex, iPrimarybluey;
|
||||
|
||||
if (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_ptr)correct_app_cms;
|
||||
}
|
||||
|
||||
if ( (pData->fProcessgamma) &&
|
||||
((pBuf->bHasGAMA) || (pData->bHasglobalGAMA)) )
|
||||
{
|
||||
mng_uint32 iGamma;
|
||||
|
||||
if (pBuf->bHasGAMA) /* get the gamma value */
|
||||
iGamma = pBuf->iGamma;
|
||||
else
|
||||
iGamma = pData->iGlobalGamma;
|
||||
/* inform the app */
|
||||
if (!pData->fProcessgamma ((mng_handle)pData, iGamma))
|
||||
MNG_ERROR (pData, MNG_APPCMSERROR)
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_ptr)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 init_app_cms_object (mng_datap pData)
|
||||
{
|
||||
mng_imagedatap pBuf = ((mng_imagep)pData->pCurrentobj)->pImgbuf;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_APP_CMS_OBJ, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
if ((pData->fProcessiccp) && (pBuf->bHasICCP))
|
||||
{ /* inform the app */
|
||||
if (!pData->fProcessiccp ((mng_handle)pData, pBuf->iProfilesize, pBuf->pProfile))
|
||||
MNG_ERROR (pData, MNG_APPCMSERROR)
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_ptr)correct_app_cms;
|
||||
}
|
||||
|
||||
if ((pData->fProcesssrgb) && (pBuf->bHasSRGB))
|
||||
{ /* inform the app */
|
||||
if (!pData->fProcesssrgb ((mng_handle)pData, pBuf->iRenderingintent))
|
||||
MNG_ERROR (pData, MNG_APPCMSERROR)
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_ptr)correct_app_cms;
|
||||
}
|
||||
|
||||
if ((pData->fProcesschroma) && (pBuf->bHasCHRM))
|
||||
{ /* inform the app */
|
||||
if (!pData->fProcesschroma ((mng_handle)pData, pBuf->iWhitepointx, pBuf->iWhitepointy,
|
||||
pBuf->iPrimaryredx, pBuf->iPrimaryredy,
|
||||
pBuf->iPrimarygreenx, pBuf->iPrimarygreeny,
|
||||
pBuf->iPrimarybluex, pBuf->iPrimarybluey))
|
||||
MNG_ERROR (pData, MNG_APPCMSERROR)
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_ptr)correct_app_cms;
|
||||
}
|
||||
|
||||
if ((pData->fProcessgamma) && (pBuf->bHasGAMA))
|
||||
{ /* inform the app */
|
||||
if (!pData->fProcessgamma ((mng_handle)pData, pBuf->iGamma))
|
||||
MNG_ERROR (pData, MNG_APPCMSERROR)
|
||||
/* load color-correction routine */
|
||||
pData->fCorrectrow = (mng_ptr)correct_app_cms;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_INIT_APP_CMS_OBJ, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_APP_CMS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_APP_CMS
|
||||
mng_retcode 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 * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_cms.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : color management routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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 * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_cms_h_
|
||||
#define _mng_cms_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.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 );
|
||||
void mnglcms_freeprofile (mng_cmsprof hProf );
|
||||
void mnglcms_freetransform (mng_cmstrans hTrans );
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_FULL_CMS
|
||||
mng_retcode init_full_cms (mng_datap pData);
|
||||
mng_retcode init_full_cms_object (mng_datap pData);
|
||||
mng_retcode correct_full_cms (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#if defined(MNG_FULL_CMS) || defined(MNG_GAMMA_ONLY)
|
||||
mng_retcode init_gamma_only (mng_datap pData);
|
||||
mng_retcode init_gamma_only_object (mng_datap pData);
|
||||
mng_retcode correct_gamma_only (mng_datap pData);
|
||||
#endif
|
||||
|
||||
#ifdef MNG_APP_CMS
|
||||
mng_retcode init_app_cms (mng_datap pData);
|
||||
mng_retcode init_app_cms_object (mng_datap pData);
|
||||
mng_retcode correct_app_cms (mng_datap pData);
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_cms_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,205 @@
|
|||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_conf.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : main configuration file * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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 * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_conf_h_
|
||||
#define _mng_conf_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * 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!) */
|
||||
|
||||
#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
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* 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 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 */
|
||||
|
||||
#if !defined(MNG_FULL_CMS) && !defined(MNG_GAMMA_ONLY) && !defined(MNG_NO_CMS) && !defined(MNG_APP_CMS)
|
||||
#if defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_FULL_CMS
|
||||
#else
|
||||
#define MNG_GAMMA_ONLY
|
||||
#endif
|
||||
/* #define MNG_NO_CMS */
|
||||
/* #define MNG_APP_CMS */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* 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! */
|
||||
|
||||
#ifndef MNG_SUPPORT_TRACE
|
||||
#if defined(MNG_BUILD_SO) || defined(MNG_USE_SO) || defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL)
|
||||
#define MNG_SUPPORT_TRACE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* 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-endian support */
|
||||
/* enable this 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 */
|
||||
|
||||
/* #define MNG_BIGENDIAN_SUPPORTED */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * End of user-selectable compile-time options * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_conf_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
|
@ -0,0 +1,617 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_data.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : main data structure definition * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the library main data structure * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/04/2000 - G.Juyn * */
|
||||
/* * - added CRC table to main structure (for thread-safety) * */
|
||||
/* * 0.5.1 - 05/06/2000 - G.Juyn * */
|
||||
/* * - added iPLTEentries for checking hIST-length * */
|
||||
/* * 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed palette definition to exported palette-type * */
|
||||
/* * - removed frozen indicator * */
|
||||
/* * - added create/write indicators * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/13/2000 - G.Juyn * */
|
||||
/* * - added eMNGma hack (will be removed in 1.0.0 !!!) * */
|
||||
/* * - added TERM animation object pointer (easier reference) * */
|
||||
/* * - added saved-data structure for SAVE/SEEK processing * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/18/2000 - G.Juyn * */
|
||||
/* * - added fields for JNG support (IJG-based) * */
|
||||
/* * 0.5.2 - 05/24/2000 - G.Juyn * */
|
||||
/* * - changed global tRNS definition * */
|
||||
/* * 0.5.2 - 05/30/2000 - G.Juyn * */
|
||||
/* * - added delta-image fields * */
|
||||
/* * 0.5.2 - 06/01/2000 - G.Juyn * */
|
||||
/* * - added internal delta-image processing callbacks * */
|
||||
/* * 0.5.2 - 06/02/2000 - G.Juyn * */
|
||||
/* * - changed SWAP_ENDIAN to BIGENDIAN_SUPPORTED * */
|
||||
/* * (contributed by Tim Rowley) * */
|
||||
/* * - added getalphaline callback for RGB8_A8 canvasstyle * */
|
||||
/* * 0.5.2 - 06/06/2000 - G.Juyn * */
|
||||
/* * - added parameter for delayed buffer-processing * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_data_h_
|
||||
#define _mng_data_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_MAGIC 0x52530a0aL
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Internal structures * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef mng_palette8 mng_rgbpaltab;
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * The saved_data structure * */
|
||||
/* * * */
|
||||
/* * This contains the saved data after a SAVE chunk has been processed. * */
|
||||
/* * The data is saved from the main data structure during SAVE processing, * */
|
||||
/* * and restored to the main data structure during SEEK processing. * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct mng_savedata_struct {
|
||||
|
||||
#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)
|
||||
mng_bool bHasglobalPLTE; /* global PLTE chunk processed */
|
||||
mng_bool bHasglobalTRNS; /* global tRNS chunk processed */
|
||||
mng_bool bHasglobalGAMA; /* global gAMA chunk processed */
|
||||
mng_bool bHasglobalCHRM; /* global cHRM chunk processed */
|
||||
mng_bool bHasglobalSRGB; /* global sRGB chunk processed */
|
||||
mng_bool bHasglobalICCP; /* global iCCP chunk processed */
|
||||
mng_bool bHasglobalBKGD; /* global bKGD chunk processed */
|
||||
#endif /* MNG_SUPPORT_READ || MNG_SUPPORT_WRITE */
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_uint16 iDEFIobjectid; /* DEFI fields */
|
||||
mng_uint8 iDEFIdonotshow;
|
||||
mng_uint8 iDEFIconcrete;
|
||||
mng_bool bDEFIhasloca;
|
||||
mng_int32 iDEFIlocax;
|
||||
mng_int32 iDEFIlocay;
|
||||
mng_bool bDEFIhasclip;
|
||||
mng_int32 iDEFIclipl;
|
||||
mng_int32 iDEFIclipr;
|
||||
mng_int32 iDEFIclipt;
|
||||
mng_int32 iDEFIclipb;
|
||||
|
||||
mng_uint16 iBACKred; /* BACK fields */
|
||||
mng_uint16 iBACKgreen;
|
||||
mng_uint16 iBACKblue;
|
||||
mng_uint8 iBACKmandatory;
|
||||
mng_uint16 iBACKimageid;
|
||||
mng_uint8 iBACKtile;
|
||||
|
||||
mng_uint8 iFRAMmode; /* FRAM fields (global) */
|
||||
mng_uint32 iFRAMdelay;
|
||||
mng_uint32 iFRAMtimeout;
|
||||
mng_bool bFRAMclipping;
|
||||
mng_int32 iFRAMclipl;
|
||||
mng_int32 iFRAMclipr;
|
||||
mng_int32 iFRAMclipt;
|
||||
mng_int32 iFRAMclipb;
|
||||
|
||||
mng_uint32 iGlobalPLTEcount; /* global PLTE fields */
|
||||
mng_rgbpaltab aGlobalPLTEentries;
|
||||
|
||||
mng_uint32 iGlobalTRNSrawlen; /* global tRNS fields */
|
||||
mng_uint8arr aGlobalTRNSrawdata;
|
||||
|
||||
mng_uint32 iGlobalGamma; /* global gAMA fields */
|
||||
|
||||
mng_uint32 iGlobalWhitepointx; /* global cHRM fields */
|
||||
mng_uint32 iGlobalWhitepointy;
|
||||
mng_uint32 iGlobalPrimaryredx;
|
||||
mng_uint32 iGlobalPrimaryredy;
|
||||
mng_uint32 iGlobalPrimarygreenx;
|
||||
mng_uint32 iGlobalPrimarygreeny;
|
||||
mng_uint32 iGlobalPrimarybluex;
|
||||
mng_uint32 iGlobalPrimarybluey;
|
||||
|
||||
mng_uint8 iGlobalRendintent; /* global sRGB fields */
|
||||
|
||||
mng_uint32 iGlobalProfilesize; /* global iCCP fields */
|
||||
mng_ptr pGlobalProfile;
|
||||
|
||||
mng_uint16 iGlobalBKGDred; /* global bKGD fields */
|
||||
mng_uint16 iGlobalBKGDgreen;
|
||||
mng_uint16 iGlobalBKGDblue;
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
} mng_savedata;
|
||||
|
||||
typedef mng_savedata * mng_savedatap;
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * The main libmng data structure * */
|
||||
/* * * */
|
||||
/* * The handle used in all functions points to this structure which * */
|
||||
/* * contains all volatile data necessary to process the network graphic. * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct mng_data_struct {
|
||||
|
||||
mng_uint32 iMagic; /* magic number to validate
|
||||
a given handle */
|
||||
mng_int32 iUserdata; /* application workdata */
|
||||
|
||||
mng_imgtype eSigtype; /* image information */
|
||||
mng_imgtype eImagetype; /* initially zeroed */
|
||||
mng_uint32 iWidth; /* filled after header is processed */
|
||||
mng_uint32 iHeight;
|
||||
mng_uint32 iTicks; /* these only after MHDR */
|
||||
mng_uint32 iLayercount;
|
||||
mng_uint32 iFramecount;
|
||||
mng_uint32 iPlaytime;
|
||||
mng_uint32 iSimplicity;
|
||||
|
||||
mng_uint32 iCanvasstyle; /* layout of the drawing-canvas */
|
||||
mng_uint32 iBkgdstyle; /* layout of the background-canvas */
|
||||
|
||||
mng_int8 iMagnify; /* magnification factor (not used yet) */
|
||||
mng_uint32 iOffsetx; /* x-offset for extremely large image */
|
||||
mng_uint32 iOffsety; /* y-offset for extremely large image */
|
||||
mng_uint32 iCanvaswidth; /* real canvas size */
|
||||
mng_uint32 iCanvasheight; /* must be set by processheader callback */
|
||||
|
||||
mng_uint16 iBGred; /* default background color */
|
||||
mng_uint16 iBGgreen; /* initially "black" */
|
||||
mng_uint16 iBGblue;
|
||||
|
||||
mng_bool bIssRGB; /* indicates sRGB system */
|
||||
|
||||
#ifdef MNG_FULL_CMS /* little CMS variables */
|
||||
mng_cmsprof hProf1; /* image input profile */
|
||||
mng_cmsprof hProf2; /* default output profile */
|
||||
mng_cmsprof hProf3; /* default sRGB profile */
|
||||
mng_cmstrans hTrans; /* current transformation handle */
|
||||
#endif
|
||||
|
||||
mng_float dViewgamma; /* gamma calculation variables */
|
||||
mng_float dDisplaygamma; /* initially set for sRGB conditions */
|
||||
mng_float dDfltimggamma;
|
||||
|
||||
mng_bool bStorechunks; /* switch to store chunkdata */
|
||||
|
||||
mng_uint32 iMaxwidth; /* maximum canvas size */
|
||||
mng_uint32 iMaxheight; /* initially set to 1024 x 1024 */
|
||||
|
||||
mng_int32 iErrorcode; /* error reporting fields */
|
||||
mng_int8 iSeverity;
|
||||
mng_int32 iErrorx1;
|
||||
mng_int32 iErrorx2;
|
||||
mng_pchar zErrortext;
|
||||
|
||||
mng_memalloc fMemalloc; /* callback pointers */
|
||||
mng_memfree fMemfree; /* initially nulled */
|
||||
mng_openstream fOpenstream;
|
||||
mng_closestream fClosestream;
|
||||
mng_readdata fReaddata;
|
||||
mng_writedata fWritedata;
|
||||
mng_errorproc fErrorproc;
|
||||
mng_traceproc fTraceproc;
|
||||
mng_processheader fProcessheader;
|
||||
mng_processtext fProcesstext;
|
||||
mng_getcanvasline fGetcanvasline;
|
||||
mng_getbkgdline fGetbkgdline;
|
||||
mng_getalphaline fGetalphaline;
|
||||
mng_refresh fRefresh;
|
||||
mng_gettickcount fGettickcount;
|
||||
mng_settimer fSettimer;
|
||||
mng_processgamma fProcessgamma;
|
||||
mng_processchroma fProcesschroma;
|
||||
mng_processsrgb fProcesssrgb;
|
||||
mng_processiccp fProcessiccp;
|
||||
mng_processarow fProcessarow;
|
||||
|
||||
#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)
|
||||
mng_bool bPreDraft48; /* flags ancient style draft */
|
||||
|
||||
mng_chunkid iChunkname; /* read/write-state variables */
|
||||
mng_uint32 iChunkseq;
|
||||
mng_chunkp pFirstchunk; /* double-linked list of */
|
||||
mng_chunkp pLastchunk; /* stored chunk-structures */
|
||||
|
||||
mng_bool bHasheader; /* first header chunk processed */
|
||||
mng_bool bHasMHDR; /* inside a MHDR-MEND sequence */
|
||||
mng_bool bHasIHDR; /* inside a IHDR-IEND sequence */
|
||||
mng_bool bHasBASI; /* inside a BASI-IEND sequence */
|
||||
mng_bool bHasDHDR; /* inside a DHDR-IEND sequence */
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
mng_bool bHasJHDR; /* inside a JHDR-IEND sequence */
|
||||
mng_bool bHasJSEP; /* passed the JSEP separator */
|
||||
mng_bool bHasJDAT; /* at least 1 JDAT processed */
|
||||
#endif
|
||||
mng_bool bHasPLTE; /* PLTE chunk processed */
|
||||
mng_bool bHasTRNS; /* tRNS chunk processed */
|
||||
mng_bool bHasGAMA; /* gAMA chunk processed */
|
||||
mng_bool bHasCHRM; /* cHRM chunk processed */
|
||||
mng_bool bHasSRGB; /* sRGB chunk processed */
|
||||
mng_bool bHasICCP; /* iCCP chunk processed */
|
||||
mng_bool bHasBKGD; /* bKGD chunk processed */
|
||||
mng_bool bHasIDAT; /* at least 1 IDAT processed */
|
||||
|
||||
mng_bool bHasSAVE; /* SAVE chunk processed */
|
||||
mng_bool bHasBACK; /* BACK chunk processed */
|
||||
mng_bool bHasFRAM; /* FRAM chunk processed */
|
||||
mng_bool bHasTERM; /* TERM chunk processed */
|
||||
mng_bool bHasLOOP; /* at least 1 LOOP open */
|
||||
|
||||
mng_bool bHasglobalPLTE; /* global PLTE chunk processed */
|
||||
mng_bool bHasglobalTRNS; /* global tRNS chunk processed */
|
||||
mng_bool bHasglobalGAMA; /* global gAMA chunk processed */
|
||||
mng_bool bHasglobalCHRM; /* global cHRM chunk processed */
|
||||
mng_bool bHasglobalSRGB; /* global sRGB chunk processed */
|
||||
mng_bool bHasglobalICCP; /* global iCCP chunk processed */
|
||||
mng_bool bHasglobalBKGD; /* global bKGD chunk processed */
|
||||
|
||||
mng_uint32 iDatawidth; /* IHDR/BASI/DHDR fields */
|
||||
mng_uint32 iDataheight; /* valid if inside IHDR-IEND, */
|
||||
mng_uint8 iBitdepth; /* BASI-IEND or DHDR-IEND */
|
||||
mng_uint8 iColortype;
|
||||
mng_uint8 iCompression;
|
||||
mng_uint8 iFilter;
|
||||
mng_uint8 iInterlace;
|
||||
|
||||
mng_uint32 iPLTEcount; /* PLTE fields */
|
||||
|
||||
mng_bool bEMNGMAhack; /* TODO: to be removed in 1.0.0 !!! */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
mng_uint8 iJHDRcolortype; /* JHDR fields */
|
||||
mng_uint8 iJHDRimgbitdepth; /* valid if inside JHDR-IEND */
|
||||
mng_uint8 iJHDRimgcompression;
|
||||
mng_uint8 iJHDRimginterlace;
|
||||
mng_uint8 iJHDRalphabitdepth;
|
||||
mng_uint8 iJHDRalphacompression;
|
||||
mng_uint8 iJHDRalphafilter;
|
||||
mng_uint8 iJHDRalphainterlace;
|
||||
#endif
|
||||
|
||||
#endif /* MNG_SUPPORT_READ || MNG_SUPPORT_WRITE */
|
||||
|
||||
#ifdef MNG_SUPPORT_READ
|
||||
mng_bool bReading; /* read processing variables */
|
||||
mng_bool bHavesig;
|
||||
mng_bool bEOF;
|
||||
mng_uint32 iReadbufsize;
|
||||
mng_uint8p pReadbuf;
|
||||
#endif /* MNG_SUPPORT_READ */
|
||||
|
||||
#ifdef MNG_SUPPORT_WRITE
|
||||
mng_bool bCreating; /* create/write processing variables */
|
||||
mng_bool bWriting;
|
||||
mng_chunkid iFirstchunkadded;
|
||||
mng_uint32 iWritebufsize;
|
||||
mng_uint8p pWritebuf;
|
||||
#endif
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
mng_bool bDisplaying; /* display-state variables */
|
||||
mng_uint32 iFrameseq;
|
||||
mng_uint32 iLayerseq;
|
||||
mng_uint32 iFrametime; /* millisecs */
|
||||
|
||||
mng_uint32 iRuntime; /* millisecs since start */
|
||||
mng_uint32 iStarttime; /* tickcount at start */
|
||||
mng_uint32 iEndtime; /* tickcount at end */
|
||||
mng_bool bRunning; /* animation is active */
|
||||
mng_bool bTimerset; /* the timer has been set;
|
||||
we're expecting a call to
|
||||
mng_display_resume! */
|
||||
mng_uint8 iBreakpoint; /* indicates at which point the
|
||||
flow was broken to run the timer */
|
||||
mng_bool bSuspended; /* input-reading has been suspended;
|
||||
we're expecting a call to
|
||||
mng_read_resume! */
|
||||
mng_uint8 iSuspendpoint; /* indicates at which point the flow
|
||||
was broken to suspend input-reading */
|
||||
mng_objectp pCurrentobj; /* current "object" */
|
||||
mng_objectp pCurraniobj; /* current animation object
|
||||
"to be"/"being" processed */
|
||||
mng_objectp pTermaniobj; /* TERM animation object */
|
||||
mng_objectp pObjzero; /* "on-the-fly" image (object = 0) */
|
||||
mng_objectp pLastclone; /* last clone */
|
||||
mng_objectp pStoreobj; /* current store object for row routines */
|
||||
mng_objectp pStorebuf; /* current store object-buffer for row routines */
|
||||
mng_objectp pRetrieveobj; /* current retrieve object for row routines */
|
||||
mng_savedatap pSavedata; /* pointer to saved data (after SAVE) */
|
||||
|
||||
mng_int8 iPass; /* current interlacing pass;
|
||||
negative value means no interlace */
|
||||
mng_int32 iRow; /* current row counter */
|
||||
mng_int32 iRowinc; /* row increment for this pass */
|
||||
mng_int32 iCol; /* current starting column */
|
||||
mng_int32 iColinc; /* column increment for this pass */
|
||||
mng_int32 iRowsamples; /* nr. of samples in current workrow */
|
||||
mng_int32 iSamplemul; /* needed to calculate rowsize */
|
||||
mng_int32 iSampleofs; /* from rowsamples */
|
||||
mng_int32 iSamplediv;
|
||||
mng_int32 iRowsize; /* size of actual data in work row */
|
||||
mng_int32 iRowmax; /* maximum size of data in work row */
|
||||
mng_uint8p pWorkrow; /* working row of pixel-data */
|
||||
mng_uint8p pPrevrow; /* previous row of pixel-data */
|
||||
mng_uint8p pRGBArow; /* intermediate row of RGBA8 or RGBA16 data */
|
||||
mng_bool bIsRGBA16; /* indicates intermediate row is RGBA16 */
|
||||
mng_bool bIsOpaque; /* indicates intermediate row is fully opaque */
|
||||
mng_int32 iFilterbpp; /* bpp index for filtering routines */
|
||||
|
||||
mng_int32 iSourcel; /* variables for showing objects */
|
||||
mng_int32 iSourcer;
|
||||
mng_int32 iSourcet;
|
||||
mng_int32 iSourceb;
|
||||
mng_int32 iDestl;
|
||||
mng_int32 iDestr;
|
||||
mng_int32 iDestt;
|
||||
mng_int32 iDestb;
|
||||
|
||||
mng_objectp pFirstimgobj; /* double-linked list of */
|
||||
mng_objectp pLastimgobj; /* image-object structures */
|
||||
mng_objectp pFirstaniobj; /* double-linked list of */
|
||||
mng_objectp pLastaniobj; /* animation-object structures */
|
||||
|
||||
#if defined(MNG_GAMMA_ONLY) || defined(MNG_FULL_CMS)
|
||||
mng_uint8 aGammatab[256]; /* precomputed gamma lookup table */
|
||||
mng_float dLastgamma; /* last gamma used to compute table */
|
||||
#endif
|
||||
|
||||
mng_ptr fDisplayrow; /* internal callback to display an
|
||||
uncompressed/unfiltered/
|
||||
color-corrected row */
|
||||
mng_ptr fRestbkgdrow; /* internal callback for restore-
|
||||
background processing of a row */
|
||||
mng_ptr fCorrectrow; /* internal callback to color-correct an
|
||||
uncompressed/unfiltered row */
|
||||
mng_ptr fRetrieverow; /* internal callback to retrieve an
|
||||
uncompressed/unfiltered row of data */
|
||||
mng_ptr fStorerow; /* internal callback to store an
|
||||
uncompressed/unfiltered row of data */
|
||||
mng_ptr fProcessrow; /* internal callback to process an
|
||||
uncompressed row of data */
|
||||
mng_ptr fInitrowproc; /* internal callback to initialize
|
||||
the row processing */
|
||||
|
||||
mng_uint16 iDEFIobjectid; /* DEFI fields */
|
||||
mng_uint8 iDEFIdonotshow;
|
||||
mng_uint8 iDEFIconcrete;
|
||||
mng_bool bDEFIhasloca;
|
||||
mng_int32 iDEFIlocax;
|
||||
mng_int32 iDEFIlocay;
|
||||
mng_bool bDEFIhasclip;
|
||||
mng_int32 iDEFIclipl;
|
||||
mng_int32 iDEFIclipr;
|
||||
mng_int32 iDEFIclipt;
|
||||
mng_int32 iDEFIclipb;
|
||||
|
||||
mng_uint16 iBACKred; /* BACK fields */
|
||||
mng_uint16 iBACKgreen;
|
||||
mng_uint16 iBACKblue;
|
||||
mng_uint8 iBACKmandatory;
|
||||
mng_uint16 iBACKimageid;
|
||||
mng_uint8 iBACKtile;
|
||||
|
||||
mng_bool bHasnextBACK; /* next frame BACK fields */
|
||||
mng_uint16 iNextBACKred;
|
||||
mng_uint16 iNextBACKgreen;
|
||||
mng_uint16 iNextBACKblue;
|
||||
mng_uint8 iNextBACKmandatory;
|
||||
mng_uint16 iNextBACKimageid;
|
||||
mng_uint8 iNextBACKtile;
|
||||
|
||||
mng_uint8 iFRAMmode; /* FRAM fields (global) */
|
||||
mng_uint32 iFRAMdelay;
|
||||
mng_uint32 iFRAMtimeout;
|
||||
mng_bool bFRAMclipping;
|
||||
mng_int32 iFRAMclipl;
|
||||
mng_int32 iFRAMclipr;
|
||||
mng_int32 iFRAMclipt;
|
||||
mng_int32 iFRAMclipb;
|
||||
|
||||
mng_uint8 iFramemode; /* current subframe variables */
|
||||
mng_uint32 iFramedelay;
|
||||
mng_uint32 iFrametimeout;
|
||||
mng_bool bFrameclipping;
|
||||
mng_int32 iFrameclipl;
|
||||
mng_int32 iFrameclipr;
|
||||
mng_int32 iFrameclipt;
|
||||
mng_int32 iFrameclipb;
|
||||
|
||||
mng_uint32 iNextdelay; /* delay for *after* next image */
|
||||
|
||||
mng_uint8 iSHOWmode; /* SAVE fields */
|
||||
mng_uint16 iSHOWfromid;
|
||||
mng_uint16 iSHOWtoid;
|
||||
mng_uint16 iSHOWnextid;
|
||||
mng_int16 iSHOWskip;
|
||||
|
||||
mng_uint32 iGlobalPLTEcount; /* global PLTE fields */
|
||||
mng_rgbpaltab aGlobalPLTEentries;
|
||||
|
||||
mng_uint32 iGlobalTRNSrawlen; /* global tRNS fields */
|
||||
mng_uint8arr aGlobalTRNSrawdata;
|
||||
|
||||
mng_uint32 iGlobalGamma; /* global gAMA fields */
|
||||
|
||||
mng_uint32 iGlobalWhitepointx; /* global cHRM fields */
|
||||
mng_uint32 iGlobalWhitepointy;
|
||||
mng_uint32 iGlobalPrimaryredx;
|
||||
mng_uint32 iGlobalPrimaryredy;
|
||||
mng_uint32 iGlobalPrimarygreenx;
|
||||
mng_uint32 iGlobalPrimarygreeny;
|
||||
mng_uint32 iGlobalPrimarybluex;
|
||||
mng_uint32 iGlobalPrimarybluey;
|
||||
|
||||
mng_uint8 iGlobalRendintent; /* global sRGB fields */
|
||||
|
||||
mng_uint32 iGlobalProfilesize; /* global iCCP fields */
|
||||
mng_ptr pGlobalProfile;
|
||||
|
||||
mng_uint16 iGlobalBKGDred; /* global bKGD fields */
|
||||
mng_uint16 iGlobalBKGDgreen;
|
||||
mng_uint16 iGlobalBKGDblue;
|
||||
|
||||
mng_ptr pDeltaImage; /* delta-image fields */
|
||||
mng_uint8 iDeltaImagetype;
|
||||
mng_uint8 iDeltatype;
|
||||
mng_uint32 iDeltaBlockwidth;
|
||||
mng_uint32 iDeltaBlockheight;
|
||||
mng_uint32 iDeltaBlockx;
|
||||
mng_uint32 iDeltaBlocky;
|
||||
|
||||
mng_ptr fDeltagetrow; /* internal delta-proc callbacks */
|
||||
mng_ptr fDeltaaddrow;
|
||||
mng_ptr fDeltareplacerow;
|
||||
mng_ptr fDeltaputrow;
|
||||
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
|
||||
#ifdef MNG_INCLUDE_ZLIB
|
||||
z_stream sZlib; /* zlib (de)compression variables */
|
||||
|
||||
mng_int32 iZlevel; /* zlib compression parameters */
|
||||
mng_int32 iZmethod;
|
||||
mng_int32 iZwindowbits;
|
||||
mng_int32 iZmemlevel;
|
||||
mng_int32 iZstrategy;
|
||||
|
||||
mng_uint32 iMaxIDAT; /* maximum size of IDAT data */
|
||||
|
||||
mng_bool bInflating; /* indicates "inflate" in progress */
|
||||
mng_bool bDeflating; /* indicates "deflate" in progress */
|
||||
#endif /* MNG_INCLUDE_ZLIB */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
mngjpeg_dctmethod eJPEGdctmethod; /* IJG compression variables */
|
||||
mng_int32 iJPEGquality;
|
||||
mng_int32 iJPEGsmoothing;
|
||||
mng_bool bJPEGcompressprogr;
|
||||
mng_bool bJPEGcompressopt;
|
||||
|
||||
mng_uint32 iMaxJDAT; /* maximum size of JDAT data */
|
||||
|
||||
mngjpeg_compp pJPEGcinfo; /* compression structure */
|
||||
mngjpeg_errorp pJPEGcerr; /* error-manager compress */
|
||||
mngjpeg_decompp pJPEGdinfo; /* decompression structure */
|
||||
mngjpeg_errorp pJPEGderr; /* error-manager decompress */
|
||||
mngjpeg_sourcep pJPEGdsrc; /* source-manager decompress */
|
||||
|
||||
mng_uint8p pJPEGbuf; /* buffer for JPEG (de)compression */
|
||||
mng_uint32 iJPEGbufmax; /* allocated space for buffer */
|
||||
mng_uint8p pJPEGcurrent; /* current pointer into buffer */
|
||||
mng_uint32 iJPEGbufremain; /* remaining bytes in buffer */
|
||||
mng_uint32 iJPEGtoskip; /* bytes to skip on next input-block */
|
||||
|
||||
mng_uint8p pJPEGrow; /* buffer for a JPEG row of samples */
|
||||
mng_uint32 iJPEGrowlen;
|
||||
|
||||
mng_bool bJPEGcompress; /* indicates "compress" initialized */
|
||||
|
||||
mng_bool bJPEGdecompress; /* indicates "decompress" ininitialized */
|
||||
mng_bool bJPEGhasheader; /* indicates "readheader" succeeded */
|
||||
mng_bool bJPEGdecostarted; /* indicates "decompress" started */
|
||||
mng_bool bJPEGscanstarted; /* indicates "first scan" started */
|
||||
mng_bool bJPEGprogressive; /* indicates a progressive image */
|
||||
|
||||
mng_ptr fStorerow2; /* internal callback to store an
|
||||
uncompressed/unfiltered row of JPEG-data */
|
||||
mng_uint32 iJPEGrow; /* row-number for current JPEG row */
|
||||
mng_uint32 iJPEGalpharow; /* nr. of rows filled with alpha */
|
||||
mng_uint32 iJPEGrgbrow; /* nr. of rows filled with 'color'-info */
|
||||
mng_uint32 iJPEGdisprow; /* nr. of rows already displayed "on-the-fly" */
|
||||
|
||||
#if defined(MNG_USE_SETJMP) && defined (MNG_INCLUDE_IJG6B)
|
||||
jmp_buf sErrorbuf; /* setjmp/longjmp buffer (error-recovery) */
|
||||
#endif
|
||||
|
||||
#endif /* MNG_INCLUDE_JNG */
|
||||
|
||||
mng_uint32 aCRCtable [256]; /* CRC prefab table */
|
||||
mng_bool bCRCcomputed; /* "has been build" indicator */
|
||||
|
||||
} mng_data;
|
||||
|
||||
typedef mng_data * mng_datap;
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Internal Callback-Function prototypes * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef mng_retcode(*mng_displayrow) (mng_datap pData);
|
||||
typedef mng_retcode(*mng_restbkgdrow) (mng_datap pData);
|
||||
typedef mng_retcode(*mng_correctrow) (mng_datap pData);
|
||||
typedef mng_retcode(*mng_retrieverow) (mng_datap pData);
|
||||
typedef mng_retcode(*mng_storerow) (mng_datap pData);
|
||||
typedef mng_retcode(*mng_processrow) (mng_datap pData);
|
||||
typedef mng_retcode(*mng_initrowproc) (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Routines for swapping byte-order from and to graphic files * */
|
||||
/* * (This code is adapted from the libpng package) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef MNG_BIGENDIAN_SUPPORTED
|
||||
mng_uint32 mng_get_uint32 (mng_uint8p pBuf);
|
||||
mng_int32 mng_get_int32 (mng_uint8p pBuf);
|
||||
mng_uint16 mng_get_uint16 (mng_uint8p pBuf);
|
||||
void mng_put_uint32 (mng_uint8p pBuf,
|
||||
mng_uint32 i);
|
||||
void mng_put_int32 (mng_uint8p pBuf,
|
||||
mng_int32 i);
|
||||
void mng_put_uint16 (mng_uint8p pBuf,
|
||||
mng_uint16 i);
|
||||
#else /* MNG_BIGENDIAN_SUPPORTED */
|
||||
#define mng_get_uint32(P) *(mng_uint32p)(P)
|
||||
#define mng_get_int32(P) *(mng_int32p)(P)
|
||||
#define mng_get_uint16(P) *(mng_uint16p)(P)
|
||||
#define mng_put_uint32(P,I) *(mng_uint32p)(P) = (I)
|
||||
#define mng_put_int32(P,I) *(mng_int32p)(P) = (I)
|
||||
#define mng_put_uint16(P,I) *(mng_uint16p)(P) = (I)
|
||||
#endif /* MNG_BIGENDIAN_SUPPORTED */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Some handy(?) macro definitions * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MAX_COORD(a, b) (((a) > (b)) ? (a) : (b))
|
||||
#define MIN_COORD(a, b) (((a) < (b)) ? (a) : (b))
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_data_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,141 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_display.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : Display management (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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 * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_display_h_
|
||||
#define _mng_display_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode display_image (mng_datap pData,
|
||||
mng_imagep pImage,
|
||||
mng_bool bLayeradvanced);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode process_display_ihdr (mng_datap pData);
|
||||
|
||||
mng_retcode process_display_idat (mng_datap pData,
|
||||
mng_uint32 iRawlen,
|
||||
mng_uint8p pRawdata);
|
||||
|
||||
mng_retcode process_display_iend (mng_datap pData);
|
||||
mng_retcode process_display_mend (mng_datap pData);
|
||||
mng_retcode process_display_defi (mng_datap pData);
|
||||
|
||||
mng_retcode process_display_basi (mng_datap pData,
|
||||
mng_uint16 iRed,
|
||||
mng_uint16 iGreen,
|
||||
mng_uint16 iBlue,
|
||||
mng_bool bHasalpha,
|
||||
mng_uint16 iAlpha,
|
||||
mng_uint8 iViewable);
|
||||
|
||||
mng_retcode 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 process_display_clon2 (mng_datap pData);
|
||||
|
||||
mng_retcode process_display_disc (mng_datap pData,
|
||||
mng_uint32 iCount,
|
||||
mng_uint16p pIds);
|
||||
|
||||
mng_retcode 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 process_display_fram2 (mng_datap pData);
|
||||
|
||||
mng_retcode process_display_move (mng_datap pData,
|
||||
mng_uint16 iFromid,
|
||||
mng_uint16 iToid,
|
||||
mng_uint8 iMovetype,
|
||||
mng_int32 iMovex,
|
||||
mng_int32 iMovey);
|
||||
|
||||
mng_retcode 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);
|
||||
|
||||
mng_retcode process_display_show (mng_datap pData);
|
||||
mng_retcode process_display_save (mng_datap pData);
|
||||
mng_retcode process_display_seek (mng_datap pData);
|
||||
mng_retcode process_display_jhdr (mng_datap pData);
|
||||
|
||||
mng_retcode process_display_jdat (mng_datap pData,
|
||||
mng_uint32 iRawlen,
|
||||
mng_uint8p pRawdata);
|
||||
|
||||
mng_retcode 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 process_display_prom (mng_datap pData,
|
||||
mng_uint8 iBitdepth,
|
||||
mng_uint8 iColortype,
|
||||
mng_uint8 iFilltype);
|
||||
|
||||
mng_retcode process_display_ipng (mng_datap pData);
|
||||
mng_retcode process_display_ijng (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_display_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,51 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_dither.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Dithering routines (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the dithering routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "mng_dither.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode dither_a_row (mng_datap pData,
|
||||
mng_uint8p pRow)
|
||||
{
|
||||
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_dither.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Dithering routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the dithering routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_dither_h_
|
||||
#define _mng_dither_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode dither_a_row (mng_datap pData,
|
||||
mng_uint8p pRow);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_dither_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,215 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_error.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : Error routines (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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 * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_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_error_entry 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"},
|
||||
{MNG_JPEGERROR, "ijgsrc6b encountered an error"},
|
||||
{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_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"},
|
||||
{MNG_INVDELTATYPE, "The delta_type is invalid"},
|
||||
{MNG_INVALIDINDEX, "Index-value out of bounds"},
|
||||
{MNG_TOOMUCHJDAT, "Too much data in JDAT chunk(s)"},
|
||||
{MNG_JPEGPARMSERR, "JHDR parameters & JFIF-data do not match"},
|
||||
{MNG_INVFILLMETHOD, "The fill_method is invalid"},
|
||||
{MNG_OBJNOTCONCRETE, "Target object for DHDR must be concrete"},
|
||||
{MNG_TARGETNOALPHA, "Target object must have alpha-channel"},
|
||||
|
||||
{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_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_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
|
||||
|
||||
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
|
||||
pData->zErrortext = 0;
|
||||
#endif /* mng_error_telltale */
|
||||
|
||||
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; }
|
||||
}
|
||||
}
|
||||
|
||||
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_FALSE; /* automatic failure */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_error.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : Error functions (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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" * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_error_h_
|
||||
#define _mng_error_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Default error routines * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_bool mng_process_error (mng_datap pData,
|
||||
mng_retcode iError,
|
||||
mng_retcode iExtra1,
|
||||
mng_retcode iExtra2);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Error handling macros * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#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; }
|
||||
#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 * mng_error_entryp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_error_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,252 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_filter.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Filtering routines (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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 * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "mng_filter.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_FILTERS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode 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[0])
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
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 + 1 + iBpp;
|
||||
pRawx_prev = pData->pWorkrow + 1;
|
||||
|
||||
for (iX = iBpp; iX < pData->iRowsize; iX++)
|
||||
{
|
||||
pRawx [0] = (mng_uint8)(pRawx [0] + pRawx_prev [0]);
|
||||
pRawx++;
|
||||
pRawx_prev++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_SUB, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
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 + 1;
|
||||
pPriorx = pData->pPrevrow + 1;
|
||||
|
||||
for (iX = 0; iX < pData->iRowsize; iX++)
|
||||
{
|
||||
pRawx [0] = (mng_uint8)(pRawx [0] + pPriorx [0]);
|
||||
pRawx++;
|
||||
pPriorx++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_UP, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
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 + 1;
|
||||
pPriorx = pData->pPrevrow + 1;
|
||||
pRawx_prev = pData->pWorkrow + 1;
|
||||
|
||||
for (iX = 0; iX < iBpp; iX++)
|
||||
{
|
||||
pRawx [0] = (mng_uint8)(pRawx [0] + (pPriorx [0] >> 1));
|
||||
pRawx++;
|
||||
pPriorx++;
|
||||
}
|
||||
|
||||
for (iX = iBpp; iX < pData->iRowsize; iX++)
|
||||
{
|
||||
pRawx [0] = (mng_uint8)(pRawx [0] + ((pRawx_prev [0] + pPriorx [0]) >> 1));
|
||||
pRawx++;
|
||||
pPriorx++;
|
||||
pRawx_prev++;
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_FILTER_AVERAGE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
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 + 1;
|
||||
pPriorx = pData->pPrevrow + 1;
|
||||
pRawx_prev = pData->pWorkrow + 1;
|
||||
pPriorx_prev = pData->pPrevrow + 1;
|
||||
|
||||
for (iX = 0; iX < iBpp; iX++)
|
||||
{
|
||||
pRawx [0] = (mng_uint8)(pRawx [0] + pPriorx [0]);
|
||||
|
||||
pRawx++;
|
||||
pPriorx++;
|
||||
}
|
||||
|
||||
for (iX = iBpp; iX < pData->iRowsize; iX++)
|
||||
{
|
||||
iA = (mng_uint32)pRawx_prev [0];
|
||||
iB = (mng_uint32)pPriorx [0];
|
||||
iC = (mng_uint32)pPriorx_prev [0];
|
||||
iP = iA + iB - iC;
|
||||
iPa = abs (iP - iA);
|
||||
iPb = abs (iP - iB);
|
||||
iPc = abs (iP - iC);
|
||||
|
||||
if ((iPa <= iPb) && (iPa <= iPc))
|
||||
pRawx [0] = (mng_uint8)(pRawx [0] + iA);
|
||||
else
|
||||
if (iPb <= iPc)
|
||||
pRawx [0] = (mng_uint8)(pRawx [0] + iB);
|
||||
else
|
||||
pRawx [0] = (mng_uint8)(pRawx [0] + 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;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_FILTERS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_filter.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Filtering routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the filtering routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_filter_h_
|
||||
#define _mng_filter_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode filter_a_row (mng_datap pData);
|
||||
|
||||
mng_retcode filter_sub (mng_datap pData);
|
||||
mng_retcode filter_up (mng_datap pData);
|
||||
mng_retcode filter_average (mng_datap pData);
|
||||
mng_retcode filter_paeth (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_filter_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,556 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_jpeg.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : JPEG library interface (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the JPEG library interface * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/22/2000 - G.Juyn * */
|
||||
/* * - implemented all the JNG routines * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "mng_memory.h"
|
||||
#include "mng_pixels.h"
|
||||
#include "mng_jpeg.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Local IJG callback routines (source-manager & error-manager) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_IJG6B
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mng_init_source (j_decompress_ptr cinfo)
|
||||
{
|
||||
return; /* nothing needed */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
boolean mng_fill_input_buffer (j_decompress_ptr cinfo)
|
||||
{
|
||||
return FALSE; /* force IJG routine to return to caller */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mng_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
|
||||
{
|
||||
if (num_bytes > 0) /* ignore fony calls */
|
||||
{ /* address my generic structure */
|
||||
mng_datap pData = (mng_datap)cinfo->client_data;
|
||||
/* address source manager */
|
||||
mngjpeg_sourcep pSrc = pData->pJPEGdinfo->src;
|
||||
/* problem scenario ? */
|
||||
if (pSrc->bytes_in_buffer < (size_t)num_bytes)
|
||||
{ /* tell the boss we need to skip some data! */
|
||||
pData->iJPEGtoskip = (size_t)num_bytes - pSrc->bytes_in_buffer;
|
||||
|
||||
pSrc->bytes_in_buffer = 0; /* let the JPEG lib suspend */
|
||||
pSrc->next_input_byte = MNG_NULL;
|
||||
}
|
||||
else
|
||||
{ /* simply advance in the buffer */
|
||||
pSrc->bytes_in_buffer -= num_bytes;
|
||||
pSrc->next_input_byte += num_bytes;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
void mng_term_source (j_decompress_ptr cinfo)
|
||||
{
|
||||
return; /* nothing needed */
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_USE_SETJMP
|
||||
void mng_error_exit (j_common_ptr cinfo)
|
||||
{ /* address my generic structure */
|
||||
mng_datap pData = (mng_datap)cinfo->client_data;
|
||||
|
||||
#ifdef MNG_ERROR_TELLTALE /* fill the message text ??? */
|
||||
(*cinfo->err->output_message) (cinfo);
|
||||
#endif
|
||||
/* return to the point of no return... */
|
||||
longjmp (pData->sErrorbuf, cinfo->err->msg_code);
|
||||
}
|
||||
#endif /* MNG_USE_SETJMP */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_USE_SETJMP
|
||||
void mng_output_message (j_common_ptr cinfo)
|
||||
{
|
||||
return; /* just do nothing ! */
|
||||
}
|
||||
#endif /* MNG_USE_SETJMP */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_IJG6B */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Global JPEG routines * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngjpeg_initialize (mng_datap pData)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_INITIALIZE, MNG_LC_START)
|
||||
#endif
|
||||
/* allocate space for JPEG structures if necessary */
|
||||
#if defined(MNG_SUPPORT_WRITE) || defined(MNG_ACCESS_CHUNKS)
|
||||
if (pData->pJPEGcerr == MNG_NULL)
|
||||
MNG_ALLOC (pData, pData->pJPEGcerr, sizeof (mngjpeg_error ))
|
||||
if (pData->pJPEGcinfo == MNG_NULL)
|
||||
MNG_ALLOC (pData, pData->pJPEGcinfo, sizeof (mngjpeg_comp ))
|
||||
/* enable reverse addressing */
|
||||
pData->pJPEGcinfo->client_data = pData;
|
||||
#endif
|
||||
|
||||
#if defined(MNG_SUPPORT_DISPLAY) || defined(MNG_ACCESS_CHUNKS)
|
||||
if (pData->pJPEGderr == MNG_NULL)
|
||||
MNG_ALLOC (pData, pData->pJPEGderr, sizeof (mngjpeg_error ))
|
||||
if (pData->pJPEGdsrc == MNG_NULL)
|
||||
MNG_ALLOC (pData, pData->pJPEGdsrc, sizeof (mngjpeg_source))
|
||||
if (pData->pJPEGdinfo == MNG_NULL)
|
||||
MNG_ALLOC (pData, pData->pJPEGdinfo, sizeof (mngjpeg_decomp))
|
||||
/* enable reverse addressing */
|
||||
pData->pJPEGdinfo->client_data = pData;
|
||||
#endif
|
||||
/* initialize temporary buffer parms */
|
||||
pData->iJPEGbufmax = MNG_JPEG_MAXBUF;
|
||||
MNG_ALLOC (pData, pData->pJPEGbuf, pData->iJPEGbufmax)
|
||||
|
||||
pData->pJPEGcurrent = pData->pJPEGbuf;
|
||||
pData->iJPEGbufremain = 0;
|
||||
pData->pJPEGrow = MNG_NULL;
|
||||
pData->iJPEGrowlen = 0;
|
||||
pData->iJPEGtoskip = 0;
|
||||
|
||||
pData->bJPEGcompress = MNG_FALSE; /* not doing anything yet ! */
|
||||
pData->bJPEGdecompress = MNG_FALSE;
|
||||
pData->bJPEGhasheader = MNG_FALSE;
|
||||
pData->bJPEGdecostarted = MNG_FALSE;
|
||||
pData->bJPEGscanstarted = MNG_FALSE;
|
||||
|
||||
pData->iJPEGrow = 0; /* zero input/output lines */
|
||||
pData->iJPEGalpharow = 0;
|
||||
pData->iJPEGrgbrow = 0;
|
||||
pData->iJPEGdisprow = 0;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_INITIALIZE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngjpeg_cleanup (mng_datap pData)
|
||||
{
|
||||
#if defined(MNG_INCLUDE_IJG6B) && defined(MNG_USE_SETJMP)
|
||||
mng_retcode iRetcode;
|
||||
#endif
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_CLEANUP, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_IJG6B
|
||||
#ifdef MNG_USE_SETJMP
|
||||
iRetcode = setjmp (pData->sErrorbuf);/* setup local JPEG error-recovery */
|
||||
if (iRetcode != 0) /* got here from longjmp ? */
|
||||
MNG_ERRORJ (pData, iRetcode); /* then IJG-lib issued an error */
|
||||
#endif
|
||||
|
||||
if (pData->bJPEGcompress) /* still compressing something ? */
|
||||
jpeg_destroy_compress (pData->pJPEGcinfo);
|
||||
|
||||
if (pData->bJPEGdecompress) /* still decompressing something ? */
|
||||
jpeg_destroy_decompress (pData->pJPEGdinfo);
|
||||
|
||||
#endif /* MNG_INCLUDE_IJG6B */
|
||||
/* cleanup temporary buffer */
|
||||
MNG_FREE (pData, pData->pJPEGbuf, pData->iJPEGbufmax)
|
||||
/* cleanup space for JPEG structures */
|
||||
#if defined(MNG_SUPPORT_DISPLAY) || defined(MNG_ACCESS_CHUNKS)
|
||||
MNG_FREE (pData, pData->pJPEGdinfo, sizeof (mngjpeg_decomp))
|
||||
MNG_FREE (pData, pData->pJPEGdsrc, sizeof (mngjpeg_source))
|
||||
MNG_FREE (pData, pData->pJPEGderr, sizeof (mngjpeg_error ))
|
||||
#endif
|
||||
|
||||
#if defined(MNG_SUPPORT_WRITE) || defined(MNG_ACCESS_CHUNKS)
|
||||
MNG_FREE (pData, pData->pJPEGcinfo, sizeof (mngjpeg_comp ))
|
||||
MNG_FREE (pData, pData->pJPEGcerr, sizeof (mngjpeg_error ))
|
||||
#endif
|
||||
|
||||
MNG_FREE (pData, pData->pJPEGrow, pData->iJPEGrowlen)
|
||||
|
||||
pData->bJPEGcompress = MNG_FALSE; /* whatever we were doing ... */
|
||||
pData->bJPEGdecompress = MNG_FALSE; /* we don't anymore ... */
|
||||
pData->bJPEGhasheader = MNG_FALSE;
|
||||
pData->bJPEGdecostarted = MNG_FALSE;
|
||||
pData->bJPEGscanstarted = MNG_FALSE;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_CLEANUP, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngjpeg_decompressinit (mng_datap pData)
|
||||
{
|
||||
#if defined(MNG_INCLUDE_IJG6B) && defined(MNG_USE_SETJMP)
|
||||
mng_retcode iRetcode;
|
||||
#endif
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_DECOMPRESSINIT, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_IJG6B
|
||||
/* Allocate and initialize a JPEG decompression object */
|
||||
pData->pJPEGdinfo->err = jpeg_std_error (pData->pJPEGderr);
|
||||
|
||||
#ifdef MNG_USE_SETJMP /* setup local JPEG error-routines */
|
||||
pData->pJPEGderr->error_exit = mng_error_exit;
|
||||
pData->pJPEGderr->output_message = mng_output_message;
|
||||
|
||||
iRetcode = setjmp (pData->sErrorbuf);/* setup local JPEG error-recovery */
|
||||
if (iRetcode != 0) /* got here from longjmp ? */
|
||||
MNG_ERRORJ (pData, iRetcode); /* then IJG-lib issued an error */
|
||||
#endif /* MNG_USE_SETJMP */
|
||||
|
||||
/* Allocate and initialize a JPEG decompression object (continued) */
|
||||
jpeg_create_decompress (pData->pJPEGdinfo);
|
||||
|
||||
pData->bJPEGdecompress = MNG_TRUE; /* indicate it's initialized */
|
||||
|
||||
/* Specify the source of the compressed data (eg, a file) */
|
||||
/* no, not a file; we have buffered input */
|
||||
pData->pJPEGdinfo->src = pData->pJPEGdsrc;
|
||||
/* use the default handler */
|
||||
pData->pJPEGdinfo->src->resync_to_restart = jpeg_resync_to_restart;
|
||||
/* setup local source routine & parms */
|
||||
pData->pJPEGdinfo->src->init_source = mng_init_source;
|
||||
pData->pJPEGdinfo->src->fill_input_buffer = mng_fill_input_buffer;
|
||||
pData->pJPEGdinfo->src->skip_input_data = mng_skip_input_data;
|
||||
pData->pJPEGdinfo->src->term_source = mng_term_source;
|
||||
pData->pJPEGdinfo->src->next_input_byte = pData->pJPEGcurrent;
|
||||
pData->pJPEGdinfo->src->bytes_in_buffer = pData->iJPEGbufremain;
|
||||
|
||||
#endif /* MNG_INCLUDE_IJG6B */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_DECOMPRESSINIT, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngjpeg_decompressdata (mng_datap pData,
|
||||
mng_uint32 iRawsize,
|
||||
mng_uint8p pRawdata)
|
||||
{
|
||||
mng_retcode iRetcode;
|
||||
mng_uint32 iRemain;
|
||||
mng_uint8p pWork;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_DECOMPRESSDATA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
#if defined (MNG_INCLUDE_IJG6B) && defined(MNG_USE_SETJMP)
|
||||
iRetcode = setjmp (pData->sErrorbuf);/* initialize local JPEG error-recovery */
|
||||
if (iRetcode != 0) /* got here from longjmp ? */
|
||||
MNG_ERRORJ (pData, iRetcode); /* then IJG-lib issued an error */
|
||||
#endif
|
||||
|
||||
pWork = pRawdata;
|
||||
iRemain = iRawsize;
|
||||
|
||||
if (pData->iJPEGtoskip) /* JPEG-lib told us to skip some more data ? */
|
||||
{
|
||||
if (iRemain > pData->iJPEGtoskip) /* enough data in this buffer ? */
|
||||
{
|
||||
iRemain -= pData->iJPEGtoskip; /* skip enough to access the next byte */
|
||||
pWork += pData->iJPEGtoskip;
|
||||
|
||||
pData->iJPEGtoskip = 0; /* no more to skip then */
|
||||
}
|
||||
else
|
||||
{
|
||||
pData->iJPEGtoskip -= iRemain; /* skip all data in the buffer */
|
||||
iRemain = 0; /* and indicate this accordingly */
|
||||
}
|
||||
/* the skip set current-pointer to NULL ! */
|
||||
pData->pJPEGcurrent = pData->pJPEGbuf;
|
||||
}
|
||||
|
||||
while (iRemain) /* repeat until no more input-bytes */
|
||||
{ /* need to shift anything ? */
|
||||
if ((pData->pJPEGcurrent > pData->pJPEGbuf) &&
|
||||
(pData->pJPEGcurrent - pData->pJPEGbuf + pData->iJPEGbufremain + iRemain > pData->iJPEGbufmax))
|
||||
{
|
||||
if (pData->iJPEGbufremain > 0) /* then do so */
|
||||
MNG_COPY (pData->pJPEGbuf, pData->pJPEGcurrent, pData->iJPEGbufremain)
|
||||
|
||||
pData->pJPEGcurrent = pData->pJPEGbuf;
|
||||
}
|
||||
/* does the remaining input fit into the buffer ? */
|
||||
if (pData->iJPEGbufremain + iRemain <= pData->iJPEGbufmax)
|
||||
{ /* move the lot */
|
||||
MNG_COPY ((pData->pJPEGcurrent + pData->iJPEGbufremain), pWork, iRemain)
|
||||
|
||||
pData->iJPEGbufremain += iRemain;/* adjust remaining_bytes counter */
|
||||
iRemain = 0; /* and indicate there's no input left */
|
||||
}
|
||||
else
|
||||
{ /* calculate what does fit */
|
||||
mng_uint32 iFits = pData->iJPEGbufmax - pData->iJPEGbufremain;
|
||||
|
||||
if (iFits <= 0) /* no space is just bugger 'm all */
|
||||
MNG_ERROR (pData, MNG_JPEGBUFTOOSMALL)
|
||||
/* move that */
|
||||
MNG_COPY ((pData->pJPEGcurrent + pData->iJPEGbufremain), pWork, iFits)
|
||||
|
||||
pData->iJPEGbufremain += iFits; /* adjust remain_bytes counter */
|
||||
iRemain -= iFits; /* and the input-parms */
|
||||
pWork += iFits;
|
||||
}
|
||||
|
||||
pData->pJPEGdinfo->src->next_input_byte = pData->pJPEGcurrent;
|
||||
pData->pJPEGdinfo->src->bytes_in_buffer = pData->iJPEGbufremain;
|
||||
|
||||
#ifdef MNG_INCLUDE_IJG6B
|
||||
if (!pData->bJPEGhasheader) /* haven't got the header yet ? */
|
||||
{
|
||||
/* Call jpeg_read_header() to obtain image info */
|
||||
if (jpeg_read_header (pData->pJPEGdinfo, TRUE) != JPEG_SUSPENDED)
|
||||
{ /* indicate the header's oke */
|
||||
pData->bJPEGhasheader = MNG_TRUE;
|
||||
|
||||
if ((pData->pJPEGdinfo->image_width != pData->iDatawidth ) ||
|
||||
(pData->pJPEGdinfo->image_height != pData->iDataheight) )
|
||||
MNG_ERROR (pData, MNG_JPEGPARMSERR)
|
||||
|
||||
if ( ((pData->iJHDRcolortype == MNG_COLORTYPE_JPEGGRAY ) ||
|
||||
(pData->iJHDRcolortype == MNG_COLORTYPE_JPEGGRAYA) ) &&
|
||||
(pData->pJPEGdinfo->jpeg_color_space != JCS_GRAYSCALE ) )
|
||||
MNG_ERROR (pData, MNG_JPEGPARMSERR)
|
||||
|
||||
if ( ((pData->iJHDRcolortype == MNG_COLORTYPE_JPEGCOLOR ) ||
|
||||
(pData->iJHDRcolortype == MNG_COLORTYPE_JPEGCOLORA) ) &&
|
||||
(pData->pJPEGdinfo->jpeg_color_space != JCS_YCbCr ) )
|
||||
MNG_ERROR (pData, MNG_JPEGPARMSERR)
|
||||
/* indicate whether or not it's progressive */
|
||||
pData->bJPEGprogressive = (mng_bool)jpeg_has_multiple_scans (pData->pJPEGdinfo);
|
||||
/* progressive+alpha can't display "on-the-fly"!! */
|
||||
if ((pData->bJPEGprogressive) &&
|
||||
((pData->iJHDRcolortype == MNG_COLORTYPE_JPEGGRAYA ) ||
|
||||
(pData->iJHDRcolortype == MNG_COLORTYPE_JPEGCOLORA) ))
|
||||
pData->fDisplayrow = MNG_NULL;
|
||||
/* allocate a row of JPEG-samples */
|
||||
if (pData->pJPEGdinfo->jpeg_color_space == JCS_YCbCr)
|
||||
pData->iJPEGrowlen = pData->pJPEGdinfo->image_width * 3;
|
||||
else
|
||||
pData->iJPEGrowlen = pData->pJPEGdinfo->image_width;
|
||||
|
||||
MNG_ALLOC (pData, pData->pJPEGrow, pData->iJPEGrowlen)
|
||||
|
||||
pData->iJPEGrgbrow = 0; /* quite empty up to now */
|
||||
}
|
||||
|
||||
pData->pJPEGcurrent = (mng_uint8p)pData->pJPEGdinfo->src->next_input_byte;
|
||||
pData->iJPEGbufremain = pData->pJPEGdinfo->src->bytes_in_buffer;
|
||||
}
|
||||
/* decompress not started ? */
|
||||
if ((pData->bJPEGhasheader) && (!pData->bJPEGdecostarted))
|
||||
{
|
||||
/* Set parameters for decompression */
|
||||
|
||||
if (pData->bJPEGprogressive) /* progressive display ? */
|
||||
pData->pJPEGdinfo->buffered_image = TRUE;
|
||||
|
||||
/* jpeg_start_decompress(...); */
|
||||
if (jpeg_start_decompress (pData->pJPEGdinfo) == TRUE)
|
||||
/* indicate it started */
|
||||
pData->bJPEGdecostarted = MNG_TRUE;
|
||||
|
||||
pData->pJPEGcurrent = (mng_uint8p)pData->pJPEGdinfo->src->next_input_byte;
|
||||
pData->iJPEGbufremain = pData->pJPEGdinfo->src->bytes_in_buffer;
|
||||
}
|
||||
/* process some scanlines ? */
|
||||
if ((pData->bJPEGhasheader) && (pData->bJPEGdecostarted) &&
|
||||
((!jpeg_input_complete (pData->pJPEGdinfo)) ||
|
||||
(pData->pJPEGdinfo->output_scanline < pData->pJPEGdinfo->output_height)))
|
||||
{
|
||||
mng_int32 iLines;
|
||||
|
||||
/* for (each output pass) */
|
||||
do
|
||||
{ /* address the row output buffer */
|
||||
JSAMPROW pRow = (JSAMPROW)pData->pJPEGrow;
|
||||
|
||||
/* init new pass ? */
|
||||
if ((pData->bJPEGprogressive) &&
|
||||
((!pData->bJPEGscanstarted) ||
|
||||
(pData->pJPEGdinfo->output_scanline >= pData->pJPEGdinfo->output_height)))
|
||||
{
|
||||
pData->bJPEGscanstarted = MNG_TRUE;
|
||||
|
||||
/* adjust output decompression parameters if required */
|
||||
/* nop */
|
||||
|
||||
/* start a new output pass */
|
||||
jpeg_start_output (pData->pJPEGdinfo, pData->pJPEGdinfo->input_scan_number);
|
||||
|
||||
pData->iJPEGrow = 0; /* start at row 0 in the image again */
|
||||
}
|
||||
|
||||
/* while (scan lines remain to be read) */
|
||||
do
|
||||
{
|
||||
/* jpeg_read_scanlines(...); */
|
||||
iLines = jpeg_read_scanlines (pData->pJPEGdinfo, (JSAMPARRAY)&pRow, 1);
|
||||
|
||||
pData->pJPEGcurrent = (mng_uint8p)pData->pJPEGdinfo->src->next_input_byte;
|
||||
pData->iJPEGbufremain = pData->pJPEGdinfo->src->bytes_in_buffer;
|
||||
|
||||
if (iLines > 0) /* got something ? */
|
||||
{
|
||||
if (pData->fStorerow2) /* store in object ? */
|
||||
{
|
||||
iRetcode = ((mng_storerow)pData->fStorerow2) (pData);
|
||||
|
||||
if (iRetcode) /* on error bail out */
|
||||
return iRetcode;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
while ((pData->pJPEGdinfo->output_scanline < pData->pJPEGdinfo->output_height) &&
|
||||
(iLines > 0)); /* until end-of-image or not enough input-data */
|
||||
|
||||
/* terminate output pass */
|
||||
if ((pData->bJPEGprogressive) &&
|
||||
(pData->pJPEGdinfo->output_scanline >= pData->pJPEGdinfo->output_height))
|
||||
jpeg_finish_output (pData->pJPEGdinfo);
|
||||
|
||||
}
|
||||
while ((!jpeg_input_complete (pData->pJPEGdinfo)) && (iLines > 0));
|
||||
}
|
||||
/* end of image ? */
|
||||
if ((pData->bJPEGhasheader) && (pData->bJPEGdecostarted) &&
|
||||
(jpeg_input_complete (pData->pJPEGdinfo)) &&
|
||||
(pData->pJPEGdinfo->input_scan_number == pData->pJPEGdinfo->output_scan_number))
|
||||
{
|
||||
/* jpeg_finish_decompress(...); */
|
||||
if (jpeg_finish_decompress (pData->pJPEGdinfo) == TRUE)
|
||||
{ /* indicate it's done */
|
||||
pData->bJPEGhasheader = MNG_FALSE;
|
||||
pData->bJPEGdecostarted = MNG_FALSE;
|
||||
pData->pJPEGcurrent = (mng_uint8p)pData->pJPEGdinfo->src->next_input_byte;
|
||||
pData->iJPEGbufremain = pData->pJPEGdinfo->src->bytes_in_buffer;
|
||||
/* remaining fluff is an error ! */
|
||||
if ((pData->iJPEGbufremain > 0) || (iRemain > 0))
|
||||
MNG_ERROR (pData, MNG_TOOMUCHJDAT)
|
||||
}
|
||||
}
|
||||
#endif /* MNG_INCLUDE_IJG6B */
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_DECOMPRESSDATA, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mngjpeg_decompressfree (mng_datap pData)
|
||||
{
|
||||
#if defined(MNG_INCLUDE_IJG6B) && defined(MNG_USE_SETJMP)
|
||||
mng_retcode iRetcode;
|
||||
#endif
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_DECOMPRESSFREE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_IJG6B
|
||||
#ifdef MNG_USE_SETJMP
|
||||
iRetcode = setjmp (pData->sErrorbuf);/* setup local JPEG error-recovery */
|
||||
if (iRetcode != 0) /* got here from longjmp ? */
|
||||
MNG_ERRORJ (pData, iRetcode); /* then IJG-lib issued an error */
|
||||
#endif
|
||||
|
||||
/* Release the JPEG decompression object */
|
||||
jpeg_destroy_decompress (pData->pJPEGdinfo);
|
||||
|
||||
pData->bJPEGdecompress = MNG_FALSE; /* indicate it's done */
|
||||
|
||||
#endif /* MNG_INCLUDE_IJG6B */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_JPEG_DECOMPRESSFREE, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_JNG */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_jpeg.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : JPEG library interface (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the JPEG library interface * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_jpeg_h_
|
||||
#define _mng_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);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_jpeg_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,62 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_memory.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Memory management (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of memory management functions * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_memory_h_
|
||||
#define _mng_memory_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Generic memory manager macros * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INTERNAL_MEMMNGMT
|
||||
#define MNG_ALLOC(H,P,L) { P = calloc (1, L); \
|
||||
if (P == 0) { MNG_ERROR (H, MNG_OUTOFMEMORY) } }
|
||||
#define MNG_ALLOCX(H,P,L) { P = calloc (1, 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 (L); \
|
||||
if (P == 0) { MNG_ERROR (H, MNG_OUTOFMEMORY) } }
|
||||
#define MNG_ALLOCX(H,P,L) { P = H->fMemalloc (L); }
|
||||
#define MNG_FREE(H,P,L) { if (P) { H->fMemfree (P, L); P = 0; } }
|
||||
#define MNG_FREEX(H,P,L) { if (P) { H->fMemfree (P, L); } }
|
||||
#endif /* mng_internal_memmngmt */
|
||||
|
||||
#define MNG_COPY(S,D,L) { memcpy (S, D, L); }
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_memory_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,390 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_object_prc.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Object processing routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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 * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_object_prc_h_
|
||||
#define _mng_object_prc_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode 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 free_imagedataobject (mng_datap pData,
|
||||
mng_imagedatap pImagedata);
|
||||
|
||||
mng_retcode clone_imagedataobject (mng_datap pData,
|
||||
mng_bool bConcrete,
|
||||
mng_imagedatap pSource,
|
||||
mng_imagedatap *ppClone);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode 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 free_imageobject (mng_datap pData,
|
||||
mng_imagep pImage);
|
||||
|
||||
mng_imagep find_imageobject (mng_datap pData,
|
||||
mng_uint16 iId);
|
||||
|
||||
mng_retcode 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 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 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 promote_imageobject (mng_datap pData,
|
||||
mng_imagep pImage,
|
||||
mng_uint8 iBitdepth,
|
||||
mng_uint8 iColortype,
|
||||
mng_uint8 iFilltype);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode create_ani_image (mng_datap pData);
|
||||
|
||||
mng_retcode create_ani_plte (mng_datap pData,
|
||||
mng_uint32 iEntrycount,
|
||||
mng_rgbpaltab aEntries);
|
||||
|
||||
mng_retcode create_ani_trns (mng_datap pData,
|
||||
mng_uint32 iRawlen,
|
||||
mng_uint8arr aRawdata);
|
||||
|
||||
mng_retcode create_ani_gama (mng_datap pData,
|
||||
mng_bool bEmpty,
|
||||
mng_uint32 iGamma);
|
||||
|
||||
mng_retcode 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 create_ani_srgb (mng_datap pData,
|
||||
mng_bool bEmpty,
|
||||
mng_uint8 iRenderinginent);
|
||||
|
||||
mng_retcode create_ani_iccp (mng_datap pData,
|
||||
mng_bool bEmpty,
|
||||
mng_uint32 iProfilesize,
|
||||
mng_ptr pProfile);
|
||||
|
||||
mng_retcode create_ani_bkgd (mng_datap pData,
|
||||
mng_uint16 iRed,
|
||||
mng_uint16 iGreen,
|
||||
mng_uint16 iBlue);
|
||||
|
||||
mng_retcode 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 create_ani_endl (mng_datap pData,
|
||||
mng_uint8 iLevel);
|
||||
|
||||
mng_retcode create_ani_defi (mng_datap pData);
|
||||
|
||||
mng_retcode 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 create_ani_clon (mng_datap pData,
|
||||
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_retcode 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 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 create_ani_move (mng_datap pData,
|
||||
mng_uint16 iFirstid,
|
||||
mng_uint16 iLastid,
|
||||
mng_uint8 iType,
|
||||
mng_int32 iLocax,
|
||||
mng_int32 iLocay);
|
||||
|
||||
mng_retcode 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 create_ani_show (mng_datap pData,
|
||||
mng_uint16 iFirstid,
|
||||
mng_uint16 iLastid,
|
||||
mng_uint8 iMode);
|
||||
|
||||
mng_retcode create_ani_term (mng_datap pData,
|
||||
mng_uint8 iTermaction,
|
||||
mng_uint8 iIteraction,
|
||||
mng_uint32 iDelay,
|
||||
mng_uint32 iItermax);
|
||||
|
||||
mng_retcode create_ani_save (mng_datap pData);
|
||||
mng_retcode create_ani_seek (mng_datap pData);
|
||||
|
||||
mng_retcode 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 create_ani_prom (mng_datap pData,
|
||||
mng_uint8 iBitdepth,
|
||||
mng_uint8 iColortype,
|
||||
mng_uint8 iFilltype);
|
||||
|
||||
mng_retcode create_ani_ipng (mng_datap pData);
|
||||
mng_retcode create_ani_ijng (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode free_ani_image (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
|
||||
mng_retcode free_ani_plte (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_trns (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_gama (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_chrm (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_srgb (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_iccp (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_bkgd (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_loop (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_endl (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_defi (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_basi (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_clon (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_back (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_fram (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_move (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_clip (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_show (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_term (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_save (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_seek (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_dhdr (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_prom (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_ipng (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode free_ani_ijng (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode process_ani_image (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
|
||||
mng_retcode process_ani_plte (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_trns (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_gama (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_chrm (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_srgb (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_iccp (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_bkgd (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_loop (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_endl (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_defi (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_basi (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_clon (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_back (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_fram (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_move (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_clip (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_show (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_term (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_save (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_seek (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_dhdr (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_prom (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_ipng (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
mng_retcode process_ani_ijng (mng_datap pData,
|
||||
mng_objectp pObject);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_object_prc_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,446 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_objects.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : Internal object structures (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the internal object structures * */
|
||||
/* * * */
|
||||
/* * requires : libmng.h * */
|
||||
/* * * */
|
||||
/* * 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 * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_objects_h_
|
||||
#define _mng_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;
|
||||
} 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_uint8 iAlphabitdepth; /* used only for JNG images */
|
||||
|
||||
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_uint8 aTRNSentries[256];
|
||||
|
||||
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_int32 iPosx; /* location fields */
|
||||
mng_int32 iPosy;
|
||||
mng_bool bClipped; /* clipping fields */
|
||||
mng_int32 iClipl;
|
||||
mng_int32 iClipr;
|
||||
mng_int32 iClipt;
|
||||
mng_int32 iClipb;
|
||||
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;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct { /* global gCRM 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;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
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;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
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;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
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_uint8 iDonotshow;
|
||||
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_ani_seek;
|
||||
typedef mng_ani_seek * mng_ani_seekp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
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;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_DISPLAY_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_objects_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,260 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_pixels.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : Pixel-row management routines (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the pixel-row management routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/22/2000 - G.Juyn * */
|
||||
/* * - added some JNG definitions * */
|
||||
/* * - added delta-image row-processing routines * */
|
||||
/* * 0.5.2 - 06/05/2000 - G.Juyn * */
|
||||
/* * - added support for RGB8_A8 canvasstyle * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_pixels_h_
|
||||
#define _mng_pixels_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Display routines - convert rowdata (which is already color-corrected) * */
|
||||
/* * to the output canvas, respecting any transparency information * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode display_rgb8 (mng_datap pData);
|
||||
mng_retcode display_rgba8 (mng_datap pData);
|
||||
mng_retcode display_argb8 (mng_datap pData);
|
||||
mng_retcode display_rgb8_a8 (mng_datap pData);
|
||||
mng_retcode display_bgr8 (mng_datap pData);
|
||||
mng_retcode display_bgra8 (mng_datap pData);
|
||||
mng_retcode display_abgr8 (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Background restore routines - restore the background with info from * */
|
||||
/* * the BACK and/or bKGD chunk and/or the app's background canvas * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode restore_bkgd_backimage (mng_datap pData);
|
||||
mng_retcode restore_bkgd_backcolor (mng_datap pData);
|
||||
mng_retcode restore_bkgd_bgcolor (mng_datap pData);
|
||||
mng_retcode restore_bkgd_rgb8 (mng_datap pData);
|
||||
mng_retcode restore_bkgd_bgr8 (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Row retrieval routines - retrieve processed & uncompressed row-data * */
|
||||
/* * from the current "object" * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode retrieve_g8 (mng_datap pData);
|
||||
mng_retcode retrieve_g16 (mng_datap pData);
|
||||
mng_retcode retrieve_rgb8 (mng_datap pData);
|
||||
mng_retcode retrieve_rgb16 (mng_datap pData);
|
||||
mng_retcode retrieve_idx8 (mng_datap pData);
|
||||
mng_retcode retrieve_ga8 (mng_datap pData);
|
||||
mng_retcode retrieve_ga16 (mng_datap pData);
|
||||
mng_retcode retrieve_rgba8 (mng_datap pData);
|
||||
mng_retcode retrieve_rgba16 (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Row storage routines - store processed & uncompressed row-data * */
|
||||
/* * into the current "object" * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode store_g1 (mng_datap pData);
|
||||
mng_retcode store_g2 (mng_datap pData);
|
||||
mng_retcode store_g4 (mng_datap pData);
|
||||
mng_retcode store_g8 (mng_datap pData);
|
||||
mng_retcode store_g16 (mng_datap pData);
|
||||
mng_retcode store_rgb8 (mng_datap pData);
|
||||
mng_retcode store_rgb16 (mng_datap pData);
|
||||
mng_retcode store_idx1 (mng_datap pData);
|
||||
mng_retcode store_idx2 (mng_datap pData);
|
||||
mng_retcode store_idx4 (mng_datap pData);
|
||||
mng_retcode store_idx8 (mng_datap pData);
|
||||
mng_retcode store_ga8 (mng_datap pData);
|
||||
mng_retcode store_ga16 (mng_datap pData);
|
||||
mng_retcode store_rgba8 (mng_datap pData);
|
||||
mng_retcode store_rgba16 (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Row storage routines (JPEG) - store processed & uncompressed row-data * */
|
||||
/* * into the current "object" * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode store_jpeg_g8 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb8 (mng_datap pData);
|
||||
mng_retcode store_jpeg_ga8 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgba8 (mng_datap pData);
|
||||
|
||||
mng_retcode store_jpeg_g12 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb12 (mng_datap pData);
|
||||
mng_retcode store_jpeg_ga12 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgba12 (mng_datap pData);
|
||||
|
||||
mng_retcode store_jpeg_g8_a1 (mng_datap pData);
|
||||
mng_retcode store_jpeg_g8_a2 (mng_datap pData);
|
||||
mng_retcode store_jpeg_g8_a4 (mng_datap pData);
|
||||
mng_retcode store_jpeg_g8_a8 (mng_datap pData);
|
||||
mng_retcode store_jpeg_g8_a16 (mng_datap pData);
|
||||
|
||||
mng_retcode store_jpeg_rgb8_a1 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb8_a2 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb8_a4 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb8_a8 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb8_a16 (mng_datap pData);
|
||||
|
||||
mng_retcode store_jpeg_g12_a1 (mng_datap pData);
|
||||
mng_retcode store_jpeg_g12_a2 (mng_datap pData);
|
||||
mng_retcode store_jpeg_g12_a4 (mng_datap pData);
|
||||
mng_retcode store_jpeg_g12_a8 (mng_datap pData);
|
||||
mng_retcode store_jpeg_g12_a16 (mng_datap pData);
|
||||
|
||||
mng_retcode store_jpeg_rgb12_a1 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb12_a2 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb12_a4 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb12_a8 (mng_datap pData);
|
||||
mng_retcode store_jpeg_rgb12_a16 (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Delta-image row routines - apply the processed & uncompressed row-data * */
|
||||
/* * onto the target "object" * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode delta_g1 (mng_datap pData);
|
||||
mng_retcode delta_g2 (mng_datap pData);
|
||||
mng_retcode delta_g4 (mng_datap pData);
|
||||
mng_retcode delta_g8 (mng_datap pData);
|
||||
mng_retcode delta_g16 (mng_datap pData);
|
||||
mng_retcode delta_rgb8 (mng_datap pData);
|
||||
mng_retcode delta_rgb16 (mng_datap pData);
|
||||
mng_retcode delta_idx1 (mng_datap pData);
|
||||
mng_retcode delta_idx2 (mng_datap pData);
|
||||
mng_retcode delta_idx4 (mng_datap pData);
|
||||
mng_retcode delta_idx8 (mng_datap pData);
|
||||
mng_retcode delta_ga8 (mng_datap pData);
|
||||
mng_retcode delta_ga16 (mng_datap pData);
|
||||
mng_retcode delta_rgba8 (mng_datap pData);
|
||||
mng_retcode delta_rgba16 (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Row processing routines - convert uncompressed data from zlib to * */
|
||||
/* * managable row-data which serves as input to the color-management * */
|
||||
/* * routines * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode process_g1 (mng_datap pData);
|
||||
mng_retcode process_g2 (mng_datap pData);
|
||||
mng_retcode process_g4 (mng_datap pData);
|
||||
mng_retcode process_g8 (mng_datap pData);
|
||||
mng_retcode process_g16 (mng_datap pData);
|
||||
mng_retcode process_rgb8 (mng_datap pData);
|
||||
mng_retcode process_rgb16 (mng_datap pData);
|
||||
mng_retcode process_idx1 (mng_datap pData);
|
||||
mng_retcode process_idx2 (mng_datap pData);
|
||||
mng_retcode process_idx4 (mng_datap pData);
|
||||
mng_retcode process_idx8 (mng_datap pData);
|
||||
mng_retcode process_ga8 (mng_datap pData);
|
||||
mng_retcode process_ga16 (mng_datap pData);
|
||||
mng_retcode process_rgba8 (mng_datap pData);
|
||||
mng_retcode process_rgba16 (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Row processing initialization routines - set up the variables needed * */
|
||||
/* * to process uncompressed row-data * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode init_g1_ni (mng_datap pData);
|
||||
mng_retcode init_g1_i (mng_datap pData);
|
||||
mng_retcode init_g2_ni (mng_datap pData);
|
||||
mng_retcode init_g2_i (mng_datap pData);
|
||||
mng_retcode init_g4_ni (mng_datap pData);
|
||||
mng_retcode init_g4_i (mng_datap pData);
|
||||
mng_retcode init_g8_ni (mng_datap pData);
|
||||
mng_retcode init_g8_i (mng_datap pData);
|
||||
mng_retcode init_g16_ni (mng_datap pData);
|
||||
mng_retcode init_g16_i (mng_datap pData);
|
||||
mng_retcode init_rgb8_ni (mng_datap pData);
|
||||
mng_retcode init_rgb8_i (mng_datap pData);
|
||||
mng_retcode init_rgb16_ni (mng_datap pData);
|
||||
mng_retcode init_rgb16_i (mng_datap pData);
|
||||
mng_retcode init_idx1_ni (mng_datap pData);
|
||||
mng_retcode init_idx1_i (mng_datap pData);
|
||||
mng_retcode init_idx2_ni (mng_datap pData);
|
||||
mng_retcode init_idx2_i (mng_datap pData);
|
||||
mng_retcode init_idx4_ni (mng_datap pData);
|
||||
mng_retcode init_idx4_i (mng_datap pData);
|
||||
mng_retcode init_idx8_ni (mng_datap pData);
|
||||
mng_retcode init_idx8_i (mng_datap pData);
|
||||
mng_retcode init_ga8_ni (mng_datap pData);
|
||||
mng_retcode init_ga8_i (mng_datap pData);
|
||||
mng_retcode init_ga16_ni (mng_datap pData);
|
||||
mng_retcode init_ga16_i (mng_datap pData);
|
||||
mng_retcode init_rgba8_ni (mng_datap pData);
|
||||
mng_retcode init_rgba8_i (mng_datap pData);
|
||||
mng_retcode init_rgba16_ni (mng_datap pData);
|
||||
mng_retcode init_rgba16_i (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Row processing initialization routines (JPEG) - set up the variables * */
|
||||
/* * needed to process uncompressed row-data * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode init_jpeg_a1_ni (mng_datap pData);
|
||||
mng_retcode init_jpeg_a2_ni (mng_datap pData);
|
||||
mng_retcode init_jpeg_a4_ni (mng_datap pData);
|
||||
mng_retcode init_jpeg_a8_ni (mng_datap pData);
|
||||
mng_retcode init_jpeg_a16_ni (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode init_rowproc (mng_datap pData);
|
||||
mng_retcode next_row (mng_datap pData);
|
||||
mng_retcode next_jpeg_alpharow (mng_datap pData);
|
||||
mng_retcode next_jpeg_row (mng_datap pData);
|
||||
mng_retcode cleanup_rowproc (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_pixels_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,475 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_read.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : Read logic (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the high-level read logic * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/11/2000 - G.Juyn * */
|
||||
/* * - added callback error-reporting support * */
|
||||
/* * 0.5.1 - 05/12/2000 - G.Juyn * */
|
||||
/* * - changed trace to macro for callback error-reporting * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/19/2000 - G.Juyn * */
|
||||
/* * - cleaned up some code regarding mixed support * */
|
||||
/* * 0.5.2 - 05/20/2000 - G.Juyn * */
|
||||
/* * - added support for JNG * */
|
||||
/* * 0.5.2 - 05/31/2000 - G.Juyn * */
|
||||
/* * - fixed up punctuation (contribution by Tim Rowley) * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "mng_objects.h"
|
||||
#include "mng_object_prc.h"
|
||||
#include "mng_chunks.h"
|
||||
#include "mng_chunk_prc.h"
|
||||
#include "mng_chunk_io.h"
|
||||
#include "mng_memory.h"
|
||||
#include "mng_display.h"
|
||||
#include "mng_read.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_READ_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode process_raw_chunk (mng_datap pData,
|
||||
mng_uint8p pBuf,
|
||||
mng_uint32 iBuflen)
|
||||
{
|
||||
/* the table-idea & binary search code was adapted from
|
||||
libpng 1.1.0 (pngread.c) */
|
||||
/* NOTE1: the table must remain sorted by chunkname, otherwise the binary
|
||||
search will break !!! */
|
||||
/* NOTE2: the layout must remain equal to the header part of all the
|
||||
chunk-structures (yes, that means even the pNext and pPrev fields;
|
||||
it's wasting a bit of space, but hey, the code is a lot easier) */
|
||||
|
||||
mng_chunk_header chunk_unknown = {MNG_UINT_HUH, init_unknown, free_unknown,
|
||||
read_unknown, write_unknown, 0, 0};
|
||||
|
||||
mng_chunk_header chunk_table [] =
|
||||
{
|
||||
{MNG_UINT_BACK, init_back, free_back, read_back, write_back, 0, 0},
|
||||
{MNG_UINT_BASI, init_basi, free_basi, read_basi, write_basi, 0, 0},
|
||||
{MNG_UINT_CLIP, init_clip, free_clip, read_clip, write_clip, 0, 0},
|
||||
{MNG_UINT_CLON, init_clon, free_clon, read_clon, write_clon, 0, 0},
|
||||
{MNG_UINT_DBYK, init_dbyk, free_dbyk, read_dbyk, write_dbyk, 0, 0},
|
||||
{MNG_UINT_DEFI, init_defi, free_defi, read_defi, write_defi, 0, 0},
|
||||
{MNG_UINT_DHDR, init_dhdr, free_dhdr, read_dhdr, write_dhdr, 0, 0},
|
||||
{MNG_UINT_DISC, init_disc, free_disc, read_disc, write_disc, 0, 0},
|
||||
{MNG_UINT_DROP, init_drop, free_drop, read_drop, write_drop, 0, 0},
|
||||
{MNG_UINT_ENDL, init_endl, free_endl, read_endl, write_endl, 0, 0},
|
||||
{MNG_UINT_FRAM, init_fram, free_fram, read_fram, write_fram, 0, 0},
|
||||
{MNG_UINT_IDAT, init_idat, free_idat, read_idat, write_idat, 0, 0}, /* 12-th element! */
|
||||
{MNG_UINT_IEND, init_iend, free_iend, read_iend, write_iend, 0, 0},
|
||||
{MNG_UINT_IHDR, init_ihdr, free_ihdr, read_ihdr, write_ihdr, 0, 0},
|
||||
{MNG_UINT_IJNG, init_ijng, free_ijng, read_ijng, write_ijng, 0, 0},
|
||||
{MNG_UINT_IPNG, init_ipng, free_ipng, read_ipng, write_ipng, 0, 0},
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
{MNG_UINT_JDAT, init_jdat, free_jdat, read_jdat, write_jdat, 0, 0},
|
||||
{MNG_UINT_JHDR, init_jhdr, free_jhdr, read_jhdr, write_jhdr, 0, 0},
|
||||
{MNG_UINT_JSEP, init_jsep, free_jsep, read_jsep, write_jsep, 0, 0},
|
||||
#endif
|
||||
{MNG_UINT_LOOP, init_loop, free_loop, read_loop, write_loop, 0, 0},
|
||||
{MNG_UINT_MEND, init_mend, free_mend, read_mend, write_mend, 0, 0},
|
||||
{MNG_UINT_MHDR, init_mhdr, free_mhdr, read_mhdr, write_mhdr, 0, 0},
|
||||
{MNG_UINT_MOVE, init_move, free_move, read_move, write_move, 0, 0},
|
||||
{MNG_UINT_ORDR, init_ordr, free_ordr, read_ordr, write_ordr, 0, 0},
|
||||
{MNG_UINT_PAST, init_past, free_past, read_past, write_past, 0, 0},
|
||||
{MNG_UINT_PLTE, init_plte, free_plte, read_plte, write_plte, 0, 0},
|
||||
{MNG_UINT_PPLT, init_pplt, free_pplt, read_pplt, write_pplt, 0, 0},
|
||||
{MNG_UINT_PROM, init_prom, free_prom, read_prom, write_prom, 0, 0},
|
||||
{MNG_UINT_SAVE, init_save, free_save, read_save, write_save, 0, 0},
|
||||
{MNG_UINT_SEEK, init_seek, free_seek, read_seek, write_seek, 0, 0},
|
||||
{MNG_UINT_SHOW, init_show, free_show, read_show, write_show, 0, 0},
|
||||
{MNG_UINT_TERM, init_term, free_term, read_term, write_term, 0, 0},
|
||||
{MNG_UINT_bKGD, init_bkgd, free_bkgd, read_bkgd, write_bkgd, 0, 0},
|
||||
{MNG_UINT_cHRM, init_chrm, free_chrm, read_chrm, write_chrm, 0, 0},
|
||||
{MNG_UINT_eXPI, init_expi, free_expi, read_expi, write_expi, 0, 0},
|
||||
{MNG_UINT_fPRI, init_fpri, free_fpri, read_fpri, write_fpri, 0, 0},
|
||||
{MNG_UINT_gAMA, init_gama, free_gama, read_gama, write_gama, 0, 0},
|
||||
{MNG_UINT_hIST, init_hist, free_hist, read_hist, write_hist, 0, 0},
|
||||
{MNG_UINT_iCCP, init_iccp, free_iccp, read_iccp, write_iccp, 0, 0},
|
||||
{MNG_UINT_iTXt, init_itxt, free_itxt, read_itxt, write_itxt, 0, 0},
|
||||
{MNG_UINT_nEED, init_need, free_need, read_need, write_need, 0, 0},
|
||||
/* TODO: {MNG_UINT_oFFs, 0, 0, 0, 0, 0, 0}, */
|
||||
/* TODO: {MNG_UINT_pCAL, 0, 0, 0, 0, 0, 0}, */
|
||||
{MNG_UINT_pHYg, init_phyg, free_phyg, read_phyg, write_phyg, 0, 0},
|
||||
{MNG_UINT_pHYs, init_phys, free_phys, read_phys, write_phys, 0, 0},
|
||||
{MNG_UINT_sBIT, init_sbit, free_sbit, read_sbit, write_sbit, 0, 0},
|
||||
/* TODO: {MNG_UINT_sCAL, 0, 0, 0, 0, 0, 0}, */
|
||||
{MNG_UINT_sPLT, init_splt, free_splt, read_splt, write_splt, 0, 0},
|
||||
{MNG_UINT_sRGB, init_srgb, free_srgb, read_srgb, write_srgb, 0, 0},
|
||||
{MNG_UINT_tEXt, init_text, free_text, read_text, write_text, 0, 0},
|
||||
{MNG_UINT_tIME, init_time, free_time, read_time, write_time, 0, 0},
|
||||
{MNG_UINT_tRNS, init_trns, free_trns, read_trns, write_trns, 0, 0},
|
||||
{MNG_UINT_zTXt, init_ztxt, free_ztxt, read_ztxt, write_ztxt, 0, 0},
|
||||
};
|
||||
/* binary search variables */
|
||||
mng_int32 iTop, iLower, iUpper, iMiddle;
|
||||
mng_chunk_headerp pEntry; /* pointer to found entry */
|
||||
mng_chunkid iChunkname; /* the chunk's tag */
|
||||
mng_chunkp pChunk; /* chunk structure (if #define MNG_STORE_CHUNKS) */
|
||||
mng_retcode iRetcode; /* temporary error-code */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_PROCESS_RAW_CHUNK, MNG_LC_START)
|
||||
#endif
|
||||
/* get the chunkname */
|
||||
iChunkname = (mng_chunkid)(mng_get_uint32 (pBuf));
|
||||
|
||||
pBuf += sizeof (mng_chunkid); /* adjust the buffer */
|
||||
iBuflen -= sizeof (mng_chunkid);
|
||||
/* determine max index of table */
|
||||
iTop = (sizeof (chunk_table) / sizeof (chunk_table [0])) - 1;
|
||||
|
||||
/* binary search; with 52 chunks, worst-case is 7 comparisons */
|
||||
iLower = 0;
|
||||
iMiddle = 11; /* start with the IDAT entry */
|
||||
iUpper = iTop;
|
||||
pEntry = 0; /* no goods yet! */
|
||||
pChunk = 0;
|
||||
|
||||
do /* the binary search itself */
|
||||
{
|
||||
if (chunk_table [iMiddle].iChunkname < iChunkname)
|
||||
iLower = iMiddle + 1;
|
||||
else if (chunk_table [iMiddle].iChunkname > iChunkname)
|
||||
iUpper = iMiddle - 1;
|
||||
else
|
||||
{
|
||||
pEntry = &chunk_table [iMiddle];
|
||||
break;
|
||||
}
|
||||
|
||||
iMiddle = (iLower + iUpper) >> 1;
|
||||
}
|
||||
while (iLower <= iUpper);
|
||||
|
||||
if (!pEntry) /* unknown chunk ? */
|
||||
pEntry = &chunk_unknown; /* make it so! */
|
||||
|
||||
pData->iChunkname = iChunkname; /* keep track of where we are */
|
||||
pData->iChunkseq++;
|
||||
|
||||
if (pEntry->fRead) /* read-callback available ? */
|
||||
{
|
||||
iRetcode = pEntry->fRead (pData, pEntry, iBuflen, (mng_ptr)pBuf, &pChunk);
|
||||
|
||||
/* remember unknown chunk's id */
|
||||
if ((!iRetcode) && (pChunk) && (pEntry == &chunk_unknown))
|
||||
((mng_chunk_headerp)pChunk)->iChunkname = iChunkname;
|
||||
|
||||
}
|
||||
else
|
||||
iRetcode = MNG_NOERROR;
|
||||
|
||||
if (pChunk) /* store this chunk ? */
|
||||
add_chunk (pData, pChunk); /* do it */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_PROCESS_RAW_CHUNK, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return iRetcode;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode read_chunk (mng_datap pData)
|
||||
{
|
||||
mng_uint32 iBufmax = pData->iReadbufsize;
|
||||
mng_uint8p pBuf = pData->pReadbuf;
|
||||
mng_uint8p pExtra; /* on-demand read-buffer (size > iBufmax) */
|
||||
mng_uint32 iBuflen = 0; /* number of bytes requested */
|
||||
mng_uint32 iRead = 0; /* number of bytes read */
|
||||
mng_uint32 iChunklen; /* chunk length */
|
||||
mng_uint32 iCrc; /* calculated CRC */
|
||||
mng_retcode iRetcode = MNG_NOERROR;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_READ_CHUNK, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
if (pData->pCurraniobj) /* processing an animation object ? */
|
||||
{
|
||||
do /* process it then */
|
||||
{
|
||||
iRetcode = ((mng_object_headerp)pData->pCurraniobj)->fProcess (pData, pData->pCurraniobj);
|
||||
/* can we advance to next object ? */
|
||||
if ((!iRetcode) && (!pData->bTimerset) && (pData->pCurraniobj))
|
||||
{
|
||||
pData->pCurraniobj = ((mng_object_headerp)pData->pCurraniobj)->pNext;
|
||||
/* TERM processing to be done ? */
|
||||
if ((!pData->pCurraniobj) && (pData->bHasTERM) && (!pData->bHasMHDR))
|
||||
iRetcode = process_display_mend (pData);
|
||||
}
|
||||
} /* until error or timer set or no more objects */
|
||||
while ((!iRetcode) && (!pData->bTimerset) && (pData->pCurraniobj));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pData->iBreakpoint) /* do we need to finish something first ? */
|
||||
{
|
||||
switch (pData->iBreakpoint) /* return to broken display routine */
|
||||
{
|
||||
case 1 : { iRetcode = process_display_fram2 (pData); break; }
|
||||
case 2 : { iRetcode = process_display_ihdr (pData); break; }
|
||||
case 3 : ; /* same as 4 !!! */
|
||||
case 4 : { iRetcode = process_display_show (pData); break; }
|
||||
case 5 : { iRetcode = process_display_clon2 (pData); break; }
|
||||
case 6 : { iRetcode = process_display_iend (pData); break; }
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
case 7 : { iRetcode = process_display_jhdr (pData); break; }
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (iRetcode) /* on error bail out */
|
||||
return iRetcode;
|
||||
|
||||
#endif /* MNG_SUPPORT_DISPLAY */
|
||||
/* can we continue processing now, or do we */
|
||||
/* need to wait for the timer to finish (again) ? */
|
||||
#ifdef MNG_SUPPORT_DISPLAY
|
||||
if ((!pData->bTimerset) && (!pData->bEOF))
|
||||
#else
|
||||
if (!pData->bEOF)
|
||||
#endif
|
||||
{
|
||||
if (pData->iSuspendpoint <= 2)
|
||||
{
|
||||
iBuflen = sizeof (iChunklen); /* read length */
|
||||
|
||||
if (!pData->fReaddata (((mng_handle)pData), ((mng_ptr)pBuf), iBuflen, &iRead))
|
||||
{
|
||||
if (iRead == 0) /* suspension required ? */
|
||||
{
|
||||
pData->bSuspended = MNG_TRUE;
|
||||
pData->iSuspendpoint = 2;
|
||||
|
||||
return MNG_NEEDMOREDATA; /* not a real error !!!! */
|
||||
}
|
||||
else
|
||||
MNG_ERROR (pData, MNG_APPIOERROR);
|
||||
}
|
||||
|
||||
pData->iSuspendpoint = 0;
|
||||
}
|
||||
/* previously suspended or not eof ? */
|
||||
if ((pData->iSuspendpoint > 2) || (iRead == iBuflen))
|
||||
{ /* determine chunklength */
|
||||
iChunklen = mng_get_uint32 (pBuf);
|
||||
/* read chunkname + data + crc */
|
||||
iBuflen = sizeof (mng_chunkid) + iChunklen + sizeof (iCrc);
|
||||
|
||||
if (iBuflen < iBufmax) /* does it fit in default buffer ? */
|
||||
{ /* note that we don't use the full size
|
||||
so there's always a zero-byte at the
|
||||
very end !!! */
|
||||
if (!pData->fReaddata (((mng_handle)pData), ((mng_ptr)pBuf), iBuflen, &iRead))
|
||||
{
|
||||
if (iRead == 0) /* suspension required ? */
|
||||
{
|
||||
pData->bSuspended = MNG_TRUE;
|
||||
pData->iSuspendpoint = 3;
|
||||
|
||||
return MNG_NEEDMOREDATA; /* not a real error !!!! */
|
||||
}
|
||||
else
|
||||
MNG_ERROR (pData, MNG_APPIOERROR);
|
||||
}
|
||||
|
||||
pData->iSuspendpoint = 0;
|
||||
|
||||
if (iRead != iBuflen) /* did we get all the data ? */
|
||||
iRetcode = MNG_UNEXPECTEDEOF;
|
||||
else
|
||||
{ /* calculate the crc */
|
||||
iCrc = crc (pData, pBuf, iBuflen - sizeof (iCrc));
|
||||
/* and check it */
|
||||
if (!(iCrc == mng_get_uint32 (pBuf + iBuflen - sizeof (iCrc))))
|
||||
iRetcode = MNG_INVALIDCRC;
|
||||
else
|
||||
iRetcode = process_raw_chunk (pData, pBuf, iBuflen - sizeof (iCrc));
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{ /* create additional large buffer */
|
||||
/* again reserve space for the last zero-byte */
|
||||
MNG_ALLOC (pData, pExtra, iBuflen+1)
|
||||
|
||||
if (!pData->fReaddata (((mng_handle)pData), ((mng_ptr)pExtra), iBuflen, &iRead))
|
||||
{ /* don't forget to free the temp buffer */
|
||||
MNG_FREEX (pData, pExtra, iBuflen+1)
|
||||
|
||||
if (iRead == 0) /* suspension required ? */
|
||||
{
|
||||
pData->bSuspended = MNG_TRUE;
|
||||
pData->iSuspendpoint = 4;
|
||||
|
||||
return MNG_NEEDMOREDATA; /* not a real error */
|
||||
}
|
||||
else
|
||||
MNG_ERROR (pData, MNG_APPIOERROR);
|
||||
}
|
||||
|
||||
pData->iSuspendpoint = 0;
|
||||
|
||||
if (iRead != iBuflen) /* did we get all the data ? */
|
||||
iRetcode = MNG_UNEXPECTEDEOF;
|
||||
else
|
||||
{ /* calculate the crc */
|
||||
iCrc = crc (pData, pExtra, iBuflen - sizeof (iCrc));
|
||||
/* and check it */
|
||||
if (!(iCrc == mng_get_uint32 (pExtra + iBuflen - sizeof (iCrc))))
|
||||
iRetcode = MNG_INVALIDCRC;
|
||||
else
|
||||
iRetcode = process_raw_chunk (pData, pExtra, iBuflen - sizeof (iCrc));
|
||||
}
|
||||
/* cleanup additional large buffer */
|
||||
MNG_FREEX (pData, pExtra, iBuflen+1)
|
||||
}
|
||||
|
||||
if (iRetcode) /* on error bail out */
|
||||
return iRetcode;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
pData->bEOF = MNG_TRUE; /* that's final */
|
||||
/* did we get an unexpected eof ? */
|
||||
if ((iRead != 0) ||
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
(pData->bHasIHDR || pData->bHasMHDR || pData->bHasJHDR))
|
||||
#else
|
||||
(pData->bHasIHDR || pData->bHasMHDR))
|
||||
#endif
|
||||
MNG_ERROR (pData, MNG_UNEXPECTEDEOF);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_READ_CHUNK, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode read_graphic (mng_datap pData)
|
||||
{
|
||||
mng_uint32 iBuflen; /* number of bytes requested */
|
||||
mng_uint32 iRead; /* number of bytes read */
|
||||
mng_retcode iRetcode; /* temporary error-code */
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_READ_GRAPHIC, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
if (!pData->pReadbuf) /* buffer allocated ? */
|
||||
{
|
||||
pData->iReadbufsize = 1024; /* allocate a default read buffer of 1024 */
|
||||
MNG_ALLOC (pData, pData->pReadbuf, pData->iReadbufsize)
|
||||
}
|
||||
/* haven't processed the signature ? */
|
||||
if ((!pData->bHavesig) || (pData->iSuspendpoint == 1))
|
||||
{
|
||||
iBuflen = 2 * sizeof (mng_uint32); /* read signature */
|
||||
|
||||
if (!pData->fReaddata ((mng_handle)pData, (mng_ptr)pData->pReadbuf, iBuflen, &iRead))
|
||||
{
|
||||
if (iRead == 0) /* input suspension required ? */
|
||||
{
|
||||
pData->bSuspended = MNG_TRUE;
|
||||
pData->iSuspendpoint = 1;
|
||||
|
||||
return MNG_NEEDMOREDATA; /* not a real error!!!! */
|
||||
}
|
||||
else
|
||||
MNG_ERROR (pData, MNG_APPIOERROR)
|
||||
}
|
||||
|
||||
if (iRead != iBuflen) /* full signature received ? */
|
||||
MNG_ERROR (pData, MNG_UNEXPECTEDEOF);
|
||||
/* is it a valid signature ? */
|
||||
if (mng_get_uint32 (pData->pReadbuf) == PNG_SIG)
|
||||
pData->eSigtype = mng_it_png;
|
||||
else
|
||||
if (mng_get_uint32 (pData->pReadbuf) == JNG_SIG)
|
||||
pData->eSigtype = mng_it_jng;
|
||||
else
|
||||
if (mng_get_uint32 (pData->pReadbuf) == MNG_SIG)
|
||||
pData->eSigtype = mng_it_mng;
|
||||
else
|
||||
MNG_ERROR (pData, MNG_INVALIDSIG);
|
||||
/* all of it ? */
|
||||
if (mng_get_uint32 (pData->pReadbuf+4) != POST_SIG)
|
||||
MNG_ERROR (pData, MNG_INVALIDSIG);
|
||||
|
||||
pData->bHavesig = MNG_TRUE;
|
||||
pData->iSuspendpoint = 0;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
iRetcode = read_chunk (pData); /* process a chunk */
|
||||
|
||||
if (iRetcode) /* on error bail out */
|
||||
return iRetcode;
|
||||
|
||||
if (pData->bEOF) /* reached EOF ? */
|
||||
if (!pData->fClosestream ((mng_handle)pData))
|
||||
MNG_ERROR (pData, MNG_APPIOERROR)
|
||||
|
||||
}
|
||||
#ifdef MNG_SUPPORT_DISPLAY /* until EOF or timer or I/O-suspension */
|
||||
while ((!pData->bEOF) && (!pData->bTimerset) && (!pData->bSuspended));
|
||||
#else /* until EOF or I/O-suspension */
|
||||
while ((!pData->bEOF) && (!pData->bSuspended));
|
||||
#endif
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_READ_GRAPHIC, MNG_LC_END)
|
||||
#endif
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_READ_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_read.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Read management (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the read management routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_read_h_
|
||||
#define _mng_read_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode read_graphic (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_read_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,947 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_trace.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Trace functions (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : implementation of the trace functions * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/12/2000 - G.Juyn * */
|
||||
/* * - added callback error-reporting support * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/23/2000 - G.Juyn * */
|
||||
/* * - added trace telltale reporting * */
|
||||
/* * 0.5.2 - 05/24/2000 - G.Juyn * */
|
||||
/* * - added tracestrings for global animation color-chunks * */
|
||||
/* * - added tracestrings for get/set of default ZLIB/IJG parms * */
|
||||
/* * - added tracestrings for global PLTE,tRNS,bKGD * */
|
||||
/* * 0.5.2 - 05/30/2000 - G.Juyn * */
|
||||
/* * - added tracestrings for image-object promotion * */
|
||||
/* * - added tracestrings for delta-image processing * */
|
||||
/* * 0.5.2 - 06/02/2000 - G.Juyn * */
|
||||
/* * - added tracestrings for getalphaline callback * */
|
||||
/* * 0.5.2 - 06/05/2000 - G.Juyn * */
|
||||
/* * - added tracestring for RGB8_A8 canvasstyle * */
|
||||
/* * 0.5.2 - 06/06/2000 - G.Juyn * */
|
||||
/* * - added tracestring for mng_read_resume HLAPI function * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_TRACE_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_TRACE_STRINGS
|
||||
mng_trace_entry trace_table [] =
|
||||
{
|
||||
{MNG_FN_INITIALIZE, "initialize"},
|
||||
{MNG_FN_RESET, "reset"},
|
||||
{MNG_FN_CLEANUP, "cleanup"},
|
||||
{MNG_FN_READ, "read"},
|
||||
{MNG_FN_WRITE, "write"},
|
||||
{MNG_FN_CREATE, "create"},
|
||||
{MNG_FN_READDISPLAY, "readdisplay"},
|
||||
{MNG_FN_DISPLAY, "display"},
|
||||
{MNG_FN_DISPLAY_RESUME, "display_resume"},
|
||||
{MNG_FN_DISPLAY_FREEZE, "display_freeze"},
|
||||
{MNG_FN_DISPLAY_RESET, "display_reset"},
|
||||
{MNG_FN_DISPLAY_GOFRAME, "display_goframe"},
|
||||
{MNG_FN_DISPLAY_GOLAYER, "display_golayer"},
|
||||
{MNG_FN_DISPLAY_GOTIME, "display_gotime"},
|
||||
{MNG_FN_GETLASTERROR, "getlasterror"},
|
||||
{MNG_FN_READ_RESUME, "read_resume"},
|
||||
|
||||
{MNG_FN_SETCB_MEMALLOC, "setcb_memalloc"},
|
||||
{MNG_FN_SETCB_MEMFREE, "setcb_memfree"},
|
||||
{MNG_FN_SETCB_READDATA, "setcb_readdata"},
|
||||
{MNG_FN_SETCB_WRITEDATA, "setcb_writedata"},
|
||||
{MNG_FN_SETCB_ERRORPROC, "setcb_errorproc"},
|
||||
{MNG_FN_SETCB_TRACEPROC, "setcb_traceproc"},
|
||||
{MNG_FN_SETCB_PROCESSHEADER, "setcb_processheader"},
|
||||
{MNG_FN_SETCB_PROCESSTEXT, "setcb_processtext"},
|
||||
{MNG_FN_SETCB_GETCANVASLINE, "setcb_getcanvasline"},
|
||||
{MNG_FN_SETCB_GETBKGDLINE, "setcb_getbkgdline"},
|
||||
{MNG_FN_SETCB_REFRESH, "setcb_refresh"},
|
||||
{MNG_FN_SETCB_GETTICKCOUNT, "setcb_gettickcount"},
|
||||
{MNG_FN_SETCB_SETTIMER, "setcb_settimer"},
|
||||
{MNG_FN_SETCB_PROCESSGAMMA, "setcb_processgamma"},
|
||||
{MNG_FN_SETCB_PROCESSCHROMA, "setcb_processchroma"},
|
||||
{MNG_FN_SETCB_PROCESSSRGB, "setcb_processsrgb"},
|
||||
{MNG_FN_SETCB_PROCESSICCP, "setcb_processiccp"},
|
||||
{MNG_FN_SETCB_PROCESSAROW, "setcb_processarow"},
|
||||
{MNG_FN_SETCB_OPENSTREAM, "setcb_openstream"},
|
||||
{MNG_FN_SETCB_CLOSESTREAM, "setcb_closestream"},
|
||||
{MNG_FN_SETCB_GETALPHALINE, "setcb_getalphaline"},
|
||||
|
||||
{MNG_FN_GETCB_MEMALLOC, "getcb_memalloc"},
|
||||
{MNG_FN_GETCB_MEMFREE, "getcb_memfree"},
|
||||
{MNG_FN_GETCB_READDATA, "getcb_readdata,"},
|
||||
{MNG_FN_GETCB_WRITEDATA, "getcb_writedata"},
|
||||
{MNG_FN_GETCB_ERRORPROC, "getcb_errorproc"},
|
||||
{MNG_FN_GETCB_TRACEPROC, "getcb_traceproc"},
|
||||
{MNG_FN_GETCB_PROCESSHEADER, "getcb_processheader"},
|
||||
{MNG_FN_GETCB_PROCESSTEXT, "getcb_processtext"},
|
||||
{MNG_FN_GETCB_GETCANVASLINE, "getcb_getcanvasline"},
|
||||
{MNG_FN_GETCB_GETBKGDLINE, "getcb_getbkgdline"},
|
||||
{MNG_FN_GETCB_REFRESH, "getcb_refresh"},
|
||||
{MNG_FN_GETCB_GETTICKCOUNT, "getcb_gettickcount"},
|
||||
{MNG_FN_GETCB_SETTIMER, "getcb_settimer"},
|
||||
{MNG_FN_GETCB_PROCESSGAMMA, "getcb_processgamma"},
|
||||
{MNG_FN_GETCB_PROCESSCHROMA, "getcb_processchroma"},
|
||||
{MNG_FN_GETCB_PROCESSSRGB, "getcb_processsrgb"},
|
||||
{MNG_FN_GETCB_PROCESSICCP, "getcb_processiccp"},
|
||||
{MNG_FN_GETCB_PROCESSAROW, "getcb_processarow"},
|
||||
{MNG_FN_GETCB_OPENSTREAM, "getcb_openstream"},
|
||||
{MNG_FN_GETCB_CLOSESTREAM, "getcb_closestream"},
|
||||
{MNG_FN_GETCB_GETALPHALINE, "getcb_getalphaline"},
|
||||
|
||||
{MNG_FN_SET_USERDATA, "set_userdata"},
|
||||
{MNG_FN_SET_CANVASSTYLE, "set_canvasstyle"},
|
||||
{MNG_FN_SET_BKGDSTYLE, "set_bkgdstyle"},
|
||||
{MNG_FN_SET_BGCOLOR, "set_bgcolor"},
|
||||
{MNG_FN_SET_STORECHUNKS, "set_storechunks"},
|
||||
{MNG_FN_SET_VIEWGAMMA, "set_viewgamma"},
|
||||
{MNG_FN_SET_DISPLAYGAMMA, "set_displaygamma"},
|
||||
{MNG_FN_SET_DFLTIMGGAMMA, "set_dfltimggamma"},
|
||||
{MNG_FN_SET_SRGB, "set_srgb"},
|
||||
{MNG_FN_SET_OUTPUTPROFILE, "set_outputprofile"},
|
||||
{MNG_FN_SET_SRGBPROFILE, "set_srgbprofile"},
|
||||
{MNG_FN_SET_MAXCANVASWIDTH, "set_maxcanvaswidth"},
|
||||
{MNG_FN_SET_MAXCANVASHEIGHT, "set_maxcanvasheight"},
|
||||
{MNG_FN_SET_MAXCANVASSIZE, "set_maxcanvassize"},
|
||||
{MNG_FN_SET_ZLIB_LEVEL, "set_zlib_level"},
|
||||
{MNG_FN_SET_ZLIB_METHOD, "set_zlib_method"},
|
||||
{MNG_FN_SET_ZLIB_WINDOWBITS, "set_zlib_windowbits"},
|
||||
{MNG_FN_SET_ZLIB_MEMLEVEL, "set_zlib_memlevel"},
|
||||
{MNG_FN_SET_ZLIB_STRATEGY, "set_zlib_strategy"},
|
||||
{MNG_FN_SET_ZLIB_MAXIDAT, "set_zlib_maxidat"},
|
||||
{MNG_FN_SET_JPEG_DCTMETHOD, "set_jpeg_dctmethod"},
|
||||
{MNG_FN_SET_JPEG_QUALITY, "set_jpeg_quality"},
|
||||
{MNG_FN_SET_JPEG_SMOOTHING, "set_jpeg_smoothing"},
|
||||
{MNG_FN_SET_JPEG_PROGRESSIVE, "set_jpeg_progressive"},
|
||||
{MNG_FN_SET_JPEG_OPTIMIZED, "set_jpeg_optimized"},
|
||||
{MNG_FN_SET_JPEG_MAXJDAT, "set_jpeg_maxjdat"},
|
||||
|
||||
{MNG_FN_GET_USERDATA, "get_userdata"},
|
||||
{MNG_FN_GET_SIGTYPE, "get_sigtype"},
|
||||
{MNG_FN_GET_IMAGETYPE, "get_imagetype"},
|
||||
{MNG_FN_GET_IMAGEWIDTH, "get_imagewidth"},
|
||||
{MNG_FN_GET_IMAGEHEIGHT, "get_imageheight"},
|
||||
{MNG_FN_GET_TICKS, "get_ticks"},
|
||||
{MNG_FN_GET_FRAMECOUNT, "get_framecount"},
|
||||
{MNG_FN_GET_LAYERCOUNT, "get_layercount"},
|
||||
{MNG_FN_GET_PLAYTIME, "get_playtime"},
|
||||
{MNG_FN_GET_SIMPLICITY, "get_simplicity"},
|
||||
{MNG_FN_GET_CANVASSTYLE, "get_canvasstyle"},
|
||||
{MNG_FN_GET_BKGDSTYLE, "get_bkgdstyle"},
|
||||
{MNG_FN_GET_BGCOLOR, "get_bgcolor"},
|
||||
{MNG_FN_GET_STORECHUNKS, "get_storechunks"},
|
||||
{MNG_FN_GET_VIEWGAMMA, "get_viewgamma"},
|
||||
{MNG_FN_GET_DISPLAYGAMMA, "get_displaygamma"},
|
||||
{MNG_FN_GET_DFLTIMGGAMMA, "get_dfltimggamma"},
|
||||
{MNG_FN_GET_SRGB, "get_srgb"},
|
||||
{MNG_FN_GET_MAXCANVASWIDTH, "get_maxcanvaswidth"},
|
||||
{MNG_FN_GET_MAXCANVASHEIGHT, "get_maxcanvasheight"},
|
||||
{MNG_FN_GET_ZLIB_LEVEL, "get_zlib_level"},
|
||||
{MNG_FN_GET_ZLIB_METHOD, "get_zlib_method"},
|
||||
{MNG_FN_GET_ZLIB_WINDOWBITS, "get_zlib_windowbits"},
|
||||
{MNG_FN_GET_ZLIB_MEMLEVEL, "get_zlib_memlevel"},
|
||||
{MNG_FN_GET_ZLIB_STRATEGY, "get_zlib_strategy"},
|
||||
{MNG_FN_GET_ZLIB_MAXIDAT, "get_zlib_maxidat"},
|
||||
{MNG_FN_GET_JPEG_DCTMETHOD, "get_jpeg_dctmethod"},
|
||||
{MNG_FN_GET_JPEG_QUALITY, "get_jpeg_quality"},
|
||||
{MNG_FN_GET_JPEG_SMOOTHING, "get_jpeg_smoothing"},
|
||||
{MNG_FN_GET_JPEG_PROGRESSIVE, "get_jpeg_progressive"},
|
||||
{MNG_FN_GET_JPEG_OPTIMIZED, "get_jpeg_optimized"},
|
||||
{MNG_FN_GET_JPEG_MAXJDAT, "get_jpeg_maxjdat"},
|
||||
|
||||
{MNG_FN_ITERATE_CHUNKS, "iterate_chunks"},
|
||||
|
||||
{MNG_FN_GETCHUNK_IHDR, "getchunk_ihdr"},
|
||||
{MNG_FN_GETCHUNK_PLTE, "getchunk_plte"},
|
||||
{MNG_FN_GETCHUNK_IDAT, "getchunk_idat"},
|
||||
{MNG_FN_GETCHUNK_IEND, "getchunk_iend"},
|
||||
{MNG_FN_GETCHUNK_TRNS, "getchunk_trns"},
|
||||
{MNG_FN_GETCHUNK_GAMA, "getchunk_gama"},
|
||||
{MNG_FN_GETCHUNK_CHRM, "getchunk_chrm"},
|
||||
{MNG_FN_GETCHUNK_SRGB, "getchunk_srgb"},
|
||||
{MNG_FN_GETCHUNK_ICCP, "getchunk_iccp"},
|
||||
{MNG_FN_GETCHUNK_TEXT, "getchunk_text"},
|
||||
{MNG_FN_GETCHUNK_ZTXT, "getchunk_ztxt"},
|
||||
{MNG_FN_GETCHUNK_ITXT, "getchunk_itxt"},
|
||||
{MNG_FN_GETCHUNK_BKGD, "getchunk_bkgd"},
|
||||
{MNG_FN_GETCHUNK_PHYS, "getchunk_phys"},
|
||||
{MNG_FN_GETCHUNK_SBIT, "getchunk_sbit"},
|
||||
{MNG_FN_GETCHUNK_SPLT, "getchunk_splt"},
|
||||
{MNG_FN_GETCHUNK_HIST, "getchunk_hist"},
|
||||
{MNG_FN_GETCHUNK_TIME, "getchunk_time"},
|
||||
{MNG_FN_GETCHUNK_MHDR, "getchunk_mhdr"},
|
||||
{MNG_FN_GETCHUNK_MEND, "getchunk_mend"},
|
||||
{MNG_FN_GETCHUNK_LOOP, "getchunk_loop"},
|
||||
{MNG_FN_GETCHUNK_ENDL, "getchunk_endl"},
|
||||
{MNG_FN_GETCHUNK_DEFI, "getchunk_defi"},
|
||||
{MNG_FN_GETCHUNK_BASI, "getchunk_basi"},
|
||||
{MNG_FN_GETCHUNK_CLON, "getchunk_clon"},
|
||||
{MNG_FN_GETCHUNK_PAST, "getchunk_past"},
|
||||
{MNG_FN_GETCHUNK_DISC, "getchunk_disc"},
|
||||
{MNG_FN_GETCHUNK_BACK, "getchunk_back"},
|
||||
{MNG_FN_GETCHUNK_FRAM, "getchunk_fram"},
|
||||
{MNG_FN_GETCHUNK_MOVE, "getchunk_move"},
|
||||
{MNG_FN_GETCHUNK_CLIP, "getchunk_clip"},
|
||||
{MNG_FN_GETCHUNK_SHOW, "getchunk_show"},
|
||||
{MNG_FN_GETCHUNK_TERM, "getchunk_term"},
|
||||
{MNG_FN_GETCHUNK_SAVE, "getchunk_save"},
|
||||
{MNG_FN_GETCHUNK_SEEK, "getchunk_seek"},
|
||||
{MNG_FN_GETCHUNK_EXPI, "getchunk_expi"},
|
||||
{MNG_FN_GETCHUNK_FPRI, "getchunk_fpri"},
|
||||
{MNG_FN_GETCHUNK_NEED, "getchunk_need"},
|
||||
{MNG_FN_GETCHUNK_PHYG, "getchunk_phyg"},
|
||||
{MNG_FN_GETCHUNK_JHDR, "getchunk_jhdr"},
|
||||
{MNG_FN_GETCHUNK_JDAT, "getchunk_jdat"},
|
||||
{MNG_FN_GETCHUNK_JSEP, "getchunk_jsep"},
|
||||
{MNG_FN_GETCHUNK_DHDR, "getchunk_dhdr"},
|
||||
{MNG_FN_GETCHUNK_PROM, "getchunk_prom"},
|
||||
{MNG_FN_GETCHUNK_IPNG, "getchunk_ipng"},
|
||||
{MNG_FN_GETCHUNK_PPLT, "getchunk_pplt"},
|
||||
{MNG_FN_GETCHUNK_IJNG, "getchunk_ijng"},
|
||||
{MNG_FN_GETCHUNK_DROP, "getchunk_drop"},
|
||||
{MNG_FN_GETCHUNK_DBYK, "getchunk_dbyk"},
|
||||
{MNG_FN_GETCHUNK_ORDR, "getchunk_ordr"},
|
||||
{MNG_FN_GETCHUNK_UNKNOWN, "getchunk_unknown"},
|
||||
|
||||
{MNG_FN_GETCHUNK_PAST_SRC, "getchunk_past_src"},
|
||||
{MNG_FN_GETCHUNK_SAVE_ENTRY, "getchunk_save_entry"},
|
||||
{MNG_FN_GETCHUNK_PPLT_ENTRY, "getchunk_pplt_entry"},
|
||||
{MNG_FN_GETCHUNK_ORDR_ENTRY, "getchunk_ordr_entry"},
|
||||
|
||||
{MNG_FN_PUTCHUNK_IHDR, "putchunk_ihdr"},
|
||||
{MNG_FN_PUTCHUNK_PLTE, "putchunk_plte"},
|
||||
{MNG_FN_PUTCHUNK_IDAT, "putchunk_idat"},
|
||||
{MNG_FN_PUTCHUNK_IEND, "putchunk_iend"},
|
||||
{MNG_FN_PUTCHUNK_TRNS, "putchunk_trns"},
|
||||
{MNG_FN_PUTCHUNK_GAMA, "putchunk_gama"},
|
||||
{MNG_FN_PUTCHUNK_CHRM, "putchunk_chrm"},
|
||||
{MNG_FN_PUTCHUNK_SRGB, "putchunk_srgb"},
|
||||
{MNG_FN_PUTCHUNK_ICCP, "putchunk_iccp"},
|
||||
{MNG_FN_PUTCHUNK_TEXT, "putchunk_text"},
|
||||
{MNG_FN_PUTCHUNK_ZTXT, "putchunk_ztxt"},
|
||||
{MNG_FN_PUTCHUNK_ITXT, "putchunk_itxt"},
|
||||
{MNG_FN_PUTCHUNK_BKGD, "putchunk_bkgd"},
|
||||
{MNG_FN_PUTCHUNK_PHYS, "putchunk_phys"},
|
||||
{MNG_FN_PUTCHUNK_SBIT, "putchunk_sbit"},
|
||||
{MNG_FN_PUTCHUNK_SPLT, "putchunk_splt"},
|
||||
{MNG_FN_PUTCHUNK_HIST, "putchunk_hist"},
|
||||
{MNG_FN_PUTCHUNK_TIME, "putchunk_time"},
|
||||
{MNG_FN_PUTCHUNK_MHDR, "putchunk_mhdr"},
|
||||
{MNG_FN_PUTCHUNK_MEND, "putchunk_mend"},
|
||||
{MNG_FN_PUTCHUNK_LOOP, "putchunk_loop"},
|
||||
{MNG_FN_PUTCHUNK_ENDL, "putchunk_endl"},
|
||||
{MNG_FN_PUTCHUNK_DEFI, "putchunk_defi"},
|
||||
{MNG_FN_PUTCHUNK_BASI, "putchunk_basi"},
|
||||
{MNG_FN_PUTCHUNK_CLON, "putchunk_clon"},
|
||||
{MNG_FN_PUTCHUNK_PAST, "putchunk_past"},
|
||||
{MNG_FN_PUTCHUNK_DISC, "putchunk_disc"},
|
||||
{MNG_FN_PUTCHUNK_BACK, "putchunk_back"},
|
||||
{MNG_FN_PUTCHUNK_FRAM, "putchunk_fram"},
|
||||
{MNG_FN_PUTCHUNK_MOVE, "putchunk_move"},
|
||||
{MNG_FN_PUTCHUNK_CLIP, "putchunk_clip"},
|
||||
{MNG_FN_PUTCHUNK_SHOW, "putchunk_show"},
|
||||
{MNG_FN_PUTCHUNK_TERM, "putchunk_term"},
|
||||
{MNG_FN_PUTCHUNK_SAVE, "putchunk_save"},
|
||||
{MNG_FN_PUTCHUNK_SEEK, "putchunk_seek"},
|
||||
{MNG_FN_PUTCHUNK_EXPI, "putchunk_expi"},
|
||||
{MNG_FN_PUTCHUNK_FPRI, "putchunk_fpri"},
|
||||
{MNG_FN_PUTCHUNK_NEED, "putchunk_need"},
|
||||
{MNG_FN_PUTCHUNK_PHYG, "putchunk_phyg"},
|
||||
{MNG_FN_PUTCHUNK_JHDR, "putchunk_jhdr"},
|
||||
{MNG_FN_PUTCHUNK_JDAT, "putchunk_jdat"},
|
||||
{MNG_FN_PUTCHUNK_JSEP, "putchunk_jsep"},
|
||||
{MNG_FN_PUTCHUNK_DHDR, "putchunk_dhdr"},
|
||||
{MNG_FN_PUTCHUNK_PROM, "putchunk_prom"},
|
||||
{MNG_FN_PUTCHUNK_IPNG, "putchunk_ipng"},
|
||||
{MNG_FN_PUTCHUNK_PPLT, "putchunk_pplt"},
|
||||
{MNG_FN_PUTCHUNK_IJNG, "putchunk_ijng"},
|
||||
{MNG_FN_PUTCHUNK_DROP, "putchunk_drop"},
|
||||
{MNG_FN_PUTCHUNK_DBYK, "putchunk_dbyk"},
|
||||
{MNG_FN_PUTCHUNK_ORDR, "putchunk_ordr"},
|
||||
{MNG_FN_PUTCHUNK_UNKNOWN, "putchunk_unknown"},
|
||||
|
||||
{MNG_FN_PUTCHUNK_PAST_SRC, "putchunk_past_src"},
|
||||
{MNG_FN_PUTCHUNK_SAVE_ENTRY, "putchunk_save_entry"},
|
||||
{MNG_FN_PUTCHUNK_PPLT_ENTRY, "putchunk_pplt_entry"},
|
||||
{MNG_FN_PUTCHUNK_ORDR_ENTRY, "putchunk_ordr_entry"},
|
||||
|
||||
{MNG_FN_GETIMGDATA_SEQ, "getimgdata_seq"},
|
||||
{MNG_FN_GETIMGDATA_CHUNKSEQ, "getimgdata_chunkseq"},
|
||||
{MNG_FN_GETIMGDATA_CHUNK, "getimgdata_chunk"},
|
||||
|
||||
{MNG_FN_PUTIMGDATA_IHDR, "putimgdata_ihdr"},
|
||||
{MNG_FN_PUTIMGDATA_JHDR, "putimgdata_jhdr"},
|
||||
{MNG_FN_PUTIMGDATA_BASI, "putimgdata_basi"},
|
||||
{MNG_FN_PUTIMGDATA_DHDR, "putimgdata_dhdr"},
|
||||
|
||||
{MNG_FN_PROCESS_RAW_CHUNK, "process_raw_chunk"},
|
||||
{MNG_FN_READ_GRAPHIC, "read_graphic"},
|
||||
{MNG_FN_DROP_CHUNKS, "drop_chunks"},
|
||||
{MNG_FN_PROCESS_ERROR, "process_error"},
|
||||
{MNG_FN_CLEAR_CMS, "clear_cms"},
|
||||
{MNG_FN_DROP_OBJECTS, "drop_objects"},
|
||||
{MNG_FN_READ_CHUNK, "read_chunk"},
|
||||
{MNG_FN_LOAD_BKGDLAYER, "load_bkgdlayer"},
|
||||
{MNG_FN_NEXT_FRAME, "next_frame"},
|
||||
{MNG_FN_NEXT_LAYER, "next_layer"},
|
||||
{MNG_FN_INTERFRAME_DELAY, "interframe_delay"},
|
||||
{MNG_FN_DISPLAY_IMAGE, "display_image"},
|
||||
{MNG_FN_DROP_IMGOBJECTS, "drop_imgobjects"},
|
||||
{MNG_FN_DROP_ANIOBJECTS, "drop_aniobjects"},
|
||||
{MNG_FN_INFLATE_BUFFER, "inflate_buffer"},
|
||||
{MNG_FN_DEFLATE_BUFFER, "deflate_buffer"},
|
||||
{MNG_FN_WRITE_RAW_CHUNK, "write_raw_chunk"},
|
||||
{MNG_FN_WRITE_GRAPHIC, "write_graphic"},
|
||||
{MNG_FN_SAVE_STATE, "save_state"},
|
||||
{MNG_FN_RESTORE_STATE, "restore_state"},
|
||||
{MNG_FN_DROP_SAVEDATA, "drop_savedata"},
|
||||
|
||||
{MNG_FN_DISPLAY_RGB8, "display_rgb8"},
|
||||
{MNG_FN_DISPLAY_RGBA8, "display_rgba8"},
|
||||
{MNG_FN_DISPLAY_ARGB8, "display_argb8"},
|
||||
{MNG_FN_DISPLAY_BGR8, "display_bgr8"},
|
||||
{MNG_FN_DISPLAY_BGRA8, "display_bgra8"},
|
||||
{MNG_FN_DISPLAY_ABGR8, "display_abgr8"},
|
||||
{MNG_FN_DISPLAY_RGB16, "display_rgb16"},
|
||||
{MNG_FN_DISPLAY_RGBA16, "display_rgba16"},
|
||||
{MNG_FN_DISPLAY_ARGB16, "display_argb16"},
|
||||
{MNG_FN_DISPLAY_BGR16, "display_bgr16"},
|
||||
{MNG_FN_DISPLAY_BGRA16, "display_bgra16"},
|
||||
{MNG_FN_DISPLAY_ABGR16, "display_abgr16"},
|
||||
{MNG_FN_DISPLAY_INDEX8, "display_index8"},
|
||||
{MNG_FN_DISPLAY_INDEXA8, "display_indexa8"},
|
||||
{MNG_FN_DISPLAY_AINDEX8, "display_aindex8"},
|
||||
{MNG_FN_DISPLAY_GRAY8, "display_gray8"},
|
||||
{MNG_FN_DISPLAY_GRAY16, "display_gray16"},
|
||||
{MNG_FN_DISPLAY_GRAYA8, "display_graya8"},
|
||||
{MNG_FN_DISPLAY_GRAYA16, "display_graya16"},
|
||||
{MNG_FN_DISPLAY_AGRAY8, "display_agray8"},
|
||||
{MNG_FN_DISPLAY_AGRAY16, "display_agray16"},
|
||||
{MNG_FN_DISPLAY_DX15, "display_dx15"},
|
||||
{MNG_FN_DISPLAY_DX16, "display_dx16"},
|
||||
{MNG_FN_DISPLAY_RGB8_A8, "display_rgb8_a8"},
|
||||
|
||||
{MNG_FN_INIT_FULL_CMS, "init_full_cms"},
|
||||
{MNG_FN_CORRECT_FULL_CMS, "correct_full_cms"},
|
||||
{MNG_FN_INIT_GAMMA_ONLY, "init_gamma_only"},
|
||||
{MNG_FN_CORRECT_GAMMA_ONLY, "correct_gamma_only"},
|
||||
{MNG_FN_CORRECT_APP_CMS, "correct_app_cms"},
|
||||
{MNG_FN_INIT_FULL_CMS_OBJ, "init_full_cms_obj"},
|
||||
{MNG_FN_INIT_GAMMA_ONLY_OBJ, "init_gamma_only_obj"},
|
||||
{MNG_FN_INIT_APP_CMS, "init_app_cms"},
|
||||
{MNG_FN_INIT_APP_CMS_OBJ, "init_app_cms_obj"},
|
||||
|
||||
{MNG_FN_PROCESS_G1, "process_g1"},
|
||||
{MNG_FN_PROCESS_G2, "process_g2"},
|
||||
{MNG_FN_PROCESS_G4, "process_g4"},
|
||||
{MNG_FN_PROCESS_G8, "process_g8"},
|
||||
{MNG_FN_PROCESS_G16, "process_g16"},
|
||||
{MNG_FN_PROCESS_RGB8, "process_rgb8"},
|
||||
{MNG_FN_PROCESS_RGB16, "process_rgb16"},
|
||||
{MNG_FN_PROCESS_IDX1, "process_idx1"},
|
||||
{MNG_FN_PROCESS_IDX2, "process_idx2"},
|
||||
{MNG_FN_PROCESS_IDX4, "process_idx4"},
|
||||
{MNG_FN_PROCESS_IDX8, "process_idx8"},
|
||||
{MNG_FN_PROCESS_GA8, "process_ga8"},
|
||||
{MNG_FN_PROCESS_GA16, "process_ga16"},
|
||||
{MNG_FN_PROCESS_RGBA8, "process_rgba8"},
|
||||
{MNG_FN_PROCESS_RGBA16, "process_rgba16"},
|
||||
|
||||
{MNG_FN_INIT_G1_NI, "init_g1_ni"},
|
||||
{MNG_FN_INIT_G1_I, "init_g1_i"},
|
||||
{MNG_FN_INIT_G2_NI, "init_g2_ni"},
|
||||
{MNG_FN_INIT_G2_I, "init_g2_i"},
|
||||
{MNG_FN_INIT_G4_NI, "init_g4_ni"},
|
||||
{MNG_FN_INIT_G4_I, "init_g4_i"},
|
||||
{MNG_FN_INIT_G8_NI, "init_g8_ni"},
|
||||
{MNG_FN_INIT_G8_I, "init_g8_i"},
|
||||
{MNG_FN_INIT_G16_NI, "init_g16_ni"},
|
||||
{MNG_FN_INIT_G16_I, "init_g16_i"},
|
||||
{MNG_FN_INIT_RGB8_NI, "init_rgb8_ni"},
|
||||
{MNG_FN_INIT_RGB8_I, "init_rgb8_i"},
|
||||
{MNG_FN_INIT_RGB16_NI, "init_rgb16_ni"},
|
||||
{MNG_FN_INIT_RGB16_I, "init_rgb16_i"},
|
||||
{MNG_FN_INIT_IDX1_NI, "init_idx1_ni"},
|
||||
{MNG_FN_INIT_IDX1_I, "init_idx1_i"},
|
||||
{MNG_FN_INIT_IDX2_NI, "init_idx2_ni"},
|
||||
{MNG_FN_INIT_IDX2_I, "init_idx2_i"},
|
||||
{MNG_FN_INIT_IDX4_NI, "init_idx4_ni"},
|
||||
{MNG_FN_INIT_IDX4_I, "init_idx4_i"},
|
||||
{MNG_FN_INIT_IDX8_NI, "init_idx8_ni"},
|
||||
{MNG_FN_INIT_IDX8_I, "init_idx8_i"},
|
||||
{MNG_FN_INIT_GA8_NI, "init_ga8_ni"},
|
||||
{MNG_FN_INIT_GA8_I, "init_ga8_i"},
|
||||
{MNG_FN_INIT_GA16_NI, "init_ga16_ni"},
|
||||
{MNG_FN_INIT_GA16_I, "init_ga16_i"},
|
||||
{MNG_FN_INIT_RGBA8_NI, "init_rgba8_ni"},
|
||||
{MNG_FN_INIT_RGBA8_I, "init_rgba8_i"},
|
||||
{MNG_FN_INIT_RGBA16_NI, "init_rgba16_ni"},
|
||||
{MNG_FN_INIT_RGBA16_I, "init_rgba16_i"},
|
||||
|
||||
{MNG_FN_INIT_ROWPROC, "init_rowproc"},
|
||||
{MNG_FN_NEXT_ROW, "next_row"},
|
||||
{MNG_FN_CLEANUP_ROWPROC, "cleanup_rowproc"},
|
||||
|
||||
{MNG_FN_FILTER_A_ROW, "filter_a_row"},
|
||||
{MNG_FN_FILTER_SUB, "filter_sub"},
|
||||
{MNG_FN_FILTER_UP, "filter_up"},
|
||||
{MNG_FN_FILTER_AVERAGE, "filter_average"},
|
||||
{MNG_FN_FILTER_PAETH, "filter_paeth"},
|
||||
|
||||
{MNG_FN_CREATE_IMGDATAOBJECT, "create_imgdataobject"},
|
||||
{MNG_FN_FREE_IMGDATAOBJECT, "free_imgdataobject"},
|
||||
{MNG_FN_CLONE_IMGDATAOBJECT, "clone_imgdataobject"},
|
||||
{MNG_FN_CREATE_IMGOBJECT, "create_imgobject"},
|
||||
{MNG_FN_FREE_IMGOBJECT, "free_imgobject"},
|
||||
{MNG_FN_FIND_IMGOBJECT, "find_imgobject"},
|
||||
{MNG_FN_CLONE_IMGOBJECT, "clone_imgobject"},
|
||||
{MNG_FN_RESET_OBJECTDETAILS, "reset_objectdetails"},
|
||||
{MNG_FN_RENUM_IMGOBJECT, "renum_imgobject"},
|
||||
{MNG_FN_PROMOTE_IMGOBJECT, "promote_imgobject"},
|
||||
|
||||
{MNG_FN_STORE_G1, "store_g1"},
|
||||
{MNG_FN_STORE_G2, "store_g2"},
|
||||
{MNG_FN_STORE_G4, "store_g4"},
|
||||
{MNG_FN_STORE_G8, "store_g8"},
|
||||
{MNG_FN_STORE_G16, "store_g16"},
|
||||
{MNG_FN_STORE_RGB8, "store_rgb8"},
|
||||
{MNG_FN_STORE_RGB16, "store_rgb16"},
|
||||
{MNG_FN_STORE_IDX1, "store_idx1"},
|
||||
{MNG_FN_STORE_IDX2, "store_idx2"},
|
||||
{MNG_FN_STORE_IDX4, "store_idx4"},
|
||||
{MNG_FN_STORE_IDX8, "store_idx8"},
|
||||
{MNG_FN_STORE_GA8, "store_ga8"},
|
||||
{MNG_FN_STORE_GA16, "store_ga16"},
|
||||
{MNG_FN_STORE_RGBA8, "store_rgba8"},
|
||||
{MNG_FN_STORE_RGBA16, "store_rgba16"},
|
||||
|
||||
{MNG_FN_RETRIEVE_G8, "retrieve_g8"},
|
||||
{MNG_FN_RETRIEVE_G16, "retrieve_g16"},
|
||||
{MNG_FN_RETRIEVE_RGB8, "retrieve_rgb8"},
|
||||
{MNG_FN_RETRIEVE_RGB16, "retrieve_rgb16"},
|
||||
{MNG_FN_RETRIEVE_IDX8, "retrieve_idx8"},
|
||||
{MNG_FN_RETRIEVE_GA8, "retrieve_ga8"},
|
||||
{MNG_FN_RETRIEVE_GA16, "retrieve_ga16"},
|
||||
{MNG_FN_RETRIEVE_RGBA8, "retrieve_rgba8"},
|
||||
{MNG_FN_RETRIEVE_RGBA16, "retrieve_rgba16"},
|
||||
|
||||
{MNG_FN_DELTA_G1, "delta_g1"},
|
||||
{MNG_FN_DELTA_G2, "delta_g2"},
|
||||
{MNG_FN_DELTA_G4, "delta_g4"},
|
||||
{MNG_FN_DELTA_G8, "delta_g8"},
|
||||
{MNG_FN_DELTA_G16, "delta_g16"},
|
||||
{MNG_FN_DELTA_RGB8, "delta_rgb8"},
|
||||
{MNG_FN_DELTA_RGB16, "delta_rgb16"},
|
||||
{MNG_FN_DELTA_IDX1, "delta_idx1"},
|
||||
{MNG_FN_DELTA_IDX2, "delta_idx2"},
|
||||
{MNG_FN_DELTA_IDX4, "delta_idx4"},
|
||||
{MNG_FN_DELTA_IDX8, "delta_idx8"},
|
||||
{MNG_FN_DELTA_GA8, "delta_ga8"},
|
||||
{MNG_FN_DELTA_GA16, "delta_ga16"},
|
||||
{MNG_FN_DELTA_RGBA8, "delta_rgba8"},
|
||||
{MNG_FN_DELTA_RGBA16, "delta_rgba16"},
|
||||
|
||||
{MNG_FN_CREATE_ANI_LOOP, "create_ani_loop"},
|
||||
{MNG_FN_CREATE_ANI_ENDL, "create_ani_endl"},
|
||||
{MNG_FN_CREATE_ANI_DEFI, "create_ani_defi"},
|
||||
{MNG_FN_CREATE_ANI_BASI, "create_ani_basi"},
|
||||
{MNG_FN_CREATE_ANI_CLON, "create_ani_clon"},
|
||||
{MNG_FN_CREATE_ANI_PAST, "create_ani_past"},
|
||||
{MNG_FN_CREATE_ANI_DISC, "create_ani_disc"},
|
||||
{MNG_FN_CREATE_ANI_BACK, "create_ani_back"},
|
||||
{MNG_FN_CREATE_ANI_FRAM, "create_ani_fram"},
|
||||
{MNG_FN_CREATE_ANI_MOVE, "create_ani_move"},
|
||||
{MNG_FN_CREATE_ANI_CLIP, "create_ani_clip"},
|
||||
{MNG_FN_CREATE_ANI_SHOW, "create_ani_show"},
|
||||
{MNG_FN_CREATE_ANI_TERM, "create_ani_term"},
|
||||
{MNG_FN_CREATE_ANI_SAVE, "create_ani_save"},
|
||||
{MNG_FN_CREATE_ANI_SEEK, "create_ani_seek"},
|
||||
{MNG_FN_CREATE_ANI_GAMA, "create_ani_gama"},
|
||||
{MNG_FN_CREATE_ANI_CHRM, "create_ani_chrm"},
|
||||
{MNG_FN_CREATE_ANI_SRGB, "create_ani_srgb"},
|
||||
{MNG_FN_CREATE_ANI_ICCP, "create_ani_iccp"},
|
||||
{MNG_FN_CREATE_ANI_PLTE, "create_ani_plte"},
|
||||
{MNG_FN_CREATE_ANI_TRNS, "create_ani_trns"},
|
||||
{MNG_FN_CREATE_ANI_BKGD, "create_ani_bkgd"},
|
||||
{MNG_FN_CREATE_ANI_DHDR, "create_ani_dhdr"},
|
||||
{MNG_FN_CREATE_ANI_PROM, "create_ani_prom"},
|
||||
{MNG_FN_CREATE_ANI_IPNG, "create_ani_ipng"},
|
||||
{MNG_FN_CREATE_ANI_IJNG, "create_ani_ijng"},
|
||||
|
||||
{MNG_FN_CREATE_ANI_IMAGE, "create_ani_image"},
|
||||
|
||||
{MNG_FN_FREE_ANI_LOOP, "free_ani_loop"},
|
||||
{MNG_FN_FREE_ANI_ENDL, "free_ani_endl"},
|
||||
{MNG_FN_FREE_ANI_DEFI, "free_ani_defi"},
|
||||
{MNG_FN_FREE_ANI_BASI, "free_ani_basi"},
|
||||
{MNG_FN_FREE_ANI_CLON, "free_ani_clon"},
|
||||
{MNG_FN_FREE_ANI_PAST, "free_ani_past"},
|
||||
{MNG_FN_FREE_ANI_DISC, "free_ani_disc"},
|
||||
{MNG_FN_FREE_ANI_BACK, "free_ani_back"},
|
||||
{MNG_FN_FREE_ANI_FRAM, "free_ani_fram"},
|
||||
{MNG_FN_FREE_ANI_MOVE, "free_ani_move"},
|
||||
{MNG_FN_FREE_ANI_CLIP, "free_ani_clip"},
|
||||
{MNG_FN_FREE_ANI_SHOW, "free_ani_show"},
|
||||
{MNG_FN_FREE_ANI_TERM, "free_ani_term"},
|
||||
{MNG_FN_FREE_ANI_SAVE, "free_ani_save"},
|
||||
{MNG_FN_FREE_ANI_SEEK, "free_ani_seek"},
|
||||
{MNG_FN_FREE_ANI_GAMA, "free_ani_gama"},
|
||||
{MNG_FN_FREE_ANI_CHRM, "free_ani_chrm"},
|
||||
{MNG_FN_FREE_ANI_SRGB, "free_ani_srgb"},
|
||||
{MNG_FN_FREE_ANI_ICCP, "free_ani_iccp"},
|
||||
{MNG_FN_FREE_ANI_PLTE, "free_ani_plte"},
|
||||
{MNG_FN_FREE_ANI_TRNS, "free_ani_trns"},
|
||||
{MNG_FN_FREE_ANI_BKGD, "free_ani_bkgd"},
|
||||
{MNG_FN_FREE_ANI_DHDR, "free_ani_dhdr"},
|
||||
{MNG_FN_FREE_ANI_PROM, "free_ani_prom"},
|
||||
{MNG_FN_FREE_ANI_IPNG, "free_ani_ipng"},
|
||||
{MNG_FN_FREE_ANI_IJNG, "free_ani_ijng"},
|
||||
|
||||
{MNG_FN_FREE_ANI_IMAGE, "free_ani_image"},
|
||||
|
||||
{MNG_FN_PROCESS_ANI_LOOP, "process_ani_loop"},
|
||||
{MNG_FN_PROCESS_ANI_ENDL, "process_ani_endl"},
|
||||
{MNG_FN_PROCESS_ANI_DEFI, "process_ani_defi"},
|
||||
{MNG_FN_PROCESS_ANI_BASI, "process_ani_basi"},
|
||||
{MNG_FN_PROCESS_ANI_CLON, "process_ani_clon"},
|
||||
{MNG_FN_PROCESS_ANI_PAST, "process_ani_past"},
|
||||
{MNG_FN_PROCESS_ANI_DISC, "process_ani_disc"},
|
||||
{MNG_FN_PROCESS_ANI_BACK, "process_ani_back"},
|
||||
{MNG_FN_PROCESS_ANI_FRAM, "process_ani_fram"},
|
||||
{MNG_FN_PROCESS_ANI_MOVE, "process_ani_move"},
|
||||
{MNG_FN_PROCESS_ANI_CLIP, "process_ani_clip"},
|
||||
{MNG_FN_PROCESS_ANI_SHOW, "process_ani_show"},
|
||||
{MNG_FN_PROCESS_ANI_TERM, "process_ani_term"},
|
||||
{MNG_FN_PROCESS_ANI_SAVE, "process_ani_save"},
|
||||
{MNG_FN_PROCESS_ANI_SEEK, "process_ani_seek"},
|
||||
{MNG_FN_PROCESS_ANI_GAMA, "process_ani_gama"},
|
||||
{MNG_FN_PROCESS_ANI_CHRM, "process_ani_chrm"},
|
||||
{MNG_FN_PROCESS_ANI_SRGB, "process_ani_srgb"},
|
||||
{MNG_FN_PROCESS_ANI_ICCP, "process_ani_iccp"},
|
||||
{MNG_FN_PROCESS_ANI_PLTE, "process_ani_plte"},
|
||||
{MNG_FN_PROCESS_ANI_TRNS, "process_ani_trns"},
|
||||
{MNG_FN_PROCESS_ANI_BKGD, "process_ani_bkgd"},
|
||||
{MNG_FN_PROCESS_ANI_DHDR, "process_ani_dhdr"},
|
||||
{MNG_FN_PROCESS_ANI_PROM, "process_ani_prom"},
|
||||
{MNG_FN_PROCESS_ANI_IPNG, "process_ani_ipng"},
|
||||
{MNG_FN_PROCESS_ANI_IJNG, "process_ani_ijng"},
|
||||
|
||||
{MNG_FN_PROCESS_ANI_IMAGE, "process_ani_image"},
|
||||
|
||||
{MNG_FN_RESTORE_BACKIMAGE, "restore_backimage"},
|
||||
{MNG_FN_RESTORE_BACKCOLOR, "restore_backcolor"},
|
||||
{MNG_FN_RESTORE_BGCOLOR, "restore_bgcolor"},
|
||||
{MNG_FN_RESTORE_RGB8, "restore_rgb8"},
|
||||
{MNG_FN_RESTORE_BGR8, "restore_bgr8"},
|
||||
|
||||
{MNG_FN_INIT_IHDR, "init_ihdr"},
|
||||
{MNG_FN_INIT_PLTE, "init_plte"},
|
||||
{MNG_FN_INIT_IDAT, "init_idat"},
|
||||
{MNG_FN_INIT_IEND, "init_iend"},
|
||||
{MNG_FN_INIT_TRNS, "init_trns"},
|
||||
{MNG_FN_INIT_GAMA, "init_gama"},
|
||||
{MNG_FN_INIT_CHRM, "init_chrm"},
|
||||
{MNG_FN_INIT_SRGB, "init_srgb"},
|
||||
{MNG_FN_INIT_ICCP, "init_iccp"},
|
||||
{MNG_FN_INIT_TEXT, "init_text"},
|
||||
{MNG_FN_INIT_ZTXT, "init_ztxt"},
|
||||
{MNG_FN_INIT_ITXT, "init_itxt"},
|
||||
{MNG_FN_INIT_BKGD, "init_bkgd"},
|
||||
{MNG_FN_INIT_PHYS, "init_phys"},
|
||||
{MNG_FN_INIT_SBIT, "init_sbit"},
|
||||
{MNG_FN_INIT_SPLT, "init_splt"},
|
||||
{MNG_FN_INIT_HIST, "init_hist"},
|
||||
{MNG_FN_INIT_TIME, "init_time"},
|
||||
{MNG_FN_INIT_MHDR, "init_mhdr"},
|
||||
{MNG_FN_INIT_MEND, "init_mend"},
|
||||
{MNG_FN_INIT_LOOP, "init_loop"},
|
||||
{MNG_FN_INIT_ENDL, "init_endl"},
|
||||
{MNG_FN_INIT_DEFI, "init_defi"},
|
||||
{MNG_FN_INIT_BASI, "init_basi"},
|
||||
{MNG_FN_INIT_CLON, "init_clon"},
|
||||
{MNG_FN_INIT_PAST, "init_past"},
|
||||
{MNG_FN_INIT_DISC, "init_disc"},
|
||||
{MNG_FN_INIT_BACK, "init_back"},
|
||||
{MNG_FN_INIT_FRAM, "init_fram"},
|
||||
{MNG_FN_INIT_MOVE, "init_move"},
|
||||
{MNG_FN_INIT_CLIP, "init_clip"},
|
||||
{MNG_FN_INIT_SHOW, "init_show"},
|
||||
{MNG_FN_INIT_TERM, "init_term"},
|
||||
{MNG_FN_INIT_SAVE, "init_save"},
|
||||
{MNG_FN_INIT_SEEK, "init_seek"},
|
||||
{MNG_FN_INIT_EXPI, "init_expi"},
|
||||
{MNG_FN_INIT_FPRI, "init_fpri"},
|
||||
{MNG_FN_INIT_NEED, "init_need"},
|
||||
{MNG_FN_INIT_PHYG, "init_phyg"},
|
||||
{MNG_FN_INIT_JHDR, "init_jhdr"},
|
||||
{MNG_FN_INIT_JDAT, "init_jdat"},
|
||||
{MNG_FN_INIT_JSEP, "init_jsep"},
|
||||
{MNG_FN_INIT_DHDR, "init_dhdr"},
|
||||
{MNG_FN_INIT_PROM, "init_prom"},
|
||||
{MNG_FN_INIT_IPNG, "init_ipng"},
|
||||
{MNG_FN_INIT_PPLT, "init_pplt"},
|
||||
{MNG_FN_INIT_IJNG, "init_ijng"},
|
||||
{MNG_FN_INIT_DROP, "init_drop"},
|
||||
{MNG_FN_INIT_DBYK, "init_dbyk"},
|
||||
{MNG_FN_INIT_ORDR, "init_ordr"},
|
||||
{MNG_FN_INIT_UNKNOWN, "init_unknown"},
|
||||
|
||||
{MNG_FN_FREE_IHDR, "free_ihdr"},
|
||||
{MNG_FN_FREE_PLTE, "free_plte"},
|
||||
{MNG_FN_FREE_IDAT, "free_idat"},
|
||||
{MNG_FN_FREE_IEND, "free_iend"},
|
||||
{MNG_FN_FREE_TRNS, "free_trns"},
|
||||
{MNG_FN_FREE_GAMA, "free_gama"},
|
||||
{MNG_FN_FREE_CHRM, "free_chrm"},
|
||||
{MNG_FN_FREE_SRGB, "free_srgb"},
|
||||
{MNG_FN_FREE_ICCP, "free_iccp"},
|
||||
{MNG_FN_FREE_TEXT, "free_text"},
|
||||
{MNG_FN_FREE_ZTXT, "free_ztxt"},
|
||||
{MNG_FN_FREE_ITXT, "free_itxt"},
|
||||
{MNG_FN_FREE_BKGD, "free_bkgd"},
|
||||
{MNG_FN_FREE_PHYS, "free_phys"},
|
||||
{MNG_FN_FREE_SBIT, "free_sbit"},
|
||||
{MNG_FN_FREE_SPLT, "free_splt"},
|
||||
{MNG_FN_FREE_HIST, "free_hist"},
|
||||
{MNG_FN_FREE_TIME, "free_time"},
|
||||
{MNG_FN_FREE_MHDR, "free_mhdr"},
|
||||
{MNG_FN_FREE_MEND, "free_mend"},
|
||||
{MNG_FN_FREE_LOOP, "free_loop"},
|
||||
{MNG_FN_FREE_ENDL, "free_endl"},
|
||||
{MNG_FN_FREE_DEFI, "free_defi"},
|
||||
{MNG_FN_FREE_BASI, "free_basi"},
|
||||
{MNG_FN_FREE_CLON, "free_clon"},
|
||||
{MNG_FN_FREE_PAST, "free_past"},
|
||||
{MNG_FN_FREE_DISC, "free_disc"},
|
||||
{MNG_FN_FREE_BACK, "free_back"},
|
||||
{MNG_FN_FREE_FRAM, "free_fram"},
|
||||
{MNG_FN_FREE_MOVE, "free_move"},
|
||||
{MNG_FN_FREE_CLIP, "free_clip"},
|
||||
{MNG_FN_FREE_SHOW, "free_show"},
|
||||
{MNG_FN_FREE_TERM, "free_term"},
|
||||
{MNG_FN_FREE_SAVE, "free_save"},
|
||||
{MNG_FN_FREE_SEEK, "free_seek"},
|
||||
{MNG_FN_FREE_EXPI, "free_expi"},
|
||||
{MNG_FN_FREE_FPRI, "free_fpri"},
|
||||
{MNG_FN_FREE_NEED, "free_need"},
|
||||
{MNG_FN_FREE_PHYG, "free_phyg"},
|
||||
{MNG_FN_FREE_JHDR, "free_jhdr"},
|
||||
{MNG_FN_FREE_JDAT, "free_jdat"},
|
||||
{MNG_FN_FREE_JSEP, "free_jsep"},
|
||||
{MNG_FN_FREE_DHDR, "free_dhdr"},
|
||||
{MNG_FN_FREE_PROM, "free_prom"},
|
||||
{MNG_FN_FREE_IPNG, "free_ipng"},
|
||||
{MNG_FN_FREE_PPLT, "free_pplt"},
|
||||
{MNG_FN_FREE_IJNG, "free_ijng"},
|
||||
{MNG_FN_FREE_DROP, "free_drop"},
|
||||
{MNG_FN_FREE_DBYK, "free_dbyk"},
|
||||
{MNG_FN_FREE_ORDR, "free_ordr"},
|
||||
{MNG_FN_FREE_UNKNOWN, "free_unknown"},
|
||||
|
||||
{MNG_FN_READ_IHDR, "read_ihdr"},
|
||||
{MNG_FN_READ_PLTE, "read_plte"},
|
||||
{MNG_FN_READ_IDAT, "read_idat"},
|
||||
{MNG_FN_READ_IEND, "read_iend"},
|
||||
{MNG_FN_READ_TRNS, "read_trns"},
|
||||
{MNG_FN_READ_GAMA, "read_gama"},
|
||||
{MNG_FN_READ_CHRM, "read_chrm"},
|
||||
{MNG_FN_READ_SRGB, "read_srgb"},
|
||||
{MNG_FN_READ_ICCP, "read_iccp"},
|
||||
{MNG_FN_READ_TEXT, "read_text"},
|
||||
{MNG_FN_READ_ZTXT, "read_ztxt"},
|
||||
{MNG_FN_READ_ITXT, "read_itxt"},
|
||||
{MNG_FN_READ_BKGD, "read_bkgd"},
|
||||
{MNG_FN_READ_PHYS, "read_phys"},
|
||||
{MNG_FN_READ_SBIT, "read_sbit"},
|
||||
{MNG_FN_READ_SPLT, "read_splt"},
|
||||
{MNG_FN_READ_HIST, "read_hist"},
|
||||
{MNG_FN_READ_TIME, "read_time"},
|
||||
{MNG_FN_READ_MHDR, "read_mhdr"},
|
||||
{MNG_FN_READ_MEND, "read_mend"},
|
||||
{MNG_FN_READ_LOOP, "read_loop"},
|
||||
{MNG_FN_READ_ENDL, "read_endl"},
|
||||
{MNG_FN_READ_DEFI, "read_defi"},
|
||||
{MNG_FN_READ_BASI, "read_basi"},
|
||||
{MNG_FN_READ_CLON, "read_clon"},
|
||||
{MNG_FN_READ_PAST, "read_past"},
|
||||
{MNG_FN_READ_DISC, "read_disc"},
|
||||
{MNG_FN_READ_BACK, "read_back"},
|
||||
{MNG_FN_READ_FRAM, "read_fram"},
|
||||
{MNG_FN_READ_MOVE, "read_move"},
|
||||
{MNG_FN_READ_CLIP, "read_clip"},
|
||||
{MNG_FN_READ_SHOW, "read_show"},
|
||||
{MNG_FN_READ_TERM, "read_term"},
|
||||
{MNG_FN_READ_SAVE, "read_save"},
|
||||
{MNG_FN_READ_SEEK, "read_seek"},
|
||||
{MNG_FN_READ_EXPI, "read_expi"},
|
||||
{MNG_FN_READ_FPRI, "read_fpri"},
|
||||
{MNG_FN_READ_NEED, "read_need"},
|
||||
{MNG_FN_READ_PHYG, "read_phyg"},
|
||||
{MNG_FN_READ_JHDR, "read_jhdr"},
|
||||
{MNG_FN_READ_JDAT, "read_jdat"},
|
||||
{MNG_FN_READ_JSEP, "read_jsep"},
|
||||
{MNG_FN_READ_DHDR, "read_dhdr"},
|
||||
{MNG_FN_READ_PROM, "read_prom"},
|
||||
{MNG_FN_READ_IPNG, "read_ipng"},
|
||||
{MNG_FN_READ_PPLT, "read_pplt"},
|
||||
{MNG_FN_READ_IJNG, "read_ijng"},
|
||||
{MNG_FN_READ_DROP, "read_drop"},
|
||||
{MNG_FN_READ_DBYK, "read_dbyk"},
|
||||
{MNG_FN_READ_ORDR, "read_ordr"},
|
||||
{MNG_FN_READ_UNKNOWN, "read_unknown"},
|
||||
|
||||
{MNG_FN_WRITE_IHDR, "write_ihdr"},
|
||||
{MNG_FN_WRITE_PLTE, "write_plte"},
|
||||
{MNG_FN_WRITE_IDAT, "write_idat"},
|
||||
{MNG_FN_WRITE_IEND, "write_iend"},
|
||||
{MNG_FN_WRITE_TRNS, "write_trns"},
|
||||
{MNG_FN_WRITE_GAMA, "write_gama"},
|
||||
{MNG_FN_WRITE_CHRM, "write_chrm"},
|
||||
{MNG_FN_WRITE_SRGB, "write_srgb"},
|
||||
{MNG_FN_WRITE_ICCP, "write_iccp"},
|
||||
{MNG_FN_WRITE_TEXT, "write_text"},
|
||||
{MNG_FN_WRITE_ZTXT, "write_ztxt"},
|
||||
{MNG_FN_WRITE_ITXT, "write_itxt"},
|
||||
{MNG_FN_WRITE_BKGD, "write_bkgd"},
|
||||
{MNG_FN_WRITE_PHYS, "write_phys"},
|
||||
{MNG_FN_WRITE_SBIT, "write_sbit"},
|
||||
{MNG_FN_WRITE_SPLT, "write_splt"},
|
||||
{MNG_FN_WRITE_HIST, "write_hist"},
|
||||
{MNG_FN_WRITE_TIME, "write_time"},
|
||||
{MNG_FN_WRITE_MHDR, "write_mhdr"},
|
||||
{MNG_FN_WRITE_MEND, "write_mend"},
|
||||
{MNG_FN_WRITE_LOOP, "write_loop"},
|
||||
{MNG_FN_WRITE_ENDL, "write_endl"},
|
||||
{MNG_FN_WRITE_DEFI, "write_defi"},
|
||||
{MNG_FN_WRITE_BASI, "write_basi"},
|
||||
{MNG_FN_WRITE_CLON, "write_clon"},
|
||||
{MNG_FN_WRITE_PAST, "write_past"},
|
||||
{MNG_FN_WRITE_DISC, "write_disc"},
|
||||
{MNG_FN_WRITE_BACK, "write_back"},
|
||||
{MNG_FN_WRITE_FRAM, "write_fram"},
|
||||
{MNG_FN_WRITE_MOVE, "write_move"},
|
||||
{MNG_FN_WRITE_CLIP, "write_clip"},
|
||||
{MNG_FN_WRITE_SHOW, "write_show"},
|
||||
{MNG_FN_WRITE_TERM, "write_term"},
|
||||
{MNG_FN_WRITE_SAVE, "write_save"},
|
||||
{MNG_FN_WRITE_SEEK, "write_seek"},
|
||||
{MNG_FN_WRITE_EXPI, "write_expi"},
|
||||
{MNG_FN_WRITE_FPRI, "write_fpri"},
|
||||
{MNG_FN_WRITE_NEED, "write_need"},
|
||||
{MNG_FN_WRITE_PHYG, "write_phyg"},
|
||||
{MNG_FN_WRITE_JHDR, "write_jhdr"},
|
||||
{MNG_FN_WRITE_JDAT, "write_jdat"},
|
||||
{MNG_FN_WRITE_JSEP, "write_jsep"},
|
||||
{MNG_FN_WRITE_DHDR, "write_dhdr"},
|
||||
{MNG_FN_WRITE_PROM, "write_prom"},
|
||||
{MNG_FN_WRITE_IPNG, "write_ipng"},
|
||||
{MNG_FN_WRITE_PPLT, "write_pplt"},
|
||||
{MNG_FN_WRITE_IJNG, "write_ijng"},
|
||||
{MNG_FN_WRITE_DROP, "write_drop"},
|
||||
{MNG_FN_WRITE_DBYK, "write_dbyk"},
|
||||
{MNG_FN_WRITE_ORDR, "write_ordr"},
|
||||
{MNG_FN_WRITE_UNKNOWN, "write_unknown"},
|
||||
|
||||
{MNG_FN_ZLIB_INITIALIZE, "zlib_initialize"},
|
||||
{MNG_FN_ZLIB_CLEANUP, "zlib_cleanup"},
|
||||
{MNG_FN_ZLIB_INFLATEINIT, "zlib_inflateinit"},
|
||||
{MNG_FN_ZLIB_INFLATEROWS, "zlib_inflaterows"},
|
||||
{MNG_FN_ZLIB_INFLATEDATA, "zlib_inflatedata"},
|
||||
{MNG_FN_ZLIB_INFLATEFREE, "zlib_inflatefree"},
|
||||
{MNG_FN_ZLIB_DEFLATEINIT, "zlib_deflateinit"},
|
||||
{MNG_FN_ZLIB_DEFLATEROWS, "zlib_deflaterows"},
|
||||
{MNG_FN_ZLIB_DEFLATEDATA, "zlib_deflatedata"},
|
||||
{MNG_FN_ZLIB_DEFLATEFREE, "zlib_deflatefree"},
|
||||
|
||||
{MNG_FN_PROCESS_DISPLAY_IHDR, "process_display_ihdr"},
|
||||
{MNG_FN_PROCESS_DISPLAY_PLTE, "process_display_plte"},
|
||||
{MNG_FN_PROCESS_DISPLAY_IDAT, "process_display_idat"},
|
||||
{MNG_FN_PROCESS_DISPLAY_IEND, "process_display_iend"},
|
||||
{MNG_FN_PROCESS_DISPLAY_TRNS, "process_display_trns"},
|
||||
{MNG_FN_PROCESS_DISPLAY_GAMA, "process_display_gama"},
|
||||
{MNG_FN_PROCESS_DISPLAY_CHRM, "process_display_chrm"},
|
||||
{MNG_FN_PROCESS_DISPLAY_SRGB, "process_display_srgb"},
|
||||
{MNG_FN_PROCESS_DISPLAY_ICCP, "process_display_iccp"},
|
||||
{MNG_FN_PROCESS_DISPLAY_BKGD, "process_display_bkgd"},
|
||||
{MNG_FN_PROCESS_DISPLAY_PHYS, "process_display_phys"},
|
||||
{MNG_FN_PROCESS_DISPLAY_SBIT, "process_display_sbit"},
|
||||
{MNG_FN_PROCESS_DISPLAY_SPLT, "process_display_splt"},
|
||||
{MNG_FN_PROCESS_DISPLAY_HIST, "process_display_hist"},
|
||||
{MNG_FN_PROCESS_DISPLAY_MHDR, "process_display_mhdr"},
|
||||
{MNG_FN_PROCESS_DISPLAY_MEND, "process_display_mend"},
|
||||
{MNG_FN_PROCESS_DISPLAY_LOOP, "process_display_loop"},
|
||||
{MNG_FN_PROCESS_DISPLAY_ENDL, "process_display_endl"},
|
||||
{MNG_FN_PROCESS_DISPLAY_DEFI, "process_display_defi"},
|
||||
{MNG_FN_PROCESS_DISPLAY_BASI, "process_display_basi"},
|
||||
{MNG_FN_PROCESS_DISPLAY_CLON, "process_display_clon"},
|
||||
{MNG_FN_PROCESS_DISPLAY_PAST, "process_display_past"},
|
||||
{MNG_FN_PROCESS_DISPLAY_DISC, "process_display_disc"},
|
||||
{MNG_FN_PROCESS_DISPLAY_BACK, "process_display_back"},
|
||||
{MNG_FN_PROCESS_DISPLAY_FRAM, "process_display_fram"},
|
||||
{MNG_FN_PROCESS_DISPLAY_MOVE, "process_display_move"},
|
||||
{MNG_FN_PROCESS_DISPLAY_CLIP, "process_display_clip"},
|
||||
{MNG_FN_PROCESS_DISPLAY_SHOW, "process_display_show"},
|
||||
{MNG_FN_PROCESS_DISPLAY_TERM, "process_display_term"},
|
||||
{MNG_FN_PROCESS_DISPLAY_SAVE, "process_display_save"},
|
||||
{MNG_FN_PROCESS_DISPLAY_SEEK, "process_display_seek"},
|
||||
{MNG_FN_PROCESS_DISPLAY_EXPI, "process_display_expi"},
|
||||
{MNG_FN_PROCESS_DISPLAY_FPRI, "process_display_fpri"},
|
||||
{MNG_FN_PROCESS_DISPLAY_NEED, "process_display_need"},
|
||||
{MNG_FN_PROCESS_DISPLAY_PHYG, "process_display_phyg"},
|
||||
{MNG_FN_PROCESS_DISPLAY_JHDR, "process_display_jhdr"},
|
||||
{MNG_FN_PROCESS_DISPLAY_JDAT, "process_display_jdat"},
|
||||
{MNG_FN_PROCESS_DISPLAY_JSEP, "process_display_jsep"},
|
||||
{MNG_FN_PROCESS_DISPLAY_DHDR, "process_display_dhdr"},
|
||||
{MNG_FN_PROCESS_DISPLAY_PROM, "process_display_prom"},
|
||||
{MNG_FN_PROCESS_DISPLAY_IPNG, "process_display_ipng"},
|
||||
{MNG_FN_PROCESS_DISPLAY_PPLT, "process_display_pplt"},
|
||||
{MNG_FN_PROCESS_DISPLAY_IJNG, "process_display_ijng"},
|
||||
{MNG_FN_PROCESS_DISPLAY_DROP, "process_display_drop"},
|
||||
{MNG_FN_PROCESS_DISPLAY_DBYK, "process_display_dbyk"},
|
||||
{MNG_FN_PROCESS_DISPLAY_ORDR, "process_display_ordr"},
|
||||
|
||||
{MNG_FN_JPEG_INITIALIZE, "jpeg_initialize"},
|
||||
{MNG_FN_JPEG_CLEANUP, "jpeg_cleanup"},
|
||||
{MNG_FN_JPEG_DECOMPRESSINIT, "jpeg_decompressinit"},
|
||||
{MNG_FN_JPEG_DECOMPRESSDATA, "jpeg_decompressdata"},
|
||||
{MNG_FN_JPEG_DECOMPRESSFREE, "jpeg_decompressfree"},
|
||||
|
||||
{MNG_FN_STORE_JPEG_G8, "store_jpeg_g8"},
|
||||
{MNG_FN_STORE_JPEG_RGB8, "store_jpeg_rgb8"},
|
||||
{MNG_FN_STORE_JPEG_G12, "store_jpeg_g12"},
|
||||
{MNG_FN_STORE_JPEG_RGB12, "store_jpeg_rgb12"},
|
||||
{MNG_FN_STORE_JPEG_GA8, "store_jpeg_ga8"},
|
||||
{MNG_FN_STORE_JPEG_RGBA8, "store_jpeg_rgba8"},
|
||||
{MNG_FN_STORE_JPEG_GA12, "store_jpeg_ga12"},
|
||||
{MNG_FN_STORE_JPEG_RGBA12, "store_jpeg_rgba12"},
|
||||
|
||||
{MNG_FN_INIT_JPEG_A1_NI, "init_jpeg_a1_ni"},
|
||||
{MNG_FN_INIT_JPEG_A2_NI, "init_jpeg_a2_ni"},
|
||||
{MNG_FN_INIT_JPEG_A4_NI, "init_jpeg_a4_ni"},
|
||||
{MNG_FN_INIT_JPEG_A8_NI, "init_jpeg_a8_ni"},
|
||||
{MNG_FN_INIT_JPEG_A16_NI, "init_jpeg_a16_ni"},
|
||||
|
||||
{MNG_FN_STORE_JPEG_G8_A1, "store_jpeg_g8_a1"},
|
||||
{MNG_FN_STORE_JPEG_G8_A2, "store_jpeg_g8_a2"},
|
||||
{MNG_FN_STORE_JPEG_G8_A4, "store_jpeg_g8_a4"},
|
||||
{MNG_FN_STORE_JPEG_G8_A8, "store_jpeg_g8_a8"},
|
||||
{MNG_FN_STORE_JPEG_G8_A16, "store_jpeg_g8_a16"},
|
||||
|
||||
{MNG_FN_STORE_JPEG_RGB8_A1, "store_jpeg_rgb8_a1"},
|
||||
{MNG_FN_STORE_JPEG_RGB8_A2, "store_jpeg_rgb8_a2"},
|
||||
{MNG_FN_STORE_JPEG_RGB8_A4, "store_jpeg_rgb8_a4"},
|
||||
{MNG_FN_STORE_JPEG_RGB8_A8, "store_jpeg_rgb8_a8"},
|
||||
{MNG_FN_STORE_JPEG_RGB8_A16, "store_jpeg_rgb8_a16"},
|
||||
|
||||
{MNG_FN_STORE_JPEG_G12_A1, "store_jpeg_g12_a1"},
|
||||
{MNG_FN_STORE_JPEG_G12_A2, "store_jpeg_g12_a2"},
|
||||
{MNG_FN_STORE_JPEG_G12_A4, "store_jpeg_g12_a4"},
|
||||
{MNG_FN_STORE_JPEG_G12_A8, "store_jpeg_g12_a8"},
|
||||
{MNG_FN_STORE_JPEG_G12_A16, "store_jpeg_g12_a16"},
|
||||
|
||||
{MNG_FN_STORE_JPEG_RGB12_A1, "store_jpeg_rgb12_a1"},
|
||||
{MNG_FN_STORE_JPEG_RGB12_A2, "store_jpeg_rgb12_a2"},
|
||||
{MNG_FN_STORE_JPEG_RGB12_A4, "store_jpeg_rgb12_a4"},
|
||||
{MNG_FN_STORE_JPEG_RGB12_A8, "store_jpeg_rgb12_a8"},
|
||||
{MNG_FN_STORE_JPEG_RGB12_A16, "store_jpeg_rgb12_a16"},
|
||||
|
||||
{MNG_FN_NEXT_JPEG_ALPHAROW, "next_jpeg_alpharow"},
|
||||
{MNG_FN_NEXT_JPEG_ROW, "next_jpeg_row"},
|
||||
{MNG_FN_DISPLAY_JPEG_ROWS, "display_jpeg_rows"},
|
||||
};
|
||||
#endif /* MNG_INCLUDE_TRACE_STINGS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode mng_trace (mng_datap pData,
|
||||
mng_uint32 iFunction,
|
||||
mng_uint32 iLocation)
|
||||
{
|
||||
mng_pchar zName = 0; /* bufferptr for tracestring */
|
||||
|
||||
if ((pData == 0) || (pData->iMagic != MNG_MAGIC))
|
||||
return MNG_INVALIDHANDLE; /* no good if the handle is corrupt */
|
||||
|
||||
if (pData->fTraceproc) /* report back to user ? */
|
||||
{
|
||||
#ifdef MNG_INCLUDE_TRACE_STRINGS
|
||||
{ /* binary search variables */
|
||||
mng_int32 iTop, iLower, iUpper, iMiddle;
|
||||
mng_trace_entryp pEntry; /* pointer to found entry */
|
||||
/* determine max index of table */
|
||||
iTop = (sizeof (trace_table) / sizeof (trace_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 (trace_table [iMiddle].iFunction < iFunction)
|
||||
iLower = iMiddle + 1;
|
||||
else if (trace_table [iMiddle].iFunction > iFunction)
|
||||
iUpper = iMiddle - 1;
|
||||
else
|
||||
{
|
||||
pEntry = &trace_table [iMiddle];
|
||||
break;
|
||||
};
|
||||
|
||||
iMiddle = (iLower + iUpper) >> 1;
|
||||
}
|
||||
while (iLower <= iUpper);
|
||||
|
||||
if (pEntry) /* found it ? */
|
||||
zName = pEntry->zTracetext;
|
||||
|
||||
}
|
||||
#endif
|
||||
/* oke, now tell */
|
||||
if (!pData->fTraceproc (((mng_handle)pData), iFunction, iLocation, zName))
|
||||
return MNG_APPTRACEABORT;
|
||||
|
||||
}
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_TRACE_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
|
@ -0,0 +1,971 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_trace.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : Trace functions (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the trace functions * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - added chunk-access function trace-codes * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * 0.5.1 - 05/12/2000 - G.Juyn * */
|
||||
/* * - changed trace to macro for callback error-reporting * */
|
||||
/* * 0.5.1 - 05/13/2000 - G.Juyn * */
|
||||
/* * - added save_state & restore_state trace-codes * */
|
||||
/* * 0.5.1 - 05/15/2000 - G.Juyn * */
|
||||
/* * - added getimgdata & putimgdata trace-codes * */
|
||||
/* * * */
|
||||
/* * 0.5.2 - 05/20/2000 - G.Juyn * */
|
||||
/* * - added JNG tracecodes * */
|
||||
/* * 0.5.2 - 05/23/2000 - G.Juyn * */
|
||||
/* * - added trace-table entry definition * */
|
||||
/* * 0.5.2 - 05/24/2000 - G.Juyn * */
|
||||
/* * - added tracecodes for global animation color-chunks * */
|
||||
/* * - added tracecodes for get/set of default ZLIB/IJG parms * */
|
||||
/* * - added tracecodes for global PLTE,tRNS,bKGD * */
|
||||
/* * 0.5.2 - 05/30/2000 - G.Juyn * */
|
||||
/* * - added tracecodes for image-object promotion * */
|
||||
/* * - added tracecodes for delta-image processing * */
|
||||
/* * 0.5.2 - 06/02/2000 - G.Juyn * */
|
||||
/* * - added tracecodes for getalphaline callback * */
|
||||
/* * 0.5.2 - 06/05/2000 - G.Juyn * */
|
||||
/* * - added tracecode for RGB8_A8 canvasstyle * */
|
||||
/* * 0.5.2 - 06/06/2000 - G.Juyn * */
|
||||
/* * - added tracecode for mng_read_resume HLAPI function * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_trace_h_
|
||||
#define _mng_trace_h_
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_TRACE_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* TODO: add a trace-mask so certain functions can be excluded */
|
||||
|
||||
mng_retcode mng_trace (mng_datap pData,
|
||||
mng_uint32 iFunction,
|
||||
mng_uint32 iLocation);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_TRACE(D,F,L) { mng_retcode iR = mng_trace (D,F,L); \
|
||||
if (iR) return iR; }
|
||||
|
||||
#define MNG_TRACEB(D,F,L) { if (mng_trace (D,F,L)) return MNG_FALSE; }
|
||||
|
||||
#define MNG_TRACEX(D,F,L) { if (mng_trace (D,F,L)) return 0; }
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_LC_START 1
|
||||
#define MNG_LC_END 2
|
||||
#define MNG_LC_INITIALIZE 3
|
||||
#define MNG_LC_CLEANUP 4
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_INITIALIZE 1
|
||||
#define MNG_FN_RESET 2
|
||||
#define MNG_FN_CLEANUP 3
|
||||
#define MNG_FN_READ 4
|
||||
#define MNG_FN_WRITE 5
|
||||
#define MNG_FN_CREATE 6
|
||||
#define MNG_FN_READDISPLAY 7
|
||||
#define MNG_FN_DISPLAY 8
|
||||
#define MNG_FN_DISPLAY_RESUME 9
|
||||
#define MNG_FN_DISPLAY_FREEZE 10
|
||||
#define MNG_FN_DISPLAY_RESET 11
|
||||
#define MNG_FN_DISPLAY_GOFRAME 12
|
||||
#define MNG_FN_DISPLAY_GOLAYER 13
|
||||
#define MNG_FN_DISPLAY_GOTIME 14
|
||||
#define MNG_FN_GETLASTERROR 15
|
||||
#define MNG_FN_READ_RESUME 16
|
||||
|
||||
#define MNG_FN_SETCB_MEMALLOC 101
|
||||
#define MNG_FN_SETCB_MEMFREE 102
|
||||
#define MNG_FN_SETCB_READDATA 103
|
||||
#define MNG_FN_SETCB_WRITEDATA 104
|
||||
#define MNG_FN_SETCB_ERRORPROC 105
|
||||
#define MNG_FN_SETCB_TRACEPROC 106
|
||||
#define MNG_FN_SETCB_PROCESSHEADER 107
|
||||
#define MNG_FN_SETCB_PROCESSTEXT 108
|
||||
#define MNG_FN_SETCB_GETCANVASLINE 109
|
||||
#define MNG_FN_SETCB_GETBKGDLINE 110
|
||||
#define MNG_FN_SETCB_REFRESH 111
|
||||
#define MNG_FN_SETCB_GETTICKCOUNT 112
|
||||
#define MNG_FN_SETCB_SETTIMER 113
|
||||
#define MNG_FN_SETCB_PROCESSGAMMA 114
|
||||
#define MNG_FN_SETCB_PROCESSCHROMA 115
|
||||
#define MNG_FN_SETCB_PROCESSSRGB 116
|
||||
#define MNG_FN_SETCB_PROCESSICCP 117
|
||||
#define MNG_FN_SETCB_PROCESSAROW 118
|
||||
#define MNG_FN_SETCB_OPENSTREAM 119
|
||||
#define MNG_FN_SETCB_CLOSESTREAM 120
|
||||
#define MNG_FN_SETCB_GETALPHALINE 121
|
||||
|
||||
#define MNG_FN_GETCB_MEMALLOC 201
|
||||
#define MNG_FN_GETCB_MEMFREE 202
|
||||
#define MNG_FN_GETCB_READDATA 203
|
||||
#define MNG_FN_GETCB_WRITEDATA 204
|
||||
#define MNG_FN_GETCB_ERRORPROC 205
|
||||
#define MNG_FN_GETCB_TRACEPROC 206
|
||||
#define MNG_FN_GETCB_PROCESSHEADER 207
|
||||
#define MNG_FN_GETCB_PROCESSTEXT 208
|
||||
#define MNG_FN_GETCB_GETCANVASLINE 209
|
||||
#define MNG_FN_GETCB_GETBKGDLINE 210
|
||||
#define MNG_FN_GETCB_REFRESH 211
|
||||
#define MNG_FN_GETCB_GETTICKCOUNT 212
|
||||
#define MNG_FN_GETCB_SETTIMER 213
|
||||
#define MNG_FN_GETCB_PROCESSGAMMA 214
|
||||
#define MNG_FN_GETCB_PROCESSCHROMA 215
|
||||
#define MNG_FN_GETCB_PROCESSSRGB 216
|
||||
#define MNG_FN_GETCB_PROCESSICCP 217
|
||||
#define MNG_FN_GETCB_PROCESSAROW 218
|
||||
#define MNG_FN_GETCB_OPENSTREAM 219
|
||||
#define MNG_FN_GETCB_CLOSESTREAM 220
|
||||
#define MNG_FN_GETCB_GETALPHALINE 221
|
||||
|
||||
#define MNG_FN_SET_USERDATA 301
|
||||
#define MNG_FN_SET_CANVASSTYLE 302
|
||||
#define MNG_FN_SET_BKGDSTYLE 303
|
||||
#define MNG_FN_SET_BGCOLOR 304
|
||||
#define MNG_FN_SET_STORECHUNKS 305
|
||||
#define MNG_FN_SET_VIEWGAMMA 306
|
||||
#define MNG_FN_SET_DISPLAYGAMMA 307
|
||||
#define MNG_FN_SET_DFLTIMGGAMMA 308
|
||||
#define MNG_FN_SET_SRGB 309
|
||||
#define MNG_FN_SET_OUTPUTPROFILE 310
|
||||
#define MNG_FN_SET_SRGBPROFILE 311
|
||||
#define MNG_FN_SET_MAXCANVASWIDTH 312
|
||||
#define MNG_FN_SET_MAXCANVASHEIGHT 313
|
||||
#define MNG_FN_SET_MAXCANVASSIZE 314
|
||||
#define MNG_FN_SET_ZLIB_LEVEL 315
|
||||
#define MNG_FN_SET_ZLIB_METHOD 316
|
||||
#define MNG_FN_SET_ZLIB_WINDOWBITS 317
|
||||
#define MNG_FN_SET_ZLIB_MEMLEVEL 318
|
||||
#define MNG_FN_SET_ZLIB_STRATEGY 319
|
||||
#define MNG_FN_SET_ZLIB_MAXIDAT 320
|
||||
#define MNG_FN_SET_JPEG_DCTMETHOD 321
|
||||
#define MNG_FN_SET_JPEG_QUALITY 322
|
||||
#define MNG_FN_SET_JPEG_SMOOTHING 323
|
||||
#define MNG_FN_SET_JPEG_PROGRESSIVE 324
|
||||
#define MNG_FN_SET_JPEG_OPTIMIZED 325
|
||||
#define MNG_FN_SET_JPEG_MAXJDAT 326
|
||||
|
||||
#define MNG_FN_GET_USERDATA 401
|
||||
#define MNG_FN_GET_SIGTYPE 402
|
||||
#define MNG_FN_GET_IMAGETYPE 403
|
||||
#define MNG_FN_GET_IMAGEWIDTH 404
|
||||
#define MNG_FN_GET_IMAGEHEIGHT 405
|
||||
#define MNG_FN_GET_TICKS 406
|
||||
#define MNG_FN_GET_FRAMECOUNT 407
|
||||
#define MNG_FN_GET_LAYERCOUNT 408
|
||||
#define MNG_FN_GET_PLAYTIME 409
|
||||
#define MNG_FN_GET_SIMPLICITY 410
|
||||
#define MNG_FN_GET_CANVASSTYLE 411
|
||||
#define MNG_FN_GET_BKGDSTYLE 412
|
||||
#define MNG_FN_GET_BGCOLOR 413
|
||||
#define MNG_FN_GET_STORECHUNKS 414
|
||||
#define MNG_FN_GET_VIEWGAMMA 415
|
||||
#define MNG_FN_GET_DISPLAYGAMMA 416
|
||||
#define MNG_FN_GET_DFLTIMGGAMMA 417
|
||||
#define MNG_FN_GET_SRGB 418
|
||||
#define MNG_FN_GET_MAXCANVASWIDTH 419
|
||||
#define MNG_FN_GET_MAXCANVASHEIGHT 420
|
||||
#define MNG_FN_GET_ZLIB_LEVEL 421
|
||||
#define MNG_FN_GET_ZLIB_METHOD 422
|
||||
#define MNG_FN_GET_ZLIB_WINDOWBITS 423
|
||||
#define MNG_FN_GET_ZLIB_MEMLEVEL 424
|
||||
#define MNG_FN_GET_ZLIB_STRATEGY 425
|
||||
#define MNG_FN_GET_ZLIB_MAXIDAT 426
|
||||
#define MNG_FN_GET_JPEG_DCTMETHOD 427
|
||||
#define MNG_FN_GET_JPEG_QUALITY 428
|
||||
#define MNG_FN_GET_JPEG_SMOOTHING 429
|
||||
#define MNG_FN_GET_JPEG_PROGRESSIVE 430
|
||||
#define MNG_FN_GET_JPEG_OPTIMIZED 431
|
||||
#define MNG_FN_GET_JPEG_MAXJDAT 432
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_ITERATE_CHUNKS 601
|
||||
|
||||
#define MNG_FN_GETCHUNK_IHDR 701
|
||||
#define MNG_FN_GETCHUNK_PLTE 702
|
||||
#define MNG_FN_GETCHUNK_IDAT 703
|
||||
#define MNG_FN_GETCHUNK_IEND 704
|
||||
#define MNG_FN_GETCHUNK_TRNS 705
|
||||
#define MNG_FN_GETCHUNK_GAMA 706
|
||||
#define MNG_FN_GETCHUNK_CHRM 707
|
||||
#define MNG_FN_GETCHUNK_SRGB 708
|
||||
#define MNG_FN_GETCHUNK_ICCP 709
|
||||
#define MNG_FN_GETCHUNK_TEXT 710
|
||||
#define MNG_FN_GETCHUNK_ZTXT 711
|
||||
#define MNG_FN_GETCHUNK_ITXT 712
|
||||
#define MNG_FN_GETCHUNK_BKGD 713
|
||||
#define MNG_FN_GETCHUNK_PHYS 714
|
||||
#define MNG_FN_GETCHUNK_SBIT 715
|
||||
#define MNG_FN_GETCHUNK_SPLT 716
|
||||
#define MNG_FN_GETCHUNK_HIST 717
|
||||
#define MNG_FN_GETCHUNK_TIME 718
|
||||
#define MNG_FN_GETCHUNK_MHDR 719
|
||||
#define MNG_FN_GETCHUNK_MEND 720
|
||||
#define MNG_FN_GETCHUNK_LOOP 721
|
||||
#define MNG_FN_GETCHUNK_ENDL 722
|
||||
#define MNG_FN_GETCHUNK_DEFI 723
|
||||
#define MNG_FN_GETCHUNK_BASI 724
|
||||
#define MNG_FN_GETCHUNK_CLON 725
|
||||
#define MNG_FN_GETCHUNK_PAST 726
|
||||
#define MNG_FN_GETCHUNK_DISC 727
|
||||
#define MNG_FN_GETCHUNK_BACK 728
|
||||
#define MNG_FN_GETCHUNK_FRAM 729
|
||||
#define MNG_FN_GETCHUNK_MOVE 730
|
||||
#define MNG_FN_GETCHUNK_CLIP 731
|
||||
#define MNG_FN_GETCHUNK_SHOW 732
|
||||
#define MNG_FN_GETCHUNK_TERM 733
|
||||
#define MNG_FN_GETCHUNK_SAVE 734
|
||||
#define MNG_FN_GETCHUNK_SEEK 735
|
||||
#define MNG_FN_GETCHUNK_EXPI 736
|
||||
#define MNG_FN_GETCHUNK_FPRI 737
|
||||
#define MNG_FN_GETCHUNK_NEED 738
|
||||
#define MNG_FN_GETCHUNK_PHYG 739
|
||||
#define MNG_FN_GETCHUNK_JHDR 740
|
||||
#define MNG_FN_GETCHUNK_JDAT 741
|
||||
#define MNG_FN_GETCHUNK_JSEP 742
|
||||
#define MNG_FN_GETCHUNK_DHDR 743
|
||||
#define MNG_FN_GETCHUNK_PROM 744
|
||||
#define MNG_FN_GETCHUNK_IPNG 745
|
||||
#define MNG_FN_GETCHUNK_PPLT 746
|
||||
#define MNG_FN_GETCHUNK_IJNG 747
|
||||
#define MNG_FN_GETCHUNK_DROP 748
|
||||
#define MNG_FN_GETCHUNK_DBYK 749
|
||||
#define MNG_FN_GETCHUNK_ORDR 750
|
||||
#define MNG_FN_GETCHUNK_UNKNOWN 751
|
||||
|
||||
#define MNG_FN_GETCHUNK_PAST_SRC 781
|
||||
#define MNG_FN_GETCHUNK_SAVE_ENTRY 782
|
||||
#define MNG_FN_GETCHUNK_PPLT_ENTRY 783
|
||||
#define MNG_FN_GETCHUNK_ORDR_ENTRY 784
|
||||
|
||||
#define MNG_FN_PUTCHUNK_IHDR 801
|
||||
#define MNG_FN_PUTCHUNK_PLTE 802
|
||||
#define MNG_FN_PUTCHUNK_IDAT 803
|
||||
#define MNG_FN_PUTCHUNK_IEND 804
|
||||
#define MNG_FN_PUTCHUNK_TRNS 805
|
||||
#define MNG_FN_PUTCHUNK_GAMA 806
|
||||
#define MNG_FN_PUTCHUNK_CHRM 807
|
||||
#define MNG_FN_PUTCHUNK_SRGB 808
|
||||
#define MNG_FN_PUTCHUNK_ICCP 809
|
||||
#define MNG_FN_PUTCHUNK_TEXT 810
|
||||
#define MNG_FN_PUTCHUNK_ZTXT 811
|
||||
#define MNG_FN_PUTCHUNK_ITXT 812
|
||||
#define MNG_FN_PUTCHUNK_BKGD 813
|
||||
#define MNG_FN_PUTCHUNK_PHYS 814
|
||||
#define MNG_FN_PUTCHUNK_SBIT 815
|
||||
#define MNG_FN_PUTCHUNK_SPLT 816
|
||||
#define MNG_FN_PUTCHUNK_HIST 817
|
||||
#define MNG_FN_PUTCHUNK_TIME 818
|
||||
#define MNG_FN_PUTCHUNK_MHDR 819
|
||||
#define MNG_FN_PUTCHUNK_MEND 820
|
||||
#define MNG_FN_PUTCHUNK_LOOP 821
|
||||
#define MNG_FN_PUTCHUNK_ENDL 822
|
||||
#define MNG_FN_PUTCHUNK_DEFI 823
|
||||
#define MNG_FN_PUTCHUNK_BASI 824
|
||||
#define MNG_FN_PUTCHUNK_CLON 825
|
||||
#define MNG_FN_PUTCHUNK_PAST 826
|
||||
#define MNG_FN_PUTCHUNK_DISC 827
|
||||
#define MNG_FN_PUTCHUNK_BACK 828
|
||||
#define MNG_FN_PUTCHUNK_FRAM 829
|
||||
#define MNG_FN_PUTCHUNK_MOVE 830
|
||||
#define MNG_FN_PUTCHUNK_CLIP 831
|
||||
#define MNG_FN_PUTCHUNK_SHOW 832
|
||||
#define MNG_FN_PUTCHUNK_TERM 833
|
||||
#define MNG_FN_PUTCHUNK_SAVE 834
|
||||
#define MNG_FN_PUTCHUNK_SEEK 835
|
||||
#define MNG_FN_PUTCHUNK_EXPI 836
|
||||
#define MNG_FN_PUTCHUNK_FPRI 837
|
||||
#define MNG_FN_PUTCHUNK_NEED 838
|
||||
#define MNG_FN_PUTCHUNK_PHYG 839
|
||||
#define MNG_FN_PUTCHUNK_JHDR 840
|
||||
#define MNG_FN_PUTCHUNK_JDAT 841
|
||||
#define MNG_FN_PUTCHUNK_JSEP 842
|
||||
#define MNG_FN_PUTCHUNK_DHDR 843
|
||||
#define MNG_FN_PUTCHUNK_PROM 844
|
||||
#define MNG_FN_PUTCHUNK_IPNG 845
|
||||
#define MNG_FN_PUTCHUNK_PPLT 846
|
||||
#define MNG_FN_PUTCHUNK_IJNG 847
|
||||
#define MNG_FN_PUTCHUNK_DROP 848
|
||||
#define MNG_FN_PUTCHUNK_DBYK 849
|
||||
#define MNG_FN_PUTCHUNK_ORDR 850
|
||||
#define MNG_FN_PUTCHUNK_UNKNOWN 851
|
||||
|
||||
#define MNG_FN_PUTCHUNK_PAST_SRC 881
|
||||
#define MNG_FN_PUTCHUNK_SAVE_ENTRY 882
|
||||
#define MNG_FN_PUTCHUNK_PPLT_ENTRY 883
|
||||
#define MNG_FN_PUTCHUNK_ORDR_ENTRY 884
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_GETIMGDATA_SEQ 901
|
||||
#define MNG_FN_GETIMGDATA_CHUNKSEQ 902
|
||||
#define MNG_FN_GETIMGDATA_CHUNK 903
|
||||
|
||||
#define MNG_FN_PUTIMGDATA_IHDR 951
|
||||
#define MNG_FN_PUTIMGDATA_JHDR 952
|
||||
#define MNG_FN_PUTIMGDATA_BASI 953
|
||||
#define MNG_FN_PUTIMGDATA_DHDR 954
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_PROCESS_RAW_CHUNK 1001
|
||||
#define MNG_FN_READ_GRAPHIC 1002
|
||||
#define MNG_FN_DROP_CHUNKS 1003
|
||||
#define MNG_FN_PROCESS_ERROR 1004
|
||||
#define MNG_FN_CLEAR_CMS 1005
|
||||
#define MNG_FN_DROP_OBJECTS 1006
|
||||
#define MNG_FN_READ_CHUNK 1007
|
||||
#define MNG_FN_LOAD_BKGDLAYER 1008
|
||||
#define MNG_FN_NEXT_FRAME 1009
|
||||
#define MNG_FN_NEXT_LAYER 1010
|
||||
#define MNG_FN_INTERFRAME_DELAY 1011
|
||||
#define MNG_FN_DISPLAY_IMAGE 1012
|
||||
#define MNG_FN_DROP_IMGOBJECTS 1013
|
||||
#define MNG_FN_DROP_ANIOBJECTS 1014
|
||||
#define MNG_FN_INFLATE_BUFFER 1015
|
||||
#define MNG_FN_DEFLATE_BUFFER 1016
|
||||
#define MNG_FN_WRITE_RAW_CHUNK 1017
|
||||
#define MNG_FN_WRITE_GRAPHIC 1018
|
||||
#define MNG_FN_SAVE_STATE 1019
|
||||
#define MNG_FN_RESTORE_STATE 1020
|
||||
#define MNG_FN_DROP_SAVEDATA 1021
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_DISPLAY_RGB8 1101
|
||||
#define MNG_FN_DISPLAY_RGBA8 1102
|
||||
#define MNG_FN_DISPLAY_ARGB8 1103
|
||||
#define MNG_FN_DISPLAY_BGR8 1104
|
||||
#define MNG_FN_DISPLAY_BGRA8 1105
|
||||
#define MNG_FN_DISPLAY_ABGR8 1106
|
||||
#define MNG_FN_DISPLAY_RGB16 1107
|
||||
#define MNG_FN_DISPLAY_RGBA16 1108
|
||||
#define MNG_FN_DISPLAY_ARGB16 1109
|
||||
#define MNG_FN_DISPLAY_BGR16 1110
|
||||
#define MNG_FN_DISPLAY_BGRA16 1111
|
||||
#define MNG_FN_DISPLAY_ABGR16 1112
|
||||
#define MNG_FN_DISPLAY_INDEX8 1113
|
||||
#define MNG_FN_DISPLAY_INDEXA8 1114
|
||||
#define MNG_FN_DISPLAY_AINDEX8 1115
|
||||
#define MNG_FN_DISPLAY_GRAY8 1116
|
||||
#define MNG_FN_DISPLAY_GRAY16 1117
|
||||
#define MNG_FN_DISPLAY_GRAYA8 1118
|
||||
#define MNG_FN_DISPLAY_GRAYA16 1119
|
||||
#define MNG_FN_DISPLAY_AGRAY8 1120
|
||||
#define MNG_FN_DISPLAY_AGRAY16 1121
|
||||
#define MNG_FN_DISPLAY_DX15 1122
|
||||
#define MNG_FN_DISPLAY_DX16 1123
|
||||
#define MNG_FN_DISPLAY_RGB8_A8 1124
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_INIT_FULL_CMS 1201
|
||||
#define MNG_FN_CORRECT_FULL_CMS 1202
|
||||
#define MNG_FN_INIT_GAMMA_ONLY 1204
|
||||
#define MNG_FN_CORRECT_GAMMA_ONLY 1205
|
||||
#define MNG_FN_CORRECT_APP_CMS 1206
|
||||
#define MNG_FN_INIT_FULL_CMS_OBJ 1207
|
||||
#define MNG_FN_INIT_GAMMA_ONLY_OBJ 1208
|
||||
#define MNG_FN_INIT_APP_CMS 1209
|
||||
#define MNG_FN_INIT_APP_CMS_OBJ 1210
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_PROCESS_G1 1301
|
||||
#define MNG_FN_PROCESS_G2 1302
|
||||
#define MNG_FN_PROCESS_G4 1303
|
||||
#define MNG_FN_PROCESS_G8 1304
|
||||
#define MNG_FN_PROCESS_G16 1305
|
||||
#define MNG_FN_PROCESS_RGB8 1306
|
||||
#define MNG_FN_PROCESS_RGB16 1307
|
||||
#define MNG_FN_PROCESS_IDX1 1308
|
||||
#define MNG_FN_PROCESS_IDX2 1309
|
||||
#define MNG_FN_PROCESS_IDX4 1310
|
||||
#define MNG_FN_PROCESS_IDX8 1311
|
||||
#define MNG_FN_PROCESS_GA8 1312
|
||||
#define MNG_FN_PROCESS_GA16 1313
|
||||
#define MNG_FN_PROCESS_RGBA8 1314
|
||||
#define MNG_FN_PROCESS_RGBA16 1315
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_INIT_G1_NI 1401
|
||||
#define MNG_FN_INIT_G1_I 1402
|
||||
#define MNG_FN_INIT_G2_NI 1403
|
||||
#define MNG_FN_INIT_G2_I 1404
|
||||
#define MNG_FN_INIT_G4_NI 1405
|
||||
#define MNG_FN_INIT_G4_I 1406
|
||||
#define MNG_FN_INIT_G8_NI 1407
|
||||
#define MNG_FN_INIT_G8_I 1408
|
||||
#define MNG_FN_INIT_G16_NI 1409
|
||||
#define MNG_FN_INIT_G16_I 1410
|
||||
#define MNG_FN_INIT_RGB8_NI 1411
|
||||
#define MNG_FN_INIT_RGB8_I 1412
|
||||
#define MNG_FN_INIT_RGB16_NI 1413
|
||||
#define MNG_FN_INIT_RGB16_I 1414
|
||||
#define MNG_FN_INIT_IDX1_NI 1415
|
||||
#define MNG_FN_INIT_IDX1_I 1416
|
||||
#define MNG_FN_INIT_IDX2_NI 1417
|
||||
#define MNG_FN_INIT_IDX2_I 1418
|
||||
#define MNG_FN_INIT_IDX4_NI 1419
|
||||
#define MNG_FN_INIT_IDX4_I 1420
|
||||
#define MNG_FN_INIT_IDX8_NI 1421
|
||||
#define MNG_FN_INIT_IDX8_I 1422
|
||||
#define MNG_FN_INIT_GA8_NI 1423
|
||||
#define MNG_FN_INIT_GA8_I 1424
|
||||
#define MNG_FN_INIT_GA16_NI 1425
|
||||
#define MNG_FN_INIT_GA16_I 1426
|
||||
#define MNG_FN_INIT_RGBA8_NI 1427
|
||||
#define MNG_FN_INIT_RGBA8_I 1428
|
||||
#define MNG_FN_INIT_RGBA16_NI 1429
|
||||
#define MNG_FN_INIT_RGBA16_I 1430
|
||||
|
||||
#define MNG_FN_INIT_ROWPROC 1497
|
||||
#define MNG_FN_NEXT_ROW 1498
|
||||
#define MNG_FN_CLEANUP_ROWPROC 1499
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_FILTER_A_ROW 1501
|
||||
#define MNG_FN_FILTER_SUB 1502
|
||||
#define MNG_FN_FILTER_UP 1503
|
||||
#define MNG_FN_FILTER_AVERAGE 1504
|
||||
#define MNG_FN_FILTER_PAETH 1505
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_CREATE_IMGDATAOBJECT 1601
|
||||
#define MNG_FN_FREE_IMGDATAOBJECT 1602
|
||||
#define MNG_FN_CLONE_IMGDATAOBJECT 1603
|
||||
#define MNG_FN_CREATE_IMGOBJECT 1604
|
||||
#define MNG_FN_FREE_IMGOBJECT 1605
|
||||
#define MNG_FN_FIND_IMGOBJECT 1606
|
||||
#define MNG_FN_CLONE_IMGOBJECT 1607
|
||||
#define MNG_FN_RESET_OBJECTDETAILS 1608
|
||||
#define MNG_FN_RENUM_IMGOBJECT 1609
|
||||
#define MNG_FN_PROMOTE_IMGOBJECT 1610
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_STORE_G1 1701
|
||||
#define MNG_FN_STORE_G2 1702
|
||||
#define MNG_FN_STORE_G4 1703
|
||||
#define MNG_FN_STORE_G8 1704
|
||||
#define MNG_FN_STORE_G16 1705
|
||||
#define MNG_FN_STORE_RGB8 1706
|
||||
#define MNG_FN_STORE_RGB16 1707
|
||||
#define MNG_FN_STORE_IDX1 1708
|
||||
#define MNG_FN_STORE_IDX2 1709
|
||||
#define MNG_FN_STORE_IDX4 1710
|
||||
#define MNG_FN_STORE_IDX8 1711
|
||||
#define MNG_FN_STORE_GA8 1712
|
||||
#define MNG_FN_STORE_GA16 1713
|
||||
#define MNG_FN_STORE_RGBA8 1714
|
||||
#define MNG_FN_STORE_RGBA16 1715
|
||||
|
||||
#define MNG_FN_RETRIEVE_G8 1751
|
||||
#define MNG_FN_RETRIEVE_G16 1752
|
||||
#define MNG_FN_RETRIEVE_RGB8 1753
|
||||
#define MNG_FN_RETRIEVE_RGB16 1754
|
||||
#define MNG_FN_RETRIEVE_IDX8 1755
|
||||
#define MNG_FN_RETRIEVE_GA8 1756
|
||||
#define MNG_FN_RETRIEVE_GA16 1757
|
||||
#define MNG_FN_RETRIEVE_RGBA8 1758
|
||||
#define MNG_FN_RETRIEVE_RGBA16 1759
|
||||
|
||||
#define MNG_FN_DELTA_G1 1771
|
||||
#define MNG_FN_DELTA_G2 1772
|
||||
#define MNG_FN_DELTA_G4 1773
|
||||
#define MNG_FN_DELTA_G8 1774
|
||||
#define MNG_FN_DELTA_G16 1775
|
||||
#define MNG_FN_DELTA_RGB8 1776
|
||||
#define MNG_FN_DELTA_RGB16 1777
|
||||
#define MNG_FN_DELTA_IDX1 1778
|
||||
#define MNG_FN_DELTA_IDX2 1779
|
||||
#define MNG_FN_DELTA_IDX4 1780
|
||||
#define MNG_FN_DELTA_IDX8 1781
|
||||
#define MNG_FN_DELTA_GA8 1782
|
||||
#define MNG_FN_DELTA_GA16 1783
|
||||
#define MNG_FN_DELTA_RGBA8 1784
|
||||
#define MNG_FN_DELTA_RGBA16 1785
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_CREATE_ANI_LOOP 1801
|
||||
#define MNG_FN_CREATE_ANI_ENDL 1802
|
||||
#define MNG_FN_CREATE_ANI_DEFI 1803
|
||||
#define MNG_FN_CREATE_ANI_BASI 1804
|
||||
#define MNG_FN_CREATE_ANI_CLON 1805
|
||||
#define MNG_FN_CREATE_ANI_PAST 1806
|
||||
#define MNG_FN_CREATE_ANI_DISC 1807
|
||||
#define MNG_FN_CREATE_ANI_BACK 1808
|
||||
#define MNG_FN_CREATE_ANI_FRAM 1809
|
||||
#define MNG_FN_CREATE_ANI_MOVE 1810
|
||||
#define MNG_FN_CREATE_ANI_CLIP 1811
|
||||
#define MNG_FN_CREATE_ANI_SHOW 1812
|
||||
#define MNG_FN_CREATE_ANI_TERM 1813
|
||||
#define MNG_FN_CREATE_ANI_SAVE 1814
|
||||
#define MNG_FN_CREATE_ANI_SEEK 1815
|
||||
#define MNG_FN_CREATE_ANI_GAMA 1816
|
||||
#define MNG_FN_CREATE_ANI_CHRM 1817
|
||||
#define MNG_FN_CREATE_ANI_SRGB 1818
|
||||
#define MNG_FN_CREATE_ANI_ICCP 1819
|
||||
#define MNG_FN_CREATE_ANI_PLTE 1820
|
||||
#define MNG_FN_CREATE_ANI_TRNS 1821
|
||||
#define MNG_FN_CREATE_ANI_BKGD 1822
|
||||
#define MNG_FN_CREATE_ANI_DHDR 1823
|
||||
#define MNG_FN_CREATE_ANI_PROM 1824
|
||||
#define MNG_FN_CREATE_ANI_IPNG 1825
|
||||
#define MNG_FN_CREATE_ANI_IJNG 1826
|
||||
|
||||
#define MNG_FN_CREATE_ANI_IMAGE 1891
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_FREE_ANI_LOOP 1901
|
||||
#define MNG_FN_FREE_ANI_ENDL 1902
|
||||
#define MNG_FN_FREE_ANI_DEFI 1903
|
||||
#define MNG_FN_FREE_ANI_BASI 1904
|
||||
#define MNG_FN_FREE_ANI_CLON 1905
|
||||
#define MNG_FN_FREE_ANI_PAST 1906
|
||||
#define MNG_FN_FREE_ANI_DISC 1907
|
||||
#define MNG_FN_FREE_ANI_BACK 1908
|
||||
#define MNG_FN_FREE_ANI_FRAM 1909
|
||||
#define MNG_FN_FREE_ANI_MOVE 1910
|
||||
#define MNG_FN_FREE_ANI_CLIP 1911
|
||||
#define MNG_FN_FREE_ANI_SHOW 1912
|
||||
#define MNG_FN_FREE_ANI_TERM 1913
|
||||
#define MNG_FN_FREE_ANI_SAVE 1914
|
||||
#define MNG_FN_FREE_ANI_SEEK 1915
|
||||
#define MNG_FN_FREE_ANI_GAMA 1916
|
||||
#define MNG_FN_FREE_ANI_CHRM 1917
|
||||
#define MNG_FN_FREE_ANI_SRGB 1918
|
||||
#define MNG_FN_FREE_ANI_ICCP 1919
|
||||
#define MNG_FN_FREE_ANI_PLTE 1920
|
||||
#define MNG_FN_FREE_ANI_TRNS 1921
|
||||
#define MNG_FN_FREE_ANI_BKGD 1922
|
||||
#define MNG_FN_FREE_ANI_DHDR 1923
|
||||
#define MNG_FN_FREE_ANI_PROM 1924
|
||||
#define MNG_FN_FREE_ANI_IPNG 1925
|
||||
#define MNG_FN_FREE_ANI_IJNG 1926
|
||||
|
||||
#define MNG_FN_FREE_ANI_IMAGE 1991
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_PROCESS_ANI_LOOP 2001
|
||||
#define MNG_FN_PROCESS_ANI_ENDL 2002
|
||||
#define MNG_FN_PROCESS_ANI_DEFI 2003
|
||||
#define MNG_FN_PROCESS_ANI_BASI 2004
|
||||
#define MNG_FN_PROCESS_ANI_CLON 2005
|
||||
#define MNG_FN_PROCESS_ANI_PAST 2006
|
||||
#define MNG_FN_PROCESS_ANI_DISC 2007
|
||||
#define MNG_FN_PROCESS_ANI_BACK 2008
|
||||
#define MNG_FN_PROCESS_ANI_FRAM 2009
|
||||
#define MNG_FN_PROCESS_ANI_MOVE 2010
|
||||
#define MNG_FN_PROCESS_ANI_CLIP 2011
|
||||
#define MNG_FN_PROCESS_ANI_SHOW 2012
|
||||
#define MNG_FN_PROCESS_ANI_TERM 2013
|
||||
#define MNG_FN_PROCESS_ANI_SAVE 2014
|
||||
#define MNG_FN_PROCESS_ANI_SEEK 2015
|
||||
#define MNG_FN_PROCESS_ANI_GAMA 2016
|
||||
#define MNG_FN_PROCESS_ANI_CHRM 2017
|
||||
#define MNG_FN_PROCESS_ANI_SRGB 2018
|
||||
#define MNG_FN_PROCESS_ANI_ICCP 2019
|
||||
#define MNG_FN_PROCESS_ANI_PLTE 2020
|
||||
#define MNG_FN_PROCESS_ANI_TRNS 2021
|
||||
#define MNG_FN_PROCESS_ANI_BKGD 2022
|
||||
#define MNG_FN_PROCESS_ANI_DHDR 2023
|
||||
#define MNG_FN_PROCESS_ANI_PROM 2024
|
||||
#define MNG_FN_PROCESS_ANI_IPNG 2025
|
||||
#define MNG_FN_PROCESS_ANI_IJNG 2026
|
||||
|
||||
#define MNG_FN_PROCESS_ANI_IMAGE 2091
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_RESTORE_BACKIMAGE 2101
|
||||
#define MNG_FN_RESTORE_BACKCOLOR 2102
|
||||
#define MNG_FN_RESTORE_BGCOLOR 2103
|
||||
#define MNG_FN_RESTORE_RGB8 2104
|
||||
#define MNG_FN_RESTORE_BGR8 2105
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_INIT_IHDR 2201
|
||||
#define MNG_FN_INIT_PLTE 2202
|
||||
#define MNG_FN_INIT_IDAT 2203
|
||||
#define MNG_FN_INIT_IEND 2204
|
||||
#define MNG_FN_INIT_TRNS 2205
|
||||
#define MNG_FN_INIT_GAMA 2206
|
||||
#define MNG_FN_INIT_CHRM 2207
|
||||
#define MNG_FN_INIT_SRGB 2208
|
||||
#define MNG_FN_INIT_ICCP 2209
|
||||
#define MNG_FN_INIT_TEXT 2210
|
||||
#define MNG_FN_INIT_ZTXT 2211
|
||||
#define MNG_FN_INIT_ITXT 2212
|
||||
#define MNG_FN_INIT_BKGD 2213
|
||||
#define MNG_FN_INIT_PHYS 2214
|
||||
#define MNG_FN_INIT_SBIT 2215
|
||||
#define MNG_FN_INIT_SPLT 2216
|
||||
#define MNG_FN_INIT_HIST 2217
|
||||
#define MNG_FN_INIT_TIME 2218
|
||||
#define MNG_FN_INIT_MHDR 2219
|
||||
#define MNG_FN_INIT_MEND 2220
|
||||
#define MNG_FN_INIT_LOOP 2221
|
||||
#define MNG_FN_INIT_ENDL 2222
|
||||
#define MNG_FN_INIT_DEFI 2223
|
||||
#define MNG_FN_INIT_BASI 2224
|
||||
#define MNG_FN_INIT_CLON 2225
|
||||
#define MNG_FN_INIT_PAST 2226
|
||||
#define MNG_FN_INIT_DISC 2227
|
||||
#define MNG_FN_INIT_BACK 2228
|
||||
#define MNG_FN_INIT_FRAM 2229
|
||||
#define MNG_FN_INIT_MOVE 2230
|
||||
#define MNG_FN_INIT_CLIP 2231
|
||||
#define MNG_FN_INIT_SHOW 2232
|
||||
#define MNG_FN_INIT_TERM 2233
|
||||
#define MNG_FN_INIT_SAVE 2234
|
||||
#define MNG_FN_INIT_SEEK 2235
|
||||
#define MNG_FN_INIT_EXPI 2236
|
||||
#define MNG_FN_INIT_FPRI 2237
|
||||
#define MNG_FN_INIT_NEED 2238
|
||||
#define MNG_FN_INIT_PHYG 2239
|
||||
#define MNG_FN_INIT_JHDR 2240
|
||||
#define MNG_FN_INIT_JDAT 2241
|
||||
#define MNG_FN_INIT_JSEP 2242
|
||||
#define MNG_FN_INIT_DHDR 2243
|
||||
#define MNG_FN_INIT_PROM 2244
|
||||
#define MNG_FN_INIT_IPNG 2245
|
||||
#define MNG_FN_INIT_PPLT 2246
|
||||
#define MNG_FN_INIT_IJNG 2247
|
||||
#define MNG_FN_INIT_DROP 2248
|
||||
#define MNG_FN_INIT_DBYK 2249
|
||||
#define MNG_FN_INIT_ORDR 2250
|
||||
#define MNG_FN_INIT_UNKNOWN 2251
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_FREE_IHDR 2401
|
||||
#define MNG_FN_FREE_PLTE 2402
|
||||
#define MNG_FN_FREE_IDAT 2403
|
||||
#define MNG_FN_FREE_IEND 2404
|
||||
#define MNG_FN_FREE_TRNS 2405
|
||||
#define MNG_FN_FREE_GAMA 2406
|
||||
#define MNG_FN_FREE_CHRM 2407
|
||||
#define MNG_FN_FREE_SRGB 2408
|
||||
#define MNG_FN_FREE_ICCP 2409
|
||||
#define MNG_FN_FREE_TEXT 2410
|
||||
#define MNG_FN_FREE_ZTXT 2411
|
||||
#define MNG_FN_FREE_ITXT 2412
|
||||
#define MNG_FN_FREE_BKGD 2413
|
||||
#define MNG_FN_FREE_PHYS 2414
|
||||
#define MNG_FN_FREE_SBIT 2415
|
||||
#define MNG_FN_FREE_SPLT 2416
|
||||
#define MNG_FN_FREE_HIST 2417
|
||||
#define MNG_FN_FREE_TIME 2418
|
||||
#define MNG_FN_FREE_MHDR 2419
|
||||
#define MNG_FN_FREE_MEND 2420
|
||||
#define MNG_FN_FREE_LOOP 2421
|
||||
#define MNG_FN_FREE_ENDL 2422
|
||||
#define MNG_FN_FREE_DEFI 2423
|
||||
#define MNG_FN_FREE_BASI 2424
|
||||
#define MNG_FN_FREE_CLON 2425
|
||||
#define MNG_FN_FREE_PAST 2426
|
||||
#define MNG_FN_FREE_DISC 2427
|
||||
#define MNG_FN_FREE_BACK 2428
|
||||
#define MNG_FN_FREE_FRAM 2429
|
||||
#define MNG_FN_FREE_MOVE 2430
|
||||
#define MNG_FN_FREE_CLIP 2431
|
||||
#define MNG_FN_FREE_SHOW 2432
|
||||
#define MNG_FN_FREE_TERM 2433
|
||||
#define MNG_FN_FREE_SAVE 2434
|
||||
#define MNG_FN_FREE_SEEK 2435
|
||||
#define MNG_FN_FREE_EXPI 2436
|
||||
#define MNG_FN_FREE_FPRI 2437
|
||||
#define MNG_FN_FREE_NEED 2438
|
||||
#define MNG_FN_FREE_PHYG 2439
|
||||
#define MNG_FN_FREE_JHDR 2440
|
||||
#define MNG_FN_FREE_JDAT 2441
|
||||
#define MNG_FN_FREE_JSEP 2442
|
||||
#define MNG_FN_FREE_DHDR 2443
|
||||
#define MNG_FN_FREE_PROM 2444
|
||||
#define MNG_FN_FREE_IPNG 2445
|
||||
#define MNG_FN_FREE_PPLT 2446
|
||||
#define MNG_FN_FREE_IJNG 2447
|
||||
#define MNG_FN_FREE_DROP 2448
|
||||
#define MNG_FN_FREE_DBYK 2449
|
||||
#define MNG_FN_FREE_ORDR 2450
|
||||
#define MNG_FN_FREE_UNKNOWN 2451
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_READ_IHDR 2601
|
||||
#define MNG_FN_READ_PLTE 2602
|
||||
#define MNG_FN_READ_IDAT 2603
|
||||
#define MNG_FN_READ_IEND 2604
|
||||
#define MNG_FN_READ_TRNS 2605
|
||||
#define MNG_FN_READ_GAMA 2606
|
||||
#define MNG_FN_READ_CHRM 2607
|
||||
#define MNG_FN_READ_SRGB 2608
|
||||
#define MNG_FN_READ_ICCP 2609
|
||||
#define MNG_FN_READ_TEXT 2610
|
||||
#define MNG_FN_READ_ZTXT 2611
|
||||
#define MNG_FN_READ_ITXT 2612
|
||||
#define MNG_FN_READ_BKGD 2613
|
||||
#define MNG_FN_READ_PHYS 2614
|
||||
#define MNG_FN_READ_SBIT 2615
|
||||
#define MNG_FN_READ_SPLT 2616
|
||||
#define MNG_FN_READ_HIST 2617
|
||||
#define MNG_FN_READ_TIME 2618
|
||||
#define MNG_FN_READ_MHDR 2619
|
||||
#define MNG_FN_READ_MEND 2620
|
||||
#define MNG_FN_READ_LOOP 2621
|
||||
#define MNG_FN_READ_ENDL 2622
|
||||
#define MNG_FN_READ_DEFI 2623
|
||||
#define MNG_FN_READ_BASI 2624
|
||||
#define MNG_FN_READ_CLON 2625
|
||||
#define MNG_FN_READ_PAST 2626
|
||||
#define MNG_FN_READ_DISC 2627
|
||||
#define MNG_FN_READ_BACK 2628
|
||||
#define MNG_FN_READ_FRAM 2629
|
||||
#define MNG_FN_READ_MOVE 2630
|
||||
#define MNG_FN_READ_CLIP 2631
|
||||
#define MNG_FN_READ_SHOW 2632
|
||||
#define MNG_FN_READ_TERM 2633
|
||||
#define MNG_FN_READ_SAVE 2634
|
||||
#define MNG_FN_READ_SEEK 2635
|
||||
#define MNG_FN_READ_EXPI 2636
|
||||
#define MNG_FN_READ_FPRI 2637
|
||||
#define MNG_FN_READ_NEED 2638
|
||||
#define MNG_FN_READ_PHYG 2639
|
||||
#define MNG_FN_READ_JHDR 2640
|
||||
#define MNG_FN_READ_JDAT 2641
|
||||
#define MNG_FN_READ_JSEP 2642
|
||||
#define MNG_FN_READ_DHDR 2643
|
||||
#define MNG_FN_READ_PROM 2644
|
||||
#define MNG_FN_READ_IPNG 2645
|
||||
#define MNG_FN_READ_PPLT 2646
|
||||
#define MNG_FN_READ_IJNG 2647
|
||||
#define MNG_FN_READ_DROP 2648
|
||||
#define MNG_FN_READ_DBYK 2649
|
||||
#define MNG_FN_READ_ORDR 2650
|
||||
#define MNG_FN_READ_UNKNOWN 2651
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_WRITE_IHDR 2801
|
||||
#define MNG_FN_WRITE_PLTE 2802
|
||||
#define MNG_FN_WRITE_IDAT 2803
|
||||
#define MNG_FN_WRITE_IEND 2804
|
||||
#define MNG_FN_WRITE_TRNS 2805
|
||||
#define MNG_FN_WRITE_GAMA 2806
|
||||
#define MNG_FN_WRITE_CHRM 2807
|
||||
#define MNG_FN_WRITE_SRGB 2808
|
||||
#define MNG_FN_WRITE_ICCP 2809
|
||||
#define MNG_FN_WRITE_TEXT 2810
|
||||
#define MNG_FN_WRITE_ZTXT 2811
|
||||
#define MNG_FN_WRITE_ITXT 2812
|
||||
#define MNG_FN_WRITE_BKGD 2813
|
||||
#define MNG_FN_WRITE_PHYS 2814
|
||||
#define MNG_FN_WRITE_SBIT 2815
|
||||
#define MNG_FN_WRITE_SPLT 2816
|
||||
#define MNG_FN_WRITE_HIST 2817
|
||||
#define MNG_FN_WRITE_TIME 2818
|
||||
#define MNG_FN_WRITE_MHDR 2819
|
||||
#define MNG_FN_WRITE_MEND 2820
|
||||
#define MNG_FN_WRITE_LOOP 2821
|
||||
#define MNG_FN_WRITE_ENDL 2822
|
||||
#define MNG_FN_WRITE_DEFI 2823
|
||||
#define MNG_FN_WRITE_BASI 2824
|
||||
#define MNG_FN_WRITE_CLON 2825
|
||||
#define MNG_FN_WRITE_PAST 2826
|
||||
#define MNG_FN_WRITE_DISC 2827
|
||||
#define MNG_FN_WRITE_BACK 2828
|
||||
#define MNG_FN_WRITE_FRAM 2829
|
||||
#define MNG_FN_WRITE_MOVE 2830
|
||||
#define MNG_FN_WRITE_CLIP 2831
|
||||
#define MNG_FN_WRITE_SHOW 2832
|
||||
#define MNG_FN_WRITE_TERM 2833
|
||||
#define MNG_FN_WRITE_SAVE 2834
|
||||
#define MNG_FN_WRITE_SEEK 2835
|
||||
#define MNG_FN_WRITE_EXPI 2836
|
||||
#define MNG_FN_WRITE_FPRI 2837
|
||||
#define MNG_FN_WRITE_NEED 2838
|
||||
#define MNG_FN_WRITE_PHYG 2839
|
||||
#define MNG_FN_WRITE_JHDR 2840
|
||||
#define MNG_FN_WRITE_JDAT 2841
|
||||
#define MNG_FN_WRITE_JSEP 2842
|
||||
#define MNG_FN_WRITE_DHDR 2843
|
||||
#define MNG_FN_WRITE_PROM 2844
|
||||
#define MNG_FN_WRITE_IPNG 2845
|
||||
#define MNG_FN_WRITE_PPLT 2846
|
||||
#define MNG_FN_WRITE_IJNG 2847
|
||||
#define MNG_FN_WRITE_DROP 2848
|
||||
#define MNG_FN_WRITE_DBYK 2849
|
||||
#define MNG_FN_WRITE_ORDR 2850
|
||||
#define MNG_FN_WRITE_UNKNOWN 2851
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_ZLIB_INITIALIZE 3001
|
||||
#define MNG_FN_ZLIB_CLEANUP 3002
|
||||
#define MNG_FN_ZLIB_INFLATEINIT 3003
|
||||
#define MNG_FN_ZLIB_INFLATEROWS 3004
|
||||
#define MNG_FN_ZLIB_INFLATEDATA 3005
|
||||
#define MNG_FN_ZLIB_INFLATEFREE 3006
|
||||
#define MNG_FN_ZLIB_DEFLATEINIT 3007
|
||||
#define MNG_FN_ZLIB_DEFLATEROWS 3008
|
||||
#define MNG_FN_ZLIB_DEFLATEDATA 3009
|
||||
#define MNG_FN_ZLIB_DEFLATEFREE 3010
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_PROCESS_DISPLAY_IHDR 3201
|
||||
#define MNG_FN_PROCESS_DISPLAY_PLTE 3202
|
||||
#define MNG_FN_PROCESS_DISPLAY_IDAT 3203
|
||||
#define MNG_FN_PROCESS_DISPLAY_IEND 3204
|
||||
#define MNG_FN_PROCESS_DISPLAY_TRNS 3205
|
||||
#define MNG_FN_PROCESS_DISPLAY_GAMA 3206
|
||||
#define MNG_FN_PROCESS_DISPLAY_CHRM 3207
|
||||
#define MNG_FN_PROCESS_DISPLAY_SRGB 3208
|
||||
#define MNG_FN_PROCESS_DISPLAY_ICCP 3209
|
||||
#define MNG_FN_PROCESS_DISPLAY_BKGD 3210
|
||||
#define MNG_FN_PROCESS_DISPLAY_PHYS 3211
|
||||
#define MNG_FN_PROCESS_DISPLAY_SBIT 3212
|
||||
#define MNG_FN_PROCESS_DISPLAY_SPLT 3213
|
||||
#define MNG_FN_PROCESS_DISPLAY_HIST 3214
|
||||
#define MNG_FN_PROCESS_DISPLAY_MHDR 3215
|
||||
#define MNG_FN_PROCESS_DISPLAY_MEND 3216
|
||||
#define MNG_FN_PROCESS_DISPLAY_LOOP 3217
|
||||
#define MNG_FN_PROCESS_DISPLAY_ENDL 3218
|
||||
#define MNG_FN_PROCESS_DISPLAY_DEFI 3219
|
||||
#define MNG_FN_PROCESS_DISPLAY_BASI 3220
|
||||
#define MNG_FN_PROCESS_DISPLAY_CLON 3221
|
||||
#define MNG_FN_PROCESS_DISPLAY_PAST 3222
|
||||
#define MNG_FN_PROCESS_DISPLAY_DISC 3223
|
||||
#define MNG_FN_PROCESS_DISPLAY_BACK 3224
|
||||
#define MNG_FN_PROCESS_DISPLAY_FRAM 3225
|
||||
#define MNG_FN_PROCESS_DISPLAY_MOVE 3226
|
||||
#define MNG_FN_PROCESS_DISPLAY_CLIP 3227
|
||||
#define MNG_FN_PROCESS_DISPLAY_SHOW 3228
|
||||
#define MNG_FN_PROCESS_DISPLAY_TERM 3229
|
||||
#define MNG_FN_PROCESS_DISPLAY_SAVE 3230
|
||||
#define MNG_FN_PROCESS_DISPLAY_SEEK 3231
|
||||
#define MNG_FN_PROCESS_DISPLAY_EXPI 3232
|
||||
#define MNG_FN_PROCESS_DISPLAY_FPRI 3233
|
||||
#define MNG_FN_PROCESS_DISPLAY_NEED 3234
|
||||
#define MNG_FN_PROCESS_DISPLAY_PHYG 3235
|
||||
#define MNG_FN_PROCESS_DISPLAY_JHDR 3236
|
||||
#define MNG_FN_PROCESS_DISPLAY_JDAT 3237
|
||||
#define MNG_FN_PROCESS_DISPLAY_JSEP 3238
|
||||
#define MNG_FN_PROCESS_DISPLAY_DHDR 3239
|
||||
#define MNG_FN_PROCESS_DISPLAY_PROM 3240
|
||||
#define MNG_FN_PROCESS_DISPLAY_IPNG 3241
|
||||
#define MNG_FN_PROCESS_DISPLAY_PPLT 3242
|
||||
#define MNG_FN_PROCESS_DISPLAY_IJNG 3243
|
||||
#define MNG_FN_PROCESS_DISPLAY_DROP 3244
|
||||
#define MNG_FN_PROCESS_DISPLAY_DBYK 3245
|
||||
#define MNG_FN_PROCESS_DISPLAY_ORDR 3246
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#define MNG_FN_JPEG_INITIALIZE 3401
|
||||
#define MNG_FN_JPEG_CLEANUP 3402
|
||||
#define MNG_FN_JPEG_DECOMPRESSINIT 3403
|
||||
#define MNG_FN_JPEG_DECOMPRESSDATA 3404
|
||||
#define MNG_FN_JPEG_DECOMPRESSFREE 3405
|
||||
|
||||
#define MNG_FN_STORE_JPEG_G8 3501
|
||||
#define MNG_FN_STORE_JPEG_RGB8 3502
|
||||
#define MNG_FN_STORE_JPEG_G12 3503
|
||||
#define MNG_FN_STORE_JPEG_RGB12 3504
|
||||
#define MNG_FN_STORE_JPEG_GA8 3505
|
||||
#define MNG_FN_STORE_JPEG_RGBA8 3506
|
||||
#define MNG_FN_STORE_JPEG_GA12 3507
|
||||
#define MNG_FN_STORE_JPEG_RGBA12 3508
|
||||
|
||||
#define MNG_FN_INIT_JPEG_A1_NI 3511
|
||||
#define MNG_FN_INIT_JPEG_A2_NI 3512
|
||||
#define MNG_FN_INIT_JPEG_A4_NI 3513
|
||||
#define MNG_FN_INIT_JPEG_A8_NI 3514
|
||||
#define MNG_FN_INIT_JPEG_A16_NI 3515
|
||||
|
||||
#define MNG_FN_STORE_JPEG_G8_A1 3521
|
||||
#define MNG_FN_STORE_JPEG_G8_A2 3522
|
||||
#define MNG_FN_STORE_JPEG_G8_A4 3523
|
||||
#define MNG_FN_STORE_JPEG_G8_A8 3524
|
||||
#define MNG_FN_STORE_JPEG_G8_A16 3525
|
||||
|
||||
#define MNG_FN_STORE_JPEG_RGB8_A1 3531
|
||||
#define MNG_FN_STORE_JPEG_RGB8_A2 3532
|
||||
#define MNG_FN_STORE_JPEG_RGB8_A4 3533
|
||||
#define MNG_FN_STORE_JPEG_RGB8_A8 3534
|
||||
#define MNG_FN_STORE_JPEG_RGB8_A16 3535
|
||||
|
||||
#define MNG_FN_STORE_JPEG_G12_A1 3541
|
||||
#define MNG_FN_STORE_JPEG_G12_A2 3542
|
||||
#define MNG_FN_STORE_JPEG_G12_A4 3543
|
||||
#define MNG_FN_STORE_JPEG_G12_A8 3544
|
||||
#define MNG_FN_STORE_JPEG_G12_A16 3545
|
||||
|
||||
#define MNG_FN_STORE_JPEG_RGB12_A1 3551
|
||||
#define MNG_FN_STORE_JPEG_RGB12_A2 3552
|
||||
#define MNG_FN_STORE_JPEG_RGB12_A4 3553
|
||||
#define MNG_FN_STORE_JPEG_RGB12_A8 3554
|
||||
#define MNG_FN_STORE_JPEG_RGB12_A16 3555
|
||||
|
||||
#define MNG_FN_NEXT_JPEG_ALPHAROW 3591
|
||||
#define MNG_FN_NEXT_JPEG_ROW 3592
|
||||
#define MNG_FN_DISPLAY_JPEG_ROWS 3593
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * Trace string-table entry * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef struct {
|
||||
mng_uint32 iFunction;
|
||||
mng_pchar zTracetext;
|
||||
} mng_trace_entry;
|
||||
typedef mng_trace_entry * mng_trace_entryp;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* MNG_INCLUDE_TRACE_PROCS */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_trace_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
|
@ -0,0 +1,370 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_types.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : type specifications * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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 * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef _mng_types_h_
|
||||
#define _mng_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 MNG_INCLUDE_ZLIB /* zlib by Mark Adler & Jean-loup Gailly */
|
||||
#include "zlib.h"
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_LCMS /* little cms by Marti Maria */
|
||||
#undef FAR /* possibly defined by zlib */
|
||||
#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 */
|
||||
#undef FAR /* possibly defined by zlib or lcms */
|
||||
#include "jpeglib.h" /* all that for JPEG support :-) */
|
||||
#endif /* MNG_INCLUDE_IJG6B */
|
||||
|
||||
#ifdef MNG_INTERNAL_MEMMNGMT
|
||||
#include <stdlib.h> /* "calloc" & "free" */
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
/* B003 */
|
||||
#if defined __BORLANDC__
|
||||
#include <mem.h> /* defines "memcpy" for BCB */
|
||||
#else
|
||||
#include <memory.h> /* defines "memcpy" for other win32 platforms */
|
||||
#endif
|
||||
/* B003 */
|
||||
#else
|
||||
#ifdef BSD
|
||||
#include <strings.h> /* defines "memcpy" for BSD (?) */
|
||||
#else
|
||||
#include <string.h> /* defines "memcpy" for all others (???) */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(MNG_FULL_CMS) || defined(MNG_GAMMA_ONLY)
|
||||
#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
|
||||
|
||||
#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
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
typedef signed long mng_int32; /* basic integers */
|
||||
typedef unsigned long mng_uint32;
|
||||
typedef signed short mng_int16;
|
||||
typedef unsigned short mng_uint16;
|
||||
typedef signed char mng_int8;
|
||||
typedef unsigned char mng_uint8;
|
||||
|
||||
typedef double mng_float; /* basic float */
|
||||
|
||||
typedef char * mng_pchar; /* string */
|
||||
typedef void * mng_ptr; /* generic 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 */
|
||||
|
||||
typedef mng_int32 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_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
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#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};
|
||||
typedef enum mng_imgtypes mng_imgtype;
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* memory management callbacks */
|
||||
typedef mng_ptr MNG_DECL (*mng_memalloc) (mng_uint32 iLen);
|
||||
typedef void MNG_DECL (*mng_memfree) (mng_ptr iPtr,
|
||||
mng_uint32 iLen);
|
||||
|
||||
/* I/O management callbacks */
|
||||
typedef mng_bool MNG_DECL (*mng_openstream) (mng_handle hHandle);
|
||||
typedef mng_bool MNG_DECL (*mng_closestream) (mng_handle hHandle);
|
||||
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);
|
||||
|
||||
/* 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 iTop,
|
||||
mng_uint32 iLeft,
|
||||
mng_uint32 iBottom,
|
||||
mng_uint32 iRight);
|
||||
|
||||
/* 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 /* _mng_types_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_write.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Write management (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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 it's appropriate function here * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "mng_memory.h"
|
||||
#include "mng_chunks.h"
|
||||
#include "mng_chunk_io.h"
|
||||
#include "mng_write.h"
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_WRITE_PROCS
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode 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->fOpenstream ((mng_handle)pData))
|
||||
MNG_ERROR (pData, MNG_APPIOERROR)
|
||||
else
|
||||
{
|
||||
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_uint32p)pData->pWritebuf = PNG_SIG;
|
||||
else
|
||||
if (((mng_chunk_headerp)pChunk)->iChunkname == MNG_UINT_JHDR)
|
||||
*(mng_uint32p)pData->pWritebuf = JNG_SIG;
|
||||
else
|
||||
*(mng_uint32p)pData->pWritebuf = MNG_SIG;
|
||||
|
||||
*(mng_uint32p)(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 it's output routine */
|
||||
iRetcode = ((mng_chunk_headerp)pChunk)->fWrite (pData, pChunk);
|
||||
|
||||
if (iRetcode) /* on error bail out */
|
||||
{
|
||||
MNG_FREE (pData, pData->pWritebuf, pData->iWritebufsize+12)
|
||||
return iRetcode;
|
||||
}
|
||||
/* neeeext */
|
||||
pChunk = ((mng_chunk_headerp)pChunk)->pNext;
|
||||
}
|
||||
/* free the temporary buffer */
|
||||
MNG_FREE (pData, pData->pWritebuf, pData->iWritebufsize+12)
|
||||
|
||||
pData->bWriting = MNG_FALSE; /* done writing */
|
||||
/* close the stream now */
|
||||
if (!pData->fClosestream ((mng_handle)pData))
|
||||
MNG_ERROR (pData, MNG_APPIOERROR)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#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 * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_write.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : Write management (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the write management routines * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_write_h_
|
||||
#define _mng_write_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode write_graphic (mng_datap pData);
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#endif /* _mng_write_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
|
@ -0,0 +1,415 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_zlib.c copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.2 * */
|
||||
/* * * */
|
||||
/* * purpose : ZLIB library interface (implementation) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * 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" * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.h"
|
||||
#include "mng_error.h"
|
||||
#include "mng_trace.h"
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
#include "mng_memory.h"
|
||||
#include "mng_pixels.h"
|
||||
#include "mng_filter.h"
|
||||
#include "mng_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)
|
||||
{
|
||||
uInt 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)
|
||||
{
|
||||
uInt 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 + 1);
|
||||
}
|
||||
|
||||
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))
|
||||
{ /* shouldn't we be at the end ? */
|
||||
if (pData->iRow >= (mng_int32)pData->iDataheight)
|
||||
/* MNG_ERROR (pData, MNG_TOOMUCHIDAT) */ ;
|
||||
else
|
||||
{ /* filter the row if necessary */
|
||||
if (pData->pWorkrow[0])
|
||||
iRslt = filter_a_row (pData);
|
||||
else
|
||||
iRslt = MNG_NOERROR;
|
||||
|
||||
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) /* on error bail out */
|
||||
MNG_ERROR (pData, iRslt);
|
||||
/* swap row-pointers */
|
||||
pSwap = pData->pWorkrow;
|
||||
pData->pWorkrow = pData->pPrevrow;
|
||||
pData->pPrevrow = pSwap; /* so prev points to the processed row! */
|
||||
|
||||
iRslt = 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 + 1);
|
||||
}
|
||||
} /* until some error or EOI */
|
||||
while ((iZrslt == Z_OK) && (pData->sZlib.avail_in > 0));
|
||||
/* 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_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)
|
||||
{
|
||||
uInt 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)
|
||||
{
|
||||
uInt 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 it's 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)
|
||||
{
|
||||
uInt 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)
|
||||
{
|
||||
uInt 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)
|
||||
{
|
||||
uInt iZrslt;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (pData, MNG_FN_ZLIB_DEFLATEFREE, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
iZrslt = deflateEnd (&pData->sZlib); /* let zlib cleanup it's 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 * */
|
||||
/* ************************************************************************** */
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/* ************************************************************************** */
|
||||
/* * For conditions of distribution and use, * */
|
||||
/* * see copyright notice in libmng.h * */
|
||||
/* ************************************************************************** */
|
||||
/* * * */
|
||||
/* * project : libmng * */
|
||||
/* * file : mng_zlib.h copyright (c) 2000 G.Juyn * */
|
||||
/* * version : 0.5.1 * */
|
||||
/* * * */
|
||||
/* * purpose : ZLIB package interface (definition) * */
|
||||
/* * * */
|
||||
/* * author : G.Juyn * */
|
||||
/* * web : http://www.3-t.com * */
|
||||
/* * email : mailto:info@3-t.com * */
|
||||
/* * * */
|
||||
/* * comment : Definition of the ZLIB package interface * */
|
||||
/* * * */
|
||||
/* * changes : 0.5.1 - 05/08/2000 - G.Juyn * */
|
||||
/* * - changed strict-ANSI stuff * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
|
||||
#pragma option -A /* force ANSI-C */
|
||||
#endif
|
||||
|
||||
#ifndef _mng_zlib_h_
|
||||
#define _mng_zlib_h_
|
||||
|
||||
#include "libmng.h"
|
||||
#include "mng_data.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 /* _mng_zlib_h_ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* * end of file * */
|
||||
/* ************************************************************************** */
|
Загрузка…
Ссылка в новой задаче