📄 dctwaterdoc.h
字号:
// DCTWaterDoc.h : interface of the CDCTWaterDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DCTWATERDOC_H__C22D8B00_5AB5_4A18_A02B_F496C3354009__INCLUDED_)
#define AFX_DCTWATERDOC_H__C22D8B00_5AB5_4A18_A02B_F496C3354009__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
///////////////My code begins/////////////
//Add a header file for getcwd function///////
#include<direct.h>
// These six header files are for "_open", "_read" and "_write" functions
//and string functions
#include <io.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
///////////////My code ends//////////////
#include "Watermethod.h"
class CDCTWaterDoc : public CDocument
{
protected: // create from serialization only
CDCTWaterDoc();
DECLARE_DYNCREATE(CDCTWaterDoc)
// Attributes
public:
///////////My code begins:To define some public variables and functions////////
//The variable for raw->bamp or vq->bmp transform
unsigned char m_StandardBmpInfo[1078];
//The initial successful flag
BOOL Success;
///////=======The Variables for Design=========////////////////
//The current working directory to save bok file
char m_CurrentDirectory[_MAX_PATH];
///////////=======The variables for encode&embed========////////////////
//The memory to save the opened raw image for encoding
unsigned char m_OriginalImageBytes[MAXIMAGESIZE];
unsigned char m_OriginalImageBytes1[MAXIMAGESIZE/4];
unsigned char m_OriginalImageBytes2[MAXIMAGESIZE/4];
unsigned char m_OriginalImageBytes3[MAXIMAGESIZE/4];
unsigned char m_OriginalImageBytes4[MAXIMAGESIZE/4];
//The memory to display the opened raw image(in bmp style)
unsigned char m_DisplayImageBytes[MAXIMAGESIZE+1078];
//The opened raw image size to be encoded
unsigned long int m_OriginalImageSize;
//The width of the opened raw image for encoding
unsigned short int m_OriginalImageWidth;
//The height of the opened raw image for encoding
unsigned short int m_OriginalImageHeight;
//The encode result:MSE
double m_EmbededMSE;
//The encode result:PSNR
double m_EmbededPSNR;
//The encode result:CPU Time
double m_EmbededTime;
//The embed algorithm
int m_EmbedMethod;
//The subsampled image flag
BOOL m_Subsampled1;
BOOL m_Subsampled2;
BOOL m_Subsampled3;
BOOL m_Subsampled4;
//The emded finished flag
BOOL m_Embeded0;
BOOL m_Embeded1;
//The information embeded
int *key1;
int *key2;
double mean1[16];
//////=====Variables for watermark preprocessing=====/////////////
//The original watermark opened flag
BOOL m_OriginalWatermarkOpened;
BOOL m_OriginalWatermarkOpened1;
//The permuted Flag
BOOL m_Permuted;
BOOL m_Permuted1;
//The memory of the original watermark
unsigned char m_OriginalWatermark[16384];
unsigned char m_OriginalWatermark1[16384];
//The memory of the permuted watermark
unsigned char m_PermutedWatermark[16384];
unsigned char m_PermutedWatermark1[16384];
//The memory of the original watermark(in bmp style)
unsigned char m_OriginalWatermarkBytes[MAXWATERMARKSIZE+62];
unsigned char m_OriginalWatermarkBytes1[MAXWATERMARKSIZE+62];
//The memory of the permuted watermark(in bmp style)
unsigned char m_PermutedWatermarkBytes[MAXWATERMARKSIZE+62];
unsigned char m_PermutedWatermarkBytes1[MAXWATERMARKSIZE+62];
//The key of permutation
long int *keyA;
long int *keyB;
///////////=======The variables for extraction========////////////////
//The memory to save the decoded image
unsigned char m_EmbededImageBytes[MAXIMAGESIZE];
unsigned char m_EmbededImageBytes1[MAXIMAGESIZE/4];
unsigned char m_EmbededImageBytes2[MAXIMAGESIZE/4];
unsigned char m_EmbededImageBytes3[MAXIMAGESIZE/4];
unsigned char m_EmbededImageBytes4[MAXIMAGESIZE/4];
//The memory to display the decoded image
unsigned char m_DisplayImageBytes1[MAXIMAGESIZE+1078];
unsigned char m_DisplayImageBytes11[MAXIMAGESIZE/4+1078];
unsigned char m_DisplayImageBytes12[MAXIMAGESIZE/4+1078];
unsigned char m_DisplayImageBytes13[MAXIMAGESIZE/4+1078];
unsigned char m_DisplayImageBytes14[MAXIMAGESIZE/4+1078];
//The memory to save the extracted image
unsigned char m_ExtractedWatermark[16384];
unsigned char m_ExtractedWatermark1[16384];
//The memory to display the extracted image
unsigned char m_ExtractedWatermarkBytes[MAXWATERMARKSIZE+62];
unsigned char m_ExtractedWatermarkBytes1[MAXWATERMARKSIZE+62];
//The extraction finished flag
BOOL m_Extracted;
BOOL m_Extracted1;
HGLOBAL Keymem;
///////////=======The variables for attack========////////////////
//The memory to save the attacked watermark
unsigned char m_AttackedWatermark[16384];
unsigned char m_AttackedWatermark1[16384];
//The memory to save the attacked image
unsigned char m_AttackedImageBytes[MAXIMAGESIZE];
unsigned char m_AttackedImageBytes1[MAXIMAGESIZE];
unsigned char m_AttackedImage1[MAXIMAGESIZE/4];
unsigned char m_AttackedImage2[MAXIMAGESIZE/4];
unsigned char m_AttackedImage3[MAXIMAGESIZE/4];
unsigned char m_AttackedImage4[MAXIMAGESIZE/4];
//The memory to display the attacked watermark
unsigned char m_AttackedWatermarkBytes[MAXWATERMARKSIZE+62];
unsigned char m_AttackedWatermarkBytes1[MAXWATERMARKSIZE+62];
//The memory to display the attacked image
unsigned char m_DisplayImageBytes2[MAXIMAGESIZE+1078];
//The flag to judge if the attacked image is opened
BOOL m_AttackedImageOpened;
//The flag to judge if the attacked watermark is extracted
BOOL m_AttackExtracked;
BOOL m_AttackExtracked1;
///////////My code ends:To define some public variables and functions////////
CWatermethod watermethod;
virtual ~CDCTWaterDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVqwaterDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual void SetTitle(LPCTSTR lpszTitle);
//}}AFX_VIRTUAL
// Generated message map functions
protected:
//{{AFX_MSG(CDCTWaterDoc)
afx_msg void OnUpdateFileSaveAs(CCmdUI* pCmdUI);
afx_msg void OnUpdateFilePrint(CCmdUI* pCmdUI);
afx_msg void OnUpdateFilePrintPreview(CCmdUI* pCmdUI);
afx_msg void OnUpdateFilePrintSetup(CCmdUI* pCmdUI);
afx_msg void OnUpdateEmbedEmbed(CCmdUI* pCmdUI);
afx_msg void OnUpdateExtractExtract(CCmdUI* pCmdUI);
afx_msg void OnEmbedMehod1();
afx_msg void OnEmbedMehod2();
afx_msg void OnEmbedMehod3();
afx_msg void OnEmbedMehod4();
afx_msg void OnUpdateEmbedMehod1(CCmdUI* pCmdUI);
afx_msg void OnUpdateEmbedMehod2(CCmdUI* pCmdUI);
afx_msg void OnUpdateEmbedMehod3(CCmdUI* pCmdUI);
afx_msg void OnUpdateEmbedMehod4(CCmdUI* pCmdUI);
afx_msg void OnEmbedMehod5();
afx_msg void OnUpdateEmbedMehod5(CCmdUI* pCmdUI);
afx_msg void OnEmbedMehod6();
afx_msg void OnUpdateEmbedMehod6(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DCTWATERDOC_H__C22D8B00_5AB5_4A18_A02B_F496C3354009__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -