summaryrefslogtreecommitdiff
path: root/xorg_grabber.h
diff options
context:
space:
mode:
Diffstat (limited to 'xorg_grabber.h')
-rw-r--r--xorg_grabber.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/xorg_grabber.h b/xorg_grabber.h
new file mode 100644
index 0000000..54bbb8f
--- /dev/null
+++ b/xorg_grabber.h
@@ -0,0 +1,25 @@
+#ifndef __XORG_GRABBER_H__
+#define __XORG_GRABBER_H__
+
+#include <xcb/xcb.h>
+#include <opencv2/opencv.hpp>
+
+using namespace cv;
+
+class XorgGrabber
+{
+ public:
+ XorgGrabber(const char* win_title);
+ ~XorgGrabber();
+ void read(Mat& mat);
+
+ private:
+ xcb_connection_t* conn;
+ xcb_window_t grabbed_win;
+ int grab_width, grab_height;
+ xcb_screen_t* grab_screen;
+ xcb_get_image_reply_t* img;
+
+};
+
+#endif