Update libmng snapshot. Not in default build.
git-svn-id: svn://10.0.0.236/trunk@73305 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
0d5bee3573
commit
cd57a86bb7
@ -13,6 +13,7 @@ This is a working version only; the next release will be 0.9.0 (first Beta!)
|
||||
- added an image-level parameter for the processtext callback
|
||||
- updated mngplg to 0.3.0 (supports JNG & full color-correction!)
|
||||
- fixed a lot of small things
|
||||
- added support for PPLT chunk
|
||||
|
||||
-------------------
|
||||
|
||||
@ -51,6 +52,12 @@ core:
|
||||
- added support for PPLT chunk
|
||||
- added trace-codes & -strings for PPLT chunk processing
|
||||
- fixed problem with incorrect gamma-correction
|
||||
- fixed inclusion of IJG read/write code
|
||||
- fixed problem with 16-bit GA format
|
||||
- fixed problem with cheap transparency for 4-bit gray
|
||||
- fixed display_xxxx routines for interlaced images
|
||||
- added precaution against faulty iCCP chunks from PS
|
||||
- changed userdata variable to mng_ptr
|
||||
|
||||
samples:
|
||||
|
||||
|
||||
@ -150,6 +150,10 @@
|
||||
/* * 0.5.3 - 06/21/2000 - G.Juyn * */
|
||||
/* * - added get/set for speedtype to facilitate testing * */
|
||||
/* * - added get for imagelevel during processtext callback * */
|
||||
/* * 0.5.3 - 06/24/2000 - G.Juyn * */
|
||||
/* * - fixed inclusion of IJG read/write code * */
|
||||
/* * 0.5.3 - 06/26/2000 - G.Juyn * */
|
||||
/* * - changed userdata variable to mng_ptr * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -193,6 +197,15 @@
|
||||
#define MNG_USE_SETJMP
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG
|
||||
#if defined(MNG_SUPPORT_DISPLAY) || defined(MNG_ACCESS_CHUNKS)
|
||||
#define MNG_INCLUDE_JNG_READ
|
||||
#endif
|
||||
#if defined(MNG_SUPPORT_WRITE) || defined(MNG_ACCESS_CHUNKS)
|
||||
#define MNG_INCLUDE_JNG_WRITE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MNG_FULL_CMS
|
||||
#define MNG_INCLUDE_LCMS
|
||||
#endif
|
||||
@ -301,7 +314,7 @@ MNG_EXT mng_uint8 MNG_DECL mng_version_release (void);
|
||||
/* library initialization function */
|
||||
/* must be the first called before anything can be done at all */
|
||||
/* initializes internal datastructure(s) */
|
||||
MNG_EXT mng_handle MNG_DECL mng_initialize (mng_int32 iUserdata,
|
||||
MNG_EXT mng_handle MNG_DECL mng_initialize (mng_ptr pUserdata,
|
||||
mng_memalloc fMemalloc,
|
||||
mng_memfree fMemfree,
|
||||
mng_traceproc fTraceproc);
|
||||
@ -556,7 +569,7 @@ MNG_EXT mng_processarow MNG_DECL mng_getcb_processarow (mng_handle hHandle);
|
||||
/* Application data pointer */
|
||||
/* provided for application use; not used by the library */
|
||||
MNG_EXT mng_retcode MNG_DECL mng_set_userdata (mng_handle hHandle,
|
||||
mng_int32 iUserdata);
|
||||
mng_ptr pUserdata);
|
||||
|
||||
/* The style of the drawing- & background-canvas */
|
||||
/* only used for displaying images */
|
||||
@ -694,7 +707,7 @@ MNG_EXT mng_retcode MNG_DECL mng_set_speed (mng_handle hHandle,
|
||||
/* ************************************************************************** */
|
||||
|
||||
/* see _set_ */
|
||||
MNG_EXT mng_int32 MNG_DECL mng_get_userdata (mng_handle hHandle);
|
||||
MNG_EXT mng_ptr MNG_DECL mng_get_userdata (mng_handle hHandle);
|
||||
|
||||
/* Network Graphic header details */
|
||||
/* these get filled once the graphics header is processed,
|
||||
|
||||
@ -80,6 +80,8 @@
|
||||
/* * - added administration of imagelevel parameter * */
|
||||
/* * 0.5.3 - 06/22/2000 - G.Juyn * */
|
||||
/* * - implemented support for PPLT chunk * */
|
||||
/* * 0.5.3 - 06/26/2000 - G.Juyn * */
|
||||
/* * - added precaution against faulty iCCP chunks from PS * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -305,7 +307,8 @@ mng_retcode inflate_buffer (mng_datap pData,
|
||||
MNG_ALLOC (pData, *pOutbuf, *iOutsize)
|
||||
}
|
||||
} /* repeat if we didn't have enough space */
|
||||
while (iRetcode == MNG_BUFOVERFLOW);
|
||||
while ((iRetcode == MNG_BUFOVERFLOW) &&
|
||||
(*iOutsize < 20 * iInsize));
|
||||
|
||||
if (!iRetcode) /* if oke ? */
|
||||
*((*pOutbuf) + *iRealsize) = 0; /* then put terminator zero */
|
||||
|
||||
@ -52,6 +52,8 @@
|
||||
/* * 0.5.3 - 06/21/2000 - G.Juyn * */
|
||||
/* * - added Speed parameter to facilitate testing * */
|
||||
/* * - added Imagelevel parameter for processtext callback * */
|
||||
/* * 0.5.3 - 06/26/2000 - G.Juyn * */
|
||||
/* * - changed userdata variable to mng_ptr * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -169,7 +171,7 @@ typedef struct mng_data_struct {
|
||||
|
||||
mng_uint32 iMagic; /* magic number to validate
|
||||
a given handle */
|
||||
mng_int32 iUserdata; /* application workdata */
|
||||
mng_ptr pUserdata; /* application workdata */
|
||||
|
||||
mng_imgtype eSigtype; /* image information */
|
||||
mng_imgtype eImagetype; /* initially zeroed */
|
||||
|
||||
@ -208,7 +208,7 @@ mng_retcode interframe_delay (mng_datap pData)
|
||||
if (pData->iRuntime < iWaitfor) /* delay necessary ? */
|
||||
iInterval = iWaitfor - pData->iRuntime;
|
||||
else
|
||||
iInterval = 10; /* force app to process messageloop */
|
||||
iInterval = 1; /* force app to process messageloop */
|
||||
/* set the timer */
|
||||
if (!pData->fSettimer ((mng_handle)pData, iInterval))
|
||||
MNG_ERROR (pData, MNG_APPTIMERERROR)
|
||||
|
||||
@ -58,6 +58,8 @@
|
||||
/* * 0.5.3 - 06/21/2000 - G.Juyn * */
|
||||
/* * - added initialization of Speed * */
|
||||
/* * - added initialization of Imagelevel * */
|
||||
/* * 0.5.3 - 06/26/2000 - G.Juyn * */
|
||||
/* * - changed userdata variable to mng_ptr * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -272,7 +274,7 @@ mng_uint8 MNG_DECL mng_version_release (void)
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_handle MNG_DECL mng_initialize (mng_int32 iUserdata,
|
||||
mng_handle MNG_DECL mng_initialize (mng_ptr pUserdata,
|
||||
mng_memalloc fMemalloc,
|
||||
mng_memfree fMemfree,
|
||||
mng_traceproc fTraceproc)
|
||||
@ -294,7 +296,7 @@ mng_handle MNG_DECL mng_initialize (mng_int32 iUserdata,
|
||||
/* validate the structure */
|
||||
pData->iMagic = MNG_MAGIC;
|
||||
/* save userdata field */
|
||||
pData->iUserdata = iUserdata;
|
||||
pData->pUserdata = pUserdata;
|
||||
/* remember trace callback */
|
||||
pData->fTraceproc = fTraceproc;
|
||||
|
||||
|
||||
@ -23,6 +23,8 @@
|
||||
/* * * */
|
||||
/* * 0.5.3 - 06/17/2000 - G.Juyn * */
|
||||
/* * - added tracing of JPEG calls * */
|
||||
/* * 0.5.3 - 06/24/2000 - G.Juyn * */
|
||||
/* * - fixed inclusion of IJG read/write code * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -55,20 +57,25 @@
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
void mng_init_source (j_decompress_ptr cinfo)
|
||||
{
|
||||
return; /* nothing needed */
|
||||
}
|
||||
#endif /* MNG_INCLUDE_JNG_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
boolean mng_fill_input_buffer (j_decompress_ptr cinfo)
|
||||
{
|
||||
return FALSE; /* force IJG routine to return to caller */
|
||||
}
|
||||
#endif /* MNG_INCLUDE_JNG_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
void mng_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
|
||||
{
|
||||
if (num_bytes > 0) /* ignore fony calls */
|
||||
@ -93,13 +100,16 @@ void mng_skip_input_data (j_decompress_ptr cinfo, long num_bytes)
|
||||
|
||||
return;
|
||||
}
|
||||
#endif /* MNG_INCLUDE_JNG_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
void mng_term_source (j_decompress_ptr cinfo)
|
||||
{
|
||||
return; /* nothing needed */
|
||||
}
|
||||
#endif /* MNG_INCLUDE_JNG_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -141,16 +151,7 @@ mng_retcode mngjpeg_initialize (mng_datap pData)
|
||||
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)
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
if (pData->pJPEGderr == MNG_NULL)
|
||||
MNG_ALLOC (pData, pData->pJPEGderr, sizeof (mngjpeg_error ))
|
||||
if (pData->pJPEGdsrc == MNG_NULL)
|
||||
@ -160,6 +161,15 @@ mng_retcode mngjpeg_initialize (mng_datap pData)
|
||||
/* enable reverse addressing */
|
||||
pData->pJPEGdinfo->client_data = pData;
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG_WRITE
|
||||
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
|
||||
/* initialize temporary buffer parms */
|
||||
pData->iJPEGbufmax = MNG_JPEG_MAXBUF;
|
||||
MNG_ALLOC (pData, pData->pJPEGbuf, pData->iJPEGbufmax)
|
||||
@ -207,25 +217,27 @@ mng_retcode mngjpeg_cleanup (mng_datap pData)
|
||||
MNG_ERRORJ (pData, iRetcode) /* then IJG-lib issued an error */
|
||||
#endif
|
||||
|
||||
#ifdef MNG_SUPPORT_WRITE
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
if (pData->bJPEGdecompress) /* still decompressing something ? */
|
||||
jpeg_destroy_decompress (pData->pJPEGdinfo);
|
||||
#endif
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG_WRITE
|
||||
if (pData->bJPEGcompress) /* still compressing something ? */
|
||||
jpeg_destroy_compress (pData->pJPEGcinfo);
|
||||
#endif
|
||||
|
||||
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)
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
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)
|
||||
#ifdef MNG_INCLUDE_JNG_WRITE
|
||||
MNG_FREE (pData, pData->pJPEGcinfo, sizeof (mngjpeg_comp ))
|
||||
MNG_FREE (pData, pData->pJPEGcerr, sizeof (mngjpeg_error ))
|
||||
#endif
|
||||
@ -247,6 +259,7 @@ mng_retcode mngjpeg_cleanup (mng_datap pData)
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
mng_retcode mngjpeg_decompressinit (mng_datap pData)
|
||||
{
|
||||
#if defined(MNG_INCLUDE_IJG6B) && defined(MNG_USE_SETJMP)
|
||||
@ -299,9 +312,11 @@ mng_retcode mngjpeg_decompressinit (mng_datap pData)
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_INCLUDE_JNG_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
mng_retcode mngjpeg_decompressdata (mng_datap pData,
|
||||
mng_uint32 iRawsize,
|
||||
mng_uint8p pRawdata)
|
||||
@ -541,9 +556,11 @@ mng_retcode mngjpeg_decompressdata (mng_datap pData,
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_INCLUDE_JNG_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifdef MNG_INCLUDE_JNG_READ
|
||||
mng_retcode mngjpeg_decompressfree (mng_datap pData)
|
||||
{
|
||||
#if defined(MNG_INCLUDE_IJG6B) && defined(MNG_USE_SETJMP)
|
||||
@ -577,6 +594,7 @@ mng_retcode mngjpeg_decompressfree (mng_datap pData)
|
||||
|
||||
return MNG_NOERROR;
|
||||
}
|
||||
#endif /* MNG_INCLUDE_JNG_READ */
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
@ -49,6 +49,11 @@
|
||||
/* * - optimized some store_xxx routines * */
|
||||
/* * 0.5.3 - 06/20/2000 - G.Juyn * */
|
||||
/* * - fixed nasty bug with embedded PNG after delta-image * */
|
||||
/* * 0.5.3 - 06/24/2000 - G.Juyn * */
|
||||
/* * - fixed problem with 16-bit GA format * */
|
||||
/* * 0.5.3 - 06/25/2000 - G.Juyn * */
|
||||
/* * - fixed problem with cheap transparency for 4-bit gray * */
|
||||
/* * - fixed display_xxxx routines for interlaced images * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -198,7 +203,7 @@ mng_retcode display_rgb8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* scale down by dropping the LSB */
|
||||
*pScanline = *pDataline;
|
||||
*(pScanline+1) = *(pDataline+2);
|
||||
@ -210,7 +215,7 @@ mng_retcode display_rgb8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* copy the values */
|
||||
*pScanline = *pDataline;
|
||||
*(pScanline+1) = *(pDataline+1);
|
||||
@ -225,7 +230,7 @@ mng_retcode display_rgb8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{
|
||||
iA16 = mng_get_uint16 (pDataline+6);
|
||||
|
||||
@ -266,7 +271,7 @@ mng_retcode display_rgb8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{
|
||||
iA8 = *(pDataline+3); /* get alpha value */
|
||||
|
||||
@ -340,7 +345,7 @@ mng_retcode display_rgba8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* scale down by dropping the LSB */
|
||||
*pScanline = *pDataline;
|
||||
*(pScanline+1) = *(pDataline+2);
|
||||
@ -353,7 +358,7 @@ mng_retcode display_rgba8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* copy the values */
|
||||
*pScanline = *pDataline;
|
||||
*(pScanline+1) = *(pDataline+1);
|
||||
@ -369,7 +374,7 @@ mng_retcode display_rgba8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* get alpha values */
|
||||
iFGa16 = mng_get_uint16 (pDataline+6);
|
||||
iBGa16 = (mng_uint16)(*(pScanline+3));
|
||||
@ -442,7 +447,7 @@ mng_retcode display_rgba8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{
|
||||
iFGa8 = *(pDataline+3); /* get alpha values */
|
||||
iBGa8 = *(pScanline+3);
|
||||
@ -537,7 +542,7 @@ mng_retcode display_argb8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* scale down by dropping the LSB */
|
||||
*pScanline = *(pDataline+6);
|
||||
*(pScanline+1) = *pDataline;
|
||||
@ -550,7 +555,7 @@ mng_retcode display_argb8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* copy the values */
|
||||
*pScanline = *(pDataline+2);
|
||||
*(pScanline+1) = *pDataline;
|
||||
@ -566,7 +571,7 @@ mng_retcode display_argb8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* get alpha values */
|
||||
iFGa16 = mng_get_uint16 (pDataline+6);
|
||||
iBGa16 = (mng_uint16)(*pScanline);
|
||||
@ -639,7 +644,7 @@ mng_retcode display_argb8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{
|
||||
iFGa8 = *(pDataline+3); /* get alpha values */
|
||||
iBGa8 = *pScanline;
|
||||
@ -739,7 +744,7 @@ mng_retcode display_rgb8_a8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* scale down by dropping the LSB */
|
||||
*pScanline = *pDataline;
|
||||
*(pScanline+1) = *(pDataline+2);
|
||||
@ -753,7 +758,7 @@ mng_retcode display_rgb8_a8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* copy the values */
|
||||
*pScanline = *pDataline;
|
||||
*(pScanline+1) = *(pDataline+1);
|
||||
@ -770,7 +775,7 @@ mng_retcode display_rgb8_a8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* get alpha values */
|
||||
iFGa16 = mng_get_uint16 (pDataline+6);
|
||||
iBGa16 = (mng_uint16)(*pAlphaline);
|
||||
@ -844,7 +849,7 @@ mng_retcode display_rgb8_a8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{
|
||||
iFGa8 = *(pDataline+3); /* get alpha values */
|
||||
iBGa8 = *(pScanline+3);
|
||||
@ -935,7 +940,7 @@ mng_retcode display_bgr8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* scale down by dropping the LSB */
|
||||
*pScanline = *(pDataline+4);
|
||||
*(pScanline+1) = *(pDataline+2);
|
||||
@ -947,7 +952,7 @@ mng_retcode display_bgr8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* copy the values */
|
||||
*pScanline = *(pDataline+2);
|
||||
*(pScanline+1) = *(pDataline+1);
|
||||
@ -962,7 +967,7 @@ mng_retcode display_bgr8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* get alpha value */
|
||||
iA16 = mng_get_uint16 (pDataline+6);
|
||||
|
||||
@ -1003,7 +1008,7 @@ mng_retcode display_bgr8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{
|
||||
iA8 = *(pDataline+3); /* get alpha value */
|
||||
|
||||
@ -1077,7 +1082,7 @@ mng_retcode display_bgra8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* scale down by dropping the LSB */
|
||||
*pScanline = *(pDataline+4);
|
||||
*(pScanline+1) = *(pDataline+2);
|
||||
@ -1090,7 +1095,7 @@ mng_retcode display_bgra8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* copy the values */
|
||||
*pScanline = *(pDataline+2);
|
||||
*(pScanline+1) = *(pDataline+1);
|
||||
@ -1106,7 +1111,7 @@ mng_retcode display_bgra8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* get alpha values */
|
||||
iFGa16 = mng_get_uint16 (pDataline+6);
|
||||
iBGa16 = (mng_uint16)(*(pScanline+3));
|
||||
@ -1179,7 +1184,7 @@ mng_retcode display_bgra8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{
|
||||
iFGa8 = *(pDataline+3); /* get alpha values */
|
||||
iBGa8 = *(pScanline+3);
|
||||
@ -1273,7 +1278,7 @@ mng_retcode display_abgr8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* scale down by dropping the LSB */
|
||||
*pScanline = *(pDataline+6);
|
||||
*(pScanline+1) = *(pDataline+4);
|
||||
@ -1286,7 +1291,7 @@ mng_retcode display_abgr8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* copy the values */
|
||||
*pScanline = *(pDataline+3);
|
||||
*(pScanline+1) = *(pDataline+2);
|
||||
@ -1302,7 +1307,7 @@ mng_retcode display_abgr8 (mng_datap pData)
|
||||
{
|
||||
if (pData->bIsRGBA16) /* 16-bit input row ? */
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{ /* get alpha values */
|
||||
iFGa16 = mng_get_uint16 (pDataline+6);
|
||||
iBGa16 = (mng_uint16)(*pScanline);
|
||||
@ -1375,7 +1380,7 @@ mng_retcode display_abgr8 (mng_datap pData)
|
||||
}
|
||||
else
|
||||
{
|
||||
for (iX = pData->iSourcel; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
for (iX = pData->iSourcel + pData->iCol; iX < pData->iSourcer; iX += pData->iColinc)
|
||||
{
|
||||
iFGa8 = *(pDataline+3); /* get alpha values */
|
||||
iBGa8 = *pScanline;
|
||||
@ -4541,7 +4546,6 @@ mng_retcode process_g4 (mng_datap pData)
|
||||
}
|
||||
/* get the gray level */
|
||||
iQ = (mng_uint8)((iB & iM) >> iS);
|
||||
iQ = (mng_uint8)(iQ + (iQ << 4));/* expand to 8-bit by replication */
|
||||
|
||||
if (iQ == pBuf->iTRNSgray) /* transparent ? */
|
||||
{
|
||||
@ -4551,8 +4555,10 @@ mng_retcode process_g4 (mng_datap pData)
|
||||
*(pRGBArow+3) = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pRGBArow = iQ; /* put in intermediate row */
|
||||
{ /* expand to 8-bit by replication */
|
||||
iQ = (mng_uint8)(iQ + (iQ << 4));
|
||||
|
||||
*pRGBArow = iQ; /* put in intermediate row */
|
||||
*(pRGBArow+1) = iQ;
|
||||
*(pRGBArow+2) = iQ;
|
||||
*(pRGBArow+3) = 0xFF;
|
||||
@ -5321,7 +5327,7 @@ mng_retcode process_ga16 (mng_datap pData)
|
||||
mng_put_uint16 (pRGBArow+2, iW);
|
||||
mng_put_uint16 (pRGBArow+4, iW);
|
||||
/* copy the alpha value */
|
||||
mng_put_uint16 (pRGBArow, mng_get_uint16 (pWorkrow+2));
|
||||
mng_put_uint16 (pRGBArow+6, mng_get_uint16 (pWorkrow+2));
|
||||
|
||||
pWorkrow += 4; /* next pixel */
|
||||
pRGBArow += 8;
|
||||
|
||||
@ -35,6 +35,8 @@
|
||||
/* * 0.5.3 - 06/21/2000 - G.Juyn * */
|
||||
/* * - added get/set for speedtype to facilitate testing * */
|
||||
/* * - added get for imagelevel during processtext callback * */
|
||||
/* * 0.5.3 - 06/26/2000 - G.Juyn * */
|
||||
/* * - changed userdata variable to mng_ptr * */
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -58,14 +60,14 @@
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_retcode MNG_DECL mng_set_userdata (mng_handle hHandle,
|
||||
mng_int32 iUserdata)
|
||||
mng_ptr pUserdata)
|
||||
{
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_USERDATA, MNG_LC_START)
|
||||
#endif
|
||||
|
||||
MNG_VALIDHANDLE (hHandle)
|
||||
((mng_datap)hHandle)->iUserdata = iUserdata;
|
||||
((mng_datap)hHandle)->pUserdata = pUserdata;
|
||||
|
||||
#ifdef MNG_SUPPORT_TRACE
|
||||
MNG_TRACE (((mng_datap)hHandle), MNG_FN_SET_USERDATA, MNG_LC_END)
|
||||
@ -817,10 +819,10 @@ mng_retcode MNG_DECL mng_set_speed (mng_handle hHandle,
|
||||
/* * * */
|
||||
/* ************************************************************************** */
|
||||
|
||||
mng_int32 MNG_DECL mng_get_userdata (mng_handle hHandle)
|
||||
mng_ptr MNG_DECL mng_get_userdata (mng_handle hHandle)
|
||||
{ /* no tracing in here to prevent recursive calls */
|
||||
MNG_VALIDHANDLEX (hHandle)
|
||||
return ((mng_datap)hHandle)->iUserdata;
|
||||
return ((mng_datap)hHandle)->pUserdata;
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -227,7 +227,7 @@ mng_retcode read_chunk (mng_datap pData)
|
||||
iRetcode = ((mng_object_headerp)pData->pCurraniobj)->fProcess (pData, pData->pCurraniobj);
|
||||
/* refresh needed ? */
|
||||
/* if ((!iRetcode) && (!pData->bTimerset) && (pData->bNeedrefresh))
|
||||
iRetcode = display_progressive_refresh (pData, 10); */
|
||||
iRetcode = display_progressive_refresh (pData, 1); */
|
||||
/* can we advance to next object ? */
|
||||
if ((!iRetcode) && (!pData->bTimerset) && (pData->pCurraniobj))
|
||||
{
|
||||
@ -387,7 +387,7 @@ mng_retcode read_chunk (mng_datap pData)
|
||||
/* refresh needed ? */
|
||||
if ((!pData->bTimerset) && (pData->bNeedrefresh))
|
||||
{
|
||||
iRetcode = display_progressive_refresh (pData, 10);
|
||||
iRetcode = display_progressive_refresh (pData, 1);
|
||||
|
||||
if (iRetcode) /* on error bail out */
|
||||
return iRetcode;
|
||||
|
||||
@ -317,7 +317,7 @@ MNGDecoder::ImgDInit()
|
||||
|
||||
/* pass ic as user data */
|
||||
imng_p->handle =
|
||||
mng_initialize((long)ilContainer, il_mng_alloc, il_mng_free, NULL);
|
||||
mng_initialize(ilContainer, il_mng_alloc, il_mng_free, NULL);
|
||||
|
||||
////////////
|
||||
// Gamma correction - gross hack, but it's what mozilla's PNG
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user