SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
glshadertvarray.h
Go to the documentation of this file.
1 // Copyright (C) 2017 F4HKW //
3 // for F4EXB / SDRAngel //
4 // //
5 // This program is free software; you can redistribute it and/or modify //
6 // it under the terms of the GNU General Public License as published by //
7 // the Free Software Foundation as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program is distributed in the hope that it will be useful, //
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
13 // GNU General Public License V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #ifndef INCLUDE_GUI_GLTVSHADERARRAY_H_
20 #define INCLUDE_GUI_GLTVSHADERARRAY_H_
21 
22 #include <QString>
23 #include <QOpenGLFunctions>
24 #include <QOpenGLFunctions_2_0>
25 #include <QOpenGLFunctions_2_1>
26 #include <QOpenGLFunctions_3_0>
27 #include <QOpenGLTexture>
28 #include <QOpenGLShaderProgram>
29 #include <QOpenGLContext>
30 #include <QMatrix4x4>
31 #include <QVector4D>
32 #include <QDebug>
33 #include <QColor>
34 #include <math.h>
35 
36 class QOpenGLShaderProgram;
37 class QMatrix4x4;
38 class QVector4D;
39 
41 {
42 public:
43  GLShaderTVArray(bool blnColor);
45 
46  void setColor(bool blnColor) { m_blnColor = blnColor; }
47  void setAlphaBlend(bool blnAlphaBlend) { m_blnAlphaBlend = blnAlphaBlend; }
48  void setAlphaReset() { m_blnAlphaReset = true; }
49  void InitializeGL(int intCols, int intRows);
50  void Cleanup();
51  QRgb *GetRowBuffer(int intRow);
52  void RenderPixels(unsigned char *chrData);
53  void ResetPixels();
54  void ResetPixels(int alpha);
55 
56  bool SelectRow(int intLine);
57  bool SetDataColor(int intCol,QRgb objColor);
58 
59 
60 protected:
61 
62  QOpenGLShaderProgram *m_objProgram;
65  //int m_objColorLoc;
66  static const QString m_strVertexShaderSourceArray;
67  static const QString m_strFragmentShaderSourceColored;
68 
69  QImage *m_objImage=NULL;
70  QOpenGLTexture *m_objTexture=NULL;
71 
72  int m_intCols;
73  int m_intRows;
74 
76 
78  bool m_blnColor;
81 };
82 
83 #endif /* INCLUDE_GUI_GLTVSHADERARRAY_H_ */
QRgb * GetRowBuffer(int intRow)
bool SelectRow(int intLine)
GLShaderTVArray(bool blnColor)
void RenderPixels(unsigned char *chrData)
bool SetDataColor(int intCol, QRgb objColor)
void InitializeGL(int intCols, int intRows)
static const QString m_strVertexShaderSourceArray
static const QString m_strFragmentShaderSourceColored
QOpenGLTexture * m_objTexture
void setColor(bool blnColor)
void setAlphaBlend(bool blnAlphaBlend)
QOpenGLShaderProgram * m_objProgram