2017-08-04 23:08:15 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <cstdint>
|
|
|
|
|
2017-08-12 07:55:32 +02:00
|
|
|
#include <utils/ColorRgb.h>
|
2017-08-04 23:08:15 +02:00
|
|
|
#include <utils/Image.h>
|
|
|
|
#include <utils/VideoMode.h>
|
|
|
|
#include <utils/GrabbingMode.h>
|
|
|
|
#include <utils/ImageResampler.h>
|
|
|
|
#include <utils/Logger.h>
|
|
|
|
|
|
|
|
|
|
|
|
class Grabber : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
Grabber(QString grabberName, int width=0, int height=0, int cropLeft=0, int cropRight=0, int cropTop=0, int cropBottom=0);
|
2017-08-12 07:55:32 +02:00
|
|
|
virtual ~Grabber();
|
|
|
|
|
2017-08-04 23:08:15 +02:00
|
|
|
///
|
|
|
|
/// Set the video mode (2D/3D)
|
|
|
|
/// @param[in] mode The new video mode
|
|
|
|
///
|
2017-08-12 07:55:32 +02:00
|
|
|
virtual void setVideoMode(VideoMode mode);
|
2017-08-04 23:08:15 +02:00
|
|
|
|
2017-08-12 07:55:32 +02:00
|
|
|
virtual void setCropping(unsigned cropLeft, unsigned cropRight, unsigned cropTop, unsigned cropBottom);
|
|
|
|
|
2017-08-04 23:08:15 +02:00
|
|
|
/// gets resulting height of image
|
2017-08-12 07:55:32 +02:00
|
|
|
virtual const int getImageWidth() { return _width; };
|
2017-08-04 23:08:15 +02:00
|
|
|
|
|
|
|
/// gets resulting width of image
|
2017-08-12 07:55:32 +02:00
|
|
|
virtual const int getImageHeight() { return _height; };
|
2017-08-04 23:08:15 +02:00
|
|
|
|
2017-09-01 08:50:37 +02:00
|
|
|
void setEnabled(bool enable);
|
2017-08-04 23:08:15 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
ImageResampler _imageResampler;
|
|
|
|
|
2017-08-12 07:55:32 +02:00
|
|
|
bool _useImageResampler;
|
|
|
|
|
2017-08-04 23:08:15 +02:00
|
|
|
/// the selected VideoMode
|
|
|
|
VideoMode _videoMode;
|
|
|
|
|
|
|
|
/// With of the captured snapshot [pixels]
|
|
|
|
int _width;
|
|
|
|
|
|
|
|
/// Height of the captured snapshot [pixels]
|
|
|
|
int _height;
|
|
|
|
|
|
|
|
// number of pixels to crop after capturing
|
|
|
|
int _cropLeft, _cropRight, _cropTop, _cropBottom;
|
|
|
|
|
2017-09-01 08:50:37 +02:00
|
|
|
bool _enabled;
|
2017-08-04 23:08:15 +02:00
|
|
|
|
|
|
|
/// logger instance
|
|
|
|
Logger * _log;
|
|
|
|
|
|
|
|
};
|