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.
tvscreen.h
Go to the documentation of this file.
1 // Copyright (C) 2018 F4HKW //
3 // for F4EXB / SDRAngel //
4 // //
5 // OpenGL interface modernization. //
6 // See: http://doc.qt.io/qt-5/qopenglshaderprogram.html //
7 // //
8 // This program is free software; you can redistribute it and/or modify //
9 // it under the terms of the GNU General Public License as published by //
10 // the Free Software Foundation as version 3 of the License, or //
11 // (at your option) any later version. //
12 // //
13 // This program is distributed in the hope that it will be useful, //
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
16 // GNU General Public License V3 for more details. //
17 // //
18 // You should have received a copy of the GNU General Public License //
19 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
21 
22 #ifndef INCLUDE_TVSCREEN_H
23 #define INCLUDE_TVSCREEN_H
24 
25 #include <QGLWidget>
26 #include <QPen>
27 #include <QTimer>
28 #include <QMutex>
29 #include <QFont>
30 #include <QMatrix4x4>
31 #include "dsp/dsptypes.h"
32 #include "glshadertextured.h"
33 #include "glshadertvarray.h"
34 #include "export.h"
35 #include "util/bitfieldindex.h"
36 
37 class QPainter;
38 
39 class SDRGUI_API TVScreen: public QGLWidget
40 {
41  Q_OBJECT
42 
43 public:
44 
45  TVScreen(bool blnColor, QWidget* parent = 0);
46  virtual ~TVScreen();
47 
48  void setColor(bool blnColor);
49  void resizeTVScreen(int intCols, int intRows);
50  void getSize(int& intCols, int& intRows) const;
51  void renderImage(unsigned char * objData);
52  QRgb* getRowBuffer(int intRow);
53  void resetImage();
54  void resetImage(int alpha);
55 
56  bool selectRow(int intLine);
57  bool setDataColor(int intCol, int intRed, int intGreen, int intBlue);
58  bool setDataColor(int intCol, int intRed, int intGreen, int intBlue, int intAlpha);
59  void setAlphaBlend(bool blnAlphaBlend) { m_objGLShaderArray.setAlphaBlend(blnAlphaBlend); }
60  void setAlphaReset() { m_objGLShaderArray.setAlphaReset(); }
61 
62  void connectTimer(const QTimer& timer);
63 
64  //Valeurs par défaut
65  static const int TV_COLS=256;
66  static const int TV_ROWS=256;
67 
68 signals:
69  void traceSizeChanged(int);
70  void sampleRateChanged(int);
71 
72 private:
76 
77 
78  // state
79  QTimer m_objTimer;
80  QMutex m_objMutex;
83 
85 
86  int m_cols;
87  int m_rows;
88 
89  void initializeGL();
90  void resizeGL(int width, int height);
91  void paintGL();
92 
93  void mousePressEvent(QMouseEvent*);
94 
95  unsigned char *m_chrLastData;
96 
97 protected slots:
98  void cleanup();
99  void tick();
100 };
101 
102 #endif // INCLUDE_TVSCREEN_H
int m_rows
Definition: tvscreen.h:87
void setAlphaBlend(bool blnAlphaBlend)
Definition: tvscreen.h:59
unsigned char * m_chrLastData
Definition: tvscreen.h:95
bool m_blnGLContextInitialized
Definition: tvscreen.h:73
bool m_blnDataChanged
Definition: tvscreen.h:81
#define SDRGUI_API
Definition: export.h:52
QMutex m_objMutex
Definition: tvscreen.h:80
int m_intAskedRows
Definition: tvscreen.h:75
GLShaderTVArray m_objGLShaderArray
Definition: tvscreen.h:84
int m_cols
Definition: tvscreen.h:86
bool m_blnConfigChanged
Definition: tvscreen.h:82
void setAlphaReset()
Definition: tvscreen.h:60
int m_intAskedCols
Definition: tvscreen.h:74
QTimer m_objTimer
Definition: tvscreen.h:79