2021-12-07 13:47:42 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
2022-02-27 14:56:51 +02:00
|
|
|
#include <QDialog>
|
2021-12-31 16:47:49 +06:00
|
|
|
#include <QEvent>
|
2022-02-27 14:56:51 +02:00
|
|
|
#include <QImage>
|
|
|
|
|
#include <QRect>
|
|
|
|
|
#include <QWidget>
|
2021-12-07 13:47:42 +01:00
|
|
|
|
2022-01-15 21:45:34 +02:00
|
|
|
#include <atomic>
|
2022-02-11 13:49:45 +06:00
|
|
|
#include <memory>
|
2022-02-27 14:56:51 +02:00
|
|
|
#include <tuple>
|
|
|
|
|
#include <vector>
|
2022-01-15 21:45:34 +02:00
|
|
|
|
2021-12-07 13:47:42 +01:00
|
|
|
class QWidget;
|
|
|
|
|
|
2022-02-27 14:56:51 +02:00
|
|
|
class RendererCommon {
|
2021-12-07 13:47:42 +01:00
|
|
|
public:
|
|
|
|
|
RendererCommon();
|
|
|
|
|
|
2022-02-27 14:56:51 +02:00
|
|
|
void onResize(int width, int height);
|
|
|
|
|
virtual void finalize() { }
|
|
|
|
|
|
2022-04-21 16:32:46 +06:00
|
|
|
virtual uint32_t getBytesPerRow() { return 2048 * 4; }
|
|
|
|
|
|
2022-11-19 08:49:04 -05:00
|
|
|
virtual std::vector<std::tuple<uint8_t *, std::atomic_flag *>> getBuffers()
|
|
|
|
|
{
|
|
|
|
|
std::vector<std::tuple<uint8_t *, std::atomic_flag *>> buffers;
|
|
|
|
|
return buffers;
|
|
|
|
|
}
|
2022-02-27 14:56:51 +02:00
|
|
|
|
|
|
|
|
/* Does renderer implement options dialog */
|
|
|
|
|
virtual bool hasOptions() const { return false; }
|
|
|
|
|
/* Returns options dialog for renderer */
|
|
|
|
|
virtual QDialog *getOptions(QWidget *parent) { return nullptr; }
|
2022-07-07 14:34:59 +06:00
|
|
|
/* Reloads options of renderer */
|
2022-11-19 08:49:04 -05:00
|
|
|
virtual void reloadOptions() { }
|
2022-02-27 14:56:51 +02:00
|
|
|
|
2023-08-11 04:45:32 +02:00
|
|
|
int r_monitor_index = 0;
|
|
|
|
|
|
2021-12-07 13:47:42 +01:00
|
|
|
protected:
|
2023-08-11 04:45:32 +02:00
|
|
|
bool eventDelegate(QEvent *event, bool &result);
|
2023-11-08 07:08:51 +01:00
|
|
|
void drawStatusBarIcons(QPainter* painter);
|
2021-12-07 13:47:42 +01:00
|
|
|
|
2023-05-29 01:30:51 -04:00
|
|
|
QRect source { 0, 0, 0, 0 };
|
|
|
|
|
QRect destination;
|
2022-02-27 14:56:51 +02:00
|
|
|
QWidget *parentWidget { nullptr };
|
2022-01-15 21:45:34 +02:00
|
|
|
|
|
|
|
|
std::vector<std::atomic_flag> buf_usage;
|
2021-12-07 13:47:42 +01:00
|
|
|
};
|