1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-18 06:11:46 -05:00
sdrangel/sdrgui/gui/glshadertvarray.h

83 lines
2.9 KiB
C
Raw Normal View History

2017-02-23 02:18:56 -05:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2017 F4HKW //
// for F4EXB / SDRAngel //
// //
// 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 //
// (at your option) any later version. //
2017-02-23 02:18:56 -05: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 08:00:33 -04:00
#ifndef INCLUDE_GUI_GLTVSHADERARRAY_H_
#define INCLUDE_GUI_GLTVSHADERARRAY_H_
2017-02-23 02:18:56 -05:00
#include <QString>
#include <QOpenGLFunctions>
#include <QOpenGLFunctions_2_0>
#include <QOpenGLFunctions_2_1>
#include <QOpenGLFunctions_3_0>
#include <QOpenGLTexture>
#include <QOpenGLShaderProgram>
#include <QMatrix4x4>
#include <QVector4D>
#include <QDebug>
#include <QColor>
#include <math.h>
class QOpenGLShaderProgram;
class QMatrix4x4;
class QVector4D;
2018-03-11 08:00:33 -04:00
class GLShaderTVArray
2017-02-23 02:18:56 -05:00
{
public:
2018-03-11 08:00:33 -04:00
GLShaderTVArray(bool blnColor);
~GLShaderTVArray();
2017-02-23 02:18:56 -05:00
2018-03-11 14:43:40 -04:00
void setColor(bool blnColor) { m_blnColor = blnColor; }
void setAlphaBlend(bool blnAlphaBlend) { m_blnAlphaBlend = blnAlphaBlend; }
void setAlphaReset() { m_blnAlphaReset = true; }
void initializeGL(int intCols, int intRows);
void cleanup();
2017-02-23 02:18:56 -05:00
QRgb *GetRowBuffer(int intRow);
void RenderPixels(unsigned char *chrData);
void ResetPixels();
void ResetPixels(int alpha);
2017-02-23 02:18:56 -05:00
bool SelectRow(int intLine);
bool SetDataColor(int intCol,QRgb objColor);
protected:
QOpenGLShaderProgram *m_objProgram;
int m_matrixLoc;
int m_textureLoc;
//int m_objColorLoc;
2017-02-23 02:18:56 -05:00
static const QString m_strVertexShaderSourceArray;
static const QString m_strFragmentShaderSourceColored;
2018-03-11 08:00:33 -04:00
QImage *m_objImage=NULL;
2017-02-23 02:18:56 -05:00
QOpenGLTexture *m_objTexture=NULL;
int m_intCols;
int m_intRows;
QRgb * m_objCurrentRow;
bool m_blnInitialized;
2018-03-11 08:00:33 -04:00
bool m_blnColor;
bool m_blnAlphaBlend;
bool m_blnAlphaReset;
2017-02-23 02:18:56 -05:00
};
2018-03-11 08:00:33 -04:00
#endif /* INCLUDE_GUI_GLTVSHADERARRAY_H_ */