📄 libmng_chunk_xs.c
字号:
mng_datap pData; mng_srgbp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SRGB, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_srgbp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_sRGB) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *bEmpty = pChunk->bEmpty; /* fill the fields */ *iRenderingintent = pChunk->iRenderingintent;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SRGB, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_iccp (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint32 *iNamesize, mng_pchar *zName, mng_uint8 *iCompression, mng_uint32 *iProfilesize, mng_ptr *pProfile){ mng_datap pData; mng_iccpp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_ICCP, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_iccpp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_iCCP) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *bEmpty = pChunk->bEmpty; /* fill the fields */ *iNamesize = pChunk->iNamesize; *zName = pChunk->zName; *iCompression = pChunk->iCompression; *iProfilesize = pChunk->iProfilesize; *pProfile = pChunk->pProfile;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_ICCP, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_text (mng_handle hHandle, mng_handle hChunk, mng_uint32 *iKeywordsize, mng_pchar *zKeyword, mng_uint32 *iTextsize, mng_pchar *zText){ mng_datap pData; mng_textp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_TEXT, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_textp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_tEXt) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ /* fill the fields */ *iKeywordsize = pChunk->iKeywordsize; *zKeyword = pChunk->zKeyword; *iTextsize = pChunk->iTextsize; *zText = pChunk->zText;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_TEXT, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_ztxt (mng_handle hHandle, mng_handle hChunk, mng_uint32 *iKeywordsize, mng_pchar *zKeyword, mng_uint8 *iCompression, mng_uint32 *iTextsize, mng_pchar *zText){ mng_datap pData; mng_ztxtp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_ZTXT, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_ztxtp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_zTXt) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ /* fill the fields */ *iKeywordsize = pChunk->iKeywordsize; *zKeyword = pChunk->zKeyword; *iCompression = pChunk->iCompression; *iTextsize = pChunk->iTextsize; *zText = pChunk->zText;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_ZTXT, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_itxt (mng_handle hHandle, mng_handle hChunk, mng_uint32 *iKeywordsize, mng_pchar *zKeyword, mng_uint8 *iCompressionflag, mng_uint8 *iCompressionmethod, mng_uint32 *iLanguagesize, mng_pchar *zLanguage, mng_uint32 *iTranslationsize, mng_pchar *zTranslation, mng_uint32 *iTextsize, mng_pchar *zText){ mng_datap pData; mng_itxtp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_ITXT, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_itxtp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_iTXt) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ /* fill the fields */ *iKeywordsize = pChunk->iKeywordsize; *zKeyword = pChunk->zKeyword; *iCompressionflag = pChunk->iCompressionflag; *iCompressionmethod = pChunk->iCompressionmethod; *iLanguagesize = pChunk->iLanguagesize; *zLanguage = pChunk->zLanguage; *iTranslationsize = pChunk->iTranslationsize; *zTranslation = pChunk->zTranslation; *iTextsize = pChunk->iTextsize; *zText = pChunk->zText;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_ITXT, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_bkgd (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint8 *iType, mng_uint8 *iIndex, mng_uint16 *iGray, mng_uint16 *iRed, mng_uint16 *iGreen, mng_uint16 *iBlue){ mng_datap pData; mng_bkgdp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_BKGD, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_bkgdp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_bKGD) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *bEmpty = pChunk->bEmpty; /* fill the fields */ *iType = pChunk->iType; *iIndex = pChunk->iIndex; *iGray = pChunk->iGray; *iRed = pChunk->iRed; *iGreen = pChunk->iGreen; *iBlue = pChunk->iBlue;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_BKGD, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_phys (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint32 *iSizex, mng_uint32 *iSizey, mng_uint8 *iUnit){ mng_datap pData; mng_physp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_PHYS, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_physp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_pHYs) 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_PHYS, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_sbit (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint8 *iType, mng_uint8arr4 *aBits){ mng_datap pData; mng_sbitp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SBIT, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_sbitp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_sBIT) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *bEmpty = pChunk->bEmpty; *iType = pChunk->iType; (*aBits)[0] = pChunk->aBits[0]; (*aBits)[1] = pChunk->aBits[1]; (*aBits)[2] = pChunk->aBits[2]; (*aBits)[3] = pChunk->aBits[3];#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SBIT, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_splt (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint32 *iNamesize, mng_pchar *zName, mng_uint8 *iSampledepth, mng_uint32 *iEntrycount, mng_ptr *pEntries){ mng_datap pData; mng_spltp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SPLT, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_spltp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_sPLT) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *bEmpty = pChunk->bEmpty; /* fill the fields */ *iNamesize = pChunk->iNamesize; *zName = pChunk->zName; *iSampledepth = pChunk->iSampledepth; *iEntrycount = pChunk->iEntrycount; *pEntries = pChunk->pEntries;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_SPLT, MNG_LC_END)#endif return MNG_NOERROR;}/* ************************************************************************** */mng_retcode MNG_DECL mng_getchunk_hist (mng_handle hHandle, mng_handle hChunk, mng_uint32 *iEntrycount, mng_uint16arr *aEntries){ mng_datap pData; mng_histp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_HIST, MNG_LC_START)#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_histp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_hIST) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *iEntrycount = pChunk->iEntrycount; /* fill the fields */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -