📄 libmng_chunk_xs.c
字号:
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;
}
#endif
/* ************************************************************************** */
#ifndef MNG_SKIPCHUNK_sBIT
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;
}
#endif
/* ************************************************************************** */
#ifndef MNG_SKIPCHUNK_sPLT
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;
}
#endif
/* ************************************************************************** */
#ifndef MNG_SKIPCHUNK_hIST
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 */
MNG_COPY (*aEntries, pChunk->aEntries, sizeof (mng_uint16arr))
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_HIST, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif
/* ************************************************************************** */
#ifndef MNG_SKIPCHUNK_tIME
mng_retcode MNG_DECL mng_getchunk_time (mng_handle hHandle,
mng_handle hChunk,
mng_uint16 *iYear,
mng_uint8 *iMonth,
mng_uint8 *iDay,
mng_uint8 *iHour,
mng_uint8 *iMinute,
mng_uint8 *iSecond)
{
mng_datap pData;
mng_timep pChunk;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_TIME, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle) /* check validity handle */
pData = (mng_datap)hHandle; /* and make it addressable */
pChunk = (mng_timep)hChunk; /* address the chunk */
if (pChunk->sHeader.iChunkname != MNG_UINT_tIME)
MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */
*iYear = pChunk->iYear; /* fill the fields */
*iMonth = pChunk->iMonth;
*iDay = pChunk->iDay;
*iHour = pChunk->iHour;
*iMinute = pChunk->iMinute;
*iSecond = pChunk->iSecond;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_TIME, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif
/* ************************************************************************** */
mng_retcode MNG_DECL mng_getchunk_mhdr (mng_handle hHandle,
mng_handle hChunk,
mng_uint32 *iWidth,
mng_uint32 *iHeight,
mng_uint32 *iTicks,
mng_uint32 *iLayercount,
mng_uint32 *iFramecount,
mng_uint32 *iPlaytime,
mng_uint32 *iSimplicity)
{
mng_datap pData;
mng_mhdrp pChunk;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_MHDR, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle) /* check validity handle */
pData = (mng_datap)hHandle; /* and make it addressable */
pChunk = (mng_mhdrp)hChunk; /* address the chunk */
if (pChunk->sHeader.iChunkname != MNG_UINT_MHDR)
MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */
*iWidth = pChunk->iWidth; /* fill the fields */
*iHeight = pChunk->iHeight;
*iTicks = pChunk->iTicks;
*iLayercount = pChunk->iLayercount;
*iFramecount = pChunk->iFramecount;
*iPlaytime = pChunk->iPlaytime;
*iSimplicity = pChunk->iSimplicity;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_MHDR, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
#ifndef MNG_SKIPCHUNK_LOOP
mng_retcode MNG_DECL mng_getchunk_loop (mng_handle hHandle,
mng_handle hChunk,
mng_uint8 *iLevel,
mng_uint32 *iRepeat,
mng_uint8 *iTermination,
mng_uint32 *iItermin,
mng_uint32 *iItermax,
mng_uint32 *iCount,
mng_uint32p *pSignals)
{
mng_datap pData;
mng_loopp pChunk;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_LOOP, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle) /* check validity handle */
pData = (mng_datap)hHandle; /* and make it addressable */
pChunk = (mng_loopp)hChunk; /* address the chunk */
if (pChunk->sHeader.iChunkname != MNG_UINT_LOOP)
MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */
*iLevel = pChunk->iLevel; /* fill teh fields */
*iRepeat = pChunk->iRepeat;
*iTermination = pChunk->iTermination;
*iItermin = pChunk->iItermin;
*iItermax = pChunk->iItermax;
*iCount = pChunk->iCount;
*pSignals = pChunk->pSignals;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_LOOP, MNG_LC_END)
#endif
return MNG_NOERROR;
}
/* ************************************************************************** */
mng_retcode MNG_DECL mng_getchunk_endl (mng_handle hHandle,
mng_handle hChunk,
mng_uint8 *iLevel)
{
mng_datap pData;
mng_endlp pChunk;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_ENDL, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle) /* check validity handle */
pData = (mng_datap)hHandle; /* and make it addressable */
pChunk = (mng_endlp)hChunk; /* address the chunk */
if (pChunk->sHeader.iChunkname != MNG_UINT_ENDL)
MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */
*iLevel = pChunk->iLevel; /* fill the field */
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_ENDL, MNG_LC_END)
#endif
return MNG_NOERROR;
}
#endif
/* ************************************************************************** */
#ifndef MNG_SKIPCHUNK_DEFI
mng_retcode MNG_DECL mng_getchunk_defi (mng_handle hHandle,
mng_handle hChunk,
mng_uint16 *iObjectid,
mng_uint8 *iDonotshow,
mng_uint8 *iConcrete,
mng_bool *bHasloca,
mng_int32 *iXlocation,
mng_int32 *iYlocation,
mng_bool *bHasclip,
mng_int32 *iLeftcb,
mng_int32 *iRightcb,
mng_int32 *iTopcb,
mng_int32 *iBottomcb)
{
mng_datap pData;
mng_defip pChunk;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_DEFI, MNG_LC_START)
#endif
MNG_VALIDHANDLE (hHandle) /* check validity handle */
pData = (mng_datap)hHandle; /* and make it addressable */
pChunk = (mng_defip)hChunk; /* address the chunk */
if (pChunk->sHeader.iChunkname != MNG_UINT_DEFI)
MNG_ERROR (pData, MNG_WRONGCHUNK) /* ouch */
*iObjectid = pChunk->iObjectid; /* fill the fields */
*iDonotshow = pChunk->iDonotshow;
*iConcrete = pChunk->iConcrete;
*bHasloca = pChunk->bHasloca;
*iXlocation = pChunk->iXlocation;
*iYlocation = pChunk->iYlocation;
*bHasclip = pChunk->bHasclip;
*iLeftcb = pChunk->iLeftcb;
*iRightcb = pChunk->iRightcb;
*iTopcb = pChunk->iTopcb;
*iBottomcb = pChunk->iBottomcb;
#ifdef MNG_SUPPORT_TRACE
MNG_TRACE (((mng_datap)hHandle), MNG_FN_GETCHUNK_DEFI, MNG_LC_END)
#endif
return MNG_NOERROR;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -