pImage->iMAGN_MethodX    = 0; pImage->iMAGN_MethodY    = 0; pImage->iMAGN_MX         = 0; pImage->iMAGN_MY         = 0; pImage->iMAGN_ML         = 0; pImage->iMAGN_MR         = 0; pImage->iMAGN_MT         = 0; pImage->iMAGN_MB         = 0;
mng_retcode create_imageobject (mng_datap  pData,                                mng_uint16 iId,                                mng_bool   bConcrete,                                mng_bool   bVisible,                                mng_bool   bViewable,                                mng_uint32 iWidth,                                mng_uint32 iHeight,                                mng_uint8  iBitdepth,                                mng_uint8  iColortype,                                mng_uint8  iCompression,                                mng_uint8  iFilter,                                mng_uint8  iInterlace,                                mng_int32  iPosx,                                mng_int32  iPosy,                                mng_bool   bClipped,                                mng_int32  iClipl,                                mng_int32  iClipr,                                mng_int32  iClipt,                                mng_int32  iClipb,                                mng_imagep *ppObject){  mng_imagep     pImage;  mng_imagep     pPrev, pNext;  mng_retcode    iRetcode;  mng_imagedatap pImgbuf;#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_CREATE_IMGOBJECT, MNG_LC_START)#endif                                       /* get a buffer */  MNG_ALLOC (pData, pImage, sizeof (mng_image))                                       /* now get a new "object buffer" */  iRetcode = create_imagedataobject (pData, bConcrete, bViewable,                                     iWidth, iHeight, iBitdepth, iColortype,                                     iCompression, iFilter, iInterlace,                                     &pImgbuf);  if (iRetcode)                        /* on error bail out */  {    MNG_FREEX (pData, pImage, sizeof (mng_image))    return iRetcode;  }                                       /* fill the appropriate fields */  pImage->sHeader.fCleanup = (mng_cleanupobject)free_imageobject;  pImage->sHeader.fProcess = 0;  pImage->iId              = iId;  pImage->bFrozen          = MNG_FALSE;  pImage->bVisible         = bVisible;  pImage->bViewable        = bViewable;  pImage->iPosx            = iPosx;  pImage->iPosy            = iPosy;  pImage->bClipped         = bClipped;  pImage->iClipl           = iClipl;  pImage->iClipr           = iClipr;  pImage->iClipt           = iClipt;  pImage->iClipb           = iClipb;  pImage->pImgbuf          = pImgbuf;  if (iId)                             /* only if not object 0 ! */  {                                    /* find previous lower object-id */    pPrev = (mng_imagep)pData->pLastimgobj;    while ((pPrev) && (pPrev->iId > iId))      pPrev = (mng_imagep)pPrev->sHeader.pPrev;    if (pPrev)                         /* found it ? */    {      pImage->sHeader.pPrev = pPrev;   /* than link it in place */      pImage->sHeader.pNext = pPrev->sHeader.pNext;      pPrev->sHeader.pNext  = pImage;    }    else                               /* if not found, it becomes the first ! */    {      pImage->sHeader.pNext = pData->pFirstimgobj;      pData->pFirstimgobj   = pImage;    }    pNext                   = (mng_imagep)pImage->sHeader.pNext;    if (pNext)      pNext->sHeader.pPrev  = pImage;    else      pData->pLastimgobj    = pImage;      }    *ppObject = pImage;                  /* and return the new buffer */#ifdef MNG_SUPPORT_TRACE  MNG_TRACE (pData, MNG_FN_CREATE_IMGOBJECT, MNG_LC_END)#endif  return MNG_NOERROR;                  /* okido */}