Click here to Skip to main content
12,510,006 members (52,878 online)
Click here to Skip to main content

Stats

154.3K views
2.2K downloads
42 bookmarked
Posted

Convolution of Bitmaps

, 29 Mar 2006
Article discussing how to convolve images, specificially the convolution of bitmaps.
// ImageConvolutionView.h : interface of the CImageConvolutionView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_IMAGECONVOLUTIONVIEW_H__4B554328_1B29_4E24_9A47_1497402C76A1__INCLUDED_)
#define AFX_IMAGECONVOLUTIONVIEW_H__4B554328_1B29_4E24_9A47_1497402C76A1__INCLUDED_

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

#include "ImageConvolutionDoc.h"

class CImageConvolutionView : public CView
{
protected: // create from serialization only
	CImageConvolutionView();
	DECLARE_DYNCREATE(CImageConvolutionView)

// Attributes
public:
	CImageConvolutionDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CImageConvolutionView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	//}}AFX_VIRTUAL

// Implementation
public:
	COLORREF Convolve(CDC* dc, int sourcex, int sourcey, float kernel[3][3], int nBias,BOOL bGrayscale=FALSE);
	void ConvolveImage(float kernel[3][3], int nBias);
	virtual ~CImageConvolutionView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	float m_kernel[3][3];
	int m_nBias;
	//{{AFX_MSG(CImageConvolutionView)
		// 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()
};

#ifndef _DEBUG  // debug version in ImageConvolutionView.cpp
inline CImageConvolutionDoc* CImageConvolutionView::GetDocument()
   { return (CImageConvolutionDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_IMAGECONVOLUTIONVIEW_H__4B554328_1B29_4E24_9A47_1497402C76A1__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Fred Ackers
Web Developer
United States United States
Programming using MFC and ATL for almost 12 years now. Currently studying Operating System implementation as well as Image processing. Previously worked on DSP and the use of FFT for audio application. Programmed using ADO, ODBC, ATL, COM, MFC for shell interfacing, databasing tasks, Internet items, and customization programs.

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160929.1 | Last Updated 29 Mar 2006
Article Copyright 2004 by Fred Ackers
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid