~ubuntu-branches/ubuntu/maverick/freeimage/maverick-201010060008

« back to all changes in this revision

Viewing changes to Source/LibMNG/libmng_chunk_descr.c

  • Committer: Stefano Rivera
  • Date: 2010-07-24 15:39:47 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: stefanor@ubuntu.com-20100724153947-bcu8otnpzm8wbzzg
Tags: 3.13.1-0ubuntu1
* New upstream release. Closes: (LP: #607800)
 - Updated debian/freeimage-get-orig-source script.
 - Removing no longer necessary debian/patches/* and
   the patch system in debian/rules.
 - Updated debian/rules to work with the new Makefiles.
 - Drop from -O3 to -O2 and use lzma compression saves
   ~10 MB of free space. 
* lintian stuff
 - fixed debhelper-but-no-misc-depends
 - fixed ldconfig-symlink-missing-for-shlib

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
/* ************************************************************************** */
5
5
/* *                                                                        * */
6
6
/* * project   : libmng                                                     * */
7
 
/* * file      : libmng_chunk_descr.c      copyright (c) 2004 G.Juyn        * */
8
 
/* * version   : 1.0.9                                                      * */
 
7
/* * file      : libmng_chunk_descr.c      copyright (c) 2005-2007 G.Juyn   * */
 
8
/* * version   : 1.0.10                                                     * */
9
9
/* *                                                                        * */
10
10
/* * purpose   : Chunk descriptor functions (implementation)                * */
11
11
/* *                                                                        * */
23
23
/* *             1.0.9 - 01/17/2005 - G.Juyn                                * */
24
24
/* *             - fixed problem with global PLTE/tRNS                      * */
25
25
/* *                                                                        * */
 
26
/* *             1.0.10 - 01/17/2005 - G.R-P.                               * */
 
27
/* *             - added typecast to appease the compiler                   * */
 
28
/* *             1.0.10 - 04/08/2007 - G.Juyn                               * */
 
29
/* *             - added support for mPNG proposal                          * */
 
30
/* *             1.0.10 - 04/12/2007 - G.Juyn                               * */
 
31
/* *             - added support for ANG proposal                           * */
 
32
/* *                                                                        * */
26
33
/* ************************************************************************** */
27
34
 
28
35
#include <stddef.h>                    /* needed for offsetof() */
43
50
#include "libmng_chunk_io.h"
44
51
#include "libmng_display.h"
45
52
 
 
53
#ifdef MNG_INCLUDE_ANG_PROPOSAL
 
54
#include "libmng_pixels.h"
 
55
#include "libmng_filter.h"
 
56
#endif
 
57
 
46
58
#if defined(__BORLANDC__) && defined(MNG_STRICT_ANSI)
47
59
#pragma option -A                      /* force ANSI-C */
48
60
#endif
1063
1075
 
1064
1076
/* ************************************************************************** */
1065
1077
 
 
1078
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
 
1079
MNG_LOCAL mng_field_descriptor mng_fields_mpng [] =
 
1080
  {
 
1081
    {MNG_NULL,
 
1082
     MNG_FIELD_INT,
 
1083
     1, 0, 4, 4,
 
1084
     offsetof(mng_mpng, iFramewidth), MNG_NULL, MNG_NULL},
 
1085
    {MNG_NULL,
 
1086
     MNG_FIELD_INT,
 
1087
     1, 0, 4, 4,
 
1088
     offsetof(mng_mpng, iFrameheight), MNG_NULL, MNG_NULL},
 
1089
    {MNG_NULL,
 
1090
     MNG_FIELD_INT,
 
1091
     0, 0xFFFF, 2, 2,
 
1092
     offsetof(mng_mpng, iNumplays), MNG_NULL, MNG_NULL},
 
1093
    {MNG_NULL,
 
1094
     MNG_FIELD_INT,
 
1095
     1, 0xFFFF, 2, 2,
 
1096
     offsetof(mng_mpng, iTickspersec), MNG_NULL, MNG_NULL},
 
1097
    {MNG_NULL,
 
1098
     MNG_FIELD_INT,
 
1099
     0, 0, 1, 1,
 
1100
     offsetof(mng_mpng, iCompressionmethod), MNG_NULL, MNG_NULL},
 
1101
    {MNG_NULL,
 
1102
     MNG_FIELD_DEFLATED,
 
1103
     0, 0, 1, 0,
 
1104
     offsetof(mng_mpng, pFrames), MNG_NULL, offsetof(mng_mpng, iFramessize)}
 
1105
  };
 
1106
#endif
 
1107
 
 
1108
/* ************************************************************************** */
 
1109
 
 
1110
#ifdef MNG_INCLUDE_ANG_PROPOSAL
 
1111
MNG_LOCAL mng_field_descriptor mng_fields_ahdr [] =
 
1112
  {
 
1113
    {MNG_NULL,
 
1114
     MNG_FIELD_INT,
 
1115
     1, 0, 4, 4,
 
1116
     offsetof(mng_ahdr, iNumframes), MNG_NULL, MNG_NULL},
 
1117
    {MNG_NULL,
 
1118
     MNG_FIELD_INT,
 
1119
     0, 0, 4, 4,
 
1120
     offsetof(mng_ahdr, iTickspersec), MNG_NULL, MNG_NULL},
 
1121
    {MNG_NULL,
 
1122
     MNG_FIELD_INT,
 
1123
     0, 0, 4, 4,
 
1124
     offsetof(mng_ahdr, iNumplays), MNG_NULL, MNG_NULL},
 
1125
    {MNG_NULL,
 
1126
     MNG_FIELD_INT,
 
1127
     1, 0, 4, 4,
 
1128
     offsetof(mng_ahdr, iTilewidth), MNG_NULL, MNG_NULL},
 
1129
    {MNG_NULL,
 
1130
     MNG_FIELD_INT,
 
1131
     1, 0, 4, 4,
 
1132
     offsetof(mng_ahdr, iTileheight), MNG_NULL, MNG_NULL},
 
1133
    {MNG_NULL,
 
1134
     MNG_FIELD_INT,
 
1135
     0, 1, 1, 1,
 
1136
     offsetof(mng_ahdr, iInterlace), MNG_NULL, MNG_NULL},
 
1137
    {MNG_NULL,
 
1138
     MNG_FIELD_INT,
 
1139
     0, 1, 1, 1,
 
1140
     offsetof(mng_ahdr, iStillused), MNG_NULL, MNG_NULL}
 
1141
  };
 
1142
 
 
1143
MNG_LOCAL mng_field_descriptor mng_fields_adat [] =
 
1144
  {
 
1145
    {mng_adat_tiles,
 
1146
     MNG_NULL,
 
1147
     0, 0, 0, 0,
 
1148
     MNG_NULL, MNG_NULL, MNG_NULL}
 
1149
  };
 
1150
#endif
 
1151
 
 
1152
/* ************************************************************************** */
 
1153
 
1066
1154
#ifndef MNG_SKIPCHUNK_evNT
1067
1155
MNG_LOCAL mng_field_descriptor mng_fields_evnt [] =
1068
1156
  {
1613
1701
     MNG_DESCR_NOSAVE};
1614
1702
#endif
1615
1703
 
 
1704
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
 
1705
MNG_LOCAL mng_chunk_descriptor mng_chunk_descr_mpng =
 
1706
    {mng_it_mpng, mng_create_none, 0, 0,
 
1707
     MNG_NULL, MNG_NULL, mng_special_mpng,
 
1708
     mng_fields_mpng, (sizeof(mng_fields_mpng) / sizeof(mng_field_descriptor)),
 
1709
     MNG_NULL,
 
1710
     MNG_NULL,
 
1711
     MNG_DESCR_NOMHDR | MNG_DESCR_NOIDAT | MNG_DESCR_NOJDAT};
 
1712
#endif
 
1713
 
 
1714
#ifdef MNG_INCLUDE_ANG_PROPOSAL
 
1715
MNG_LOCAL mng_chunk_descriptor mng_chunk_descr_ahdr =
 
1716
    {mng_it_ang, mng_create_none, 0, 0,
 
1717
     MNG_NULL, MNG_NULL, mng_special_ahdr,
 
1718
     mng_fields_ahdr, (sizeof(mng_fields_ahdr) / sizeof(mng_field_descriptor)),
 
1719
     MNG_NULL,
 
1720
     MNG_DESCR_IHDR,
 
1721
     MNG_DESCR_NOMHDR | MNG_DESCR_NOJHDR | MNG_DESCR_NOIDAT};
 
1722
 
 
1723
MNG_LOCAL mng_chunk_descriptor mng_chunk_descr_adat =
 
1724
    {mng_it_ang, mng_create_none, 0, 0,
 
1725
     MNG_NULL, MNG_NULL, mng_special_adat,
 
1726
     mng_fields_adat, (sizeof(mng_fields_adat) / sizeof(mng_field_descriptor)),
 
1727
     MNG_NULL,
 
1728
     MNG_DESCR_IHDR,
 
1729
     MNG_DESCR_NOMHDR | MNG_DESCR_NOJHDR};
 
1730
#endif
 
1731
 
1616
1732
/* ************************************************************************** */
1617
1733
/* ************************************************************************** */
1618
1734
/* the good ol' unknown babe */
1721
1837
#ifndef MNG_NO_DELTA_PNG
1722
1838
    {MNG_UINT_PPLT, mng_init_general, mng_free_general, mng_read_general, mng_write_pplt, mng_assign_general, 0, 0, sizeof(mng_pplt), &mng_chunk_descr_pplt},
1723
1839
    {MNG_UINT_PROM, mng_init_general, mng_free_general, mng_read_general, mng_write_prom, mng_assign_general, 0, 0, sizeof(mng_prom), &mng_chunk_descr_prom},
1724
 
#endif                                     
 
1840
#endif
1725
1841
#ifndef MNG_SKIPCHUNK_SAVE
1726
1842
    {MNG_UINT_SAVE, mng_init_general, mng_free_save,    mng_read_general, mng_write_save, mng_assign_save,    0, 0, sizeof(mng_save), &mng_chunk_descr_save},
1727
1843
#endif
1734
1850
#ifndef MNG_SKIPCHUNK_TERM
1735
1851
    {MNG_UINT_TERM, mng_init_general, mng_free_general, mng_read_general, mng_write_term, mng_assign_general, 0, 0, sizeof(mng_term), &mng_chunk_descr_term},
1736
1852
#endif
 
1853
#ifdef MNG_INCLUDE_ANG_PROPOSAL
 
1854
    {MNG_UINT_adAT, mng_init_general, mng_free_adat,    mng_read_general, mng_write_adat, mng_assign_adat,    0, 0, sizeof(mng_adat), &mng_chunk_descr_adat},
 
1855
    {MNG_UINT_ahDR, mng_init_general, mng_free_general, mng_read_general, mng_write_ahdr, mng_assign_ahdr,    0, 0, sizeof(mng_ahdr), &mng_chunk_descr_ahdr},
 
1856
#endif
1737
1857
#ifndef MNG_SKIPCHUNK_bKGD
1738
1858
    {MNG_UINT_bKGD, mng_init_general, mng_free_general, mng_read_general, mng_write_bkgd, mng_assign_general, 0, 0, sizeof(mng_bkgd), &mng_chunk_descr_bkgd},
1739
1859
#endif
1761
1881
#ifndef MNG_SKIPCHUNK_iTXt
1762
1882
    {MNG_UINT_iTXt, mng_init_general, mng_free_itxt,    mng_read_general, mng_write_itxt, mng_assign_itxt,    0, 0, sizeof(mng_itxt), &mng_chunk_descr_itxt},
1763
1883
#endif
 
1884
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
 
1885
    {MNG_UINT_mpNG, mng_init_general, mng_free_mpng,    mng_read_general, mng_write_mpng, mng_assign_mpng,    0, 0, sizeof(mng_mpng), &mng_chunk_descr_mpng},
 
1886
#endif
1764
1887
#ifndef MNG_SKIPCHUNK_nEED
1765
1888
    {MNG_UINT_nEED, mng_init_general, mng_free_need,    mng_read_general, mng_write_need, mng_assign_need,    0, 0, sizeof(mng_need), &mng_chunk_descr_need},
1766
1889
#endif
1965
2088
    if ((pData->iWidth > pData->iMaxwidth) || (pData->iHeight > pData->iMaxheight))
1966
2089
      MNG_WARNING (pData, MNG_IMAGETOOLARGE);
1967
2090
 
 
2091
#if !defined(MNG_INCLUDE_MPNG_PROPOSAL) || !defined(MNG_SUPPORT_DISPLAY)
1968
2092
    if (pData->fProcessheader)         /* inform the app ? */
1969
2093
      if (!pData->fProcessheader (((mng_handle)pData), pData->iWidth, pData->iHeight))
1970
2094
        MNG_ERROR (pData, MNG_APPMISCERROR);
 
2095
#endif
1971
2096
  }
1972
2097
 
1973
2098
  if (!pData->bHasDHDR)
2051
2176
#endif
2052
2177
    {                                  /* get the current object */
2053
2178
      pImage = (mng_imagep)pData->pCurrentobj;
2054
 
 
2055
2179
      if (!pImage)                     /* no object then dump it in obj 0 */
2056
2180
        pImage = (mng_imagep)pData->pObjzero;
2057
2181
 
2128
2252
/* ************************************************************************** */
2129
2253
 
2130
2254
MNG_C_SPECIALFUNC (mng_special_iend)
2131
 
{
2132
 
                                       /* IHDR-block requires IDAT */
 
2255
{                                      /* IHDR-block requires IDAT */
2133
2256
  if ((pData->bHasIHDR) && (!pData->bHasIDAT))
2134
2257
    MNG_ERROR (pData, MNG_IDATMISSING);
2135
2258
 
2665
2788
                                       /* allocate a buffer & copy it */
2666
2789
        MNG_ALLOC (pData, pImage->pImgbuf->pProfile, ((mng_iccpp)pChunk)->iProfilesize);
2667
2790
        MNG_COPY  (pImage->pImgbuf->pProfile, ((mng_iccpp)pChunk)->pProfile, ((mng_iccpp)pChunk)->iProfilesize);
2668
 
                                       /* store it's length as well */
 
2791
                                       /* store its length as well */
2669
2792
        pImage->pImgbuf->iProfilesize = ((mng_iccpp)pChunk)->iProfilesize;
2670
2793
        pImage->pImgbuf->bHasICCP     = MNG_TRUE;
2671
2794
      }
2682
2805
                                       /* allocate a buffer & copy it */
2683
2806
        MNG_ALLOC (pData, pImage->pImgbuf->pProfile, ((mng_iccpp)pChunk)->iProfilesize);
2684
2807
        MNG_COPY  (pImage->pImgbuf->pProfile, ((mng_iccpp)pChunk)->pProfile, ((mng_iccpp)pChunk)->iProfilesize);
2685
 
                                       /* store it's length as well */
 
2808
                                       /* store its length as well */
2686
2809
        pImage->pImgbuf->iProfilesize = ((mng_iccpp)pChunk)->iProfilesize;
2687
2810
        pImage->pImgbuf->bHasICCP     = MNG_TRUE;
2688
2811
      }
2701
2824
      {                                /* allocate a global buffer & copy it */
2702
2825
        MNG_ALLOC (pData, pData->pGlobalProfile, ((mng_iccpp)pChunk)->iProfilesize);
2703
2826
        MNG_COPY  (pData->pGlobalProfile, ((mng_iccpp)pChunk)->pProfile, ((mng_iccpp)pChunk)->iProfilesize);
2704
 
                                       /* store it's length as well */
 
2827
                                       /* store its length as well */
2705
2828
        pData->iGlobalProfilesize = ((mng_iccpp)pChunk)->iProfilesize;
2706
2829
      }
2707
2830
                                       /* create an animation object */
4540
4663
    if (iM < iX)
4541
4664
      MNG_ERROR (pData, MNG_INVALIDINDEX);
4542
4665
 
4543
 
    if (iM >= (mng_int32)iMax)                    /* determine highest used index */
 
4666
    if (iM >= (mng_int32) iMax)       /* determine highest used index */
4544
4667
      iMax = iM + 1;
4545
4668
 
4546
4669
    pRawdata += 2;
5164
5287
 
5165
5288
/* ************************************************************************** */
5166
5289
 
 
5290
#ifdef MNG_INCLUDE_MPNG_PROPOSAL
 
5291
MNG_C_SPECIALFUNC (mng_special_mpng)
 
5292
{
 
5293
  if ((pData->eImagetype != mng_it_png) && (pData->eImagetype != mng_it_jng))
 
5294
    MNG_ERROR (pData, MNG_CHUNKNOTALLOWED);
 
5295
    
 
5296
#ifdef MNG_SUPPORT_DISPLAY
 
5297
  return mng_create_mpng_obj (pData, pChunk);
 
5298
#else
 
5299
  return MNG_NOERROR;
 
5300
#endif
 
5301
}
 
5302
#endif
 
5303
 
 
5304
/* ************************************************************************** */
 
5305
 
 
5306
#ifdef MNG_INCLUDE_ANG_PROPOSAL
 
5307
MNG_C_SPECIALFUNC (mng_special_ahdr)
 
5308
{
 
5309
#ifdef MNG_SUPPORT_DISPLAY
 
5310
  return mng_create_ang_obj (pData, pChunk);
 
5311
#else
 
5312
  return MNG_NOERROR;
 
5313
#endif
 
5314
}
 
5315
#endif
 
5316
 
 
5317
/* ************************************************************************** */
 
5318
 
 
5319
#ifdef MNG_INCLUDE_ANG_PROPOSAL
 
5320
MNG_F_SPECIALFUNC (mng_adat_tiles)
 
5321
{
 
5322
  if ((pData->eImagetype != mng_it_ang) || (!pData->pANG))
 
5323
    MNG_ERROR (pData, MNG_CHUNKNOTALLOWED);
 
5324
 
 
5325
  {
 
5326
    mng_adatp      pADAT = (mng_adatp)pChunk;
 
5327
    mng_ang_objp   pANG  = (mng_ang_objp)pData->pANG;
 
5328
    mng_uint32     iRawlen  = *piRawlen;
 
5329
    mng_uint8p     pRawdata = *ppRawdata;
 
5330
    mng_retcode    iRetcode;
 
5331
    mng_uint8p     pBuf;
 
5332
    mng_uint32     iBufsize;
 
5333
    mng_uint32     iRealsize;
 
5334
    mng_uint8p     pTemp;
 
5335
    mng_uint8p     pTemp2;
 
5336
    mng_int32      iX;
 
5337
    mng_int32      iSize;
 
5338
 
 
5339
#ifdef MNG_SUPPORT_DISPLAY
 
5340
    mng_imagep     pImage;
 
5341
    mng_int32      iTemplen;
 
5342
    mng_uint8p     pSwap;
 
5343
 
 
5344
    mng_processobject pProcess;
 
5345
 
 
5346
    mng_uint32     iSavedatawidth;
 
5347
    mng_uint32     iSavedataheight;
 
5348
 
 
5349
    mng_fptr       fSaveinitrowproc;
 
5350
    mng_fptr       fSavestorerow;
 
5351
    mng_fptr       fSaveprocessrow;
 
5352
    mng_fptr       fSavedifferrow;
 
5353
    mng_imagep     fSavestoreobj;
 
5354
    mng_imagedatap fSavestorebuf;
 
5355
 
 
5356
#ifdef MNG_OPTIMIZE_FOOTPRINT_INIT
 
5357
    png_imgtype    eSavepngimgtype;
 
5358
#endif
 
5359
 
 
5360
    mng_uint8      iSaveinterlace;
 
5361
    mng_int8       iSavepass;
 
5362
    mng_int32      iSaverow;
 
5363
    mng_int32      iSaverowinc;
 
5364
    mng_int32      iSavecol;
 
5365
    mng_int32      iSavecolinc;
 
5366
    mng_int32      iSaverowsamples;
 
5367
    mng_int32      iSavesamplemul;
 
5368
    mng_int32      iSavesampleofs;
 
5369
    mng_int32      iSavesamplediv;
 
5370
    mng_int32      iSaverowsize;
 
5371
    mng_int32      iSaverowmax;
 
5372
    mng_int32      iSavefilterofs;
 
5373
    mng_int32      iSavepixelofs;
 
5374
    mng_uint32     iSavelevel0;
 
5375
    mng_uint32     iSavelevel1;
 
5376
    mng_uint32     iSavelevel2;
 
5377
    mng_uint32     iSavelevel3;
 
5378
    mng_uint8p     pSaveworkrow;
 
5379
    mng_uint8p     pSaveprevrow;
 
5380
    mng_uint8p     pSaverGBArow;
 
5381
    mng_bool       bSaveisRGBA16;
 
5382
    mng_bool       bSaveisOpaque;
 
5383
    mng_int32      iSavefilterbpp;
 
5384
 
 
5385
    mng_int32      iSavedestl;
 
5386
    mng_int32      iSavedestt;
 
5387
    mng_int32      iSavedestr;
 
5388
    mng_int32      iSavedestb;
 
5389
    mng_int32      iSavesourcel;
 
5390
    mng_int32      iSavesourcet;
 
5391
    mng_int32      iSavesourcer;
 
5392
    mng_int32      iSavesourceb;
 
5393
#endif /* MNG_SUPPORT_DISPLAY */
 
5394
 
 
5395
    iRetcode = mng_inflate_buffer (pData, pRawdata, iRawlen,
 
5396
                                   &pBuf, &iBufsize, &iRealsize);
 
5397
    if (iRetcode)                      /* on error bail out */
 
5398
    {                                  /* don't forget to drop the temp buffer */
 
5399
      MNG_FREEX (pData, pBuf, iBufsize);
 
5400
      return iRetcode;
 
5401
    }
 
5402
                                       /* get buffer for tile info in ADAT chunk */
 
5403
    pADAT->iTilessize = pANG->iNumframes * sizeof(mng_adat_tile);
 
5404
    MNG_ALLOCX (pData, pADAT->pTiles, pADAT->iTilessize);
 
5405
    if (!pADAT->pTiles)
 
5406
    {
 
5407
      pADAT->iTilessize = 0;
 
5408
      MNG_FREEX (pData, pBuf, iBufsize);
 
5409
      MNG_ERROR (pData, MNG_OUTOFMEMORY);
 
5410
    }
 
5411
 
 
5412
    pTemp  = pBuf;
 
5413
    pTemp2 = (mng_uint8p)pADAT->pTiles;
 
5414
 
 
5415
    if (!pANG->iStillused)
 
5416
      iSize = 12;
 
5417
    else
 
5418
      iSize = 13;
 
5419
 
 
5420
    for (iX = 0; iX < pANG->iNumframes; iX++)
 
5421
    {
 
5422
      MNG_COPY (pTemp2, pTemp, iSize);
 
5423
      pTemp  += iSize;
 
5424
      pTemp2 += sizeof(mng_adat_tile);
 
5425
    }
 
5426
 
 
5427
#ifdef MNG_SUPPORT_DISPLAY
 
5428
                                       /* get buffer for tile info in ANG object */
 
5429
    pANG->iTilessize = pADAT->iTilessize;
 
5430
    MNG_ALLOCX (pData, pANG->pTiles, pANG->iTilessize);
 
5431
    if (!pANG->pTiles)
 
5432
    {
 
5433
      pANG->iTilessize = 0;
 
5434
      MNG_FREEX (pData, pBuf, iBufsize);
 
5435
      MNG_ERROR (pData, MNG_OUTOFMEMORY);
 
5436
    }
 
5437
                                       /* copy it from the ADAT object */
 
5438
    MNG_COPY (pANG->pTiles, pADAT->pTiles, pANG->iTilessize);
 
5439
 
 
5440
                                       /* save IDAT work-parms */
 
5441
    fSaveinitrowproc    = pData->fInitrowproc;
 
5442
    fSavestorerow       = pData->fDisplayrow;
 
5443
    fSaveprocessrow     = pData->fProcessrow;
 
5444
    fSavedifferrow      = pData->fDifferrow;
 
5445
    fSavestoreobj       = pData->pStoreobj;
 
5446
    fSavestorebuf       = pData->pStorebuf;
 
5447
 
 
5448
#ifdef MNG_OPTIMIZE_FOOTPRINT_INIT
 
5449
    eSavepngimgtype     = pData->ePng_imgtype;
 
5450
#endif
 
5451
 
 
5452
    iSavedatawidth      = pData->iDatawidth;
 
5453
    iSavedataheight     = pData->iDataheight;
 
5454
    iSaveinterlace      = pData->iInterlace;
 
5455
    iSavepass           = pData->iPass;
 
5456
    iSaverow            = pData->iRow;
 
5457
    iSaverowinc         = pData->iRowinc;
 
5458
    iSavecol            = pData->iCol;
 
5459
    iSavecolinc         = pData->iColinc;
 
5460
    iSaverowsamples     = pData->iRowsamples;
 
5461
    iSavesamplemul      = pData->iSamplemul;
 
5462
    iSavesampleofs      = pData->iSampleofs;
 
5463
    iSavesamplediv      = pData->iSamplediv;
 
5464
    iSaverowsize        = pData->iRowsize;
 
5465
    iSaverowmax         = pData->iRowmax;
 
5466
    iSavefilterofs      = pData->iFilterofs;
 
5467
    iSavepixelofs       = pData->iPixelofs;
 
5468
    iSavelevel0         = pData->iLevel0;
 
5469
    iSavelevel1         = pData->iLevel1;
 
5470
    iSavelevel2         = pData->iLevel2;
 
5471
    iSavelevel3         = pData->iLevel3;
 
5472
    pSaveworkrow        = pData->pWorkrow;
 
5473
    pSaveprevrow        = pData->pPrevrow;
 
5474
    pSaverGBArow        = pData->pRGBArow;
 
5475
    bSaveisRGBA16       = pData->bIsRGBA16;
 
5476
    bSaveisOpaque       = pData->bIsOpaque;
 
5477
    iSavefilterbpp      = pData->iFilterbpp;
 
5478
    iSavedestl          = pData->iDestl;
 
5479
    iSavedestt          = pData->iDestt;
 
5480
    iSavedestr          = pData->iDestr;
 
5481
    iSavedestb          = pData->iDestb;
 
5482
    iSavesourcel        = pData->iSourcel;
 
5483
    iSavesourcet        = pData->iSourcet;
 
5484
    iSavesourcer        = pData->iSourcer;
 
5485
    iSavesourceb        = pData->iSourceb;
 
5486
 
 
5487
    pData->iDatawidth   = pANG->iTilewidth;
 
5488
    pData->iDataheight  = pANG->iTileheight;
 
5489
 
 
5490
    pData->iDestl       = 0;
 
5491
    pData->iDestt       = 0;
 
5492
    pData->iDestr       = pANG->iTilewidth;
 
5493
    pData->iDestb       = pANG->iTileheight;
 
5494
    pData->iSourcel     = 0;
 
5495
    pData->iSourcet     = 0;
 
5496
    pData->iSourcer     = pANG->iTilewidth;
 
5497
    pData->iSourceb     = pANG->iTileheight;
 
5498
 
 
5499
    pData->fInitrowproc = MNG_NULL;
 
5500
    pData->fStorerow    = MNG_NULL;
 
5501
    pData->fProcessrow  = MNG_NULL;
 
5502
    pData->fDifferrow   = MNG_NULL;
 
5503
 
 
5504
    /* clone image object to store the pixel-data from object 0 */
 
5505
    iRetcode = mng_clone_imageobject (pData, 1, MNG_FALSE, MNG_FALSE, MNG_FALSE,
 
5506
                                      MNG_FALSE, 0, 0, 0, pData->pObjzero, &pImage);
 
5507
    if (iRetcode)                      /* on error, drop temp buffer and bail */
 
5508
    {
 
5509
      MNG_FREEX (pData, pBuf, iBufsize);
 
5510
      return iRetcode;
 
5511
    }
 
5512
 
 
5513
    /* make sure we got the right dimensions and interlacing */
 
5514
    iRetcode = mng_reset_object_details (pData, pImage, pANG->iTilewidth, pANG->iTileheight,
 
5515
                                         pImage->pImgbuf->iBitdepth, pImage->pImgbuf->iColortype,
 
5516
                                         pImage->pImgbuf->iCompression, pImage->pImgbuf->iFilter,
 
5517
                                         pANG->iInterlace, MNG_FALSE);
 
5518
    if (iRetcode)                      /* on error, drop temp buffer and bail */
 
5519
    {
 
5520
      MNG_FREEX (pData, pBuf, iBufsize);
 
5521
      return iRetcode;
 
5522
    }
 
5523
 
 
5524
    pData->pStoreobj    = pImage;
 
5525
 
 
5526
#ifdef MNG_OPTIMIZE_FOOTPRINT_INIT
 
5527
    pData->fInitrowproc = (mng_fptr)mng_init_rowproc;
 
5528
    pData->ePng_imgtype = mng_png_imgtype(pData->iColortype,pData->iBitdepth);
 
5529
#else
 
5530
    switch (pData->iColortype)         /* determine row initialization routine */
 
5531
    {
 
5532
      case 0 : {                       /* gray */
 
5533
                 switch (pData->iBitdepth)
 
5534
                 {
 
5535
#ifndef MNG_NO_1_2_4BIT_SUPPORT
 
5536
                   case  1 : {
 
5537
                               if (!pData->iInterlace)
 
5538
                                 pData->fInitrowproc = (mng_fptr)mng_init_g1_ni;
 
5539
                               else
 
5540
                                 pData->fInitrowproc = (mng_fptr)mng_init_g1_i;
 
5541
 
 
5542
                               break;
 
5543
                             }
 
5544
                   case  2 : {
 
5545
                               if (!pData->iInterlace)
 
5546
                                 pData->fInitrowproc = (mng_fptr)mng_init_g2_ni;
 
5547
                               else
 
5548
                                 pData->fInitrowproc = (mng_fptr)mng_init_g2_i;
 
5549
 
 
5550
                               break;
 
5551
                             }
 
5552
                   case  4 : {
 
5553
                               if (!pData->iInterlace)
 
5554
                                 pData->fInitrowproc = (mng_fptr)mng_init_g4_ni;
 
5555
                               else
 
5556
                                 pData->fInitrowproc = (mng_fptr)mng_init_g4_i;
 
5557
                               break;
 
5558
                             }
 
5559
#endif /* MNG_NO_1_2_4BIT_SUPPORT */
 
5560
                   case  8 : {
 
5561
                               if (!pData->iInterlace)
 
5562
                                 pData->fInitrowproc = (mng_fptr)mng_init_g8_ni;
 
5563
                               else
 
5564
                                 pData->fInitrowproc = (mng_fptr)mng_init_g8_i;
 
5565
 
 
5566
                               break;
 
5567
                             }
 
5568
#ifndef MNG_NO_16BIT_SUPPORT
 
5569
                   case 16 : {
 
5570
                               if (!pData->iInterlace)
 
5571
                                 pData->fInitrowproc = (mng_fptr)mng_init_g16_ni;
 
5572
                               else
 
5573
                                 pData->fInitrowproc = (mng_fptr)mng_init_g16_i;
 
5574
 
 
5575
                               break;
 
5576
                             }
 
5577
#endif
 
5578
                 }
 
5579
 
 
5580
                 break;
 
5581
               }
 
5582
      case 2 : {                       /* rgb */
 
5583
                 switch (pData->iBitdepth)
 
5584
                 {
 
5585
                   case  8 : {
 
5586
                               if (!pData->iInterlace)
 
5587
                                 pData->fInitrowproc = (mng_fptr)mng_init_rgb8_ni;
 
5588
                               else
 
5589
                                 pData->fInitrowproc = (mng_fptr)mng_init_rgb8_i;
 
5590
                               break;
 
5591
                             }
 
5592
#ifndef MNG_NO_16BIT_SUPPORT
 
5593
                   case 16 : {
 
5594
                               if (!pData->iInterlace)
 
5595
                                 pData->fInitrowproc = (mng_fptr)mng_init_rgb16_ni;
 
5596
                               else
 
5597
                                 pData->fInitrowproc = (mng_fptr)mng_init_rgb16_i;
 
5598
 
 
5599
                               break;
 
5600
                             }
 
5601
#endif
 
5602
                 }
 
5603
 
 
5604
                 break;
 
5605
               }
 
5606
      case 3 : {                       /* indexed */
 
5607
                 switch (pData->iBitdepth)
 
5608
                 {
 
5609
#ifndef MNG_NO_1_2_4BIT_SUPPORT
 
5610
                   case  1 : {
 
5611
                               if (!pData->iInterlace)
 
5612
                                 pData->fInitrowproc = (mng_fptr)mng_init_idx1_ni;
 
5613
                               else
 
5614
                                 pData->fInitrowproc = (mng_fptr)mng_init_idx1_i;
 
5615
 
 
5616
                               break;
 
5617
                             }
 
5618
                   case  2 : {
 
5619
                               if (!pData->iInterlace)
 
5620
                                 pData->fInitrowproc = (mng_fptr)mng_init_idx2_ni;
 
5621
                               else
 
5622
                                 pData->fInitrowproc = (mng_fptr)mng_init_idx2_i;
 
5623
 
 
5624
                               break;
 
5625
                             }
 
5626
                   case  4 : {
 
5627
                               if (!pData->iInterlace)
 
5628
                                 pData->fInitrowproc = (mng_fptr)mng_init_idx4_ni;
 
5629
                               else
 
5630
                                 pData->fInitrowproc = (mng_fptr)mng_init_idx4_i;
 
5631
 
 
5632
                               break;
 
5633
                             }
 
5634
#endif /* MNG_NO_1_2_4BIT_SUPPORT */
 
5635
                   case  8 : {
 
5636
                               if (!pData->iInterlace)
 
5637
                                 pData->fInitrowproc = (mng_fptr)mng_init_idx8_ni;
 
5638
                               else
 
5639
                                 pData->fInitrowproc = (mng_fptr)mng_init_idx8_i;
 
5640
 
 
5641
                               break;
 
5642
                             }
 
5643
                 }
 
5644
 
 
5645
                 break;
 
5646
               }
 
5647
      case 4 : {                       /* gray+alpha */
 
5648
                 switch (pData->iBitdepth)
 
5649
                 {
 
5650
                   case  8 : {
 
5651
                               if (!pData->iInterlace)
 
5652
                                 pData->fInitrowproc = (mng_fptr)mng_init_ga8_ni;
 
5653
                               else
 
5654
                                 pData->fInitrowproc = (mng_fptr)mng_init_ga8_i;
 
5655
 
 
5656
                               break;
 
5657
                             }
 
5658
#ifndef MNG_NO_16BIT_SUPPORT
 
5659
                   case 16 : {
 
5660
                               if (!pData->iInterlace)
 
5661
                                 pData->fInitrowproc = (mng_fptr)mng_init_ga16_ni;
 
5662
                               else
 
5663
                                 pData->fInitrowproc = (mng_fptr)mng_init_ga16_i;
 
5664
                               break;
 
5665
                             }
 
5666
#endif
 
5667
                 }
 
5668
 
 
5669
                 break;
 
5670
               }
 
5671
      case 6 : {                       /* rgb+alpha */
 
5672
                 switch (pData->iBitdepth)
 
5673
                 {
 
5674
                   case  8 : {
 
5675
                               if (!pData->iInterlace)
 
5676
                                 pData->fInitrowproc = (mng_fptr)mng_init_rgba8_ni;
 
5677
                               else
 
5678
                                 pData->fInitrowproc = (mng_fptr)mng_init_rgba8_i;
 
5679
 
 
5680
                               break;
 
5681
                             }
 
5682
#ifndef MNG_NO_16BIT_SUPPORT
 
5683
                   case 16 : {
 
5684
                               if (!pData->iInterlace)
 
5685
                                 pData->fInitrowproc = (mng_fptr)mng_init_rgba16_ni;
 
5686
                               else
 
5687
                                 pData->fInitrowproc = (mng_fptr)mng_init_rgba16_i;
 
5688
 
 
5689
                               break;
 
5690
                             }
 
5691
#endif
 
5692
                 }
 
5693
 
 
5694
                 break;
 
5695
               }
 
5696
    }
 
5697
#endif /* MNG_OPTIMIZE_FOOTPRINT_INIT */
 
5698
 
 
5699
    pData->iFilterofs = 0;             /* determine filter characteristics */
 
5700
    pData->iLevel0    = 0;             /* default levels */
 
5701
    pData->iLevel1    = 0;    
 
5702
    pData->iLevel2    = 0;
 
5703
    pData->iLevel3    = 0;
 
5704
 
 
5705
#ifdef FILTER192                       /* leveling & differing ? */
 
5706
    if (pData->iFilter == MNG_FILTER_DIFFERING)
 
5707
    {
 
5708
      switch (pData->iColortype)
 
5709
      {
 
5710
        case 0 : {
 
5711
                   if (pData->iBitdepth <= 8)
 
5712
                     pData->iFilterofs = 1;
 
5713
                   else
 
5714
                     pData->iFilterofs = 2;
 
5715
 
 
5716
                   break;
 
5717
                 }
 
5718
        case 2 : {
 
5719
                   if (pData->iBitdepth <= 8)
 
5720
                     pData->iFilterofs = 3;
 
5721
                   else
 
5722
                     pData->iFilterofs = 6;
 
5723
 
 
5724
                   break;
 
5725
                 }
 
5726
        case 3 : {
 
5727
                   pData->iFilterofs = 1;
 
5728
                   break;
 
5729
                 }
 
5730
        case 4 : {
 
5731
                   if (pData->iBitdepth <= 8)
 
5732
                     pData->iFilterofs = 2;
 
5733
                   else
 
5734
                     pData->iFilterofs = 4;
 
5735
 
 
5736
                   break;
 
5737
                 }
 
5738
        case 6 : {
 
5739
                   if (pData->iBitdepth <= 8)
 
5740
                     pData->iFilterofs = 4;
 
5741
                   else
 
5742
                     pData->iFilterofs = 8;
 
5743
 
 
5744
                   break;
 
5745
                 }
 
5746
      }
 
5747
    }
 
5748
#endif
 
5749
 
 
5750
#ifdef FILTER193                       /* no adaptive filtering ? */
 
5751
    if (pData->iFilter == MNG_FILTER_NOFILTER)
 
5752
      pData->iPixelofs = pData->iFilterofs;
 
5753
    else
 
5754
#endif
 
5755
      pData->iPixelofs = pData->iFilterofs + 1;
 
5756
 
 
5757
    if (pData->fInitrowproc)           /* need to initialize row processing? */
 
5758
    {
 
5759
      iRetcode = ((mng_initrowproc)pData->fInitrowproc) (pData);
 
5760
      if (iRetcode)
 
5761
      {
 
5762
         MNG_FREEX (pData, pBuf, iBufsize);
 
5763
         return iRetcode;
 
5764
      }
 
5765
    }
 
5766
                                       /* calculate remainder of buffer */
 
5767
    pTemp    = pBuf + (mng_int32)(pANG->iNumframes * iSize);
 
5768
    iTemplen = iRealsize - (mng_int32)(pANG->iNumframes * iSize);
 
5769
 
 
5770
    do
 
5771
    {
 
5772
      if (iTemplen > pData->iRowmax)   /* get a pixel-row from the temp buffer */
 
5773
      {
 
5774
        MNG_COPY (pData->pWorkrow, pTemp, pData->iRowmax);
 
5775
      }
 
5776
      else
 
5777
      {
 
5778
        MNG_COPY (pData->pWorkrow, pTemp, iTemplen);
 
5779
      }
 
5780
 
 
5781
      {                                /* image not completed yet ? */
 
5782
        if (pData->iRow < (mng_int32)pData->iDataheight)
 
5783
        {
 
5784
#ifdef MNG_NO_1_2_4BIT_SUPPORT
 
5785
          if (pData->iPNGdepth == 1)
 
5786
          {
 
5787
            /* Inflate Workrow to 8-bit */
 
5788
            mng_int32  iX;
 
5789
            mng_uint8p pSrc = pData->pWorkrow+1;
 
5790
            mng_uint8p pDest = pSrc + pData->iRowsize - (pData->iRowsize+7)/8;
 
5791
 
 
5792
            for (iX = ((pData->iRowsize+7)/8) ; iX > 0 ; iX--)
 
5793
              *pDest++ = *pSrc++;
 
5794
 
 
5795
            pDest = pData->pWorkrow+1;
 
5796
            pSrc = pDest + pData->iRowsize - (pData->iRowsize+7)/8;
 
5797
            for (iX = pData->iRowsize; ;)
 
5798
            {
 
5799
              *pDest++ = (((*pSrc)>>7)&1);
 
5800
              if (iX-- <= 0)
 
5801
                break;
 
5802
              *pDest++ = (((*pSrc)>>6)&1);
 
5803
              if (iX-- <= 0)
 
5804
                break;
 
5805
              *pDest++ = (((*pSrc)>>5)&1);
 
5806
              if (iX-- <= 0)
 
5807
                break;
 
5808
              *pDest++ = (((*pSrc)>>4)&1);
 
5809
              if (iX-- <= 0)
 
5810
                break;
 
5811
              *pDest++ = (((*pSrc)>>3)&1);
 
5812
              if (iX-- <= 0)
 
5813
                break;
 
5814
              *pDest++ = (((*pSrc)>>2)&1);
 
5815
              if (iX-- <= 0)
 
5816
                break;
 
5817
              *pDest++ = (((*pSrc)>>1)&1);
 
5818
              if (iX-- <= 0)
 
5819
                break;
 
5820
              *pDest++ = (((*pSrc)   )&1);
 
5821
              if (iX-- <= 0)
 
5822
                break;
 
5823
              pSrc++;
 
5824
            }
 
5825
          }
 
5826
          else if (pData->iPNGdepth == 2)
 
5827
          {
 
5828
            /* Inflate Workrow to 8-bit */
 
5829
            mng_int32  iX;
 
5830
            mng_uint8p pSrc = pData->pWorkrow+1;
 
5831
            mng_uint8p pDest = pSrc + pData->iRowsize - (2*pData->iRowsize+7)/8;
 
5832
 
 
5833
            for (iX = ((2*pData->iRowsize+7)/8) ; iX > 0 ; iX--)
 
5834
               *pDest++ = *pSrc++;
 
5835
 
 
5836
            pDest = pData->pWorkrow+1;
 
5837
            pSrc = pDest + pData->iRowsize - (2*pData->iRowsize+7)/8;
 
5838
            for (iX = pData->iRowsize; ;)
 
5839
            {
 
5840
              *pDest++ = (((*pSrc)>>6)&3);
 
5841
              if (iX-- <= 0)
 
5842
                break;
 
5843
              *pDest++ = (((*pSrc)>>4)&3);
 
5844
              if (iX-- <= 0)
 
5845
                break;
 
5846
              *pDest++ = (((*pSrc)>>2)&3);
 
5847
              if (iX-- <= 0)
 
5848
                break;
 
5849
              *pDest++ = (((*pSrc)   )&3);
 
5850
              if (iX-- <= 0)
 
5851
                break;
 
5852
              pSrc++;
 
5853
            }
 
5854
          }
 
5855
          else if (pData->iPNGdepth == 4)
 
5856
          {
 
5857
            /* Inflate Workrow to 8-bit */
 
5858
            mng_int32  iX;
 
5859
            mng_uint8p pSrc = pData->pWorkrow+1;
 
5860
            mng_uint8p pDest = pSrc + pData->iRowsize - (4*pData->iRowsize+7)/8;
 
5861
 
 
5862
            for (iX = ((4*pData->iRowsize+7)/8) ; iX > 0 ; iX--)
 
5863
               *pDest++ = *pSrc++;
 
5864
 
 
5865
            pDest = pData->pWorkrow+1;
 
5866
            pSrc = pDest + pData->iRowsize - (4*pData->iRowsize+7)/8;
 
5867
            for (iX = pData->iRowsize; ;)
 
5868
            {
 
5869
              *pDest++ = (((*pSrc)>>4)&0x0f);
 
5870
              if (iX-- <= 0)
 
5871
                break;
 
5872
              *pDest++ = (((*pSrc)   )&0x0f);
 
5873
              if (iX-- <= 0)
 
5874
                break;
 
5875
              pSrc++;
 
5876
            }
 
5877
          }
 
5878
          if (pData->iPNGdepth < 8 && pData->iColortype == 0)
 
5879
          {
 
5880
            /* Expand samples to 8-bit by LBR */
 
5881
            mng_int32  iX;
 
5882
            mng_uint8p pSrc = pData->pWorkrow+1;
 
5883
            mng_uint8 multiplier[]={0,255,85,0,17,0,0,0,1};
 
5884
 
 
5885
            for (iX = pData->iRowsize; iX > 0; iX--)
 
5886
                *pSrc++ *= multiplier[pData->iPNGdepth];
 
5887
          }
 
5888
#endif
 
5889
#ifdef MNG_NO_16BIT_SUPPORT
 
5890
          if (pData->iPNGdepth > 8)
 
5891
          {
 
5892
            /* Reduce Workrow to 8-bit */
 
5893
            mng_int32  iX;
 
5894
            mng_uint8p pSrc = pData->pWorkrow+1;
 
5895
            mng_uint8p pDest = pSrc;
 
5896
 
 
5897
            for (iX = pData->iRowsize; iX > 0; iX--)
 
5898
            {
 
5899
              *pDest = *pSrc;
 
5900
              pDest++;
 
5901
              pSrc+=2;
 
5902
            }
 
5903
          }
 
5904
#endif
 
5905
 
 
5906
#ifdef FILTER192                       /* has leveling info ? */
 
5907
          if (pData->iFilterofs == MNG_FILTER_DIFFERING)
 
5908
            iRetcode = init_rowdiffering (pData);
 
5909
          else
 
5910
#endif
 
5911
            iRetcode = MNG_NOERROR;
 
5912
                                       /* filter the row if necessary */
 
5913
          if ((!iRetcode) && (pData->iFilterofs < pData->iPixelofs  ) &&
 
5914
                             (*(pData->pWorkrow + pData->iFilterofs))    )
 
5915
            iRetcode = mng_filter_a_row (pData);
 
5916
 
 
5917
                                       /* additional leveling/differing ? */
 
5918
          if ((!iRetcode) && (pData->fDifferrow))
 
5919
          {
 
5920
            iRetcode = ((mng_differrow)pData->fDifferrow) (pData);
 
5921
 
 
5922
            pSwap           = pData->pWorkrow;
 
5923
            pData->pWorkrow = pData->pPrevrow;
 
5924
            pData->pPrevrow = pSwap;   /* make sure we're processing the right data */
 
5925
          }
 
5926
 
 
5927
          if (!iRetcode)
 
5928
          {
 
5929
            {                          /* process this row */
 
5930
              if ((!iRetcode) && (pData->fProcessrow))
 
5931
                iRetcode = ((mng_processrow)pData->fProcessrow) (pData);
 
5932
                                       /* store in object ? */
 
5933
              if ((!iRetcode) && (pData->fStorerow))
 
5934
                iRetcode = ((mng_storerow)pData->fStorerow)     (pData);
 
5935
            }
 
5936
          }
 
5937
 
 
5938
          if (iRetcode)                   /* on error bail out */
 
5939
          {
 
5940
            MNG_FREEX (pData, pBuf, iBufsize);
 
5941
            MNG_ERROR (pData, iRetcode);
 
5942
          }
 
5943
 
 
5944
          if (!pData->fDifferrow)      /* swap row-pointers */
 
5945
          {
 
5946
            pSwap           = pData->pWorkrow;
 
5947
            pData->pWorkrow = pData->pPrevrow;
 
5948
            pData->pPrevrow = pSwap;   /* so prev points to the processed row! */
 
5949
          }
 
5950
                                       /* adjust variables for next row */
 
5951
          iRetcode = mng_next_row (pData);
 
5952
 
 
5953
          if (iRetcode)                   /* on error bail out */
 
5954
          {
 
5955
            MNG_FREEX (pData, pBuf, iBufsize);
 
5956
            MNG_ERROR (pData, iRetcode);
 
5957
          }
 
5958
        }
 
5959
      }
 
5960
 
 
5961
      pTemp    += pData->iRowmax;
 
5962
      iTemplen -= pData->iRowmax;
 
5963
    }                                  /* until some error or EOI
 
5964
                                          or all pixels received */
 
5965
    while ( (iTemplen > 0)  &&
 
5966
            ( (pData->iRow < (mng_int32)pData->iDataheight) ||
 
5967
              ( (pData->iPass >= 0) && (pData->iPass < 7) )    )    );
 
5968
 
 
5969
    mng_cleanup_rowproc (pData);       /* cleanup row processing buffers !! */
 
5970
 
 
5971
                                       /* restore saved work-parms */
 
5972
    pData->iDatawidth   = iSavedatawidth;
 
5973
    pData->iDataheight  = iSavedataheight;
 
5974
 
 
5975
    pData->fInitrowproc = fSaveinitrowproc;
 
5976
    pData->fDisplayrow  = fSavestorerow;
 
5977
    pData->fProcessrow  = fSaveprocessrow;
 
5978
    pData->fDifferrow   = fSavedifferrow;
 
5979
    pData->pStoreobj    = fSavestoreobj;
 
5980
    pData->pStorebuf    = fSavestorebuf;
 
5981
 
 
5982
#ifdef MNG_OPTIMIZE_FOOTPRINT_INIT
 
5983
    pData->ePng_imgtype = eSavepngimgtype;
 
5984
#endif
 
5985
 
 
5986
    pData->iInterlace   = iSaveinterlace;
 
5987
    pData->iPass        = iSavepass;
 
5988
    pData->iRow         = iSaverow;
 
5989
    pData->iRowinc      = iSaverowinc;
 
5990
    pData->iCol         = iSavecol;
 
5991
    pData->iColinc      = iSavecolinc;
 
5992
    pData->iRowsamples  = iSaverowsamples;
 
5993
    pData->iSamplemul   = iSavesamplemul;
 
5994
    pData->iSampleofs   = iSavesampleofs;
 
5995
    pData->iSamplediv   = iSavesamplediv;
 
5996
    pData->iRowsize     = iSaverowsize;
 
5997
    pData->iRowmax      = iSaverowmax;
 
5998
    pData->iFilterofs   = iSavefilterofs;
 
5999
    pData->iPixelofs    = iSavepixelofs;
 
6000
    pData->iLevel0      = iSavelevel0;
 
6001
    pData->iLevel1      = iSavelevel1;
 
6002
    pData->iLevel2      = iSavelevel2;
 
6003
    pData->iLevel3      = iSavelevel3;
 
6004
    pData->pWorkrow     = pSaveworkrow;
 
6005
    pData->pPrevrow     = pSaveprevrow;
 
6006
    pData->pRGBArow     = pSaverGBArow;
 
6007
    pData->bIsRGBA16    = bSaveisRGBA16;
 
6008
    pData->bIsOpaque    = bSaveisOpaque;
 
6009
    pData->iFilterbpp   = iSavefilterbpp;
 
6010
    pData->iDestl       = iSavedestl;
 
6011
    pData->iDestt       = iSavedestt;
 
6012
    pData->iDestr       = iSavedestr;
 
6013
    pData->iDestb       = iSavedestb;
 
6014
    pData->iSourcel     = iSavesourcel;
 
6015
    pData->iSourcet     = iSavesourcet;
 
6016
    pData->iSourcer     = iSavesourcer;
 
6017
    pData->iSourceb     = iSavesourceb;
 
6018
 
 
6019
                                       /* create the animation directives ! */
 
6020
    pProcess = (mng_processobject)pANG->sHeader.fProcess;
 
6021
    iRetcode = pProcess (pData, (mng_objectp)pData->pANG);
 
6022
    if (iRetcode)
 
6023
      return iRetcode;
 
6024
 
 
6025
#endif /* MNG_SUPPORT_DISPLAY */
 
6026
 
 
6027
    MNG_FREE (pData, pBuf, iBufsize);  /* always free the temp buffer ! */
 
6028
  }
 
6029
 
 
6030
  *piRawlen = 0;
 
6031
 
 
6032
  return MNG_NOERROR;
 
6033
}
 
6034
#endif
 
6035
 
 
6036
/* ************************************************************************** */
 
6037
 
 
6038
#ifdef MNG_INCLUDE_ANG_PROPOSAL
 
6039
MNG_C_SPECIALFUNC (mng_special_adat)
 
6040
{
 
6041
  return MNG_NOERROR;
 
6042
}
 
6043
#endif
 
6044
 
 
6045
/* ************************************************************************** */
 
6046
 
5167
6047
MNG_C_SPECIALFUNC (mng_special_unknown)
5168
6048
{
5169
6049
                                       /* critical chunk ? */