Update libmng snapshot. Not in default build.

This commit is contained in:
tor%cs.brown.edu 2000-06-29 12:32:04 +00:00
Родитель 56d058dd39
Коммит 8d9ec27a36
6 изменённых файлов: 97 добавлений и 21 удалений

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

@ -7,6 +7,13 @@ in short:
This is a working version only; the next release will be 0.9.0 (first Beta!)
There are a few incompatible changes with previous versions. The userdata
variable has been changed from mng_uint32 to mng_ptr to accomodate 64-bit
systems. For the same reason memory allocation size parameters have been
changed to a mng_size_t type which is a typedef of size_t.
Thanks to Aleks Jakulin for helping to iron out some 64-bit platform issues!
- implemented the update-region parameters of the refresh callback
- added support for most common delta-image options
- added an animation-speed modifier
@ -14,6 +21,7 @@ This is a working version only; the next release will be 0.9.0 (first Beta!)
- updated mngplg to 0.3.0 (supports JNG & full color-correction!)
- fixed a lot of small things
- added support for PPLT chunk
- fixed to support 64-bit platforms
-------------------
@ -60,6 +68,11 @@ core:
- changed userdata variable to mng_ptr
- added typedef for mng_size_t
- changed size parameter for memory allocation to mng_size_t
- fixed compiler-warning for non-initialized iB variable
- changed definition for 32-bit ints (64-bit platforms)
- changed definition for mng_handle (64-bit platforms)
- swapped refresh parameters
- fixed initialization routine for new mng_handle type
samples:
@ -70,6 +83,7 @@ doc:
makefiles:
- changed makefile.linux to reflect versionnr for shared-lib
- changed makefile.linux to depend on mng_conf.h & mng_types.h
-----------------------------------------------------------

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

@ -64,6 +64,8 @@
/* * - added speed-modifier to timing routine * */
/* * 0.5.3 - 06/22/2000 - G.Juyn * */
/* * - added support for PPLT chunk processing * */
/* * 0.5.3 - 06/29/2000 - G.Juyn * */
/* * - swapped refresh parameters * */
/* * * */
/* ************************************************************************** */
@ -105,8 +107,8 @@ mng_retcode display_progressive_refresh (mng_datap pData,
if ((pData->iUpdatetop < pData->iUpdatebottom) && (pData->iUpdateleft < pData->iUpdateright))
{
if (!pData->fRefresh (((mng_handle)pData),
pData->iUpdatetop, pData->iUpdateleft,
pData->iUpdatebottom, pData->iUpdateright))
pData->iUpdateleft, pData->iUpdatetop,
pData->iUpdateright, pData->iUpdatebottom))
MNG_ERROR (pData, MNG_APPMISCERROR)
pData->iUpdateleft = 0; /* reset update-region */
@ -153,8 +155,8 @@ mng_retcode interframe_delay (mng_datap pData)
{
if ((pData->iUpdatetop < pData->iUpdatebottom) && (pData->iUpdateleft < pData->iUpdateright))
if (!pData->fRefresh (((mng_handle)pData),
pData->iUpdatetop, pData->iUpdateleft,
pData->iUpdatebottom, pData->iUpdateright))
pData->iUpdateleft, pData->iUpdatetop,
pData->iUpdateright, pData->iUpdatebottom))
MNG_ERROR (pData, MNG_APPMISCERROR)
pData->iUpdateleft = 0; /* reset update-region */

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

@ -60,6 +60,8 @@
/* * - added initialization of Imagelevel * */
/* * 0.5.3 - 06/26/2000 - G.Juyn * */
/* * - changed userdata variable to mng_ptr * */
/* * 0.5.3 - 06/29/2000 - G.Juyn * */
/* * - fixed initialization routine for new mng_handle type * */
/* * * */
/* ************************************************************************** */
@ -286,13 +288,13 @@ mng_handle MNG_DECL mng_initialize (mng_ptr pUserdata,
#endif
#ifdef MNG_INTERNAL_MEMMNGMT /* allocate the main datastruc */
pData = calloc (1, sizeof (mng_data));
pData = (mng_datap)calloc (1, sizeof (mng_data));
#else
pData = (mng_datap)fMemalloc (sizeof (mng_data));
#endif
if (!pData)
return 0; /* error: out of memory?? */
return MNG_NULL; /* error: out of memory?? */
/* validate the structure */
pData->iMagic = MNG_MAGIC;
/* save userdata field */
@ -301,7 +303,11 @@ mng_handle MNG_DECL mng_initialize (mng_ptr pUserdata,
pData->fTraceproc = fTraceproc;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_INITIALIZE, MNG_LC_INITIALIZE)
if (mng_trace (pData, MNG_FN_INITIALIZE, MNG_LC_INITIALIZE))
{
MNG_FREEX (pData, pData, sizeof (mng_data))
return MNG_NULL;
}
#endif
/* default canvas styles are 8-bit RGB */
pData->iCanvasstyle = MNG_CANVAS_RGB8;
@ -369,7 +375,7 @@ mng_handle MNG_DECL mng_initialize (mng_ptr pUserdata,
if (iRetcode) /* on error drop out */
{
MNG_FREEX (pData, pData, sizeof (mng_data))
return 0;
return MNG_NULL;
}
pData->pObjzero = pImage;
@ -404,7 +410,11 @@ mng_handle MNG_DECL mng_initialize (mng_ptr pUserdata,
mng_reset ((mng_handle)pData);
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (pData, MNG_FN_INITIALIZE, MNG_LC_END)
if (mng_trace (pData, MNG_FN_INITIALIZE, MNG_LC_END))
{
MNG_FREEX (pData, pData, sizeof (mng_data))
return MNG_NULL;
}
#endif
return (mng_handle)pData; /* if we get here, we're in business */

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

@ -54,6 +54,8 @@
/* * 0.5.3 - 06/25/2000 - G.Juyn * */
/* * - fixed problem with cheap transparency for 4-bit gray * */
/* * - fixed display_xxxx routines for interlaced images * */
/* * 0.5.3 - 06/28/2000 - G.Juyn * */
/* * - fixed compiler-warning for non-initialized iB variable * */
/* * * */
/* ************************************************************************** */
@ -2084,6 +2086,7 @@ mng_retcode store_g1 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
{
@ -2130,6 +2133,7 @@ mng_retcode store_g2 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -2183,6 +2187,7 @@ mng_retcode store_g4 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -2361,6 +2366,7 @@ mng_retcode store_idx1 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
{
@ -2407,6 +2413,7 @@ mng_retcode store_idx2 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -2453,6 +2460,7 @@ mng_retcode store_idx4 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -2783,6 +2791,7 @@ mng_retcode store_jpeg_g8_a1 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize) + 1;
iM = 0; /* start at pixel 0 */
iB = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
{
@ -2829,6 +2838,7 @@ mng_retcode store_jpeg_g8_a2 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize) + 1;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -2882,6 +2892,7 @@ mng_retcode store_jpeg_g8_a4 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize) + 1;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -2994,6 +3005,7 @@ mng_retcode store_jpeg_rgb8_a1 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize) + 3;
iM = 0; /* start at pixel 0 */
iB = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
{
@ -3040,6 +3052,7 @@ mng_retcode store_jpeg_rgb8_a2 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize) + 3;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -3093,6 +3106,7 @@ mng_retcode store_jpeg_rgb8_a4 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize) + 3;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -3205,6 +3219,7 @@ mng_retcode store_jpeg_g12_a1 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize) + 2;
iM = 0; /* start at pixel 0 */
iB = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
{
@ -3251,6 +3266,7 @@ mng_retcode store_jpeg_g12_a2 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize) + 2;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -3304,6 +3320,7 @@ mng_retcode store_jpeg_g12_a4 (mng_datap pData)
pOutrow = pBuf->pImgdata + (pData->iRow * pBuf->iRowsize ) +
(pData->iCol * pBuf->iSamplesize) + 2;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
for (iX = 0; iX < pData->iRowsamples; iX++)
@ -3432,6 +3449,7 @@ mng_retcode delta_g1 (mng_datap pData)
(pData->iCol * pBuf->iSamplesize) +
(pData->iDeltaBlockx * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
/* pixel replace ? */
if (pData->iDeltatype == MNG_DELTATYPE_BLOCKPIXELREPLACE)
{
@ -3501,6 +3519,7 @@ mng_retcode delta_g2 (mng_datap pData)
(pData->iCol * pBuf->iSamplesize) +
(pData->iDeltaBlockx * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
/* pixel replace ? */
if (pData->iDeltatype == MNG_DELTATYPE_BLOCKPIXELREPLACE)
@ -3584,6 +3603,7 @@ mng_retcode delta_g4 (mng_datap pData)
(pData->iCol * pBuf->iSamplesize) +
(pData->iDeltaBlockx * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
/* pixel replace ? */
if (pData->iDeltatype == MNG_DELTATYPE_BLOCKPIXELREPLACE)
@ -3865,6 +3885,7 @@ mng_retcode delta_idx1 (mng_datap pData)
(pData->iCol * pBuf->iSamplesize) +
(pData->iDeltaBlockx * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
/* pixel replace ? */
if (pData->iDeltatype == MNG_DELTATYPE_BLOCKPIXELREPLACE)
{
@ -3934,6 +3955,7 @@ mng_retcode delta_idx2 (mng_datap pData)
(pData->iCol * pBuf->iSamplesize) +
(pData->iDeltaBlockx * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
/* pixel replace ? */
if (pData->iDeltatype == MNG_DELTATYPE_BLOCKPIXELREPLACE)
@ -4004,6 +4026,7 @@ mng_retcode delta_idx4 (mng_datap pData)
(pData->iCol * pBuf->iSamplesize) +
(pData->iDeltaBlockx * pBuf->iSamplesize);
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
/* pixel replace ? */
if (pData->iDeltatype == MNG_DELTATYPE_BLOCKPIXELREPLACE)
@ -4335,6 +4358,7 @@ mng_retcode process_g1 (mng_datap pData)
pWorkrow = pData->pWorkrow + 1; /* temporary work pointers */
pRGBArow = pData->pRGBArow;
iM = 0; /* start at pixel 0 */
iB = 0;
if (pBuf->bHasTRNS) /* tRNS encountered ? */
{
@ -4437,6 +4461,7 @@ mng_retcode process_g2 (mng_datap pData)
pWorkrow = pData->pWorkrow + 1; /* temporary work pointers */
pRGBArow = pData->pRGBArow;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
if (pBuf->bHasTRNS) /* tRNS encountered ? */
@ -4531,6 +4556,7 @@ mng_retcode process_g4 (mng_datap pData)
pWorkrow = pData->pWorkrow + 1; /* temporary work pointers */
pRGBArow = pData->pRGBArow;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
if (pBuf->bHasTRNS) /* tRNS encountered ? */
@ -4919,6 +4945,7 @@ mng_retcode process_idx1 (mng_datap pData)
pWorkrow = pData->pWorkrow + 1; /* temporary work pointers */
pRGBArow = pData->pRGBArow;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
if (pBuf->bHasTRNS) /* tRNS encountered ? */
@ -5018,6 +5045,7 @@ mng_retcode process_idx2 (mng_datap pData)
pWorkrow = pData->pWorkrow + 1; /* temporary work pointers */
pRGBArow = pData->pRGBArow;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
if (pBuf->bHasTRNS) /* tRNS encountered ? */
@ -5117,6 +5145,7 @@ mng_retcode process_idx4 (mng_datap pData)
pWorkrow = pData->pWorkrow + 1; /* temporary work pointers */
pRGBArow = pData->pRGBArow;
iM = 0; /* start at pixel 0 */
iB = 0;
iS = 0;
if (pBuf->bHasTRNS) /* tRNS encountered ? */

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

@ -51,6 +51,12 @@
/* * - added typedef for mng_size_t * */
/* * - changed size parameter for memory callbacks to * */
/* * mng_size_t * */
/* * 0.5.3 - 06/28/2000 - G.Juyn * */
/* * - changed definition of 32-bit ints (64-bit platforms) * */
/* * - changed definition of mng_handle (64-bit platforms) * */
/* * 0.5.3 - 06/29/2000 - G.Juyn * */
/* * - changed definition of mng_handle (again) * */
/* * - swapped refresh parameters * */
/* * * */
/* ************************************************************************** */
@ -104,6 +110,8 @@
#include <stdlib.h> /* "calloc" & "free" */
#endif
#include <limits.h> /* get proper integer widths */
#ifdef WIN32
/* B003 */
#if defined __BORLANDC__
@ -162,9 +170,20 @@
/* ************************************************************************** */
typedef signed long mng_int32; /* basic integers */
#if USHRT_MAX == 0xffffffff /* get the proper 32-bit width !!! */
typedef unsigned short mng_uint32;
typedef signed short mng_int32;
#elif UINT_MAX == 0xffffffff
typedef unsigned int mng_uint32;
typedef signed int mng_int32;
#elif ULONG_MAX == 0xffffffff
typedef unsigned long mng_uint32;
typedef signed short mng_int16;
typedef signed long mng_int32;
#else
#error Sorry, I can't find any 32-bit integers on this platform.
#endif
typedef signed short mng_int16; /* other basic integers */
typedef unsigned short mng_uint16;
typedef signed char mng_int8;
typedef unsigned char mng_uint8;
@ -189,7 +208,9 @@ typedef mng_uint8 * mng_uint8p; /* pointer to unsigned bytes */
typedef mng_int8 mng_bool; /* booleans */
typedef mng_int32 mng_handle; /* generic handle */
struct mng_data_struct;
typedef struct mng_data_struct * mng_handle; /* generic handle */
typedef mng_int32 mng_retcode; /* generic return code */
typedef mng_int32 mng_chunkid; /* 4-byte chunkname identifier */
typedef mng_ptr mng_chunkp; /* pointer to a chunk-structure */
@ -335,10 +356,10 @@ typedef mng_ptr MNG_DECL (*mng_getbkgdline) (mng_handle hHandle,
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);
mng_uint32 iTop,
mng_uint32 iRight,
mng_uint32 iBottom);
/* timer management callbacks */
typedef mng_uint32 MNG_DECL (*mng_gettickcount) (mng_handle hHandle);

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

@ -163,15 +163,15 @@ il_mng_getcanvasline(mng_handle handle, mng_uint32 iLinenr)
static mng_bool
il_mng_refresh(mng_handle handle,
mng_uint32 top, mng_uint32 left,
mng_uint32 bottom, mng_uint32 right)
mng_uint32 left, mng_uint32 top,
mng_uint32 right, mng_uint32 bottom)
{
// dprintf((stderr, "=== refresh(top=%d left=%d bottom=%d right=%d)\n",
// top, left, bottom, right));
EXTRACT_STRUCTS;
for (int y=top; y<bottom; y++) {
for (int y=top; y<=bottom; y++) {
memcpy(imng_p->rowbuf,
imng_p->image+y*CHANNELS*imng_p->width,
CHANNELS*imng_p->width);