Dib.h
上传用户:pass2008
上传日期:2021-07-05
资源大小:3299k
文件大小:2k
- #pragma once
- //cximage.lib
- //cximagecrtd.lib
- //jasper.lib
- //jbig.lib
- //Jpeg.lib
- //libdcr.lib
- //mng.lib
- //png.lib
- //Tiff.lib
- //zlib.lib
- class CDib
- {
- public:
- CDib(void);
- public:
- virtual ~CDib(void);
- public:
- BOOL imageLoadOperation(LPCTSTR lpszPathName, UINT nOperatorSel);
- private:
- enum nImageFormat{
- IMG_FORMAT_BMP,
- IMG_FORMAT_JPEG,
- IMG_FORMAT_GIF,
- IMG_FORMAT_PNG,
- IMG_FORMAT_TIFF,
- IMG_FORMAT_DEFAULT
- };
- unsigned char* m_pDib;
- unsigned char* m_pDibBits;
- DWORD m_dwDibSize;
- BITMAPINFOHEADER *m_pBIH;
- RGBQUAD *m_pPalette;
- CPalette m_Palette;
- int m_nPaletteEntries;
- int m_Width;
- int m_Height;
- int analysisImageFormat(LPCTSTR lpszPathName); //只分析以上五种图像格式
- BOOL loadIntoMemory(LPCTSTR lpszPathName);
- CString alterFileExtension(LPCTSTR lpszPathName, int nImgFormat);
- BOOL saveAfterProcess(LPCTSTR lpszPathName);
- BOOL imageEdgeOperation(UINT nOperatorSel);
- BOOL LaplaceOperator(void); // <1> laplace算子
- BOOL CannyOperator(double sigma, double dRatLow, double dRatHigh); // <2> canny算子
- void CreatGauss(double sigma, double** pdKernel, int* pnWidowSize);
- void GaussianSmooth(unsigned char* pResult, double sigma);
- void Grad(unsigned char* pGray, int* pGradX, int* pGradY, int* pMag);
- void NonmaxSuppress(int* pMag, int* pGradX, int* pGradY, unsigned char* pNSRst);
- void Hysteresis(int* pMag, double dRatLow, double dRatHigh, unsigned char* pResult);
- void EstimateThreshold(int* pMag, int* pThrHigh, int* pThrLow, unsigned char* pGray, double dRatHigh, double dRatLow);
- void TraceEdge(int y, int x, int nThrLow, unsigned char* pResult, int* pMag);
- };