hyperion.ng
Grabber.h
1 #pragma once
2 
3 #include <QObject>
4 #include <cstdint>
5 
6 #include <utils/ColorRgb.h>
7 #include <utils/Image.h>
8 #include <utils/VideoMode.h>
9 #include <grabber/VideoStandard.h>
10 #include <utils/ImageResampler.h>
11 #include <utils/Logger.h>
12 
17 class Grabber : public QObject
18 {
19  Q_OBJECT
20 
21 public:
22  Grabber(QString grabberName, int width=0, int height=0, int cropLeft=0, int cropRight=0, int cropTop=0, int cropBottom=0);
23  virtual ~Grabber();
24 
29  virtual void setVideoMode(VideoMode mode);
30 
34  virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom);
35 
40  virtual bool setWidthHeight(int width, int height);
41 
45  virtual void setPixelDecimation(int pixelDecimation) {};
46 
50  virtual void setSignalThreshold(
51  double redSignalThreshold,
52  double greenSignalThreshold,
53  double blueSignalThreshold,
54  int noSignalCounterThreshold = 50) {};
59  double verticalMin,
60  double horizontalMin,
61  double verticalMax,
62  double horizontalMax) {};
63 
67  virtual void setSignalDetectionEnable(bool enable) {};
68 
72  virtual void setDeviceVideoStandard(QString device, VideoStandard videoStandard) {};
73 
77  virtual void setDisplayIndex(int index) {};
78 
82  virtual void setDevicePath(const QString& path) {};
83 
87  virtual int getImageWidth() { return _width; };
88 
92  virtual int getImageHeight() { return _height; };
93 
97  void setEnabled(bool enable);
98 
99 protected:
100  ImageResampler _imageResampler;
101 
102  bool _useImageResampler;
103 
105  VideoMode _videoMode;
106 
108  int _width;
109 
111  int _height;
112 
113  // number of pixels to crop after capturing
114  int _cropLeft, _cropRight, _cropTop, _cropBottom;
115 
116  bool _enabled;
117 
120 
121 };
Definition: Logger.h:32
virtual void setVideoMode(VideoMode mode)
Set the video mode (2D/3D)
Definition: Grabber.cpp:31
Definition: ImageResampler.h:8
virtual void setDevicePath(const QString &path)
Apply path for device (used from framebuffer)
Definition: Grabber.h:82
int _width
With of the captured snapshot [pixels].
Definition: Grabber.h:108
virtual void setSignalThreshold(double redSignalThreshold, double greenSignalThreshold, double blueSignalThreshold, int noSignalCounterThreshold=50)
Apply new signalThreshold (used from v4l)
Definition: Grabber.h:50
void setEnabled(bool enable)
Prevent the real capture implementation from capturing if disabled.
Definition: Grabber.cpp:25
virtual void setDeviceVideoStandard(QString device, VideoStandard videoStandard)
Apply device and videoStanded (used from v4l)
Definition: Grabber.h:72
virtual void setPixelDecimation(int pixelDecimation)
Apply new pixelDecimation (used from x11 and qt)
Definition: Grabber.h:45
VideoMode _videoMode
the selected VideoMode
Definition: Grabber.h:105
virtual int getImageWidth()
get current resulting height of image (after crop)
Definition: Grabber.h:87
virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom)
Apply new crop values, on errors reject the values.
Definition: Grabber.cpp:41
The Grabber class is responsible to apply image resizes (with or without ImageResampler) Overwrite th...
Definition: Grabber.h:17
Logger * _log
logger instance
Definition: Grabber.h:119
virtual void setSignalDetectionEnable(bool enable)
Apply SignalDetectionEnable (used from v4l)
Definition: Grabber.h:67
virtual void setDisplayIndex(int index)
Apply display index (used from qt)
Definition: Grabber.h:77
virtual void setSignalDetectionOffset(double verticalMin, double horizontalMin, double verticalMax, double horizontalMax)
Apply new SignalDetectionOffset (used from v4l)
Definition: Grabber.h:58
virtual int getImageHeight()
get current resulting width of image (after crop)
Definition: Grabber.h:92
int _height
Height of the captured snapshot [pixels].
Definition: Grabber.h:111
virtual bool setWidthHeight(int width, int height)
Apply new width/height values, on errors (collide with cropping) reject the values.
Definition: Grabber.cpp:72