2016-07-24 15:18:34 +02:00
|
|
|
#pragma once
|
|
|
|
|
2016-08-11 07:13:55 +02:00
|
|
|
#include <hyperion/GrabberWrapper.h>
|
2017-08-12 07:55:32 +02:00
|
|
|
#include <grabber/X11Grabber.h>
|
|
|
|
// some include of xorg defines "None" this is also used by QT and has to be undefined to avoid collisions
|
|
|
|
#ifdef None
|
|
|
|
#undef None
|
|
|
|
#endif
|
2016-07-24 15:18:34 +02:00
|
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
/// The X11Wrapper uses an instance of the X11Grabber to obtain ImageRgb's from the
|
|
|
|
/// displayed content. This ImageRgb is processed to a ColorRgb for each led and commmited to the
|
|
|
|
/// attached Hyperion.
|
|
|
|
///
|
2016-08-11 07:13:55 +02:00
|
|
|
class X11Wrapper: public GrabberWrapper
|
2016-07-24 15:18:34 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
/// Constructs the framebuffer frame grabber with a specified grab size and update rate.
|
|
|
|
///
|
|
|
|
/// @param[in] device X11 device name/path
|
|
|
|
/// @param[in] grabWidth The width of the grabbed image [pixels]
|
|
|
|
/// @param[in] grabHeight The height of the grabbed images [pixels]
|
|
|
|
/// @param[in] updateRate_Hz The image grab rate [Hz]
|
|
|
|
///
|
2018-12-27 23:11:32 +01:00
|
|
|
X11Wrapper(int cropLeft, int cropRight, int cropTop, int cropBottom, int pixelDecimation, const unsigned updateRate_Hz);
|
2016-07-24 15:18:34 +02:00
|
|
|
|
2020-07-12 18:27:24 +02:00
|
|
|
///
|
|
|
|
/// Destructor of this framebuffer frame grabber. Releases any claimed resources.
|
|
|
|
///
|
|
|
|
~X11Wrapper() override;
|
|
|
|
|
2016-07-24 15:18:34 +02:00
|
|
|
public slots:
|
|
|
|
///
|
|
|
|
/// Performs a single frame grab and computes the led-colors
|
|
|
|
///
|
2016-08-11 07:13:55 +02:00
|
|
|
virtual void action();
|
2016-07-24 15:18:34 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
/// The actual grabber
|
2017-08-12 07:55:32 +02:00
|
|
|
X11Grabber _grabber;
|
2016-08-11 07:13:55 +02:00
|
|
|
|
2016-07-24 15:18:34 +02:00
|
|
|
bool _init;
|
|
|
|
};
|