-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOverlayWidget.h
65 lines (51 loc) · 1.43 KB
/
OverlayWidget.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
#ifndef OVERLAY_WIDGET_H
#define OVERLAY_WIDGET_H
#include <QWidget>
#include <QX11Info>
#define __user
#include <linux/omapfb.h>
#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <FCam/Image.h>
class OverlayWidget : public QWidget {
Q_OBJECT;
public:
OverlayWidget(QWidget *parent = NULL);
~OverlayWidget();
// If you draw on a widget at the same place as this one, using
// any color but the one below, it will show through the overlay.
static QColor colorKey() {return QColor(12, 14, 3);}
// A reference to the frame buffer
FCam::Image framebuffer();
public slots:
void newViewfinderFrame();
void enable();
void disable();
signals:
void activate();
void deactivate();
void quit();
protected:
struct omapfb_color_key old_color_key;
void resizeEvent(QResizeEvent *);
void moveEvent(QMoveEvent *);
void showEvent(QShowEvent *);
void hideEvent(QHideEvent *);
bool eventFilter(QObject *receiver, QEvent *event);
virtual void drawUI() = 0;
virtual bool inputHandler(QMouseEvent *) = 0;
FCam::Image framebuffer_;
unsigned char *ptr;
unsigned char *cur;
//struct fb_var_screeninfo var_info;
struct fb_var_screeninfo overlay_info;
struct omapfb_mem_info mem_info;
struct omapfb_plane_info plane_info;
int overlay_fd;
};
#endif