convolutionfilter.h

来自「visual c++数字图像与图形处理中的光盘内容」· C头文件 代码 · 共 57 行

H
57
字号
/////////////////////////////////////////////////////////////////////////////////
//
//	ConvolutionFilter.h: interface for the CConvolutionFilter class.
//
////////////////////////////////////////////////////////////////////////////////
// 版权所有(2000)
// Copyright(2000)
// 编写者: 向世明
// Author: Xiang Shiming



//统一的卷积处理类

#ifndef _CCNVLTFILTER_H
#define _CCNVLTFILTER_H

#ifndef _CIMGAREAPROCESS_H
#include "ImageAreaProcess.h"
#endif
	 
class CConvolutionFilter  : public  CImageAreaProcess
{
DECLARE_DYNAMIC(CConvolutionFilter)
public:
	CConvolutionFilter();
	virtual ~CConvolutionFilter();

protected:

	//卷积系数权重;
	int m_nKernelWeight;

	////卷积核, 一个 m_nRows 行, m_nCols 列矩阵, 用一维数组表示
	int* m_pnKernel;	

protected:
	PIXELCOLORRGB FilterPixelInner(LPBYTE lpbyBitsSrc32,  int x,  int y,  int nScanWidth,  int nScanHeight);
	PIXELCOLORRGB FilterPixelOnBorder(LPBYTE lpbyBitsSrc32, int x, int y, int nScanWidth, int nScanHeight);
	virtual PIXELCOLORRGB Convolute(BYTE *pbyRed, BYTE *pbyGreen, BYTE *pbyBlue,  int nNum);
	
public:
	void SetKernelWeight(int nKernelWeight);
	

	BOOL Filter(LPBYTE lpbyBits32,  int x,  int y,  int nWidth,  int nHeight,  int nScanWidth,  int nScanHeight);
	
	void SetKernel(const int* pnKernel, int nRows, int nCols);
	virtual void SetOperation(DWORD dwOperation);

	#ifdef _DEBUG
	virtual void Dump(CDumpContext& dc) const;
	virtual void AssertValid() const;
	#endif
};

#endif 

⌨️ 快捷键说明

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