pData->iMaxwidth             = 1600; pData->iMaxheight            = 1200;
pData->iMaxwidth             = 10000; pData->iMaxheight            = 10000;
mng_handle MNG_DECL mng_initialize (mng_ptr       pUserdata,                                    mng_memalloc  fMemalloc,                                    mng_memfree   fMemfree,                                    mng_traceproc fTraceproc){  mng_datap   pData;#ifdef MNG_SUPPORT_DISPLAY  mng_retcode iRetcode;  mng_imagep  pImage;#endif#ifdef MNG_INTERNAL_MEMMNGMT           /* allocate the main datastruc */  pData = (mng_datap)calloc (1, sizeof (mng_data));#else  pData = (mng_datap)fMemalloc (sizeof (mng_data));#endif  if (!pData)    return MNG_NULL;                   /* error: out of memory?? */                                       /* validate the structure */  pData->iMagic                = MNG_MAGIC;                                       /* save userdata field */  pData->pUserdata             = pUserdata;                                       /* remember trace callback */  pData->fTraceproc            = fTraceproc;#ifdef MNG_SUPPORT_TRACE  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;  pData->iBkgdstyle            = MNG_CANVAS_RGB8;  pData->iBGred                = 0;  /* black */  pData->iBGgreen              = 0;  pData->iBGblue               = 0;#ifdef MNG_FULL_CMS  pData->bIssRGB               = MNG_TRUE;  pData->hProf1                = 0;    /* no profiles yet */  pData->hProf2                = 0;  pData->hProf3                = 0;  pData->hTrans                = 0;#endif  pData->dViewgamma            = 1.0;  pData->dDisplaygamma         = 2.2;  pData->dDfltimggamma         = 0.45455;                                       /* initially remember chunks */  pData->bStorechunks          = MNG_TRUE;                                       /* no breaks at section-borders */  pData->bSectionbreaks        = MNG_FALSE;                                       /* normal animation-speed ! */  pData->iSpeed                = mng_st_normal;                                       /* initial image limits */  pData->iMaxwidth             = 1600;  pData->iMaxheight            = 1200;#ifdef MNG_INTERNAL_MEMMNGMT  pData->fMemalloc             = 0;    /* internal management */  pData->fMemfree              = 0;#else                                  /* keep callbacks */  pData->fMemalloc             = fMemalloc;  pData->fMemfree              = fMemfree;#endif  pData->fOpenstream           = 0;    /* no value (yet) */  pData->fClosestream          = 0;  pData->fReaddata             = 0;  pData->fWritedata            = 0;  pData->fErrorproc            = 0;  pData->fProcessheader        = 0;  pData->fProcesstext          = 0;  pData->fProcesssave          = 0;  pData->fProcessseek          = 0;  pData->fGetcanvasline        = 0;  pData->fGetbkgdline          = 0;  pData->fGetalphaline         = 0;  pData->fRefresh              = 0;  pData->fGettickcount         = 0;  pData->fSettimer             = 0;  pData->fProcessgamma         = 0;  pData->fProcesschroma        = 0;  pData->fProcesssrgb          = 0;  pData->fProcessiccp          = 0;  pData->fProcessarow          = 0;#if defined(MNG_SUPPORT_DISPLAY) && (defined(MNG_GAMMA_ONLY) || defined(MNG_FULL_CMS))  pData->dLastgamma            = 0;    /* lookup table needs first-time calc */#endif#ifdef MNG_SUPPORT_DISPLAY             /* create object 0 */  iRetcode = create_imageobject (pData, 0, MNG_TRUE, MNG_TRUE, MNG_TRUE,                                 0, 0, 0, 0, 0, 0, 0, 0, 0, MNG_FALSE,                                 0, 0, 0, 0, &pImage);  if (iRetcode)                        /* on error drop out */  {    MNG_FREEX (pData, pData, sizeof (mng_data))    return MNG_NULL;  }  pData->pObjzero = pImage;#endif#if defined(MNG_SUPPORT_DISPLAY) && defined(MNG_INCLUDE_LCMS)  mnglcms_initlibrary ();              /* init lcms particulairs */#endif#ifdef MNG_SUPPORT_READ  pData->bSuspensionmode       = MNG_FALSE;  pData->iSuspendbufsize       = 0;  pData->pSuspendbuf           = MNG_NULL;  pData->pSuspendbufnext       = MNG_NULL;  pData->iSuspendbufleft       = 0;  pData->iChunklen             = 0;  pData->pReadbufnext          = MNG_NULL;#endif#ifdef MNG_INCLUDE_ZLIB  mngzlib_initialize (pData);          /* initialize zlib structures and such */                                       /* default zlib compression parameters */  pData->iZlevel               = MNG_ZLIB_LEVEL;  pData->iZmethod              = MNG_ZLIB_METHOD;  pData->iZwindowbits          = MNG_ZLIB_WINDOWBITS;  pData->iZmemlevel            = MNG_ZLIB_MEMLEVEL;  pData->iZstrategy            = MNG_ZLIB_STRATEGY;                                       /* default maximum IDAT data size */  pData->iMaxIDAT              = MNG_MAX_IDAT_SIZE;#endif#ifdef MNG_INCLUDE_JNG                 /* default IJG compression parameters */  pData->eJPEGdctmethod        = MNG_JPEG_DCT;  pData->iJPEGquality          = MNG_JPEG_QUALITY;  pData->iJPEGsmoothing        = MNG_JPEG_SMOOTHING;  pData->bJPEGcompressprogr    = MNG_JPEG_PROGRESSIVE;  pData->bJPEGcompressopt      = MNG_JPEG_OPTIMIZED;                                       /* default maximum JDAT data size */  pData->iMaxJDAT              = MNG_MAX_JDAT_SIZE;#endif  mng_reset ((mng_handle)pData);#ifdef MNG_SUPPORT_TRACE  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 */}