forked from ImpulseAdventure/JPEGsnoop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJPEGsnoopDoc.h
175 lines (133 loc) · 5.15 KB
/
JPEGsnoopDoc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
// JPEGsnoop - JPEG Image Decoder & Analysis Utility
// Copyright (C) 2017 - Calvin Hass
// http://www.impulseadventure.com/photo/jpeg-snoop.html
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ==========================================================================
// CLASS DESCRIPTION:
// - JPEGsnoop SDI document class
//
// ==========================================================================
// JPEGsnoopDoc.h : interface of the CJPEGsnoopDoc class
//
#pragma once
#include "JPEGsnoopCore.h"
#include "FolderDlg.h"
#include "BatchDlg.h"
#define DOCLOG_MAX_LINES 30000
class CJPEGsnoopDoc : public CRichEditDoc
{
protected: // create from serialization only
CJPEGsnoopDoc();
DECLARE_DYNCREATE(CJPEGsnoopDoc)
// Attributes
public:
// Operations
public:
// Overrides
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual CRichEditCntrItem* CreateClientItem(REOBJECT* preo) const;
// Implementation
public:
virtual ~CJPEGsnoopDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
void SetupView(CRichEditView* pView);
int AppendToLog(CString strTxt, COLORREF sColor);
int InsertQuickLog();
CStatusBar* GetStatusBar();
void DoBatchProcess(CString strBatchDir,bool bRecSubdir,bool bExtractAll);
BOOL ReadLine(CString& strLine, int nLength, LONG lOffset = -1L);
void Reset();
BOOL Reprocess();
protected:
// Generated message map functions
protected:
DECLARE_MESSAGE_MAP()
private:
CSnoopConfig* m_pAppConfig; // Pointer to application config
// Input JPEG file
CFile* m_pFile;
ULONGLONG m_lFileSize;
// The following is a mirror of m_strPathName, but only set during Open
// This is used only during OnSaveDocument() to ensure that we are
// not overwriting our input file.
CString m_strPathNameOpened;
CRichEditView* m_pView; // Preserved reference to View
public:
// Allocate the processing core
// - Public access by CJPEGsnoopViewImg
CJPEGsnoopCore* m_pCore;
public:
// Public accessors from CJPEGsnoopApp
void J_ImgSrcChanged();
// Public accessors from CJPEGsnoopViewImg
void I_ViewOnDraw(CDC* pDC,CRect rectClient,CPoint ptScrolledPos,CFont* pFont, CSize &szNewScrollSize);
void I_GetPreviewPos(unsigned &nX,unsigned &nY);
void I_GetPreviewSize(unsigned &nX,unsigned &nY);
float I_GetPreviewZoom();
// Callback functions
static BYTE CbWrap_B_Buf(void* pWrapClass,
unsigned long nNum,bool bBool);
static void CbWrap_I_LookupFilePosPix(void* pWrapClass,
unsigned int nX, unsigned int nY, unsigned int &nByte, unsigned int &nBit);
public:
void DoGuiExtractEmbeddedJPEG();
private:
virtual void DeleteContents();
void RedrawLog();
public:
// OnOpenDocument() is public for View:OnDropFiles()
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
private:
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
afx_msg void OnFileOffset();
afx_msg void OnToolsDecode();
afx_msg void OnToolsAddcameratodb();
afx_msg void OnUpdateToolsAddcameratodb(CCmdUI *pCmdUI);
afx_msg void OnToolsSearchforward();
afx_msg void OnToolsSearchreverse();
afx_msg void OnUpdateToolsSearchforward(CCmdUI *pCmdUI);
afx_msg void OnUpdateToolsSearchreverse(CCmdUI *pCmdUI);
afx_msg void OnFileReprocess();
afx_msg void OnFileOpenimage();
afx_msg void OnFileSaveAs();
afx_msg void OnPreviewRng(UINT nID);
afx_msg void OnUpdatePreviewRng(CCmdUI *pCmdUI);
afx_msg void OnZoomRng(UINT nID);
afx_msg void OnUpdateZoomRng(CCmdUI * pCmdUI);
afx_msg void OnToolsSearchexecutablefordqt();
afx_msg void OnUpdateFileReprocess(CCmdUI *pCmdUI);
afx_msg void OnUpdateFileSaveAs(CCmdUI *pCmdUI);
afx_msg void OnToolsExtractembeddedjpeg();
afx_msg void OnUpdateToolsExtractembeddedjpeg(CCmdUI *pCmdUI);
afx_msg void OnToolsFileoverlay();
afx_msg void OnUpdateToolsFileoverlay(CCmdUI *pCmdUI);
afx_msg void OnToolsLookupmcuoffset();
afx_msg void OnUpdateToolsLookupmcuoffset(CCmdUI *pCmdUI);
afx_msg void OnOverlaysMcugrid();
afx_msg void OnUpdateOverlaysMcugrid(CCmdUI *pCmdUI);
afx_msg void OnUpdateIndicatorYcc(CCmdUI* pCmdUI);
afx_msg void OnUpdateIndicatorMcu(CCmdUI* pCmdUI);
afx_msg void OnUpdateIndicatorFilePos(CCmdUI* pCmdUI);
afx_msg void OnScansegmentDetaileddecode();
afx_msg void OnUpdateScansegmentDetaileddecode(CCmdUI *pCmdUI);
afx_msg void OnToolsExporttiff();
afx_msg void OnUpdateToolsExporttiff(CCmdUI *pCmdUI);
};