2017-07-02 20:55:56 +01:00
|
|
|
#ifndef VIDEO_H
|
|
|
|
#define VIDEO_H
|
|
|
|
|
2017-07-04 12:14:04 +01:00
|
|
|
#include <QOpenGLWidget>
|
2017-07-09 20:49:26 +01:00
|
|
|
#include <memory>
|
2017-07-02 20:55:56 +01:00
|
|
|
|
2019-11-16 11:59:37 +00:00
|
|
|
#include "graphics/graphicscache.h"
|
|
|
|
|
2017-07-11 21:23:26 +01:00
|
|
|
#define VIDEO_BASECLASS QOpenGLWidget
|
|
|
|
//#define VIDEO_BASECLASS QWidget
|
2017-07-02 20:55:56 +01:00
|
|
|
|
2017-07-09 20:49:26 +01:00
|
|
|
|
2017-07-04 12:14:04 +01:00
|
|
|
class Video : public VIDEO_BASECLASS
|
2017-07-02 20:55:56 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2019-11-16 11:59:37 +00:00
|
|
|
typedef GraphicsCache::ScreenPainter_t ScreenPainter_t;
|
|
|
|
typedef GraphicsCache::Image_t Image_t;
|
|
|
|
|
2017-07-02 20:55:56 +01:00
|
|
|
explicit Video(QWidget *parent = 0);
|
|
|
|
|
2019-11-16 11:59:37 +00:00
|
|
|
Image_t getScreen() const;
|
2017-10-17 21:14:36 +01:00
|
|
|
|
2017-07-03 21:00:42 +01:00
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
protected:
|
2017-07-04 12:14:04 +01:00
|
|
|
virtual void paintEvent(QPaintEvent *event);
|
|
|
|
virtual void keyPressEvent(QKeyEvent *event);
|
2017-10-07 20:44:42 +01:00
|
|
|
virtual void mouseMoveEvent(QMouseEvent *event);
|
|
|
|
virtual void mousePressEvent(QMouseEvent *event);
|
|
|
|
virtual void mouseReleaseEvent(QMouseEvent *event);
|
2017-07-02 20:55:56 +01:00
|
|
|
|
|
|
|
private:
|
2019-11-16 11:59:37 +00:00
|
|
|
|
|
|
|
bool Update40ColCell(ScreenPainter_t & painter, int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool Update80ColCell(ScreenPainter_t & painter, int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool UpdateLoResCell(ScreenPainter_t & painter, int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool UpdateDLoResCell(ScreenPainter_t & painter, int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool UpdateHiResCell(ScreenPainter_t & painter, int x, int y, int xpixel, int ypixel, int offset);
|
|
|
|
bool UpdateDHiResCell(ScreenPainter_t & painter, int x, int y, int xpixel, int ypixel, int offset);
|
2017-07-02 20:55:56 +01:00
|
|
|
|
2017-07-11 21:23:26 +01:00
|
|
|
// paint the whole screen
|
|
|
|
// no scale applied
|
2019-11-16 11:59:37 +00:00
|
|
|
void paint(ScreenPainter_t & painter);
|
2017-07-11 21:23:26 +01:00
|
|
|
|
2017-07-09 20:49:26 +01:00
|
|
|
std::shared_ptr<const GraphicsCache> myGraphicsCache;
|
2019-11-16 11:59:37 +00:00
|
|
|
Image_t myOffscreen;
|
2017-07-02 20:55:56 +01:00
|
|
|
};
|
|
|
|
|
2017-07-03 21:00:42 +01:00
|
|
|
#endif // VIDEO_H
|