-
Notifications
You must be signed in to change notification settings - Fork 0
/
rect.h
43 lines (40 loc) · 813 Bytes
/
rect.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
#ifndef RECT_H
#define RECT_H
#include <QDataStream>
#include <QMutex>
#include <QRect>
namespace DG{
class ScreenPacket;
}
namespace DG{
class Rect{
private:
static quint8 bytesPerPixel;
private:
mutable QMutex sMutex;
mutable QMutex uMutex;
public:
Rect();
Rect(quint32 left, quint32 top, quint32 width, quint32 height);
Rect(const DG::Rect& rect);
public:
quint32 left;
quint32 top;
quint32 width;
quint32 height;
public:
bool valid() const;
quint32 pixels() const;
quint64 size() const;
public:
Rect& operator=(const Rect& rect);
public:
ScreenPacket* packet(int state) const;
public:
friend QDataStream& operator<<(QDataStream&, const Rect& rect);
friend QDataStream& operator>>(QDataStream&, Rect& rect);
public:
QRect toQRect() const;
};
}
#endif // RECT_H