📄 libmng.h
字号:
MNG_EXT mng_retcode MNG_DECL mng_create (mng_handle hHandle);#endif/* high-level display functions *//* use these to display a previously read or created graphic or to read & display a graphic simultaneously *//* mng_display_resume should be called after a timer-interval expires that was set through the settimer-callback, after a read suspension-break, or, to resume an animation after a call to mng_display_freeze/mng_display_reset *//* mng_display_freeze thru mng_display_gotime can be used to influence the display of an image, BUT ONLY if it has been completely read! */#ifdef MNG_SUPPORT_DISPLAY#ifdef MNG_SUPPORT_READMNG_EXT mng_retcode MNG_DECL mng_readdisplay (mng_handle hHandle);#endifMNG_EXT mng_retcode MNG_DECL mng_display (mng_handle hHandle);MNG_EXT mng_retcode MNG_DECL mng_display_resume (mng_handle hHandle);MNG_EXT mng_retcode MNG_DECL mng_display_freeze (mng_handle hHandle);MNG_EXT mng_retcode MNG_DECL mng_display_reset (mng_handle hHandle);MNG_EXT mng_retcode MNG_DECL mng_display_goframe (mng_handle hHandle, mng_uint32 iFramenr);MNG_EXT mng_retcode MNG_DECL mng_display_golayer (mng_handle hHandle, mng_uint32 iLayernr);MNG_EXT mng_retcode MNG_DECL mng_display_gotime (mng_handle hHandle, mng_uint32 iPlaytime);#endif /* MNG_SUPPORT_DISPLAY *//* error reporting function *//* use this if you need more detailed info on the last error *//* iExtra1 & iExtra2 may contain errorcodes from zlib, jpeg, etc... *//* zErrortext will only be filled if you #define MNG_ERROR_TELLTALE */MNG_EXT mng_retcode MNG_DECL mng_getlasterror (mng_handle hHandle, mng_int8* iSeverity, mng_chunkid* iChunkname, mng_uint32* iChunkseq, mng_int32* iExtra1, mng_int32* iExtra2, mng_pchar* zErrortext);/* ************************************************************************** *//* * * *//* * Callback set functions * *//* * * *//* ************************************************************************** *//* memory callbacks *//* called to allocate and release internal datastructures */#ifndef MNG_INTERNAL_MEMMNGMTMNG_EXT mng_retcode MNG_DECL mng_setcb_memalloc (mng_handle hHandle, mng_memalloc fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_memfree (mng_handle hHandle, mng_memfree fProc);#endif /* MNG_INTERNAL_MEMMNGMT *//* open- & close-stream callbacks *//* called to open & close streams for input or output */#if defined(MNG_SUPPORT_READ) || defined(MNG_SUPPORT_WRITE)MNG_EXT mng_retcode MNG_DECL mng_setcb_openstream (mng_handle hHandle, mng_openstream fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_closestream (mng_handle hHandle, mng_closestream fProc);#endif/* read callback *//* called to get data from the inputstream */#ifdef MNG_SUPPORT_READMNG_EXT mng_retcode MNG_DECL mng_setcb_readdata (mng_handle hHandle, mng_readdata fProc);#endif/* write callback *//* called to put data into the outputstream */#ifdef MNG_SUPPORT_WRITEMNG_EXT mng_retcode MNG_DECL mng_setcb_writedata (mng_handle hHandle, mng_writedata fProc);#endif/* error callback *//* called when an error occurs *//* the application can determine if the error is recoverable, and may inform the library by setting specific returncodes */MNG_EXT mng_retcode MNG_DECL mng_setcb_errorproc (mng_handle hHandle, mng_errorproc fProc);/* trace callback *//* called to show the currently executing function */#ifdef MNG_SUPPORT_TRACEMNG_EXT mng_retcode MNG_DECL mng_setcb_traceproc (mng_handle hHandle, mng_traceproc fProc);#endif/* callbacks for read processing *//* processheader is called when all header information has been gathered from the inputstream *//* processtext is called for every tEXt, zTXt and iTXt chunk in the inputstream (iType=0 for tEXt, 1 for zTXt and 2 for iTXt); you can call get_imagelevel to check at what nesting-level the chunk is encountered (eg. tEXt inside an embedded image inside a MNG -> level == 2; in most other case -> level == 1) *//* processsave & processseek are called for SAVE/SEEK chunks *//* processneed is called for the nEED chunk; you should specify a callback for this as the default behavior will be to abort processing *//* processunknown is called after reading each non-critical unknown chunk */#ifdef MNG_SUPPORT_READMNG_EXT mng_retcode MNG_DECL mng_setcb_processheader (mng_handle hHandle, mng_processheader fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processtext (mng_handle hHandle, mng_processtext fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processsave (mng_handle hHandle, mng_processsave fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processseek (mng_handle hHandle, mng_processseek fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processneed (mng_handle hHandle, mng_processneed fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processmend (mng_handle hHandle, mng_processmend fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processunknown(mng_handle hHandle, mng_processunknown fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processterm (mng_handle hHandle, mng_processterm fProc);#endif/* callbacks for display processing *//* getcanvasline is called to get an access-pointer to a line on the drawing-canvas *//* getbkgdline is called to get an access-pointer to a line from the background-canvas *//* refresh is called to inform the GUI to redraw the current canvas onto it's output device (eg. in Win32 this would mean sending an invalidate message for the specified region *//* NOTE that the update-region is specified as x,y,width,height; eg. the invalidate message for Windows requires left,top,right,bottom parameters where the bottom-right is exclusive of the region!! to get these correctly is as simple as: left = x; top = y; right = x + width; bottom = y + height; if your implementation requires inclusive points, simply subtract 1 from both the right & bottom values calculated above. */#ifdef MNG_SUPPORT_DISPLAYMNG_EXT mng_retcode MNG_DECL mng_setcb_getcanvasline (mng_handle hHandle, mng_getcanvasline fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_getbkgdline (mng_handle hHandle, mng_getbkgdline fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_getalphaline (mng_handle hHandle, mng_getalphaline fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_refresh (mng_handle hHandle, mng_refresh fProc);/* timing callbacks *//* gettickcount is called to get the system tickcount (milliseconds); this is used to determine the remaining interval between frames *//* settimer is called to inform the application that it should set a timer; when the timer is triggered the app must call mng_display_resume */MNG_EXT mng_retcode MNG_DECL mng_setcb_gettickcount (mng_handle hHandle, mng_gettickcount fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_settimer (mng_handle hHandle, mng_settimer fProc);/* color management callbacks *//* called to transmit color management information to the application *//* these are only used when you #define MNG_APP_CMS */#ifdef MNG_APP_CMSMNG_EXT mng_retcode MNG_DECL mng_setcb_processgamma (mng_handle hHandle, mng_processgamma fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processchroma (mng_handle hHandle, mng_processchroma fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processsrgb (mng_handle hHandle, mng_processsrgb fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processiccp (mng_handle hHandle, mng_processiccp fProc);MNG_EXT mng_retcode MNG_DECL mng_setcb_processarow (mng_handle hHandle, mng_processarow fProc);#endif /* MNG_APP_CMS */#endif /* MNG_SUPPORT_DISPLAY *//* ************************************************************************** *//* * * *//* * Callback get functions * *//* * * *//* ************************************************************************** *//* see _setcb_ */#ifndef MNG_INTERNAL_MEMMNGMTMNG_EXT mng_memalloc MNG_DECL mng_getcb_memalloc (mng_handle hHandle);MNG_EXT mng_memfree MNG_DECL mng_getcb_memfree (mng_handle hHandle);#endif/* see _setcb_ */#if defined(MNG_SUPPORT_READ) || defined(MNG_WRITE_SUPPORT)MNG_EXT mng_openstream MNG_DECL mng_getcb_openstream (mng_handle hHandle);MNG_EXT mng_closestream MNG_DECL mng_getcb_closestream (mng_handle hHandle);#endif/* see _setcb_ */#ifdef MNG_SUPPORT_READMNG_EXT mng_readdata MNG_DECL mng_getcb_readdata (mng_handle hHandle);#endif/* see _setcb_ */#ifdef MNG_SUPPORT_WRITEMNG_EXT mng_writedata MNG_DECL mng_getcb_writedata (mng_handle hHandle);#endif/* see _setcb_ */MNG_EXT mng_errorproc MNG_DECL mng_getcb_errorproc (mng_handle hHandle);/* see _setcb_ */#ifdef MNG_SUPPORT_TRACEMNG_EXT mng_traceproc MNG_DECL mng_getcb_traceproc (mng_handle hHandle);#endif/* see _setcb_ */#ifdef MNG_SUPPORT_READMNG_EXT mng_processheader MNG_DECL mng_getcb_processheader (mng_handle hHandle);MNG_EXT mng_processtext MNG_DECL mng_getcb_processtext (mng_handle hHandle);MNG_EXT mng_processsave MNG_DECL mng_getcb_processsave (mng_handle hHandle);MNG_EXT mng_processseek MNG_DECL mng_getcb_processseek (mng_handle hHandle);MNG_EXT mng_processneed MNG_DECL mng_getcb_processneed (mng_handle hHandle);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -