-
Notifications
You must be signed in to change notification settings - Fork 0
/
einkscreen.h
37 lines (29 loc) · 953 Bytes
/
einkscreen.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
#ifndef EINKSCREEN_H
#define EINKSCREEN_H
#include <QScreen>
#include <QPainter>
class QEInkScreen : public QScreen
{
public:
QEInkScreen(int displayId);
~QEInkScreen() {}
bool connect(const QString &displaySpec);
void disconnect();
bool initDevice();
void shutdownDevice();
void blit(const QImage &image, const QPoint &topLeft, const QRegion ®ion);
void solidFill(const QColor &color, const QRegion ®ion);
void exposeRegion(QRegion region, int changing);
void setMode(int nw, int nh, int nd);
private:
bool _openFramebuffer(const QString& filename, int *fb, unsigned char **buffer, unsigned char **prebuffer);
unsigned int _fbShift(int x, int y);
void _fillPoint(unsigned char colorSpec, int x, int y);
private:
QString _displaySpec;
protected:
int d_fd, i_fd;
unsigned char *d_buffer, *i_buffer, *d_prebuffer, *i_prebuffer;
size_t buffer_len;
};
#endif // EINKSCREEN_H