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

📄 watermarkxview.h

📁 一篇有关数字水印的程序
💻 H
字号:
// WaterMarkView.h : interface of the CWaterMarkxView class
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INCLUDES()
//#include "labelcontrol.h"
//}}AFX_INCLUDES

#if !defined(AFX_WATERMARKVIEW_H__19462CA7_2941_4AC4_9DC6_91A2237D4262__INCLUDED_)
#define AFX_WATERMARKVIEW_H__19462CA7_2941_4AC4_9DC6_91A2237D4262__INCLUDED_

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

#include "engine.h"	
#include "matlab.hpp"
#include "BusyDlg.h"
#include "Information.h"
#include "dibapi.h"



class CBusyDlg;
class CInformation;

class CWaterMarkxView : public CFormView
{

private: 
	CInformation infor;	
	CBusyDlg busydlg;
	int A;              //         %0的嵌入强度因子
	int B;              //         %1的嵌入强度因子
	int G;               //         %嵌入强度因子

	int blocksize;           //    %原始图像分块系数大小
	int watersize;           //    %水印分块系数大小

 	mwArray h_a;	  //图形对话框子窗口句柄
	mwArray h_fig ;	   //图形对话框窗口句柄
 	mwArray Im_filename;  //原始图像文件名
	mwArray EIm_filename; // 嵌入水印后的图像文件名	 
	mwArray Water_filename; //水印图像文件名
	mwArray I,W,EI,EI_1,EWI2; 
	CString Filename;//包含路径
	CString Filetype;
	CTime startime,endtime;
	CTimeSpan costime; 	
	int bWait;	
	int bfont;	
	int bshow,binsert; // 控制嵌入水印流程菜单项的显示
	int bdishow,bcheck; //	控制检测水印流程菜单项的显示
	int bsave_I,bsave_C;
	int i_Mc,i_Nc,i_Mw,i_Nw;
	int water_block,i_max_message; 
	mwArray Mc,Nc,Mw,Nw,max_message;

	HDIB m_OriginHDIB;
	HDIB m_SuiyinHDIB;
	HDIB m_QianruHDIB;
	HDIB m_TiquHDIB;

	CRect m_rectInitImage;
	CRect m_rectSuiyin;
	CRect m_rectQianruSuiyin;
	CRect m_rectTiquSuiyin;

	CPalette* m_OriginpalDIB;
	CPalette* m_SuiyinpalDIB;

	DWORD m_OriginImageSize;
	DWORD m_SuiyinImageSize;

protected: // create from serialization only
	CWaterMarkxView();
	CalImageLocation();
	void CopyHDIB(HDIB SourceHDIB,HDIB ObjectHDIB,long nCount);
	void OnInitData();
	DECLARE_DYNCREATE(CWaterMarkxView)

public:
	//{{AFX_DATA(CWaterMarkxView)
	enum { IDD = IDD_WATERMARKX_FORM };
	CLabelControl	m_sim;
	CLabelControl	m_psnr;
	CLabelControl	m_time;
	CLabelControl	m_cq;
	CLabelControl	m_title;
	CLabelControl	m_nc;
	//}}AFX_DATA

// Attributes
public:
	CWaterMarkxDoc* GetDocument();

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CWaterMarkxView)
	public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnDraw(CDC* pDC);
	//}}AFX_VIRTUAL

// Implementation
public:
	mwArray NC(mwArray Im_original,mwArray Im_modified);
	void GetCoef(mwArray Im_original,int m,int n, mwArray Im_modified);
	mwArray CQ(mwArray Im_original,mwArray Im_modified);
	mwArray Similar(mwArray Im_original,mwArray Im_modified);
	mwArray PSNR(mwArray Im_original,int m,int n,mwArray Im_modified);
	void OpenFileDlg(int model);
	void CreatFigDlg();
	virtual ~CWaterMarkxView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif


private:
	
	void DCTCheck();
	void DCTWater();
	mwArray Get_h(mwArray strFigName, mwArray BKColor, mwArray strVisible);
	void SetVisible(mwArray h_a, mwArray strVisible);   

// Generated message map functions
protected:
	//{{AFX_MSG(CWaterMarkxView)
	afx_msg void OnDestroy();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnPaint();
	afx_msg void OnClose();
	afx_msg void OnWaterInsert();
	afx_msg void OnWaterDistill();
	afx_msg void OnFileOpen(); 
	afx_msg void OnFileOpenWater();
	afx_msg void OnDistillOpen();
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnUpdateFileOpen(CCmdUI* pCmdUI);
	afx_msg void OnUpdateFileOpenWater(CCmdUI* pCmdUI);
	afx_msg void OnUpdateWaterInsert(CCmdUI* pCmdUI);
	afx_msg void OnUpdateWaterDistill(CCmdUI* pCmdUI);
	afx_msg void OnUpdateDistillOpen(CCmdUI* pCmdUI);
	afx_msg void OnFileSaveqianru();
	afx_msg void OnUpdateFileSaveqianru(CCmdUI* pCmdUI);
	afx_msg void OnFileSaveshuiyin();
	afx_msg void OnUpdateFileSaveshuiyin(CCmdUI* pCmdUI);
	afx_msg void OnAssaultTest();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in WaterMarkView.cpp
inline CWaterMarkxDoc* CWaterMarkxView::GetDocument()
   { return (CWaterMarkxDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_WATERMARKVIEW_H__19462CA7_2941_4AC4_9DC6_91A2237D4262__INCLUDED_)

⌨️ 快捷键说明

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