📄 libmng_chunk_xs.c
字号:
*bEmpty = pChunk->bEmpty; /* fill the fields */ *bGlobal = pChunk->bGlobal; *iType = pChunk->iType; *iCount = pChunk->iCount; *iGray = pChunk->iGray; *iRed = pChunk->iRed; *iGreen = pChunk->iGreen; *iBlue = pChunk->iBlue; *iRawlen = pChunk->iRawlen; MNG_COPY (*aAlphas, pChunk->aEntries, sizeof (mng_uint8arr)); MNG_COPY (*aRawdata, pChunk->aRawdata, sizeof (mng_uint8arr));#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_TRNS, MNG_LC_END);#endif return MNG_NOERROR;}/* ************************************************************************** */#ifndef MNG_SKIPCHUNK_gAMAmng_retcode MNG_DECL mng_getchunk_gama (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint32 *iGamma){ mng_datap pData; mng_gamap pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_GAMA, MNG_LC_START);#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_gamap)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_gAMA) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *bEmpty = pChunk->bEmpty; /* fill the fields */ *iGamma = pChunk->iGamma;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_GAMA, MNG_LC_END);#endif return MNG_NOERROR;}#endif/* ************************************************************************** */#ifndef MNG_SKIPCHUNK_cHRMmng_retcode MNG_DECL mng_getchunk_chrm (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint32 *iWhitepointx, mng_uint32 *iWhitepointy, mng_uint32 *iRedx, mng_uint32 *iRedy, mng_uint32 *iGreenx, mng_uint32 *iGreeny, mng_uint32 *iBluex, mng_uint32 *iBluey){ mng_datap pData; mng_chrmp pChunk;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_CHRM, MNG_LC_START);#endif MNG_VALIDHANDLE (hHandle) /* check validity handle */ pData = (mng_datap)hHandle; /* and make it addressable */ pChunk = (mng_chrmp)hChunk; /* address the chunk */ if (pChunk->sHeader.iChunkname != MNG_UINT_cHRM) MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */ *bEmpty = pChunk->bEmpty; /* fill the fields */ *iWhitepointx = pChunk->iWhitepointx; *iWhitepointy = pChunk->iWhitepointy; *iRedx = pChunk->iRedx; *iRedy = pChunk->iRedy; *iGreenx = pChunk->iGreenx; *iGreeny = pChunk->iGreeny; *iBluex = pChunk->iBluex; *iBluey = pChunk->iBluey;#ifdef MNG_SUPPORT_TRACE MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_CHRM, MNG_LC_END);#endif return MNG_NOERROR;}#endif/* ************************************************************************** */#ifndef MNG_SKIPCHUNK_sRGBmng_retcode MNG_DECL mng_getchunk_srgb (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint8 *iRenderingintent){ 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;}#endif/* ************************************************************************** */#ifndef MNG_SKIPCHUNK_iCCPmng_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;}#endif/* ************************************************************************** */#ifndef MNG_SKIPCHUNK_tEXtmng_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;}#endif/* ************************************************************************** */#ifndef MNG_SKIPCHUNK_zTXtmng_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;}#endif/* ************************************************************************** */#ifndef MNG_SKIPCHUNK_iTXtmng_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;}#endif/* ************************************************************************** */#ifndef MNG_SKIPCHUNK_bKGDmng_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;}#endif/* ************************************************************************** */#ifndef MNG_SKIPCHUNK_pHYsmng_retcode MNG_DECL mng_getchunk_phys (mng_handle hHandle, mng_handle hChunk, mng_bool *bEmpty, mng_uint32 *iSizex, mng_uint32 *iSizey,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -