-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathglvideowidget.h
50 lines (40 loc) · 1.08 KB
/
glvideowidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef GLVIDEOWIDGET_H
#define GLVIDEOWIDGET_H
#include <QOpenGLWidget>
#include <QOpenGLShader>
#include <QOpenGLShaderProgram>
#include <QDebug>
#include <QOpenGLTexture>
#include "glvideosurface.h"
#include "filters/facedetectfilter.h"
#include "filters/grayscalefilter.h"
class GLVideoWidget : public QOpenGLWidget
{
Q_OBJECT
private:
GLVideoSurface *videoSurface;
public:
explicit GLVideoWidget(QWidget *parent = nullptr);
GLVideoSurface *getVideoSurface();
QImage &getRenderedImage();
void registerFilter(QSharedPointer<AbstractFilter> filter);
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
void renderImage(const QImage &image);
private:
QImage renderedImage;
QPoint renderPosition;
QSize renderSize;
cv::Mat opencvFrame;
QList<QSharedPointer<AbstractFilter>> filters;
void calculateRenderPosition();
private slots:
void cleanup();
public slots:
void showImage(const QImage& image);
void renderFrame(cv::Mat &frame);
void disableFilters();
};
#endif // GLVIDEOWIDGET_H