1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-30 03:38:55 -05:00
sdrangel/plugins/channelrx/demodatv/atvscreen.h

95 lines
3.0 KiB
C
Raw Normal View History

2017-02-23 02:18:56 -05:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2017 F4HKW //
// for F4EXB / SDRAngel //
// //
// OpenGL interface modernization. //
// See: http://doc.qt.io/qt-5/qopenglshaderprogram.html //
// //
// 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 //
// //
// 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/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDE_ATVSCREEN_H
#define INCLUDE_ATVSCREEN_H
#include <QGLWidget>
#include <QPen>
#include <QTimer>
#include <QMutex>
#include <QFont>
#include <QMatrix4x4>
#include "dsp/dsptypes.h"
#include "glshaderarray.h"
#include "gui/glshadertextured.h"
#include "util/export.h"
#include "util/bitfieldindex.h"
#include "atvscreeninterface.h"
2017-02-23 02:18:56 -05:00
class QPainter;
class SDRANGEL_API ATVScreen: public QGLWidget, public ATVScreenInterface
2017-02-23 02:18:56 -05:00
{
Q_OBJECT
public:
ATVScreen(QWidget* parent = NULL);
virtual ~ATVScreen();
2017-02-23 02:18:56 -05:00
virtual void resizeATVScreen(int intCols, int intRows);
virtual void renderImage(unsigned char * objData);
virtual bool selectRow(int intLine);
virtual bool setDataColor(int intCol,int intRed, int intGreen, int intBlue);
2017-02-23 02:18:56 -05:00
signals:
void traceSizeChanged(int);
void sampleRateChanged(int);
private:
bool m_blnGLContextInitialized;
int m_intAskedCols;
int m_intAskedRows;
// state
QTimer m_objTimer;
QMutex m_objMutex;
bool m_blnDataChanged;
bool m_blnConfigChanged;
GLShaderArray m_objGLShaderArray;
2017-11-06 19:10:56 -05:00
unsigned char *m_chrLastData;
//Valeurs par défaut
static const int ATV_COLS=192;
static const int ATV_ROWS=625;
2017-02-23 02:18:56 -05:00
void initializeGL();
void resizeGL(int width, int height);
void paintGL();
void mousePressEvent(QMouseEvent*);
2017-11-06 19:10:56 -05:00
QRgb* getRowBuffer(int intRow);
void resetImage();
2017-02-23 02:18:56 -05:00
protected slots:
void cleanup();
void tick();
};
#endif // INCLUDE_ATVSCREEN_H