2014-02-23 22:39:23 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// Hyperion includes
|
|
|
|
#include <hyperion/Hyperion.h>
|
|
|
|
#include <hyperion/ImageProcessor.h>
|
2016-08-11 07:13:55 +02:00
|
|
|
#include <hyperion/GrabberWrapper.h>
|
2014-02-23 22:39:23 +01:00
|
|
|
|
|
|
|
// Grabber includes
|
|
|
|
#include <grabber/V4L2Grabber.h>
|
|
|
|
|
2016-08-11 07:13:55 +02:00
|
|
|
class V4L2Wrapper : public GrabberWrapper
|
2014-02-23 22:39:23 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
V4L2Wrapper(const std::string & device,
|
|
|
|
int input,
|
|
|
|
VideoStandard videoStandard,
|
2014-03-31 17:36:36 +02:00
|
|
|
PixelFormat pixelFormat,
|
2014-02-23 22:39:23 +01:00
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
int frameDecimation,
|
|
|
|
int pixelDecimation,
|
2014-03-04 22:04:15 +01:00
|
|
|
double redSignalThreshold,
|
|
|
|
double greenSignalThreshold,
|
|
|
|
double blueSignalThreshold,
|
2016-08-11 07:13:55 +02:00
|
|
|
const int priority);
|
2014-02-23 22:39:23 +01:00
|
|
|
virtual ~V4L2Wrapper();
|
|
|
|
|
|
|
|
public slots:
|
2016-07-14 23:40:10 +02:00
|
|
|
bool start();
|
2014-02-23 22:39:23 +01:00
|
|
|
void stop();
|
|
|
|
|
2016-08-12 23:07:32 +02:00
|
|
|
void setCropping(int cropLeft, int cropRight, int cropTop, int cropBottom);
|
2016-12-16 19:48:43 +01:00
|
|
|
void setSignalDetectionOffset(double verticalMin, double horizontalMin, double verticalMax, double horizontalMax);
|
2014-02-23 22:39:23 +01:00
|
|
|
void set3D(VideoMode mode);
|
|
|
|
|
2016-08-11 07:13:55 +02:00
|
|
|
// signals:
|
|
|
|
// void emitColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms);
|
2014-03-04 20:32:54 +01:00
|
|
|
|
2014-02-23 22:39:23 +01:00
|
|
|
private slots:
|
|
|
|
void newFrame(const Image<ColorRgb> & image);
|
2016-08-12 09:39:41 +02:00
|
|
|
void readError(const char* err);
|
2014-02-23 22:39:23 +01:00
|
|
|
|
2016-08-11 07:13:55 +02:00
|
|
|
virtual void action();
|
2014-03-22 15:35:25 +01:00
|
|
|
void checkSources();
|
|
|
|
|
2014-02-23 22:39:23 +01:00
|
|
|
private:
|
|
|
|
/// The timeout of the led colors [ms]
|
|
|
|
const int _timeout_ms;
|
|
|
|
|
|
|
|
/// The V4L2 grabber
|
|
|
|
V4L2Grabber _grabber;
|
|
|
|
|
|
|
|
/// The list with computed led colors
|
|
|
|
std::vector<ColorRgb> _ledColors;
|
|
|
|
};
|