PngModule.h
上传用户:yatsl7111
上传日期:2007-01-08
资源大小:1433k
文件大小:3k
- // PngModule.h : main header file for the PNGMODULE DLL
- //
- #if !defined(AFX_PNGMODULE_H__C03B0E6D_460A_11D4_8853_C6A14464AE19__INCLUDED_)
- #define AFX_PNGMODULE_H__C03B0E6D_460A_11D4_8853_C6A14464AE19__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #ifndef __AFXWIN_H__
- #error include 'stdafx.h' before including this file for PCH
- #endif
- #include "resource.h" // main symbols
- #include "..publicgol_isee.h" // 此文件定义了接口数据包
- #include ".pngincpng.h"
- #define DIBSCANLINE_WIDTHBYTES(bits) (((bits)+31)/32*4)
- /////////////////////////////////////////////////////////////////////////////
- // CPngModuleApp
- // See PngModule.cpp for the implementation of this class
- //
- class CPngModuleApp : public CWinApp
- {
- public:
- CPngModuleApp();
- // Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CPngModuleApp)
- //}}AFX_VIRTUAL
- //{{AFX_MSG(CPngModuleApp)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
- // 定义模块版本
- #define MODULE_BUILDID 1
- #define RWPROGRESSSIZE 100 // 总的进度条值,此值不能改动!
- struct _tagPNGINFOHEADER;
- typedef _tagPNGINFOHEADER PNGINFOHEADER;
- // 接口函数声明 — 第一层,唯一与外界联系的接口
- long WINAPI GetLong(void);
- int WINAPI AccessPNGModule(INFOSTR *pInfo);
- // 命令解释函数 — 第二层解释函数
- void _fnCMD_GETPROCTYPE(INFOSTR *pInfo);
- void _fnCMD_GETWRITERS(INFOSTR *pInfo);
- void _fnCMD_GETWRITERMESS(INFOSTR *pInfo);
- void _fnCMD_GETBUILDID(INFOSTR *pInfo);
- void _fnCMD_IS_VALID_FILE(INFOSTR *pInfo);
- void _fnCMD_GET_FILE_INFO(INFOSTR *pInfo);
- void _fnCMD_LOAD_FROM_FILE(INFOSTR *pInfo);
- void _fnCMD_SAVE_TO_FILE(INFOSTR *pInfo);
- void _fnCMD_IS_SUPPORT(INFOSTR *pInfo);
- void _fnCMD_RESIZE(INFOSTR *pInfo);
- // 内部执行函数 - 第三层执行函数.....
- BOOL Image24to32(INFOSTR *pInfo, PBYTE pImage, PBYTE* pLineAddr);
- BOOL Image24to16(INFOSTR *pInfo, PBYTE pImage, PBYTE* pLineAddr);
- BOOL Image24to24(INFOSTR *pInfo, PBYTE pImage, PBYTE* pLineAddr);
- void pngSetIHDR(png_structp pPng, png_infop pPngInfo, INFOSTR *pInfo);
- BOOL TransformImage16(INFOSTR *pInfo, PBYTE pngImage);
- BOOL TransformImage24(INFOSTR *pInfo, PBYTE pngImage);
- BOOL TransformImage32(INFOSTR* pInfo, PBYTE pngImage);
- BOOL TransformImage1_4_8(INFOSTR* pInfo, PBYTE pngImage);
- //PNG用户自定义读写函数及错误处理函数
- static void PngErrorHandler(png_structp png_ptr, png_const_charp message);
- static void PngRead4Win32(png_structp png_ptr, png_bytep data, png_size_t length);
- static void PngWrite4Win32(png_structp png_ptr, png_bytep data, png_size_t length);
- static void PngFlush4Win32(png_structp png_ptr);
- //PNGDLL中所需的全局变量和结构定义
- /* PNG图象信息结构 */
- struct _tagPNGINFOHEADER
- {
- DWORD Width;
- DWORD Height;
- int color_type;
- int bit_depth;
- int interlace_type;
- int filter_type;
- int compression_type;
- int number_passes;
- };
- /////////////////////////////////////////////////////////////////////////////
- //{{AFX_INSERT_LOCATION}}
- // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
- #endif // !defined(AFX_PNGMODULE_H__C03B0E6D_460A_11D4_8853_C6A14464AE19__INCLUDED_)