blob: abe591b4f50562537d71e52e2c1f72e57071b9b5 (
plain)
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
|
#pragma once
#include <QtWidgets/QWidget>
#include <QtGui/QImage>
#include <thread>
#include "uitypes.h"
class EntropyThread
{
BinaryViewRef m_data;
QImage m_image;
size_t m_blockSize;
bool m_updated, m_running;
std::thread m_thread;
public:
EntropyThread(BinaryViewRef data, int width, size_t blockSize);
~EntropyThread();
void Run();
bool IsUpdated() { return m_updated; }
void ResetUpdated() { m_updated = false; }
const QImage& GetImage() { return m_image; }
};
class TriageView;
class EntropyWidget: public QWidget
{
TriageView* m_view;
BinaryViewRef m_data, m_rawData;
size_t m_blockSize;
int m_width;
EntropyThread* m_thread;
public:
EntropyWidget(QWidget* parent, TriageView* view, BinaryViewRef data);
virtual ~EntropyWidget();
virtual QSize sizeHint() const override;
protected:
virtual void paintEvent(QPaintEvent* event) override;
virtual void mousePressEvent(QMouseEvent* event) override;
private Q_SLOTS:
void timerExpired();
};
|