7 #include <QOpenGLBuffer>
8 #include <QOpenGLShader>
9 #include <QOpenGLFunctions>
10 #include <QOpenGLFramebufferObject>
17 #define VV_DRAWMODE_VOLUME 0
18 #define VV_DRAWMODE_VIDEODIFF 1
20 #define VV_METRIC_NONE 0
21 #define VV_METRIC_IQDIF 1
22 #define VV_METRIC_YDIF 2
23 #define VV_METRIC_YNDIF 3
24 #define VV_METRIC_YMSE 4
25 #define VV_METRIC_YNMSE 5
36 class GLWidget :
public QGLWidget,
protected QOpenGLFunctions
143 void resizeGL(
int width,
int height);
154 bool prepareShaderProgram(
const QString& vertexShaderPath,
const QString& fragmentShaderPath, QOpenGLShaderProgram **shader);
155 void createBufferObjects();
158 void setupModelMatrix();
160 void calculateVideoDiffBuffer(
bool normalized);
161 void calculateMeanAndStdDev();
163 QOpenGLShaderProgram *m_volumeShader;
164 QOpenGLShaderProgram *m_videoDiffShader;
165 QOpenGLBuffer *m_boxPosVBO;
166 QOpenGLBuffer *m_texCoordVBO;
167 QOpenGLBuffer *m_boxIBO;
168 QOpenGLBuffer *m_squarePosVBO;
169 QOpenGLBuffer *m_squareTexCoordVBO;
170 QOpenGLBuffer *m_squareIBO;
172 GLuint m_videoTexture;
173 GLuint m_transferTexture;
174 GLuint m_meanTexture;
179 QMatrix4x4 m_viewMatrix;
180 QMatrix4x4 m_projectionMatrix;
181 QMatrix4x4 m_modelMatrix;
185 PBYTE p_videoDiffBuffer;
186 PBYTE p_videoNDiffBuffer;
197 float m_cameraAngleUp;
198 float m_cameraAngleSide;
199 float m_cameraDistance;
201 QVector3D m_cameraCenter;
202 QVector3D m_backgroundColor;
203 QVector3D m_cameraPosition;
205 GLfloat *p_transferFunction;
207 bool m_horseShowView;
213 QPoint m_oldMousePos;