31 lines
447 B
C++
31 lines
447 B
C++
#pragma once
|
|
|
|
#include <opencv2/opencv.hpp>
|
|
|
|
#include <X11/Xlib.h>
|
|
#include <X11/Xutil.h>
|
|
|
|
#include <X11/extensions/XShm.h>
|
|
#include <sys/ipc.h>
|
|
#include <sys/shm.h>
|
|
|
|
class ScreenShot {
|
|
private:
|
|
Display* display = nullptr;
|
|
Window root;
|
|
XWindowAttributes window_attributes;
|
|
XImage* ximg = nullptr;
|
|
XShmSegmentInfo shminfo;
|
|
|
|
int x, y, width, height;
|
|
|
|
bool init;
|
|
|
|
public:
|
|
|
|
ScreenShot();
|
|
~ScreenShot();
|
|
|
|
void operator() (cv::Mat& cvimg);
|
|
|
|
}; |