-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.h
96 lines (76 loc) · 1.85 KB
/
app.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
#ifndef _APPLICATION_H_
#define _APPLICATION_H_
#include "common.h"
#include <QMainWindow>
#include <QScrollArea>
#include <QPixmap>
#include <QComboBox>
#include <QCheckBox>
class QLabel;
class QAction;
#define REALTIME_UPDATE 0
class ZPartitionInfo
{
public:
ZPartitionInfo(int w, int h, int partitions, const ZPartitionInfo* pExtra0 = nullptr, const ZPartitionInfo* pExtra1 = nullptr);
~ZPartitionInfo();
static const int patterns = 1024;
struct SSimilar
{
void Init()
{
set = -1;
pattern = -1;
}
int set;
int pattern;
};
void CalcPatterns();
QPixmap* CreatePixmap(uint nGUIWidth, uint size, int hideDupes, int showCrossDupes);
int CheckUnique(int pattern);
ZPartitionInfo::SSimilar CheckCrossDupes(int pattern, const ZPartitionInfo* pExtra0, const ZPartitionInfo* pExtra1) const;
bool Test(const uint8* curblock, uint& idx) const;
int NumUnique() const { return 1024 - mnNumDupes; }
int mnWidth;
int mnHeight;
int mnNumPartitions;
uint8* mpPartitions;
uint8 maNumActualPartitions[1024];
int maDupes[1024]; // Refers to the unique id. -1 if unique
SSimilar maSimilar[1024];
int mnNumDupes;
int mnNumCrossDupes;
int manPartitionUsage[4];
};
class ZASTC : public QMainWindow
{
Q_OBJECT
public:
ZASTC(QWidget* parent = NULL);
virtual ~ZASTC();
#if REALTIME_UPDATE
void resizeEvent(QResizeEvent *event);
#endif
void CreatePixmap(uint size, int hideDupes);
public slots:
void BlockSize(int size);
void Partitions(int size);
void Dupes(int show);
void Save();
void about();
void aboutQt();
public:
ZPartitionInfo* mpInfo;
QScrollArea* mpScrollArea;
QPixmap* mpPixmap;
QLabel* mpImageLabel;
QComboBox* mpBlockSize;
QComboBox* mpPartitions;
QCheckBox* mpDupes;
QCheckBox* mpCrossDupes;
QLabel* mpDupeStats;
int mnNumPartitions;
QAction* mActionAbout;
QAction* mActionAboutQt;
};
#endif