-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathJPEGsnoopDoc.h
189 lines (140 loc) · 5.1 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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// JPEGsnoop - JPEG Image Decoder & Analysis Utility
// Copyright (C) 2010 - 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/>.
//
// JPEGsnoopDoc.h : interface of the CJPEGsnoopDoc class
//
#pragma once
#include "JfifDecode.h"
#include "ImgDecode.h"
#include "WindowBuf.h"
#include "DocLog.h"
#include "FolderDlg.h"
#include "BatchDlg.h"
#define DOCLOG_MAX_LINES 30000
#define ITER_TEST_MAX 2000 //800
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);
void AddLine(CString strTxt);
void AddLineHdr(CString strTxt);
void AddLineHdrDesc(CString strTxt);
void AddLineWarn(CString strTxt);
void AddLineErr(CString strTxt);
void AddLineGood(CString strTxt);
int AppendToLog(CString str, COLORREF color);
int InsertQuickLog();
CStatusBar* GetStatusBar();
void recurseBatch(CString szPathName,bool bSubdirs);
void doBatchSingle(CString szFileName);
BOOL ReadLine(CString& strLine, int nLength, LONG lOffset = -1L);
BOOL AnalyzeOpen();
void AnalyzeClose();
void AnalyzeFileDo();
BOOL AnalyzeFile();
void Reset();
void Reprocess();
// Misc helper
// CString Dec2Bin(unsigned nVal,unsigned nLen);
unsigned short Swap16(unsigned short nVal);
public:
void batchProcess();
protected:
// Generated message map functions
protected:
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnToolsDecode();
public:
// Input JPEG file
CFile* m_pFile;
ULONGLONG m_lFileSize;
unsigned m_nDisplayRows;
// 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;
// Output log file
BOOL m_bFileOpened; // Have we opened up a file? (i.e. filename def'd)
unsigned m_nModeScanDetail; // Scan detail mode: 0=off, 1=select pt1, 2=select pt2, 3=done
private:
CRichEditView* m_pView; // Preserved reference to View
bool m_bLogQuickMode;
CStringArray m_saLogQuickTxt;
CUIntArray m_naLogQuickCol;
public:
//CAL! Made public temporarily so that I can access from CJPEGsnoopViewImg
CjfifDecode* m_pJfifDec;
CDocLog* m_pLog;
CwindowBuf* m_pWBuf;
CimgDecode* m_pImgDec;
public:
afx_msg void OnFileOffset();
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();
virtual void DeleteContents();
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
afx_msg void OnFileOpenimage();
void DoDirectSave(CString strLogName);
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);
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
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);
};