summaryrefslogtreecommitdiff
path: root/xorg_grabber.h
blob: 54bbb8f29c817aecb2fa18b8fc4eb5b70698f2bd (plain)
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
#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