⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hyperspectraldatacompressdlg.h

📁 改进的JPEG-LS算法
💻 H
字号:
// HyperspectralDataCompressDlg.h : header file
//

#if !defined(AFX_HYPERSPECTRALDATACOMPRESSDLG_H__5DB6A6DC_72B2_4536_A03A_2FB674F4AF24__INCLUDED_)
#define AFX_HYPERSPECTRALDATACOMPRESSDLG_H__5DB6A6DC_72B2_4536_A03A_2FB674F4AF24__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define MAXBANDNUMBER	512//最大波段数
#define MIN_LINES_PER_BLOCK		64//每个压缩数据块包含图像最小行数
#define MAX_LINES_PER_BLOCK		512//每个压缩数据块包含图像最大行数
#define BSQ_AUXDATA_WIDTH		24//BSQ高光谱图像格式数据中每个图像行所包含的辅助数据默认宽度(以象素数为单位)
#define BFILE_AUXDATA_WIDTH		0
#define BIP_AUXDATA_WIDTH		0
#define BIL_AUXDATA_WIDTH		0
/////////////////////////////////////////////////////////////////////////////
// CHyperspectralDataCompressDlg dialog
#define WM_USER_HYPERSPECTRAL_COMPRESS_DLG (WM_USER+2)
class HyperspectralCompressThread;
class HyperspectralTestRelativeThread;
class CHyperspectralDataCompressDlg : public CDialog
{
// Construction
public:
	CHyperspectralDataCompressDlg(CWnd* pParent = NULL);	// standard constructor
	CString lpImageFile[MAXBANDNUMBER];//纯图像方式时,单波段图像文件名
	int AllDataWidth;//连同辅助数据一起图像行总宽度
	int FileNumber;//输入文件数(纯图像方式时就是波段数,高光谱图像格式时是1)
	int	m_AllowMaxErr;//最大允许误差
	CString PredictBandList;//预测波段配置[波段号(-1是不预测,其它则为预测波段号)]
	BOOL CompressComplete;//压缩完成标志(区别于终止压缩过程)
	BOOL PureImageFormat;//纯图像格式标志
	HyperspectralCompressThread *m_pCompressThread;//压缩过程运行线程
	BOOL CompressThreadRun;//压缩过程运行标志
	HyperspectralTestRelativeThread *m_pTestRelativeThread;//相关系数矩阵计算过程运行线程
	BOOL TestRelativeThreadRun;//相关系数矩阵计算过程运行标志
	BOOL TestRelativeComplate;//相关系数矩阵计算过程运行完成标志
	double ErrMse,BitPerPixel;//均方误差及单象素比特统计量
	int AllowMaxErrBgn,AllowMaxErrEnd,AllowMaxErrStep;//用于连续误差界下测试程序
	CString Report;
	BOOL AllowReport;

	//预测波段更新过程
	void UpdateControlList(BOOL UpdateMode);
	//从字符串中获得下一个数据项位置
	int GetNextDataSeat(LPCTSTR lpAsc,LPSTR lpOne,int &Seat);
	//初始化预测波段串
	void InitPredictBandString();
	//压缩过程
	void OkCompressProce();
	//相关系数矩阵计算过程
	void OkTestRelativeProce();
	//计算一行图像的均方值及均值(用于相关系数矩阵的计算)
	void StatisticOneLineImage(LPBYTE lpImageLine1,//图像行1
							   int BytesPerPixel,//图像象素字节数
							   int OneLineWidth,//图像行宽度
							   double &Mse1,//图像行1平均平方和
							   double &M1);//图像行1平均值
	//计算一两图像行的相关函数值(用于相关系数矩阵的计算)
	void StatisticOneLineTwoImage(LPBYTE lpImageLine1,//图像行1
								LPBYTE lpImageLine2,//图像行2
								int BytesPerPixel,//图像象素字节数
								int OneLineWidth,//图像行宽度
								double &Relative);//平均相关函数
	CString GetCompressFileName(CString &InputFileName);//根据输入文件名和最大允许误差产生压缩数据文件名
	void OutString(CString str,LPCTSTR lpOutFile=NULL);
	BOOL OnOffBandPredict();
// Dialog Data
	//{{AFX_DATA(CHyperspectralDataCompressDlg)
	enum { IDD = IDD_HYPERSPECTRALDATACOMPRESS_DIALOG };
	CListCtrl	m_RelativeList;	
	int		m_AuxDataWidth;//辅助数据宽度
	int		m_BandNumber;//预测数
	int		m_BitsPerPixel;//每象素所包含的比特数
	int		m_BytesPerPixel;//每象素所包含的字节数
	CString	m_ComperssFileName;//压缩数据文件名
	CString	m_CompressRateString;//压缩比显示
	int		m_ImageHeight;//图像高度
	int		m_ImageWidth;//图像宽度
	CString	m_InputFileName;//输入的高光谱图像文件名
	int		m_LinesPerBlock;//每个压缩块所含图像行数
	CString	m_MaxErrString;//最大误差显示
	CString	m_NoticeString;//用于运行提示
	CString	m_PSNRString;//PSNR显示
	CString	m_RateString;//码率显示
	CString	m_NoticeNumberString;//运行进度提示
	CString	m_AllowMaxErrorString;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CHyperspectralDataCompressDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CHyperspectralDataCompressDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnDestroy();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnClose();
	afx_msg void OnCompressCancel();
	afx_msg void OnKillfocusCompressFileName();
	afx_msg void OnCompressOk();
	afx_msg void OnMulbandImageFilenameFindButton();
	afx_msg void OnOmisIPredictBand();
	afx_msg void OnOmisIiPredictBand();
	afx_msg void OnTestPredictBand();
	afx_msg void OnKillfocusAuxDataWidth();
	afx_msg void OnKillfocusLinesPerBlock();
	afx_msg void OnDblclkCompressRelativeList(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnKillfocusImageWidth();
	afx_msg void OnKillfocusAllowMasError();
	afx_msg void OnKillfocusCompressRelativeList(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	LRESULT OnSmallEditRecvMessage(WPARAM wParam, LPARAM lParam);
	LRESULT OnHyperspectralDataCompressRecvMessage(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
};



/////////////////////////////////////////////////////////////////////////////
// HyperspectralCompressThread thread

class HyperspectralCompressThread : public CWinThread
{
	DECLARE_DYNCREATE(HyperspectralCompressThread)
protected:

// Attributes
public:
	HyperspectralCompressThread();           // protected constructor used by dynamic creation
	CHyperspectralDataCompressDlg* m_pOwner;
	BOOL m_bDone;
	void SetOwner(CHyperspectralDataCompressDlg* pOwner) { m_pOwner = pOwner; };
	virtual ~HyperspectralCompressThread();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(HyperspectralCompressThread)
	public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();
	virtual int Run();
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(HyperspectralCompressThread)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

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


/////////////////////////////////////////////////////////////////////////////
// HyperspectralTestRelativeThread thread

class HyperspectralTestRelativeThread : public CWinThread
{
	DECLARE_DYNCREATE(HyperspectralTestRelativeThread)
protected:

// Attributes
public:
	HyperspectralTestRelativeThread();           // protected constructor used by dynamic creation
	CHyperspectralDataCompressDlg* m_pOwner;
	BOOL m_bDone;
	void SetOwner(CHyperspectralDataCompressDlg* pOwner) { m_pOwner = pOwner; };
	virtual ~HyperspectralTestRelativeThread();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(HyperspectralTestRelativeThread)
	public:
	virtual BOOL InitInstance();
	virtual int ExitInstance();
	virtual int Run();
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(HyperspectralTestRelativeThread)
		// NOTE - the ClassWizard will add and remove member functions here.
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_HYPERSPECTRALDATACOMPRESSDLG_H__5DB6A6DC_72B2_4536_A03A_2FB674F4AF24__INCLUDED_)

⌨️ 快捷键说明

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