geotrans.h

来自「一个基于matlab与vc混合编程小例子,对初学者非常有利」· C头文件 代码 · 共 59 行

H
59
字号
// GeoTrans.h: interface for the CGeoTrans class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GEOTRANS_H__526243D9_08A2_47D0_87CA_6AB2414B073D__INCLUDED_)
#define AFX_GEOTRANS_H__526243D9_08A2_47D0_87CA_6AB2414B073D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "DibObject.h"

// 常数π
#define PI 3.1415926535

//角度到弧度转化的宏
#define RADIAN(angle) ((angle)*PI/180.0) 

class CGeoTrans : public CObject  
{
	DECLARE_DYNCREATE(CGeoTrans)
public:
	//构造函数
	CGeoTrans();
	CGeoTrans( CDibObject * );
	//析构函数
	virtual ~CGeoTrans();
	//设置DibObject类对象
	void SetDibObjectClass( CDibObject * );

public:
	//图像旋转
	BOOL Rotate(int nRotateAngle = 0, BOOL bBilinear = TRUE, CDibObject *pDibObject = NULL);
	//图像缩放
	BOOL ZoomImage(float fXZoomRatio = 1.0, float fYZoomRatio = 1.0, BOOL bBilinear = TRUE, CDibObject *pDibObject = NULL);
	//图像转置
	BOOL Transpose(CDibObject *pDibObject = NULL);
	//图像镜像
	BOOL Mirror(BOOL bDirection = TRUE, CDibObject *pDibObject=NULL);
	//图像平移
	BOOL TranslationPixel(long lXOffset = 0, long lYOffset =0, CDibObject *pDibObject = NULL);
	//图像平移
	BOOL TranslationLine(long lXOffset = 0, long lYOffset = 0, CDibObject *pDibObject = NULL);

//诊断调试函数
#ifdef _DEBUG
	virtual void Dump( CDumpContext &dc) const;
	virtual void AssertValid() const;
#endif

protected:
	//用双线性插值算法
	unsigned char *Interpolation(int nWidth, int nHeight,  float x, float y, int nWidthBytes, int nMovedBits, unsigned char *pBits);
	CDibObject * m_pDibObject;
};

#endif // !defined(AFX_GEOTRANS_H__526243D9_08A2_47D0_87CA_6AB2414B073D__INCLUDED_)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?