-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglwidget.h
43 lines (32 loc) · 992 Bytes
/
glwidget.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
#ifndef _GLWIDGET_H
#define _GLWIDGET_H
#include <GL/freeglut.h>
#include <QtOpenGL/QGLWidget>
#include <opencv2/opencv.hpp>
class GLWidget : public QGLWidget {
Q_OBJECT // must include this if you use Qt signals/slots
public:
GLWidget(QWidget *parent, cv::Size imageSize);
~GLWidget();
void setSaturation(float sat) ;
void setBrightness(float bright) ;
void updateImage(uchar *ptr_h) ;
private:
uchar* testPtr;
uchar* inputPtr_d=NULL;
uchar* outputPtr_d=NULL;
int W=0;
int H =0;
float saturationLevel=1.0;
float brightnessLevel=1.0;
GLuint texture=0;
GLuint pixelBufferObject=0;
struct cudaGraphicsResource *cudaPboResource;
static void process(uchar* in, uchar* out, float saturation, float brightness, int width, int height) ;
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
void paintGLOK();
};
#endif /* _GLWIDGET_H */