mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
5e3cb497fa
Former-commit-id: 5edb206bb2657e78f711f67625fd5f6164d8296c
66 lines
1.3 KiB
C++
66 lines
1.3 KiB
C++
#pragma once
|
|
|
|
// Hyperion includes
|
|
#include <hyperion/Hyperion.h>
|
|
#include <hyperion/ImageProcessor.h>
|
|
|
|
// Grabber includes
|
|
#include <grabber/V4L2Grabber.h>
|
|
|
|
class V4L2Wrapper : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
V4L2Wrapper(const std::string & device,
|
|
int input,
|
|
VideoStandard videoStandard,
|
|
int width,
|
|
int height,
|
|
int frameDecimation,
|
|
int pixelDecimation,
|
|
double redSignalThreshold,
|
|
double greenSignalThreshold,
|
|
double blueSignalThreshold,
|
|
Hyperion * hyperion,
|
|
int hyperionPriority);
|
|
virtual ~V4L2Wrapper();
|
|
|
|
public slots:
|
|
void start();
|
|
|
|
void stop();
|
|
|
|
void setCropping(int cropLeft,
|
|
int cropRight,
|
|
int cropTop,
|
|
int cropBottom);
|
|
|
|
void set3D(VideoMode mode);
|
|
|
|
signals:
|
|
void emitColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms);
|
|
|
|
private slots:
|
|
void newFrame(const Image<ColorRgb> & image);
|
|
|
|
private:
|
|
/// The timeout of the led colors [ms]
|
|
const int _timeout_ms;
|
|
|
|
/// The priority of the led colors
|
|
const int _priority;
|
|
|
|
/// The V4L2 grabber
|
|
V4L2Grabber _grabber;
|
|
|
|
/// The processor for transforming images to led colors
|
|
ImageProcessor * _processor;
|
|
|
|
/// The Hyperion instance
|
|
Hyperion * _hyperion;
|
|
|
|
/// The list with computed led colors
|
|
std::vector<ColorRgb> _ledColors;
|
|
};
|