Gem Illuminator
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
blureffect.h
Go to the documentation of this file.
1 #ifndef GLOWEFFECT_H
2 #define GLOWEFFECT_H
3 
4 #include <QObject>
5 
6 class QOpenGLFunctions;
7 class QOpenGLShaderProgram;
8 class QSize;
9 
10 class Camera;
11 class ScreenAlignedQuad;
12 enum class ShaderPrograms;
13 
17 class BlurEffect : public QObject
18 {
19  Q_OBJECT
20 public:
27  BlurEffect(QOpenGLFunctions &gl, uint glowTexture, QObject *parent = nullptr);
28  virtual ~BlurEffect();
29 
35  void blur(const QSize &textureSize);
36 
37 protected:
38  void initialize();
39  void initializeFBOs();
45  void renderGaussHorizontal(const QSize &textureSize);
50  void renderGaussVertical(const QSize &textureSize);
51 
52 protected:
53  QOpenGLFunctions &m_gl;
54  QMap<ShaderPrograms, QOpenGLShaderProgram*> *m_shaderPrograms;
56 
57  uint m_blurFBO;
61 
63 
65 };
66 
67 #endif // GLOWEFFECT_H
QSize * m_usedViewport
Definition: blureffect.h:62
virtual ~BlurEffect()
Definition: blureffect.cpp:23
The BlurEffect blurs a given texture.
Definition: blureffect.h:17
void renderGaussHorizontal(const QSize &textureSize)
Blurs texture horizontally.
Definition: blureffect.cpp:145
The Camera class provides view and perspective projection matrices. Additional the viewport of camera...
Definition: camera.h:16
uint m_blurTexture
Definition: blureffect.h:58
void initializeShaderPrograms()
Definition: blureffect.cpp:124
uint m_secondaryBlurTexture
Definition: blureffect.h:60
uint m_blurFBO
Definition: blureffect.h:57
void initializeFBOs()
Definition: blureffect.cpp:93
bool m_initialized
Definition: blureffect.h:55
void blur(const QSize &textureSize)
Blurs previous set texture. The texture is blurred using two seperated passes of gauss blur...
Definition: blureffect.cpp:37
void initialize()
Definition: blureffect.cpp:85
ScreenAlignedQuad * m_quad
Definition: blureffect.h:64
The ScreenAlignedQuad class encapsulates the drawing of a screen aligned quad.
Definition: screenalignedquad.h:10
QOpenGLFunctions & m_gl
Definition: blureffect.h:53
QMap< ShaderPrograms, QOpenGLShaderProgram * > * m_shaderPrograms
Definition: blureffect.h:54
void renderGaussVertical(const QSize &textureSize)
Blurs texture vertically.
Definition: blureffect.cpp:164
ShaderPrograms
The ShaderPrograms enum Manage ShaderPrograms with the help of this enum class. If it is neccessary ...
Definition: shaderprograms.h:14
BlurEffect(QOpenGLFunctions &gl, uint glowTexture, QObject *parent=nullptr)
Creates a new BlurEffect that will blur a specified texture everytime blur() is called.
Definition: blureffect.cpp:11
uint m_secondaryBlurFBO
Definition: blureffect.h:59