ImgProcess.h
上传用户:gzboli
上传日期:2013-04-10
资源大小:471k
文件大小:2k
- // ImgProcess.h: interface for the CImgProcess class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_IMGPROCESS_H__77CC8C62_E478_465B_9F18_B22239E6A3C7__INCLUDED_)
- #define AFX_IMGPROCESS_H__77CC8C62_E478_465B_9F18_B22239E6A3C7__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "dibapi.h"
- // Definitions required for convolution image filtering
- #define KERNELCOLS 3
- #define KERNELROWS 3
- #define KERNELELEMENTS (KERNELCOLS * KERNELROWS)
- // local use macro
- #define PIXEL_OFFSET(i, j, nWidthBytes)
- (LONG)((LONG)(i)*(LONG)(nWidthBytes) + (LONG)(j)*3)
- //#define Point(x,y) lpPoints[(x)+(y)*nWidth]
- // struct for convolute kernel
- typedef struct
- {
- int Element[KERNELELEMENTS];
- int Divisor;
- } KERNEL;
- class CImgProcess
- {
- private:
- public:
- CImgProcess();
- virtual ~CImgProcess();
-
- // local function prototype
- static int compare(const void *e1, const void *e2);
- static void DoMedianFilterDIB(int *red, int *green, int *blue, int i, int j,
- WORD wBytesPerLine, LPSTR lpDIBits);
- static void DoConvoluteDIB(int *red, int *green, int *blue, int i, int j,
- WORD wBytesPerLine, LPSTR lpDIBits, KERNEL *lpKernel);
- static BOOL ConvoluteDIB(HDIB hDib, KERNEL *lpKernel, int Strength, int nKernelNum=1);
-
- static BOOL HighPassDIB(HDIB hDib, int Strength, int nAlgorithm);
- static BOOL LowPassDIB(HDIB hDib, int Strength, int nAlgorithm);
- static BOOL EdgeEnhanceDIB(HDIB hDib, int Strength, int nAlgorithm);
- static BOOL MedianFilterDIB(HDIB hDib);
- static BOOL ReverseDIB(HDIB hDib);
- static BOOL ErosionDIB(HDIB hDib, BOOL bHori);
- static BOOL DilationDIB(HDIB hDib, BOOL bHori);
- static BOOL MorphOpenDIB(HDIB hDib, BOOL bHori);
- static BOOL MorphCloseDIB(HDIB hDib, BOOL bHori);
- static BOOL ContourDIB(HDIB hDib, BOOL bHori);
- static BOOL ThinningDIB(HDIB hDib);
- static void GetPoints(int nWidth,int nHeight,BYTE *lpBits,BYTE *lpPoints);
- static void PutPoints(int nWidth,int nHeight,BYTE *lpBits,BYTE *lpPoints);
- static BOOL FFTDIB(HDIB hDIB);
- static BOOL DCTDIB(HDIB hDIB);
- static BOOL WALhDIB(HDIB hDIB);
-
- };
- #endif // !defined(AFX_IMGPROCESS_H__77CC8C62_E478_465B_9F18_B22239E6A3C7__INCLUDED_)