📄 libmng_chunk_xs.c
字号:
/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_save_entry (mng_handle hHandle, mng_handle hChunk, mng_uint32 iEntry, mng_uint8 *iEntrytype, mng_uint32arr2 *iOffset, mng_uint32arr2 *iStarttime, mng_uint32 *iLayernr, mng_uint32 *iFramenr, mng_uint32 *iNamesize, mng_pchar *zName){ mng_datap pData; mng_savep pChunk; mng_save_entryp pEntry;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SAVE_ENTRY, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_savep)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_SAVE) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ if (iEntry >= pChunk->iCount) /* valid index ? */ MNG_ERROR (pData, MNG_INVALIDENTRYIX) pEntry = pChunk->pEntries + iEntry; /* address the entry */ /* fill the fields */ *iEntrytype = pEntry->iEntrytype; (*iOffset)[0] = pEntry->iOffset[0]; (*iOffset)[1] = pEntry->iOffset[1]; (*iStarttime)[0] = pEntry->iStarttime[0]; (*iStarttime)[1] = pEntry->iStarttime[1]; *iLayernr = pEntry->iLayernr; *iFramenr = pEntry->iFramenr; *iNamesize = pEntry->iNamesize; *zName = pEntry->zName;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SAVE_ENTRY, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_seek (mng_handle hHandle, mng_handle hChunk, mng_uint32 *iNamesize, mng_pchar *zName){ mng_datap pData; mng_seekp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SEEK, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_seekp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_SEEK) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *iNamesize = pChunk->iNamesize; /* fill the fields */ *zName = pChunk->zName;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SEEK, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_expi (mng_handle hHandle, mng_handle hChunk, mng_uint16 *iSnapshotid, mng_uint32 *iNamesize, mng_pchar *zName){ mng_datap pData; mng_expip pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_EXPI, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_expip)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_eXPI) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *iSnapshotid = pChunk->iSnapshotid; /* fill the fields */ *iNamesize = pChunk->iNamesize; *zName = pChunk->zName;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_EXPI, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_fpri (mng_handle hHandle, mng_handle hChunk, mng_uint8 *iDeltatype, mng_uint8 *iPriority){ mng_datap pData; mng_fprip pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_FPRI, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_fprip)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_fPRI) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *iDeltatype = pChunk->iDeltatype; /* fill the fields */ *iPriority = pChunk->iPriority;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_FPRI, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_need (mng_handle hHandle, mng_handle hChunk, mng_uint32 *iKeywordssize, mng_pchar *zKeywords){ mng_datap pData; mng_needp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_NEED, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_needp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_nEED) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ /* fill the fields */ *iKeywordssize = pChunk->iKeywordssize; *zKeywords = pChunk->zKeywords;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_NEED, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_phyg (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint32 *iSizex, mng_uint32 *iSizey, mng_uint8 *iUnit){ mng_datap pData; mng_phygp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_PHYG, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_phygp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_pHYg) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *bEmpty = pChunk->bEmpty; /* fill the fields */ *iSizex = pChunk->iSizex; *iSizey = pChunk->iSizey; *iUnit = pChunk->iUnit;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_PHYG, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** *//* B004 */#ifdef MNG_INCLUDE_JNG/* B004 */mng_retcode MNG_DECL mng_getchunk_jhdr (mng_handle hHandle, mng_handle hChunk, mng_uint32 *iWidth, mng_uint32 *iHeight, mng_uint8 *iColortype, mng_uint8 *iImagesampledepth, mng_uint8 *iImagecompression, mng_uint8 *iImageinterlace, mng_uint8 *iAlphasampledepth, mng_uint8 *iAlphacompression, mng_uint8 *iAlphafilter, mng_uint8 *iAlphainterlace){ mng_datap pData; mng_jhdrp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_JHDR, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_jhdrp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_JHDR) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *iWidth = pChunk->iWidth; /* fill the fields */ *iHeight = pChunk->iHeight; *iColortype = pChunk->iColortype; *iImagesampledepth = pChunk->iImagesampledepth; *iImagecompression = pChunk->iImagecompression; *iImageinterlace = pChunk->iImageinterlace; *iAlphasampledepth = pChunk->iAlphasampledepth; *iAlphacompression = pChunk->iAlphacompression; *iAlphafilter = pChunk->iAlphafilter; *iAlphainterlace = pChunk->iAlphainterlace;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_JHDR, MNG_LC_END)#endif return MNG_NOERROR;}/* B004 */#endif /* MNG_INCLUDE_JNG *//* B004 *//* ************************************************************************** *//* B004 */#ifdef MNG_INCLUDE_JNG/* B004 */mng_retcode MNG_DECL mng_getchunk_jdat (mng_handle hHandle, mng_handle hChunk, mng_uint32 *iRawlen, mng_ptr *pRawdata){ mng_datap pData; mng_jdatp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_JDAT, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_jdatp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_JDAT) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *iRawlen = pChunk->iDatasize; /* fill the fields */ *pRawdata = pChunk->pData;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_JDAT, MNG_LC_END)#endif return MNG_NOERROR;}/* B004 */#endif /* MNG_INCLUDE_JNG *//* B004 *//* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_dhdr (mng_handle hHandle, mng_handle hChunk, mng_uint16 *iObjectid, mng_uint8 *iImagetype, mng_uint8 *iDeltatype, mng_uint32 *iBlockwidth, mng_uint32 *iBlockheight, mng_uint32 *iBlockx, mng_uint32 *iBlocky){ mng_datap pData; mng_dhdrp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_DHDR, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_dhdrp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_DHDR) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *iObjectid = pChunk->iObjectid; /* fill the fields */ *iImagetype = pChunk->iImagetype; *iDeltatype = pChunk->iDeltatype; *iBlockwidth = pChunk->iBlockwidth; *iBlockheight = pChunk->iBlockheight; *iBlockx = pChunk->iBlockx; *iBlocky = pChunk->iBlocky;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_DHDR, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_prom (mng_handle hHandle, mng_handle hChunk, mng_uint8 *iColortype, mng_uint8 *iSampledepth, mng_uint8 *iFilltype){ mng_datap pData; mng_promp pChunk;#ifdef MNG_SUPPORT_TRACE MNG
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -