00001 #ifndef OVERLAY_WIDGET_H
00002 #define OVERLAY_WIDGET_H
00003
00006 #include <QWidget>
00007 #include <QX11Info>
00008
00009 #include <sys/ipc.h>
00010 #include <sys/shm.h>
00011
00012 #include <X11/Xlib.h>
00013 #include <X11/Xutil.h>
00014 #include <X11/Xatom.h>
00015 #include <X11/extensions/XShm.h>
00016 #include <X11/extensions/Xv.h>
00017 #include <X11/extensions/Xvlib.h>
00018
00019 #include <FCam/Image.h>
00020
00021 class OverlayWidget : public QWidget {
00022 public:
00023 OverlayWidget(QWidget *parent = NULL);
00024
00025
00026
00027 static QColor colorKey() {return QColor(0, 0, 0);}
00028
00029
00030 FCam::Image framebuffer();
00031
00032
00033 protected:
00034
00035 void paintEvent(QPaintEvent *e);
00036
00037 void initXv();
00038
00039 void checkImageSize();
00040
00041 Display *dpy;
00042
00043
00044 XvImage *yuv_image;
00045 FCam::Image framebuffer_;
00046
00047 XShmSegmentInfo yuv_shminfo;
00048 GC gc;
00049 int xv_port;
00050 };
00051
00052 #endif