hyperion.ng/src/hyperion-x11/X11Grabber.h
T. van der Zwan 8e446bf883 Implemented the X11-grabber (based on v4l code).
Former-commit-id: 17ad66ff7e2a1e3fae2d853e5360f791934b6563
2014-01-30 12:35:29 +00:00

38 lines
618 B
C++

// Hyperion-utils includes
#include <utils/Image.h>
#include <utils/ColorRgb.h>
// X11 includes
#include <X11/Xlib.h>
class X11Grabber
{
public:
X11Grabber(const unsigned cropHorizontal, const unsigned cropVertical, const unsigned pixelDecimation);
virtual ~X11Grabber();
int open();
Image<ColorRgb> & grab();
private:
const unsigned _pixelDecimation;
const unsigned _cropWidth;
const unsigned _cropHeight;
/// Reference to the X11 display (nullptr if not opened)
Display * _x11Display;
unsigned _screenWidth;
unsigned _screenHeight;
Image<ColorRgb> _image;
int updateScreenDimensions();
};