Update to libmng 1.0.3. rs=blizzard

This commit is contained in:
tor%cs.brown.edu 2001-11-01 00:19:53 +00:00
Родитель 7a2bc6cf75
Коммит 47489a840c
14 изменённых файлов: 789 добавлений и 313 удалений

Просмотреть файл

@ -1,5 +1,78 @@
-----------------------------------------------------------
1.0.3 (Sep 18th 2001)
---------------------
in short:
Small cosmetic changes. Cleaning up the contributions.
New makefile for mingw32, and new fbcon example.
Major thanks to Greg for helping out with the *nix stuff!
Note that there's also a separate download for ASM programmers now.
Check http://www.libmng.com for details (download/ports&packages page).
It may be a while for the next release. I'm "off duty" for the next 8 or
so months...
Gerard
-------------------
bugfixes:
- B459058 - wrong include for lcms headers
core:
- changed inclusion of lcms.h header for Linux platforms (suggested by Greg)
- added get function for last processed BACK chunk
samples:
- replaced the gtk & sdl viewer apps with updates by Greg Roelofs
contrib:
doc:
makefiles:
- changed makefile.linux & makefile.unix as suggested by Greg Roelofs
(makefile.linux now compiles with lcms by default)
- added makefile.mingw for mingw32 by Benoit Blanchon (thanks Mate!)
autoconf:
-----------------------------------------------------------
1.0.2 (Jul 7th 2001)
--------------------
in short:
Another maintenance release with a few added extra's.
-------------------
bugfixes:
- B421427 - writes wrong format in bKGD and tRNS
- B434583 - compiler-warning if MNG_STORE_CHUNKS undefined
core:
- added optimization option for MNG-video playback
- added processterm callback
- added late binding errorcode (not used internally)
- fixed memory-leak with delta-images (Thanks Michael!)
- added option to turn off progressive refresh for large images
samples:
contrib:
doc:
makefiles:
autoconf:
-----------------------------------------------------------
1.0.1 (May 2nd 2001)
--------------------
@ -9,7 +82,7 @@ Maintenance release.
Fixed several memory-leaks with the help of Gregg Kelly, added/fixed some CMS
handling, exported JPEG functions from standard DLL, and some other minor fixes.
The CMS fix now makes libmng automagically work in MNG_FULL_CMS mode as a
The CMS fix now makes libmng automagically work in MNG_FULL_CMS mode as a
sRGB compliant system. YOU WILL NEED TO CHANGE THIS IF YOU ARE NOT ON AN sRGB
COMPLIANT SYSTEM AND WANT TO USE CMS!!!!
(look in libmng.h for the proper function-calls)
@ -19,8 +92,8 @@ COMPLIANT SYSTEM AND WANT TO USE CMS!!!!
bugfixes:
core:
- added MEND processing callback
- fixed first FRAM_MODE=4 timing problem
- added MEND processing callback
- fixed first FRAM_MODE=4 timing problem
- added handle status-copy function (use with care)
- exported JPEG functions from standard DLL
- added BGRA8 canvas with premultiplied alpha (contrib by Gregg Kelly)

Просмотреть файл

@ -100,7 +100,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng.h copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.3 * */
/* * * */
/* * purpose : main application interface * */
/* * * */
@ -219,6 +219,16 @@
/* * 1.0.1 - 05/02/2001 - G.Juyn * */
/* * - added "default" sRGB generation (Thanks Marti!) * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added optimization option for MNG-video playback * */
/* * - added processterm callback * */
/* * 1.0.2 - 06/25/2001 - G.Juyn * */
/* * - added late binding errorcode (not used internally) * */
/* * - added option to turn off progressive refresh * */
/* * * */
/* * 1.0.3 - 08/06/2001 - G.Juyn * */
/* * - added get function for last processed BACK chunk * */
/* * * */
/* ************************************************************************** */
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
@ -357,12 +367,12 @@ extern "C" {
/* * * */
/* ************************************************************************** */
#define MNG_VERSION_TEXT "1.0.1"
#define MNG_VERSION_TEXT "1.0.3"
#define MNG_VERSION_SO 1 /* eg. libmng.so.1 */
#define MNG_VERSION_DLL 1 /* but: libmng.dll (!) */
#define MNG_VERSION_MAJOR 1
#define MNG_VERSION_MINOR 0
#define MNG_VERSION_RELEASE 1
#define MNG_VERSION_RELEASE 3
MNG_EXT mng_pchar MNG_DECL mng_version_text (void);
MNG_EXT mng_uint8 MNG_DECL mng_version_so (void);
@ -384,7 +394,8 @@ MNG_EXT mng_uint8 MNG_DECL mng_version_release (void);
#define MNG_MNG_VERSION "1.0"
#define MNG_MNG_VERSION_MAJ 1
#define MNG_MNG_VERSION_MIN 0
#define MNG_MNG_DRAFT 99 /* deprecated */
#define MNG_MNG_DRAFT 99 /* deprecated;
only used for nEED "MNG DRAFT nn" */
/* ************************************************************************** */
/* * * */
@ -550,6 +561,8 @@ MNG_EXT mng_retcode MNG_DECL mng_setcb_processmend (mng_handle hHandle,
mng_processmend fProc);
MNG_EXT mng_retcode MNG_DECL mng_setcb_processunknown(mng_handle hHandle,
mng_processunknown fProc);
MNG_EXT mng_retcode MNG_DECL mng_setcb_processterm (mng_handle hHandle,
mng_processterm fProc);
#endif
/* callbacks for display processing */
@ -652,6 +665,7 @@ MNG_EXT mng_processsave MNG_DECL mng_getcb_processsave (mng_handle hHandle);
MNG_EXT mng_processseek MNG_DECL mng_getcb_processseek (mng_handle hHandle);
MNG_EXT mng_processneed MNG_DECL mng_getcb_processneed (mng_handle hHandle);
MNG_EXT mng_processunknown MNG_DECL mng_getcb_processunknown (mng_handle hHandle);
MNG_EXT mng_processterm MNG_DECL mng_getcb_processterm (mng_handle hHandle);
#endif
/* see _setcb_ */
@ -718,6 +732,24 @@ MNG_EXT mng_retcode MNG_DECL mng_set_storechunks (mng_handle hHandle,
MNG_EXT mng_retcode MNG_DECL mng_set_sectionbreaks (mng_handle hHandle,
mng_bool bSectionbreaks);
/* Indicates storage of playback info (ON by default!) */
/* can be used to turn off caching of playback info; this is useful to
specifically optimize MNG-video playback; note that if caching is turned off
LOOP chunks will be flagged as errors! TERM chunks will be ignored and only
passed to the processterm() callback if it is defined by the app; also, this
feature can only be used with mng_readdisplay(); mng_read(),
mng_display_reset() and mng_display_goxxxx() will return an error;
once this option is turned off it can't be turned on for the same stream!!! */
MNG_EXT mng_retcode MNG_DECL mng_set_cacheplayback (mng_handle hHandle,
mng_bool bCacheplayback);
/* Indicates automatic progressive refreshes for large images (ON by default!) */
/* turn this off if you do not want intermittent painting while a large image
is being read. useful if the input-stream comes from a fast medium, such
as a local harddisk */
MNG_EXT mng_retcode MNG_DECL mng_set_doprogressive (mng_handle hHandle,
mng_bool bDoProgressive);
/* Color-management necessaries */
/*
*************************************************************************
@ -951,6 +983,12 @@ MNG_EXT mng_bool MNG_DECL mng_get_storechunks (mng_handle hHandle)
/* see _set_ */
MNG_EXT mng_bool MNG_DECL mng_get_sectionbreaks (mng_handle hHandle);
/* see _set_ */
MNG_EXT mng_bool MNG_DECL mng_get_cacheplayback (mng_handle hHandle);
/* see _set_ */
MNG_EXT mng_bool MNG_DECL mng_get_doprogressive (mng_handle hHandle);
/* see _set_ */
#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_FULL_CMS)
MNG_EXT mng_bool MNG_DECL mng_get_srgb (mng_handle hHandle);
@ -1010,6 +1048,16 @@ MNG_EXT mng_speedtype
texts, and the value 2 for a text inside an embedded image inside a MNG */
MNG_EXT mng_uint32 MNG_DECL mng_get_imagelevel (mng_handle hHandle);
/* BACK info */
/* can be used to retrieve the color & mandatory values for the last processed
BACK chunk of a MNG (will fail for other image-types);
if no BACK chunk was processed yet, it will return all zeroes */
MNG_EXT mng_retcode MNG_DECL mng_get_lastbackchunk (mng_handle hHandle,
mng_uint16* iRed,
mng_uint16* iGreen,
mng_uint16* iBlue,
mng_uint8* iMandatory);
/* Display status variables */
/* these get filled & updated during display processing */
/* starttime is the tickcount at the start of displaying the animation */
@ -2033,6 +2081,9 @@ MNG_EXT mng_retcode MNG_DECL mng_updatemngsimplicity (mng_handle hHandle,
#define MNG_NEEDMOREDATA (mng_retcode)14 /* I'm hungry, give me more */
#define MNG_NEEDTIMERWAIT (mng_retcode)15 /* Sleep a while then wake me */
#define MNG_NEEDSECTIONWAIT (mng_retcode)16 /* just processed a SEEK */
#define MNG_LOOPWITHCACHEOFF (mng_retcode)17 /* LOOP when playback info off */
#define MNG_DLLNOTLOADED (mng_retcode)99 /* late binding failed */
#define MNG_APPIOERROR (mng_retcode)901 /* application I/O error */
#define MNG_APPTIMERERROR (mng_retcode)902 /* application timing error */

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_callback_xs.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.2 * */
/* * * */
/* * purpose : callback get/set interface (implementation) * */
/* * * */
@ -40,6 +40,9 @@
/* * 1.0.1 - 02/08/2001 - G.Juyn * */
/* * - added MEND processing callback * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added processterm callback * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
@ -373,6 +376,27 @@ mng_retcode MNG_DECL mng_setcb_processunknown (mng_handle hHandle,
/* ************************************************************************** */
#ifdef MNG_SUPPORT_READ
mng_retcode MNG_DECL mng_setcb_processterm (mng_handle hHandle,
mng_processterm fProc)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSTERM, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->fProcessterm = fProc;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SETCB_PROCESSTERM, 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)
@ -891,6 +915,25 @@ mng_processunknown MNG_DECL mng_getcb_processunknown (mng_handle hHandle)
/* ************************************************************************** */
#ifdef MNG_SUPPORT_READ
mng_processterm MNG_DECL mng_getcb_processterm (mng_handle hHandle)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSTERM, MNG_LC_START)
#endif
MNG_VALIDHANDLEX (hHandle)
#ifdef MNG_SUPPORT_TRACE
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GETCB_PROCESSTERM, MNG_LC_END)
#endif
return ((mng_datap)hHandle)->fProcessterm;
}
#endif /* MNG_SUPPORT_READ */
/* ************************************************************************** */
#ifdef MNG_SUPPORT_DISPLAY
mng_getcanvasline MNG_DECL mng_getcb_getcanvasline (mng_handle hHandle)
{

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_chunk_io.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.0 * */
/* * version : 1.0.2 * */
/* * * */
/* * purpose : Chunk I/O routines (implementation) * */
/* * * */
@ -142,6 +142,11 @@
/* * 0.9.5 - 1/25/2001 - G.Juyn * */
/* * - fixed some small compiler warnings (thanks Nikki) * */
/* * * */
/* * 1.0.2 - 05/05/2000 - G.Juyn * */
/* * - B421427 - writes wrong format in bKGD and tRNS * */
/* * 1.0.2 - 06/20/2000 - G.Juyn * */
/* * - B434583 - compiler-warning if MNG_STORE_CHUNKS undefined * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
@ -649,7 +654,6 @@ READ_CHUNK (read_ihdr)
if (pData->fProcessheader) /* inform the app ? */
if (!pData->fProcessheader (((mng_handle)pData), pData->iWidth, pData->iHeight))
MNG_ERROR (pData, MNG_APPMISCERROR)
}
if (!pData->bHasDHDR)
@ -3043,6 +3047,9 @@ READ_CHUNK (read_loop)
if (!pData->bHasMHDR) /* sequence checks */
MNG_ERROR (pData, MNG_SEQUENCEERROR)
if (!pData->bCacheplayback) /* must store playback info to work!! */
MNG_ERROR (pData, MNG_LOOPWITHCACHEOFF)
#ifdef MNG_INCLUDE_JNG
if ((pData->bHasIHDR) || (pData->bHasBASI) || (pData->bHasDHDR) || (pData->bHasJHDR))
#else
@ -3661,7 +3668,9 @@ READ_CHUNK (read_clon)
READ_CHUNK (read_past)
{
#ifdef MNG_STORE_CHUNKS
mng_uint32 iCount;
#endif
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_READ_PAST, MNG_LC_START)
@ -3681,7 +3690,9 @@ READ_CHUNK (read_past)
if ((iRawlen < 41) || (((iRawlen - 11) % 30) != 0))
MNG_ERROR (pData, MNG_INVALIDLENGTH)
#ifdef MNG_STORE_CHUNKS
iCount = ((iRawlen - 11) / 30); /* how many entries again */
#endif
#ifdef MNG_SUPPORT_DISPLAY
{
@ -3902,7 +3913,9 @@ READ_CHUNK (read_back)
READ_CHUNK (read_fram)
{
mng_uint8p pTemp;
#ifdef MNG_STORE_CHUNKS
mng_uint32 iNamelen;
#endif
mng_uint32 iRemain;
mng_uint32 iRequired = 0;
@ -3922,7 +3935,9 @@ READ_CHUNK (read_fram)
if (iRawlen <= 1) /* only framing-mode ? */
{
#ifdef MNG_STORE_CHUNKS
iNamelen = 0; /* indicate so */
#endif
iRemain = 0;
pTemp = MNG_NULL;
}
@ -3933,7 +3948,9 @@ READ_CHUNK (read_fram)
if ((pTemp - pRawdata) > (mng_int32)iRawlen)
MNG_ERROR (pData, MNG_NULLNOTFOUND)
#ifdef MNG_STORE_CHUNKS
iNamelen = (mng_uint32)((pTemp - pRawdata) - 1);
#endif
iRemain = (mng_uint32)(iRawlen - (pTemp - pRawdata) - 1);
/* remains must be empty or at least 4 bytes */
if ((iRemain != 0) && (iRemain < 4))
@ -4383,6 +4400,11 @@ READ_CHUNK (read_show)
READ_CHUNK (read_term)
{
mng_uint8 iTermaction;
mng_uint8 iIteraction = 0;
mng_uint32 iDelay = 0;
mng_uint32 iItermax = 0;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_READ_TERM, MNG_LC_START)
#endif
@ -4411,25 +4433,24 @@ READ_CHUNK (read_term)
if ((!pData->bHasSAVE) && (pData->iChunkseq > 2))
pData->bEMNGMAhack = MNG_TRUE;
#ifdef MNG_SUPPORT_DISPLAY
iTermaction = *pRawdata; /* get the fields */
if (iRawlen > 1)
{
mng_uint8 iTermaction;
mng_uint8 iIteraction = 0;
mng_uint32 iDelay = 0;
mng_uint32 iItermax = 0;
mng_retcode iRetcode;
iIteraction = *(pRawdata+1);
iDelay = mng_get_uint32 (pRawdata+2);
iItermax = mng_get_uint32 (pRawdata+6);
}
iTermaction = *pRawdata; /* get the fields */
if (pData->fProcessterm) /* inform the app ? */
if (!pData->fProcessterm (((mng_handle)pData), iTermaction, iIteraction,
iDelay, iItermax))
MNG_ERROR (pData, MNG_APPMISCERROR)
if (iRawlen > 1)
{
iIteraction = *(pRawdata+1);
iDelay = mng_get_uint32 (pRawdata+2);
iItermax = mng_get_uint32 (pRawdata+6);
}
/* create the TERM ani-object */
iRetcode = create_ani_term (pData, iTermaction, iIteraction,
iDelay, iItermax);
#ifdef MNG_SUPPORT_DISPLAY
{ /* create the TERM ani-object */
mng_retcode iRetcode = create_ani_term (pData, iTermaction, iIteraction,
iDelay, iItermax);
if (iRetcode) /* on error bail out */
return iRetcode;
@ -4446,14 +4467,10 @@ READ_CHUNK (read_term)
if (iRetcode) /* on error bail out */
return iRetcode;
/* store the fields */
((mng_termp)*ppChunk)->iTermaction = *pRawdata;
if (iRawlen > 1)
{
((mng_termp)*ppChunk)->iIteraction = *(pRawdata+1);
((mng_termp)*ppChunk)->iDelay = mng_get_uint32 (pRawdata+2);
((mng_termp)*ppChunk)->iItermax = mng_get_uint32 (pRawdata+6);
}
((mng_termp)*ppChunk)->iTermaction = iTermaction;
((mng_termp)*ppChunk)->iIteraction = iIteraction;
((mng_termp)*ppChunk)->iDelay = iDelay;
((mng_termp)*ppChunk)->iItermax = iItermax;
}
#endif /* MNG_STORE_CHUNKS */
@ -6422,16 +6439,16 @@ WRITE_CHUNK (write_trns)
switch (pTRNS->iType)
{
case 0: {
iRawlen = 1; /* fill the size & output buffer */
*pRawdata = (mng_uint8)pTRNS->iGray;
iRawlen = 2; /* fill the size & output buffer */
mng_put_uint16 (pRawdata, pTRNS->iGray);
break;
}
case 2: {
iRawlen = 3; /* fill the size & output buffer */
*pRawdata = (mng_uint8)pTRNS->iRed;
*(pRawdata+1) = (mng_uint8)pTRNS->iGreen;
*(pRawdata+2) = (mng_uint8)pTRNS->iBlue;
iRawlen = 6; /* fill the size & output buffer */
mng_put_uint16 (pRawdata, pTRNS->iRed);
mng_put_uint16 (pRawdata+2, pTRNS->iGreen);
mng_put_uint16 (pRawdata+4, pTRNS->iBlue);
break;
}
@ -6880,16 +6897,16 @@ WRITE_CHUNK (write_bkgd)
switch (pBKGD->iType)
{
case 0: { /* gray */
iRawlen = 1; /* fill the size & output buffer */
*pRawdata = (mng_uint8)pBKGD->iGray;
iRawlen = 2; /* fill the size & output buffer */
mng_put_uint16 (pRawdata, pBKGD->iGray);
break;
}
case 2: { /* rgb */
iRawlen = 3; /* fill the size & output buffer */
*pRawdata = (mng_uint8)pBKGD->iRed;
*(pRawdata+1) = (mng_uint8)pBKGD->iGreen;
*(pRawdata+2) = (mng_uint8)pBKGD->iBlue;
iRawlen = 6; /* fill the size & output buffer */
mng_put_uint16 (pRawdata, pBKGD->iRed);
mng_put_uint16 (pRawdata+2, pBKGD->iGreen);
mng_put_uint16 (pRawdata+4, pBKGD->iBlue);
break;
}

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_data.h copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.2 * */
/* * * */
/* * purpose : main data structure definition * */
/* * * */
@ -101,6 +101,12 @@
/* * 1.0.1 - 02/13/2001 - G.Juyn * */
/* * - fixed first FRAM_MODE=4 timing problem * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added optimization option for MNG-video playback * */
/* * - added processterm callback * */
/* * 1.0.2 - 06/25/2001 - G.Juyn * */
/* * - added option to turn off progressive refresh * */
/* * * */
/* ************************************************************************** */
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
@ -249,6 +255,8 @@ typedef struct mng_data_struct {
mng_bool bStorechunks; /* switch for storing chunkdata */
mng_bool bSectionbreaks; /* indicate NEEDSECTIONWAIT breaks */
mng_bool bCacheplayback; /* switch to cache playback info */
mng_bool bDoProgressive; /* progressive refresh for large images */
mng_speedtype iSpeed; /* speed-modifier for animations */
@ -276,6 +284,7 @@ typedef struct mng_data_struct {
mng_processneed fProcessneed;
mng_processmend fProcessmend;
mng_processunknown fProcessunknown;
mng_processterm fProcessterm;
mng_getcanvasline fGetcanvasline;
mng_getbkgdline fGetbkgdline;
mng_getalphaline fGetalphaline;

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_display.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.2 * */
/* * * */
/* * purpose : Display management (implementation) * */
/* * * */
@ -142,6 +142,9 @@
/* * - fixed memory-leak for JNGs with alpha (Thanks Gregg!) * */
/* * - added BGRA8 canvas with premultiplied alpha * */
/* * * */
/* * 1.0.2 - 06/25/2001 - G.Juyn * */
/* * - fixed memory-leak with delta-images (Thanks Michael!) * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
@ -1386,6 +1389,9 @@ mng_retcode execute_delta_image (mng_datap pData,
/* indicate where to retrieve & where to store */
pData->pRetrieveobj = (mng_objectp)pDelta;
pData->pStoreobj = (mng_objectp)pTarget;
if (pData->pRGBArow) /* prevent duplicate allocation! */
MNG_FREE (pData, pData->pRGBArow, (pData->iDatawidth << 3))
/* get a temporary row-buffer */
MNG_ALLOC (pData, pData->pRGBArow, pBufdelta->iRowsize)
@ -2427,7 +2433,8 @@ mng_retcode process_display_mend (mng_datap pData)
MNG_TRACE (pData, MNG_FN_PROCESS_DISPLAY_MEND, MNG_LC_START)
#endif
/* TERM processed ? */
if ((pData->bDisplaying) && (pData->bRunning) && (pData->bHasTERM))
if ((pData->bDisplaying) && (pData->bRunning) &&
(pData->bHasTERM) && (pData->pTermaniobj))
{
mng_retcode iRetcode;
mng_ani_termp pTERM;

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_error.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.0 * */
/* * version : 1.0.2 * */
/* * * */
/* * purpose : Error routines (implementation) * */
/* * * */
@ -50,6 +50,9 @@
/* * 0.9.4 - 1/18/2001 - G.Juyn * */
/* * - added errorcode for MAGN methods * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added optimization option for MNG-video playback * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
@ -86,6 +89,7 @@
{MNG_NEEDMOREDATA, "Reading suspended; waiting for I/O to catch up"},
{MNG_NEEDTIMERWAIT, "Timer suspension; normal animation delay"},
{MNG_NEEDSECTIONWAIT, "SEEK suspension; application decides"},
{MNG_LOOPWITHCACHEOFF, "LOOP encountered when playback cache is turned off"},
{MNG_APPIOERROR, "Application signalled I/O error"},
{MNG_APPTIMERERROR, "Application signalled timing error"},

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_hlapi.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.2 * */
/* * * */
/* * purpose : high-level application API (implementation) * */
/* * * */
@ -128,6 +128,12 @@
/* * 1.0.1 - 04/25/2001 - G.Juyn * */
/* * - moved mng_clear_cms to libmng_cms * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added optimization option for MNG-video playback * */
/* * - added processterm callback * */
/* * 1.0.2 - 06/25/2001 - G.Juyn * */
/* * - added option to turn off progressive refresh * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
@ -521,6 +527,10 @@ mng_handle MNG_DECL mng_initialize (mng_ptr pUserdata,
pData->bStorechunks = MNG_TRUE;
/* no breaks at section-borders */
pData->bSectionbreaks = MNG_FALSE;
/* initially cache playback info */
pData->bCacheplayback = MNG_TRUE;
/* progressive refresh for large images */
pData->bDoProgressive = MNG_TRUE;
/* normal animation-speed ! */
pData->iSpeed = mng_st_normal;
/* initial image limits */
@ -545,7 +555,9 @@ mng_handle MNG_DECL mng_initialize (mng_ptr pUserdata,
pData->fProcesssave = MNG_NULL;
pData->fProcessseek = MNG_NULL;
pData->fProcessneed = MNG_NULL;
pData->fProcessmend = MNG_NULL;
pData->fProcessunknown = MNG_NULL;
pData->fProcessterm = MNG_NULL;
pData->fGetcanvasline = MNG_NULL;
pData->fGetbkgdline = MNG_NULL;
pData->fGetalphaline = MNG_NULL;
@ -1074,6 +1086,9 @@ mng_retcode MNG_DECL mng_read (mng_handle hHandle)
MNG_ERROR (pData, MNG_FUNCTIONINVALID)
#endif
if (!pData->bCacheplayback) /* must store playback info to work!! */
MNG_ERROR (pData, MNG_FUNCTIONINVALID)
cleanup_errors (pData); /* cleanup previous errors */
pData->bReading = MNG_TRUE; /* read only! */
@ -1588,6 +1603,9 @@ mng_retcode MNG_DECL mng_display_reset (mng_handle hHandle)
if ((!pData->bDisplaying) || (pData->bReading))
MNG_ERROR (pData, MNG_FUNCTIONINVALID)
if (!pData->bCacheplayback) /* must store playback info to work!! */
MNG_ERROR (pData, MNG_FUNCTIONINVALID)
cleanup_errors (pData); /* cleanup previous errors */
if (pData->bRunning) /* is it running ? */
@ -1640,6 +1658,9 @@ mng_retcode MNG_DECL mng_display_goframe (mng_handle hHandle,
if ((!pData->bDisplaying) || (pData->bRunning))
MNG_ERROR ((mng_datap)hHandle, MNG_FUNCTIONINVALID)
if (!pData->bCacheplayback) /* must store playback info to work!! */
MNG_ERROR (pData, MNG_FUNCTIONINVALID)
if (iFramenr > pData->iFramecount) /* is the parameter within bounds ? */
MNG_ERROR (pData, MNG_FRAMENRTOOHIGH);
@ -1681,6 +1702,9 @@ mng_retcode MNG_DECL mng_display_golayer (mng_handle hHandle,
if ((!pData->bDisplaying) || (pData->bRunning))
MNG_ERROR (pData, MNG_FUNCTIONINVALID)
if (!pData->bCacheplayback) /* must store playback info to work!! */
MNG_ERROR (pData, MNG_FUNCTIONINVALID)
if (iLayernr > pData->iLayercount) /* is the parameter within bounds ? */
MNG_ERROR (pData, MNG_LAYERNRTOOHIGH)
@ -1722,6 +1746,9 @@ mng_retcode MNG_DECL mng_display_gotime (mng_handle hHandle,
if ((!pData->bDisplaying) || (pData->bRunning))
MNG_ERROR (pData, MNG_FUNCTIONINVALID)
if (!pData->bCacheplayback) /* must store playback info to work!! */
MNG_ERROR (pData, MNG_FUNCTIONINVALID)
if (iPlaytime > pData->iPlaytime) /* is the parameter within bounds ? */
MNG_ERROR (pData, MNG_PLAYTIMETOOHIGH)

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_object_prc.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.0 * */
/* * version : 1.0.2 * */
/* * * */
/* * purpose : Object processing routines (implementation) * */
/* * * */
@ -77,6 +77,9 @@
/* * 0.9.5 - 1/22/2001 - G.Juyn * */
/* * - B129681 - fixed compiler warnings SGI/Irix * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added optimization option for MNG-video playback * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
@ -1455,24 +1458,27 @@ mng_retcode create_ani_image (mng_datap pData)
MNG_TRACE (pData, MNG_FN_CREATE_ANI_IMAGE, MNG_LC_START)
#endif
if (pData->bHasDHDR) /* processing delta-image ? */
pCurrent = (mng_imagep)pData->pObjzero;
else /* get the current object */
pCurrent = (mng_imagep)pData->pCurrentobj;
if (pData->bCacheplayback) /* caching playback info ? */
{
if (pData->bHasDHDR) /* processing delta-image ? */
pCurrent = (mng_imagep)pData->pObjzero;
else /* get the current object */
pCurrent = (mng_imagep)pData->pCurrentobj;
if (!pCurrent) /* otherwise object 0 */
pCurrent = (mng_imagep)pData->pObjzero;
if (!pCurrent) /* otherwise object 0 */
pCurrent = (mng_imagep)pData->pObjzero;
/* now just clone the object !!! */
iRetcode = clone_imageobject (pData, 0, MNG_FALSE, pCurrent->bVisible,
MNG_FALSE, MNG_FALSE, 0, 0, 0, pCurrent, &pImage);
iRetcode = clone_imageobject (pData, 0, MNG_FALSE, pCurrent->bVisible,
MNG_FALSE, MNG_FALSE, 0, 0, 0, pCurrent, &pImage);
if (iRetcode) /* on error bail out */
return iRetcode;
if (iRetcode) /* on error bail out */
return iRetcode;
pImage->sHeader.fCleanup = free_ani_image;
pImage->sHeader.fProcess = process_ani_image;
pImage->sHeader.fCleanup = free_ani_image;
pImage->sHeader.fProcess = process_ani_image;
add_ani_object (pData, (mng_object_headerp)pImage);
add_ani_object (pData, (mng_object_headerp)pImage);
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_IMAGE, MNG_LC_END)
@ -1620,16 +1626,19 @@ mng_retcode create_ani_plte (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_PLTE, MNG_LC_START)
#endif
MNG_ALLOC (pData, pPLTE, sizeof (mng_ani_plte))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pPLTE, sizeof (mng_ani_plte))
pPLTE->sHeader.fCleanup = free_ani_plte;
pPLTE->sHeader.fProcess = process_ani_plte;
pPLTE->sHeader.fCleanup = free_ani_plte;
pPLTE->sHeader.fProcess = process_ani_plte;
add_ani_object (pData, (mng_object_headerp)pPLTE);
add_ani_object (pData, (mng_object_headerp)pPLTE);
pPLTE->iEntrycount = iEntrycount;
pPLTE->iEntrycount = iEntrycount;
MNG_COPY (pPLTE->aEntries, paEntries, sizeof (pPLTE->aEntries))
MNG_COPY (pPLTE->aEntries, paEntries, sizeof (pPLTE->aEntries))
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_PLTE, MNG_LC_END)
@ -1692,16 +1701,19 @@ mng_retcode create_ani_trns (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_TRNS, MNG_LC_START)
#endif
MNG_ALLOC (pData, pTRNS, sizeof (mng_ani_trns))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pTRNS, sizeof (mng_ani_trns))
pTRNS->sHeader.fCleanup = free_ani_trns;
pTRNS->sHeader.fProcess = process_ani_trns;
pTRNS->sHeader.fCleanup = free_ani_trns;
pTRNS->sHeader.fProcess = process_ani_trns;
add_ani_object (pData, (mng_object_headerp)pTRNS);
add_ani_object (pData, (mng_object_headerp)pTRNS);
pTRNS->iRawlen = iRawlen;
pTRNS->iRawlen = iRawlen;
MNG_COPY (pTRNS->aRawdata, pRawdata, sizeof (pTRNS->aRawdata))
MNG_COPY (pTRNS->aRawdata, pRawdata, sizeof (pTRNS->aRawdata))
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_TRNS, MNG_LC_END)
@ -1764,15 +1776,18 @@ mng_retcode create_ani_gama (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_GAMA, MNG_LC_START)
#endif
MNG_ALLOC (pData, pGAMA, sizeof (mng_ani_gama))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pGAMA, sizeof (mng_ani_gama))
pGAMA->sHeader.fCleanup = free_ani_gama;
pGAMA->sHeader.fProcess = process_ani_gama;
pGAMA->sHeader.fCleanup = free_ani_gama;
pGAMA->sHeader.fProcess = process_ani_gama;
add_ani_object (pData, (mng_object_headerp)pGAMA);
add_ani_object (pData, (mng_object_headerp)pGAMA);
pGAMA->bEmpty = bEmpty;
pGAMA->iGamma = iGamma;
pGAMA->bEmpty = bEmpty;
pGAMA->iGamma = iGamma;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_GAMA, MNG_LC_END)
@ -1848,22 +1863,25 @@ mng_retcode create_ani_chrm (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_CHRM, MNG_LC_START)
#endif
MNG_ALLOC (pData, pCHRM, sizeof (mng_ani_chrm))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pCHRM, sizeof (mng_ani_chrm))
pCHRM->sHeader.fCleanup = free_ani_chrm;
pCHRM->sHeader.fProcess = process_ani_chrm;
pCHRM->sHeader.fCleanup = free_ani_chrm;
pCHRM->sHeader.fProcess = process_ani_chrm;
add_ani_object (pData, (mng_object_headerp)pCHRM);
add_ani_object (pData, (mng_object_headerp)pCHRM);
pCHRM->bEmpty = bEmpty;
pCHRM->iWhitepointx = iWhitepointx;
pCHRM->iWhitepointy = iWhitepointy;
pCHRM->iRedx = iRedx;
pCHRM->iRedy = iRedy;
pCHRM->iGreenx = iGreenx;
pCHRM->iGreeny = iGreeny;
pCHRM->iBluex = iBluex;
pCHRM->iBluey = iBluey;
pCHRM->bEmpty = bEmpty;
pCHRM->iWhitepointx = iWhitepointx;
pCHRM->iWhitepointy = iWhitepointy;
pCHRM->iRedx = iRedx;
pCHRM->iRedy = iRedy;
pCHRM->iGreenx = iGreenx;
pCHRM->iGreeny = iGreeny;
pCHRM->iBluex = iBluex;
pCHRM->iBluey = iBluey;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_CHRM, MNG_LC_END)
@ -1946,15 +1964,18 @@ mng_retcode create_ani_srgb (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_SRGB, MNG_LC_START)
#endif
MNG_ALLOC (pData, pSRGB, sizeof (mng_ani_srgb))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pSRGB, sizeof (mng_ani_srgb))
pSRGB->sHeader.fCleanup = free_ani_srgb;
pSRGB->sHeader.fProcess = process_ani_srgb;
pSRGB->sHeader.fCleanup = free_ani_srgb;
pSRGB->sHeader.fProcess = process_ani_srgb;
add_ani_object (pData, (mng_object_headerp)pSRGB);
add_ani_object (pData, (mng_object_headerp)pSRGB);
pSRGB->bEmpty = bEmpty;
pSRGB->iRenderingintent = iRenderingintent;
pSRGB->bEmpty = bEmpty;
pSRGB->iRenderingintent = iRenderingintent;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_SRGB, MNG_LC_END)
@ -2024,20 +2045,23 @@ mng_retcode create_ani_iccp (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_ICCP, MNG_LC_START)
#endif
MNG_ALLOC (pData, pICCP, sizeof (mng_ani_iccp))
pICCP->sHeader.fCleanup = free_ani_iccp;
pICCP->sHeader.fProcess = process_ani_iccp;
add_ani_object (pData, (mng_object_headerp)pICCP);
pICCP->bEmpty = bEmpty;
pICCP->iProfilesize = iProfilesize;
if (iProfilesize)
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pICCP->pProfile, iProfilesize)
MNG_COPY (pICCP->pProfile, pProfile, iProfilesize)
MNG_ALLOC (pData, pICCP, sizeof (mng_ani_iccp))
pICCP->sHeader.fCleanup = free_ani_iccp;
pICCP->sHeader.fProcess = process_ani_iccp;
add_ani_object (pData, (mng_object_headerp)pICCP);
pICCP->bEmpty = bEmpty;
pICCP->iProfilesize = iProfilesize;
if (iProfilesize)
{
MNG_ALLOC (pData, pICCP->pProfile, iProfilesize)
MNG_COPY (pICCP->pProfile, pProfile, iProfilesize)
}
}
#ifdef MNG_SUPPORT_TRACE
@ -2124,16 +2148,19 @@ mng_retcode create_ani_bkgd (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_BKGD, MNG_LC_START)
#endif
MNG_ALLOC (pData, pBKGD, sizeof (mng_ani_bkgd))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pBKGD, sizeof (mng_ani_bkgd))
pBKGD->sHeader.fCleanup = free_ani_bkgd;
pBKGD->sHeader.fProcess = process_ani_bkgd;
pBKGD->sHeader.fCleanup = free_ani_bkgd;
pBKGD->sHeader.fProcess = process_ani_bkgd;
add_ani_object (pData, (mng_object_headerp)pBKGD);
add_ani_object (pData, (mng_object_headerp)pBKGD);
pBKGD->iRed = iRed;
pBKGD->iGreen = iGreen;
pBKGD->iBlue = iBlue;
pBKGD->iRed = iRed;
pBKGD->iGreen = iGreen;
pBKGD->iBlue = iBlue;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_BKGD, MNG_LC_END)
@ -2201,26 +2228,29 @@ mng_retcode create_ani_loop (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_LOOP, MNG_LC_START)
#endif
MNG_ALLOC (pData, pLOOP, sizeof (mng_ani_loop))
pLOOP->sHeader.fCleanup = free_ani_loop;
pLOOP->sHeader.fProcess = process_ani_loop;
add_ani_object (pData, (mng_object_headerp)pLOOP);
pLOOP->iLevel = iLevel;
pLOOP->iRepeatcount = iRepeatcount;
pLOOP->iTermcond = iTermcond;
pLOOP->iItermin = iItermin;
pLOOP->iItermax = iItermax;
pLOOP->iCount = iCount;
/* running counter starts with repeat_count */
pLOOP->iRunningcount = iRepeatcount;
if (iCount)
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pLOOP->pSignals, (iCount << 1))
MNG_COPY (pLOOP->pSignals, pSignals, (iCount << 1))
MNG_ALLOC (pData, pLOOP, sizeof (mng_ani_loop))
pLOOP->sHeader.fCleanup = free_ani_loop;
pLOOP->sHeader.fProcess = process_ani_loop;
add_ani_object (pData, (mng_object_headerp)pLOOP);
pLOOP->iLevel = iLevel;
pLOOP->iRepeatcount = iRepeatcount;
pLOOP->iTermcond = iTermcond;
pLOOP->iItermin = iItermin;
pLOOP->iItermax = iItermax;
pLOOP->iCount = iCount;
/* running counter starts with repeat_count */
pLOOP->iRunningcount = iRepeatcount;
if (iCount)
{
MNG_ALLOC (pData, pLOOP->pSignals, (iCount << 1))
MNG_COPY (pLOOP->pSignals, pSignals, (iCount << 1))
}
}
#ifdef MNG_SUPPORT_TRACE
@ -2285,14 +2315,17 @@ mng_retcode create_ani_endl (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_ENDL, MNG_LC_START)
#endif
MNG_ALLOC (pData, pENDL, sizeof (mng_ani_endl))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pENDL, sizeof (mng_ani_endl))
pENDL->sHeader.fCleanup = free_ani_endl;
pENDL->sHeader.fProcess = process_ani_endl;
pENDL->sHeader.fCleanup = free_ani_endl;
pENDL->sHeader.fProcess = process_ani_endl;
add_ani_object (pData, (mng_object_headerp)pENDL);
add_ani_object (pData, (mng_object_headerp)pENDL);
pENDL->iLevel = iLevel;
pENDL->iLevel = iLevel;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_ENDL, MNG_LC_END)
@ -2395,26 +2428,29 @@ mng_retcode create_ani_defi (mng_datap pData)
MNG_TRACE (pData, MNG_FN_CREATE_ANI_DEFI, MNG_LC_START)
#endif
MNG_ALLOC (pData, pDEFI, sizeof (mng_ani_defi))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pDEFI, sizeof (mng_ani_defi))
pDEFI->sHeader.fCleanup = free_ani_defi;
pDEFI->sHeader.fProcess = process_ani_defi;
pDEFI->sHeader.fCleanup = free_ani_defi;
pDEFI->sHeader.fProcess = process_ani_defi;
add_ani_object (pData, (mng_object_headerp)pDEFI);
add_ani_object (pData, (mng_object_headerp)pDEFI);
pDEFI->iId = pData->iDEFIobjectid;
pDEFI->bHasdonotshow = pData->bDEFIhasdonotshow;
pDEFI->iDonotshow = pData->iDEFIdonotshow;
pDEFI->bHasconcrete = pData->bDEFIhasconcrete;
pDEFI->iConcrete = pData->iDEFIconcrete;
pDEFI->bHasloca = pData->bDEFIhasloca;
pDEFI->iLocax = pData->iDEFIlocax;
pDEFI->iLocay = pData->iDEFIlocay;
pDEFI->bHasclip = pData->bDEFIhasclip;
pDEFI->iClipl = pData->iDEFIclipl;
pDEFI->iClipr = pData->iDEFIclipr;
pDEFI->iClipt = pData->iDEFIclipt;
pDEFI->iClipb = pData->iDEFIclipb;
pDEFI->iId = pData->iDEFIobjectid;
pDEFI->bHasdonotshow = pData->bDEFIhasdonotshow;
pDEFI->iDonotshow = pData->iDEFIdonotshow;
pDEFI->bHasconcrete = pData->bDEFIhasconcrete;
pDEFI->iConcrete = pData->iDEFIconcrete;
pDEFI->bHasloca = pData->bDEFIhasloca;
pDEFI->iLocax = pData->iDEFIlocax;
pDEFI->iLocay = pData->iDEFIlocay;
pDEFI->bHasclip = pData->bDEFIhasclip;
pDEFI->iClipl = pData->iDEFIclipl;
pDEFI->iClipr = pData->iDEFIclipr;
pDEFI->iClipt = pData->iDEFIclipt;
pDEFI->iClipb = pData->iDEFIclipb;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_DEFI, MNG_LC_END)
@ -2496,19 +2532,22 @@ mng_retcode create_ani_basi (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_BASI, MNG_LC_START)
#endif
MNG_ALLOC (pData, pBASI, sizeof (mng_ani_basi))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pBASI, sizeof (mng_ani_basi))
pBASI->sHeader.fCleanup = free_ani_basi;
pBASI->sHeader.fProcess = process_ani_basi;
pBASI->sHeader.fCleanup = free_ani_basi;
pBASI->sHeader.fProcess = process_ani_basi;
add_ani_object (pData, (mng_object_headerp)pBASI);
add_ani_object (pData, (mng_object_headerp)pBASI);
pBASI->iRed = iRed;
pBASI->iGreen = iGreen;
pBASI->iBlue = iBlue;
pBASI->bHasalpha = bHasalpha;
pBASI->iAlpha = iAlpha;
pBASI->iViewable = iViewable;
pBASI->iRed = iRed;
pBASI->iGreen = iGreen;
pBASI->iBlue = iBlue;
pBASI->bHasalpha = bHasalpha;
pBASI->iAlpha = iAlpha;
pBASI->iViewable = iViewable;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_BASI, MNG_LC_END)
@ -2578,23 +2617,26 @@ mng_retcode create_ani_clon (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_CLON, MNG_LC_START)
#endif
MNG_ALLOC (pData, pCLON, sizeof (mng_ani_clon))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pCLON, sizeof (mng_ani_clon))
pCLON->sHeader.fCleanup = free_ani_clon;
pCLON->sHeader.fProcess = process_ani_clon;
pCLON->sHeader.fCleanup = free_ani_clon;
pCLON->sHeader.fProcess = process_ani_clon;
add_ani_object (pData, (mng_object_headerp)pCLON);
add_ani_object (pData, (mng_object_headerp)pCLON);
pCLON->iCloneid = iCloneid;
pCLON->iSourceid = iSourceid;
pCLON->iClonetype = iClonetype;
pCLON->bHasdonotshow = bHasdonotshow;
pCLON->iDonotshow = iDonotshow;
pCLON->iConcrete = iConcrete;
pCLON->bHasloca = bHasloca;
pCLON->iLocatype = iLocatype;
pCLON->iLocax = iLocax;
pCLON->iLocay = iLocay;
pCLON->iCloneid = iCloneid;
pCLON->iSourceid = iSourceid;
pCLON->iClonetype = iClonetype;
pCLON->bHasdonotshow = bHasdonotshow;
pCLON->iDonotshow = iDonotshow;
pCLON->iConcrete = iConcrete;
pCLON->bHasloca = bHasloca;
pCLON->iLocatype = iLocatype;
pCLON->iLocax = iLocax;
pCLON->iLocay = iLocay;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_CLON, MNG_LC_END)
@ -2663,20 +2705,23 @@ mng_retcode create_ani_back (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_BACK, MNG_LC_START)
#endif
MNG_ALLOC (pData, pBACK, sizeof (mng_ani_back))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pBACK, sizeof (mng_ani_back))
pBACK->sHeader.fCleanup = free_ani_back;
pBACK->sHeader.fProcess = process_ani_back;
pBACK->sHeader.fCleanup = free_ani_back;
pBACK->sHeader.fProcess = process_ani_back;
add_ani_object (pData, (mng_object_headerp)pBACK);
pBACK->iRed = iRed;
pBACK->iGreen = iGreen;
pBACK->iBlue = iBlue;
pBACK->iMandatory = iMandatory;
pBACK->iImageid = iImageid;
pBACK->iTile = iTile;
add_ani_object (pData, (mng_object_headerp)pBACK);
pBACK->iRed = iRed;
pBACK->iGreen = iGreen;
pBACK->iBlue = iBlue;
pBACK->iMandatory = iMandatory;
pBACK->iImageid = iImageid;
pBACK->iTile = iTile;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_BACK, MNG_LC_END)
#endif
@ -2749,24 +2794,27 @@ mng_retcode create_ani_fram (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_FRAM, MNG_LC_START)
#endif
MNG_ALLOC (pData, pFRAM, sizeof (mng_ani_fram))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pFRAM, sizeof (mng_ani_fram))
pFRAM->sHeader.fCleanup = free_ani_fram;
pFRAM->sHeader.fProcess = process_ani_fram;
pFRAM->sHeader.fCleanup = free_ani_fram;
pFRAM->sHeader.fProcess = process_ani_fram;
add_ani_object (pData, (mng_object_headerp)pFRAM);
add_ani_object (pData, (mng_object_headerp)pFRAM);
pFRAM->iFramemode = iFramemode;
pFRAM->iChangedelay = iChangedelay;
pFRAM->iDelay = iDelay;
pFRAM->iChangetimeout = iChangetimeout;
pFRAM->iTimeout = iTimeout;
pFRAM->iChangeclipping = iChangeclipping;
pFRAM->iCliptype = iCliptype;
pFRAM->iClipl = iClipl;
pFRAM->iClipr = iClipr;
pFRAM->iClipt = iClipt;
pFRAM->iClipb = iClipb;
pFRAM->iFramemode = iFramemode;
pFRAM->iChangedelay = iChangedelay;
pFRAM->iDelay = iDelay;
pFRAM->iChangetimeout = iChangetimeout;
pFRAM->iTimeout = iTimeout;
pFRAM->iChangeclipping = iChangeclipping;
pFRAM->iCliptype = iCliptype;
pFRAM->iClipl = iClipl;
pFRAM->iClipr = iClipr;
pFRAM->iClipt = iClipt;
pFRAM->iClipb = iClipb;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_FRAM, MNG_LC_END)
@ -2841,18 +2889,21 @@ mng_retcode create_ani_move (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_MOVE, MNG_LC_START)
#endif
MNG_ALLOC (pData, pMOVE, sizeof (mng_ani_move))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pMOVE, sizeof (mng_ani_move))
pMOVE->sHeader.fCleanup = free_ani_move;
pMOVE->sHeader.fProcess = process_ani_move;
pMOVE->sHeader.fCleanup = free_ani_move;
pMOVE->sHeader.fProcess = process_ani_move;
add_ani_object (pData, (mng_object_headerp)pMOVE);
add_ani_object (pData, (mng_object_headerp)pMOVE);
pMOVE->iFirstid = iFirstid;
pMOVE->iLastid = iLastid;
pMOVE->iType = iType;
pMOVE->iLocax = iLocax;
pMOVE->iLocay = iLocay;
pMOVE->iFirstid = iFirstid;
pMOVE->iLastid = iLastid;
pMOVE->iType = iType;
pMOVE->iLocax = iLocax;
pMOVE->iLocay = iLocay;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_MOVE, MNG_LC_END)
@ -2920,20 +2971,23 @@ mng_retcode create_ani_clip (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_CLIP, MNG_LC_START)
#endif
MNG_ALLOC (pData, pCLIP, sizeof (mng_ani_clip))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pCLIP, sizeof (mng_ani_clip))
pCLIP->sHeader.fCleanup = free_ani_clip;
pCLIP->sHeader.fProcess = process_ani_clip;
pCLIP->sHeader.fCleanup = free_ani_clip;
pCLIP->sHeader.fProcess = process_ani_clip;
add_ani_object (pData, (mng_object_headerp)pCLIP);
add_ani_object (pData, (mng_object_headerp)pCLIP);
pCLIP->iFirstid = iFirstid;
pCLIP->iLastid = iLastid;
pCLIP->iType = iType;
pCLIP->iClipl = iClipl;
pCLIP->iClipr = iClipr;
pCLIP->iClipt = iClipt;
pCLIP->iClipb = iClipb;
pCLIP->iFirstid = iFirstid;
pCLIP->iLastid = iLastid;
pCLIP->iType = iType;
pCLIP->iClipl = iClipl;
pCLIP->iClipr = iClipr;
pCLIP->iClipt = iClipt;
pCLIP->iClipb = iClipb;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_CLIP, MNG_LC_END)
@ -2998,16 +3052,19 @@ mng_retcode create_ani_show (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_SHOW, MNG_LC_START)
#endif
MNG_ALLOC (pData, pSHOW, sizeof (mng_ani_show))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pSHOW, sizeof (mng_ani_show))
pSHOW->sHeader.fCleanup = free_ani_show;
pSHOW->sHeader.fProcess = process_ani_show;
pSHOW->sHeader.fCleanup = free_ani_show;
pSHOW->sHeader.fProcess = process_ani_show;
add_ani_object (pData, (mng_object_headerp)pSHOW);
add_ani_object (pData, (mng_object_headerp)pSHOW);
pSHOW->iFirstid = iFirstid;
pSHOW->iLastid = iLastid;
pSHOW->iMode = iMode;
pSHOW->iFirstid = iFirstid;
pSHOW->iLastid = iLastid;
pSHOW->iMode = iMode;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_SHOW, MNG_LC_END)
@ -3081,17 +3138,20 @@ mng_retcode create_ani_term (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_TERM, MNG_LC_START)
#endif
MNG_ALLOC (pData, pTERM, sizeof (mng_ani_term))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pTERM, sizeof (mng_ani_term))
pTERM->sHeader.fCleanup = free_ani_term;
pTERM->sHeader.fProcess = process_ani_term;
pTERM->sHeader.fCleanup = free_ani_term;
pTERM->sHeader.fProcess = process_ani_term;
add_ani_object (pData, (mng_object_headerp)pTERM);
add_ani_object (pData, (mng_object_headerp)pTERM);
pTERM->iTermaction = iTermaction;
pTERM->iIteraction = iIteraction;
pTERM->iDelay = iDelay;
pTERM->iItermax = iItermax;
pTERM->iTermaction = iTermaction;
pTERM->iIteraction = iIteraction;
pTERM->iDelay = iDelay;
pTERM->iItermax = iItermax;
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_TERM, MNG_LC_END)
@ -3147,12 +3207,15 @@ mng_retcode create_ani_save (mng_datap pData)
MNG_TRACE (pData, MNG_FN_CREATE_ANI_SAVE, MNG_LC_START)
#endif
MNG_ALLOC (pData, pSAVE, sizeof (mng_ani_save))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pSAVE, sizeof (mng_ani_save))
pSAVE->sHeader.fCleanup = free_ani_save;
pSAVE->sHeader.fProcess = process_ani_save;
pSAVE->sHeader.fCleanup = free_ani_save;
pSAVE->sHeader.fProcess = process_ani_save;
add_ani_object (pData, (mng_object_headerp)pSAVE);
add_ani_object (pData, (mng_object_headerp)pSAVE);
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_SAVE, MNG_LC_END)
@ -3213,12 +3276,15 @@ mng_retcode create_ani_seek (mng_datap pData)
MNG_TRACE (pData, MNG_FN_CREATE_ANI_SEEK, MNG_LC_START)
#endif
MNG_ALLOC (pData, pSEEK, sizeof (mng_ani_seek))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pSEEK, sizeof (mng_ani_seek))
pSEEK->sHeader.fCleanup = free_ani_seek;
pSEEK->sHeader.fProcess = process_ani_seek;
pSEEK->sHeader.fCleanup = free_ani_seek;
pSEEK->sHeader.fProcess = process_ani_seek;
add_ani_object (pData, (mng_object_headerp)pSEEK);
add_ani_object (pData, (mng_object_headerp)pSEEK);
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_SEEK, MNG_LC_END)
@ -3286,20 +3352,23 @@ mng_retcode create_ani_dhdr (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_DHDR, MNG_LC_START)
#endif
MNG_ALLOC (pData, pDHDR, sizeof (mng_ani_dhdr))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pDHDR, sizeof (mng_ani_dhdr))
pDHDR->sHeader.fCleanup = free_ani_dhdr;
pDHDR->sHeader.fProcess = process_ani_dhdr;
pDHDR->sHeader.fCleanup = free_ani_dhdr;
pDHDR->sHeader.fProcess = process_ani_dhdr;
pDHDR->iObjectid = iObjectid;
pDHDR->iImagetype = iImagetype;
pDHDR->iDeltatype = iDeltatype;
pDHDR->iBlockwidth = iBlockwidth;
pDHDR->iBlockheight = iBlockheight;
pDHDR->iBlockx = iBlockx;
pDHDR->iBlocky = iBlocky;
pDHDR->iObjectid = iObjectid;
pDHDR->iImagetype = iImagetype;
pDHDR->iDeltatype = iDeltatype;
pDHDR->iBlockwidth = iBlockwidth;
pDHDR->iBlockheight = iBlockheight;
pDHDR->iBlockx = iBlockx;
pDHDR->iBlocky = iBlocky;
add_ani_object (pData, (mng_object_headerp)pDHDR);
add_ani_object (pData, (mng_object_headerp)pDHDR);
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_DHDR, MNG_LC_END)
@ -3369,16 +3438,19 @@ mng_retcode create_ani_prom (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_PROM, MNG_LC_START)
#endif
MNG_ALLOC (pData, pPROM, sizeof (mng_ani_prom))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pPROM, sizeof (mng_ani_prom))
pPROM->sHeader.fCleanup = free_ani_prom;
pPROM->sHeader.fProcess = process_ani_prom;
pPROM->sHeader.fCleanup = free_ani_prom;
pPROM->sHeader.fProcess = process_ani_prom;
pPROM->iBitdepth = iBitdepth;
pPROM->iColortype = iColortype;
pPROM->iFilltype = iFilltype;
pPROM->iBitdepth = iBitdepth;
pPROM->iColortype = iColortype;
pPROM->iFilltype = iFilltype;
add_ani_object (pData, (mng_object_headerp)pPROM);
add_ani_object (pData, (mng_object_headerp)pPROM);
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_PROM, MNG_LC_END)
@ -3441,12 +3513,15 @@ mng_retcode create_ani_ipng (mng_datap pData)
MNG_TRACE (pData, MNG_FN_CREATE_ANI_IPNG, MNG_LC_START)
#endif
MNG_ALLOC (pData, pIPNG, sizeof (mng_ani_ipng))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pIPNG, sizeof (mng_ani_ipng))
pIPNG->sHeader.fCleanup = free_ani_ipng;
pIPNG->sHeader.fProcess = process_ani_ipng;
pIPNG->sHeader.fCleanup = free_ani_ipng;
pIPNG->sHeader.fProcess = process_ani_ipng;
add_ani_object (pData, (mng_object_headerp)pIPNG);
add_ani_object (pData, (mng_object_headerp)pIPNG);
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_IPNG, MNG_LC_END)
@ -3507,12 +3582,15 @@ mng_retcode create_ani_ijng (mng_datap pData)
MNG_TRACE (pData, MNG_FN_CREATE_ANI_IJNG, MNG_LC_START)
#endif
MNG_ALLOC (pData, pIJNG, sizeof (mng_ani_ijng))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pIJNG, sizeof (mng_ani_ijng))
pIJNG->sHeader.fCleanup = free_ani_ijng;
pIJNG->sHeader.fProcess = process_ani_ijng;
pIJNG->sHeader.fCleanup = free_ani_ijng;
pIJNG->sHeader.fProcess = process_ani_ijng;
add_ani_object (pData, (mng_object_headerp)pIJNG);
add_ani_object (pData, (mng_object_headerp)pIJNG);
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_IJNG, MNG_LC_END)
@ -3578,19 +3656,22 @@ mng_retcode create_ani_pplt (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_PPLT, MNG_LC_START)
#endif
MNG_ALLOC (pData, pPPLT, sizeof (mng_ani_pplt))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pPPLT, sizeof (mng_ani_pplt))
pPPLT->sHeader.fCleanup = free_ani_pplt;
pPPLT->sHeader.fProcess = process_ani_pplt;
pPPLT->sHeader.fCleanup = free_ani_pplt;
pPPLT->sHeader.fProcess = process_ani_pplt;
pPPLT->iType = iType;
pPPLT->iCount = iCount;
pPPLT->iType = iType;
pPPLT->iCount = iCount;
MNG_COPY (pPPLT->aIndexentries, paIndexentries, sizeof (pPPLT->aIndexentries))
MNG_COPY (pPPLT->aAlphaentries, paAlphaentries, sizeof (pPPLT->aAlphaentries))
MNG_COPY (pPPLT->aUsedentries, paUsedentries, sizeof (pPPLT->aUsedentries ))
MNG_COPY (pPPLT->aIndexentries, paIndexentries, sizeof (pPPLT->aIndexentries))
MNG_COPY (pPPLT->aAlphaentries, paAlphaentries, sizeof (pPPLT->aAlphaentries))
MNG_COPY (pPPLT->aUsedentries, paUsedentries, sizeof (pPPLT->aUsedentries ))
add_ani_object (pData, (mng_object_headerp)pPPLT);
add_ani_object (pData, (mng_object_headerp)pPPLT);
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_PPLT, MNG_LC_END)
@ -3664,23 +3745,26 @@ mng_retcode create_ani_magn (mng_datap pData,
MNG_TRACE (pData, MNG_FN_CREATE_ANI_MAGN, MNG_LC_START)
#endif
MNG_ALLOC (pData, pMAGN, sizeof (mng_ani_magn))
if (pData->bCacheplayback) /* caching playback info ? */
{
MNG_ALLOC (pData, pMAGN, sizeof (mng_ani_magn))
pMAGN->sHeader.fCleanup = free_ani_magn;
pMAGN->sHeader.fProcess = process_ani_magn;
pMAGN->sHeader.fCleanup = free_ani_magn;
pMAGN->sHeader.fProcess = process_ani_magn;
pMAGN->iFirstid = iFirstid;
pMAGN->iLastid = iLastid;
pMAGN->iMethodX = iMethodX;
pMAGN->iMX = iMX;
pMAGN->iMY = iMY;
pMAGN->iML = iML;
pMAGN->iMR = iMR;
pMAGN->iMT = iMT;
pMAGN->iMB = iMB;
pMAGN->iMethodY = iMethodY;
pMAGN->iFirstid = iFirstid;
pMAGN->iLastid = iLastid;
pMAGN->iMethodX = iMethodX;
pMAGN->iMX = iMX;
pMAGN->iMY = iMY;
pMAGN->iML = iML;
pMAGN->iMR = iMR;
pMAGN->iMT = iMT;
pMAGN->iMB = iMB;
pMAGN->iMethodY = iMethodY;
add_ani_object (pData, (mng_object_headerp)pMAGN);
add_ani_object (pData, (mng_object_headerp)pMAGN);
}
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_CREATE_ANI_MAGN, MNG_LC_END)

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_pixels.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.2 * */
/* * * */
/* * purpose : Pixel-row management routines (implementation) * */
/* * * */
@ -99,6 +99,9 @@
/* * 1.0.1 - 04/25/2001 - G.Juyn * */
/* * - moved mng_clear_cms to libmng_cms * */
/* * * */
/* * 1.0.2 - 06/25/2001 - G.Juyn * */
/* * - added option to turn off progressive refresh * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
@ -235,8 +238,9 @@ mng_uint32 const interlace_divider [7] = { 3, 3, 2, 2, 1, 1, 0 };
/* ************************************************************************** */
mng_retcode display_progressive_check (mng_datap pData)
{ /* approximate the need for progressive display */
if (((pData->eImagetype != mng_it_mng) || (pData->iDataheight > 300)) &&
{
if ((pData->bDoProgressive) && /* need progressive display? */
((pData->eImagetype != mng_it_mng) || (pData->iDataheight > 300)) &&
(pData->iDestb - pData->iDestt > 50) && (!pData->pCurraniobj))
{
mng_int32 iC = pData->iRow + pData->iDestt - pData->iSourcet;

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_prop_xs.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.3 * */
/* * * */
/* * purpose : property get/set interface (implementation) * */
/* * * */
@ -65,6 +65,14 @@
/* * 1.0.1 - 05/02/2001 - G.Juyn * */
/* * - added "default" sRGB generation (Thanks Marti!) * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added optimization option for MNG-video playback * */
/* * 1.0.2 - 06/25/2001 - G.Juyn * */
/* * - added option to turn off progressive refresh * */
/* * * */
/* * 1.0.3 - 08/06/2001 - G.Juyn * */
/* * - added get function for last processed BACK chunk * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
@ -270,6 +278,49 @@ mng_retcode MNG_DECL mng_set_sectionbreaks (mng_handle hHandle,
/* ************************************************************************** */
mng_retcode MNG_DECL mng_set_cacheplayback (mng_handle hHandle,
mng_bool bCacheplayback)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_CACHEPLAYBACK, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
if (((mng_datap)hHandle)->bHasheader)
MNG_ERROR (((mng_datap)hHandle), MNG_FUNCTIONINVALID)
((mng_datap)hHandle)->bCacheplayback = bCacheplayback;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_CACHEPLAYBACK, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
mng_retcode MNG_DECL mng_set_doprogressive (mng_handle hHandle,
mng_bool bDoProgressive)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DOPROGRESSIVE, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle)
((mng_datap)hHandle)->bDoProgressive = bDoProgressive;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_DOPROGRESSIVE, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
#ifdef MNG_SUPPORT_DISPLAY
mng_retcode MNG_DECL mng_set_srgb (mng_handle hHandle,
mng_bool bIssRGB)
@ -1537,6 +1588,40 @@ mng_bool MNG_DECL mng_get_sectionbreaks (mng_handle hHandle)
/* ************************************************************************** */
mng_bool MNG_DECL mng_get_cacheplayback (mng_handle hHandle)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_CACHEPLAYBACK, MNG_LC_START)
#endif
MNG_VALIDHANDLEX (hHandle)
#ifdef MNG_SUPPORT_TRACE
MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_CACHEPLAYBACK, MNG_LC_END)
#endif
return ((mng_datap)hHandle)->bCacheplayback;
}
/* ************************************************************************** */
mng_bool MNG_DECL mng_get_doprogressive (mng_handle hHandle)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_DOPROGRESSIVE, MNG_LC_START)
#endif
MNG_VALIDHANDLEX (hHandle)
#ifdef MNG_SUPPORT_TRACE
MNG_TRACEB (((mng_datap)hHandle), MNG_FN_GET_DOPROGRESSIVE, MNG_LC_END)
#endif
return ((mng_datap)hHandle)->bDoProgressive;
}
/* ************************************************************************** */
#ifdef MNG_SUPPORT_DISPLAY
mng_bool MNG_DECL mng_get_srgb (mng_handle hHandle)
{
@ -1978,6 +2063,35 @@ mng_uint32 MNG_DECL mng_get_imagelevel (mng_handle hHandle)
/* ************************************************************************** */
mng_retcode MNG_DECL mng_get_lastbackchunk (mng_handle hHandle,
mng_uint16* iRed,
mng_uint16* iGreen,
mng_uint16* iBlue,
mng_uint8* iMandatory)
{
#ifdef MNG_SUPPORT_TRACE
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_LASTBACKCHUNK, MNG_LC_START)
#endif
MNG_VALIDHANDLEX (hHandle)
if (((mng_datap)hHandle)->eImagetype != mng_it_mng)
MNG_ERROR (((mng_datap)hHandle), MNG_FUNCTIONINVALID)
*iRed = ((mng_datap)hHandle)->iBACKred;
*iGreen = ((mng_datap)hHandle)->iBACKgreen;
*iBlue = ((mng_datap)hHandle)->iBACKblue;
*iMandatory = ((mng_datap)hHandle)->iBACKmandatory;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACEX (((mng_datap)hHandle), MNG_FN_GET_LASTBACKCHUNK, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
#ifdef MNG_SUPPORT_DISPLAY
mng_uint32 MNG_DECL mng_get_starttime (mng_handle hHandle)
{

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_trace.c copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.3 * */
/* * * */
/* * purpose : Trace functions (implementation) * */
/* * * */
@ -94,6 +94,15 @@
/* * 1.0.1 - 05/02/2001 - G.Juyn * */
/* * - added "default" sRGB generation (Thanks Marti!) * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added optimization option for MNG-video playback * */
/* * - added processterm callback * */
/* * 1.0.2 - 06/25/2001 - G.Juyn * */
/* * - added option to turn off progressive refresh * */
/* * * */
/* * 1.0.3 - 08/06/2001 - G.Juyn * */
/* * - added get function for last processed BACK chunk * */
/* * * */
/* ************************************************************************** */
#include "libmng.h"
@ -160,6 +169,7 @@
{MNG_FN_SETCB_PROCESSNEED, "setcb_processneed"},
{MNG_FN_SETCB_PROCESSUNKNOWN, "setcb_processunknown"},
{MNG_FN_SETCB_PROCESSMEND, "setcb_processmend"},
{MNG_FN_SETCB_PROCESSTERM, "setcb_processterm"},
{MNG_FN_GETCB_MEMALLOC, "getcb_memalloc"},
{MNG_FN_GETCB_MEMFREE, "getcb_memfree"},
@ -187,6 +197,7 @@
{MNG_FN_GETCB_PROCESSNEED, "getcb_processneed"},
{MNG_FN_GETCB_PROCESSUNKNOWN, "getcb_processunknown"},
{MNG_FN_GETCB_PROCESSMEND, "getcb_processmend"},
{MNG_FN_GETCB_PROCESSTERM, "getcb_processterm"},
{MNG_FN_SET_USERDATA, "set_userdata"},
{MNG_FN_SET_CANVASSTYLE, "set_canvasstyle"},
@ -222,6 +233,8 @@
{MNG_FN_SET_SRGBPROFILE2, "set_srgbprofile2"},
{MNG_FN_SET_OUTPUTSRGB, "set_outputsrgb"},
{MNG_FN_SET_SRGBIMPLICIT, "set_srgbimplicit"},
{MNG_FN_SET_CACHEPLAYBACK, "set_cacheplayback"},
{MNG_FN_SET_DOPROGRESSIVE, "set_doprogressive"},
{MNG_FN_GET_USERDATA, "get_userdata"},
{MNG_FN_GET_SIGTYPE, "get_sigtype"},
@ -276,6 +289,9 @@
{MNG_FN_GET_ALPHAINTERLACE, "get_alphainterlace"},
{MNG_FN_GET_USEBKGD, "get_usebkgd"},
{MNG_FN_GET_REFRESHPASS, "get_refreshpass"},
{MNG_FN_GET_CACHEPLAYBACK, "get_cacheplayback"},
{MNG_FN_GET_DOPROGRESSIVE, "get_doprogressive"},
{MNG_FN_GET_LASTBACKCHUNK, "get_lastbackchunk"},
{MNG_FN_STATUS_ERROR, "status_error"},
{MNG_FN_STATUS_READING, "status_reading"},

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_trace.h copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.3 * */
/* * * */
/* * purpose : Trace functions (definition) * */
/* * * */
@ -103,6 +103,15 @@
/* * 1.0.1 - 05/02/2001 - G.Juyn * */
/* * - added "default" sRGB generation (Thanks Marti!) * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added optimization option for MNG-video playback * */
/* * - added processterm callback * */
/* * 1.0.2 - 06/25/2001 - G.Juyn * */
/* * - added option to turn off progressive refresh * */
/* * * */
/* * 1.0.3 - 08/06/2001 - G.Juyn * */
/* * - added get function for last processed BACK chunk * */
/* * * */
/* ************************************************************************** */
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
@ -196,6 +205,7 @@ mng_retcode mng_trace (mng_datap pData,
#define MNG_FN_SETCB_PROCESSNEED 124
#define MNG_FN_SETCB_PROCESSUNKNOWN 125
#define MNG_FN_SETCB_PROCESSMEND 126
#define MNG_FN_SETCB_PROCESSTERM 127
#define MNG_FN_GETCB_MEMALLOC 201
#define MNG_FN_GETCB_MEMFREE 202
@ -223,6 +233,7 @@ mng_retcode mng_trace (mng_datap pData,
#define MNG_FN_GETCB_PROCESSNEED 224
#define MNG_FN_GETCB_PROCESSUNKNOWN 225
#define MNG_FN_GETCB_PROCESSMEND 226
#define MNG_FN_GETCB_PROCESSTERM 227
#define MNG_FN_SET_USERDATA 301
#define MNG_FN_SET_CANVASSTYLE 302
@ -258,6 +269,8 @@ mng_retcode mng_trace (mng_datap pData,
#define MNG_FN_SET_SRGBPROFILE2 332
#define MNG_FN_SET_OUTPUTSRGB 333
#define MNG_FN_SET_SRGBIMPLICIT 334
#define MNG_FN_SET_CACHEPLAYBACK 335
#define MNG_FN_SET_DOPROGRESSIVE 336
#define MNG_FN_GET_USERDATA 401
#define MNG_FN_GET_SIGTYPE 402
@ -312,6 +325,9 @@ mng_retcode mng_trace (mng_datap pData,
#define MNG_FN_GET_ALPHAINTERLACE 451
#define MNG_FN_GET_USEBKGD 452
#define MNG_FN_GET_REFRESHPASS 453
#define MNG_FN_GET_CACHEPLAYBACK 454
#define MNG_FN_GET_DOPROGRESSIVE 455
#define MNG_FN_GET_LASTBACKCHUNK 456
#define MNG_FN_STATUS_ERROR 481
#define MNG_FN_STATUS_READING 482

Просмотреть файл

@ -5,7 +5,7 @@
/* * * */
/* * project : libmng * */
/* * file : libmng_types.h copyright (c) 2000 G.Juyn * */
/* * version : 1.0.1 * */
/* * version : 1.0.3 * */
/* * * */
/* * purpose : type specifications * */
/* * * */
@ -94,6 +94,12 @@
/* * 1.0.1 - 02/08/2001 - G.Juyn * */
/* * - added MEND processing callback * */
/* * * */
/* * 1.0.2 - 06/23/2001 - G.Juyn * */
/* * - added processterm callback * */
/* * * */
/* * 1.0.3 - 08/06/2001 - G.Juyn * */
/* * - changed inclusion of lcms.h for Linux platforms * */
/* * * */
/* ************************************************************************** */
#ifndef _libmng_types_h_
@ -146,7 +152,7 @@
#ifndef ZLIB_DLL
#undef FAR
#endif
#ifdef WIN32 /* different header locations */
#if defined(WIN32) || defined(linux) /* different header locations */
#include "lcms.h"
#else
#include "lcms/lcms.h"
@ -429,6 +435,11 @@ typedef mng_bool (MNG_DECL *mng_processunknown) (mng_handle hHandle,
mng_chunkid iChunkid,
mng_uint32 iRawlen,
mng_ptr pRawdata);
typedef mng_bool (MNG_DECL *mng_processterm) (mng_handle hHandle,
mng_uint8 iTermaction,
mng_uint8 iIteraction,
mng_uint32 iDelay,
mng_uint32 iItermax);
/* display processing callbacks */
typedef mng_ptr (MNG_DECL *mng_getcanvasline) (mng_handle hHandle,