| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							| 
									
										
										
										
											2023-11-19 13:31:45 +01:00
										 |  |  | // Copyright (C) 2012 maintech GmbH, Otto-Hahn-Str. 15, 97204 Hoechberg, Germany //
 | 
					
						
							|  |  |  | // written by Christian Daniel                                                   //
 | 
					
						
							|  |  |  | // Copyright (C) 2015-2020, 2022 Edouard Griffiths, F4EXB <f4exb06@gmail.com>    //
 | 
					
						
							|  |  |  | // Copyright (C) 2020 Vort <vvort@yandex.ru>                                     //
 | 
					
						
							|  |  |  | // Copyright (C) 2022 Jon Beniston, M7RCE <jon@beniston.com>                     //
 | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is free software; you can redistribute it and/or modify          //
 | 
					
						
							|  |  |  | // it under the terms of the GNU General Public License as published by          //
 | 
					
						
							|  |  |  | // the Free Software Foundation as version 3 of the License, or                  //
 | 
					
						
							| 
									
										
										
										
											2019-04-11 14:43:33 +02:00
										 |  |  | // (at your option) any later version.                                           //
 | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful,               //
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of                //
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                  //
 | 
					
						
							|  |  |  | // GNU General Public License V3 for more details.                               //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU General Public License             //
 | 
					
						
							|  |  |  | // along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-11 13:00:33 +01:00
										 |  |  | #ifndef INCLUDE_GUI_GLTVSHADERARRAY_H_
 | 
					
						
							|  |  |  | #define INCLUDE_GUI_GLTVSHADERARRAY_H_
 | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							|  |  |  | #include <QOpenGLFunctions>
 | 
					
						
							|  |  |  | #include <QOpenGLFunctions_2_0>
 | 
					
						
							|  |  |  | #include <QOpenGLFunctions_2_1>
 | 
					
						
							|  |  |  | #include <QOpenGLFunctions_3_0>
 | 
					
						
							|  |  |  | #include <QOpenGLTexture>
 | 
					
						
							|  |  |  | #include <QOpenGLShaderProgram>
 | 
					
						
							| 
									
										
										
										
											2022-06-19 23:22:43 +01:00
										 |  |  | #include <QOpenGLVertexArrayObject>
 | 
					
						
							|  |  |  | #include <QOpenGLBuffer>
 | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | #include <QMatrix4x4>
 | 
					
						
							|  |  |  | #include <QVector4D>
 | 
					
						
							|  |  |  | #include <QDebug>
 | 
					
						
							|  |  |  | #include <QColor>
 | 
					
						
							|  |  |  | #include <math.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class QOpenGLShaderProgram; | 
					
						
							|  |  |  | class QMatrix4x4; | 
					
						
							|  |  |  | class QVector4D; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-11 13:00:33 +01:00
										 |  |  | class GLShaderTVArray | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2018-03-11 13:00:33 +01:00
										 |  |  |     GLShaderTVArray(bool blnColor); | 
					
						
							|  |  |  |     ~GLShaderTVArray(); | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-11 19:43:40 +01:00
										 |  |  |     void setColor(bool blnColor) { m_blnColor = blnColor; } | 
					
						
							| 
									
										
										
										
											2018-03-13 01:39:43 +01:00
										 |  |  |     void setAlphaBlend(bool blnAlphaBlend) { m_blnAlphaBlend = blnAlphaBlend; } | 
					
						
							|  |  |  |     void setAlphaReset() { m_blnAlphaReset = true; } | 
					
						
							| 
									
										
										
										
											2022-06-19 23:22:43 +01:00
										 |  |  |     void initializeGL(int majorVersion, int minorVersion, int intCols, int intRows); | 
					
						
							| 
									
										
										
										
											2020-12-12 20:04:18 +01:00
										 |  |  |     void cleanup(); | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  |     QRgb *GetRowBuffer(int intRow); | 
					
						
							|  |  |  |     void RenderPixels(unsigned char *chrData); | 
					
						
							|  |  |  |     void ResetPixels(); | 
					
						
							| 
									
										
										
										
											2018-03-13 01:39:43 +01:00
										 |  |  |     void ResetPixels(int alpha); | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     bool SelectRow(int intLine); | 
					
						
							|  |  |  |     bool SetDataColor(int intCol,QRgb objColor); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							|  |  |  |     QOpenGLShaderProgram *m_objProgram; | 
					
						
							| 
									
										
										
										
											2022-06-19 23:22:43 +01:00
										 |  |  |     QOpenGLVertexArrayObject *m_vao; | 
					
						
							|  |  |  |     QOpenGLBuffer *m_verticesBuf; | 
					
						
							|  |  |  |     QOpenGLBuffer *m_textureCoordsBuf; | 
					
						
							| 
									
										
										
										
											2020-12-12 20:04:18 +01:00
										 |  |  |     int m_matrixLoc; | 
					
						
							|  |  |  |     int m_textureLoc; | 
					
						
							| 
									
										
										
										
											2018-03-12 20:39:16 +01:00
										 |  |  |     //int m_objColorLoc;
 | 
					
						
							| 
									
										
										
										
											2022-06-19 23:22:43 +01:00
										 |  |  |     static const QString m_strVertexShaderSourceArray2; | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  |     static const QString m_strVertexShaderSourceArray; | 
					
						
							| 
									
										
										
										
											2022-06-19 23:22:43 +01:00
										 |  |  |     static const QString m_strFragmentShaderSourceColored2; | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  |     static const QString m_strFragmentShaderSourceColored; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-14 13:16:01 +02:00
										 |  |  |     QImage *m_objImage; | 
					
						
							|  |  |  |     QOpenGLTexture *m_objTexture; | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     int m_intCols; | 
					
						
							|  |  |  |     int m_intRows; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-04-14 13:16:01 +02:00
										 |  |  |     QRgb *m_objCurrentRow; | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     bool m_blnInitialized; | 
					
						
							| 
									
										
										
										
											2018-03-11 13:00:33 +01:00
										 |  |  |     bool m_blnColor; | 
					
						
							| 
									
										
										
										
											2018-03-13 01:39:43 +01:00
										 |  |  |     bool m_blnAlphaBlend; | 
					
						
							|  |  |  |     bool m_blnAlphaReset; | 
					
						
							| 
									
										
										
										
											2017-02-23 08:18:56 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-11 13:00:33 +01:00
										 |  |  | #endif /* INCLUDE_GUI_GLTVSHADERARRAY_H_ */
 |