我的图像库的扩展接口
来源:互联网 发布:tomcat源码 编辑:程序博客网 时间:2024/06/07 08:57
在《bmp位图操作函数和类 》中的dll中有一个接口类,用来扩展支持图像格式。头文件如下:
// ***************************************************************
// JKs_CDibInterface version: 1.0 date:
// -------------------------------------------------------------
// 图像库扩展接口
// -------------------------------------------------------------
// Copyright (C) 2007 - All Rights Reserved
// ***************************************************************
//
// ***************************************************************
#if !defined(_JKS_CDIBINTERFACE_HPP__)
#define _JKS_CDIBINTERFACE_HPP__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#if !defined(_JKSDIBBUILD)
#define _JKSDIBBUILD
#ifdef _DEBUG
#pragma comment(lib,"jksDibD.lib")
#pragma message("jksDibD.lib is linked. ")
#else
#pragma comment(lib,"jksDib.lib")
#pragma message("jksDib.lib is linked. ")
#endif
#endif
#ifndef __AFXWIN_H__
#pragma message("This is not supported by MFC.Can't use this Lib. ")
#endif
#ifdef DIB_DLLEXPORT
#define CLASS_DECL_CDIBINTERFACE __declspec(dllexport)
#else
#define CLASS_DECL_CDIBINTERFACE __declspec(dllimport)
#endif
#include <afxtempl.h>
namespace jks
/**///////////////////////////////////////////////////////////////////////////
...{
class CDib;
class CLASS_DECL_CDIBINTERFACE CDibInterface
...{
public:
CDibInterface() :m_pDib(NULL),m_pExt(NULL),m_nExt(0) ...{m_PtrList.AddTail(this); }
virtual ~CDibInterface();
CDibInterface(CDib *pDib):m_pDib(pDib)
...{ m_PtrList.AddTail(this); }
void Release() ...{delete this;}
/**//// Get CDib
virtual CDib * GetDib() ...{return m_pDib;}
/**//// Set CDib
virtual BOOL SetDib(CDib *pDib);
/**//// filename extension ,必须复写
/// pp用于指定所支持的文件类型的扩展名数组,不带"."
/// n支持的文件扩展名个数
virtual char** GetEXT(int& nExt)=0;
/**//// Load file
virtual BOOL Load(LPCTSTR lpstrFileName) =0;
/**//// Save file
virtual BOOL Save(LPCTSTR lpstrFileName, CDib* pDib) =0;
/**////只要创建一个派生类的对象,系统就知道了
static CPtrList m_PtrList;
protected:
CDib* m_pDib;
char** m_pExt;
int m_nExt;
};
/**//************************************
//接口函数,dll里导出派生类对象,或者在def中导出序号为1
CDibInterface* GetDibInterfaceObj()
{
pObj = new CDibInterface();
return pObj;
}
*************************************/
/**///////////////////////////////////////////////////////////////////////////
} //
#endif // !defined(AFX_JKS_CDIBINTERFACE_HPP__0A3AF2B0_D836_4592_B72E_E68D6727FE21__INCLUDED_)
// JKs_CDibInterface version: 1.0 date:
// -------------------------------------------------------------
// 图像库扩展接口
// -------------------------------------------------------------
// Copyright (C) 2007 - All Rights Reserved
// ***************************************************************
//
// ***************************************************************
#if !defined(_JKS_CDIBINTERFACE_HPP__)
#define _JKS_CDIBINTERFACE_HPP__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#if !defined(_JKSDIBBUILD)
#define _JKSDIBBUILD
#ifdef _DEBUG
#pragma comment(lib,"jksDibD.lib")
#pragma message("jksDibD.lib is linked. ")
#else
#pragma comment(lib,"jksDib.lib")
#pragma message("jksDib.lib is linked. ")
#endif
#endif
#ifndef __AFXWIN_H__
#pragma message("This is not supported by MFC.Can't use this Lib. ")
#endif
#ifdef DIB_DLLEXPORT
#define CLASS_DECL_CDIBINTERFACE __declspec(dllexport)
#else
#define CLASS_DECL_CDIBINTERFACE __declspec(dllimport)
#endif
#include <afxtempl.h>
namespace jks
/**///////////////////////////////////////////////////////////////////////////
...{
class CDib;
class CLASS_DECL_CDIBINTERFACE CDibInterface
...{
public:
CDibInterface() :m_pDib(NULL),m_pExt(NULL),m_nExt(0) ...{m_PtrList.AddTail(this); }
virtual ~CDibInterface();
CDibInterface(CDib *pDib):m_pDib(pDib)
...{ m_PtrList.AddTail(this); }
void Release() ...{delete this;}
/**//// Get CDib
virtual CDib * GetDib() ...{return m_pDib;}
/**//// Set CDib
virtual BOOL SetDib(CDib *pDib);
/**//// filename extension ,必须复写
/// pp用于指定所支持的文件类型的扩展名数组,不带"."
/// n支持的文件扩展名个数
virtual char** GetEXT(int& nExt)=0;
/**//// Load file
virtual BOOL Load(LPCTSTR lpstrFileName) =0;
/**//// Save file
virtual BOOL Save(LPCTSTR lpstrFileName, CDib* pDib) =0;
/**////只要创建一个派生类的对象,系统就知道了
static CPtrList m_PtrList;
protected:
CDib* m_pDib;
char** m_pExt;
int m_nExt;
};
/**//************************************
//接口函数,dll里导出派生类对象,或者在def中导出序号为1
CDibInterface* GetDibInterfaceObj()
{
pObj = new CDibInterface();
return pObj;
}
*************************************/
/**///////////////////////////////////////////////////////////////////////////
} //
#endif // !defined(AFX_JKS_CDIBINTERFACE_HPP__0A3AF2B0_D836_4592_B72E_E68D6727FE21__INCLUDED_)
- 我的图像库的扩展接口
- 接口的扩展
- 我的图像库设计
- jssdk的图像接口
- 我的Firefox扩展
- 图像数据集的扩展
- 扩展Struts的Plugin接口
- s3c2440的网卡接口扩展
- s3c2440的网卡接口扩展
- 我的笔记 接口
- 我的小接口
- 我用的FireFox扩展
- 扩展JLabel实现图像的裁剪
- 图像扩展函数cvCopyMakeBorder的使用
- 我的十年图像生涯
- 用c写PHP的扩展接口
- Perl 对 C 的扩展接口
- 抽象类与接口的扩展功能
- Oracle9i中的监听动态注册
- 简述Linux 文件系统的目录结构
- const限定符
- sql server 与 oracle函数的对比
- Linux 文件和目录的属性
- 我的图像库的扩展接口
- DDR配置举例
- Ruby的头号Gem:Rake
- 如何在Delphi中调用.Net编写的DLL中的函数(Function)、过程(Procedure)
- 文件操作篇
- DbToCodeDemo示例项目源码DALFactory无法反射创建类实例的常见错误说明
- Bpel异步流程的构建与关联集
- 侯佩岑、林志玲发型对比,谁是台湾第1美女?
- 中国军车