2021-12-07 13:47:42 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QRect>
|
|
|
|
|
#include <QImage>
|
2021-12-31 16:47:49 +06:00
|
|
|
#include <QEvent>
|
2021-12-07 13:47:42 +01:00
|
|
|
|
2022-01-15 21:45:34 +02:00
|
|
|
#include <vector>
|
|
|
|
|
#include <tuple>
|
|
|
|
|
#include <atomic>
|
|
|
|
|
|
2021-12-07 13:47:42 +01:00
|
|
|
class QWidget;
|
|
|
|
|
|
|
|
|
|
class RendererCommon
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
RendererCommon();
|
|
|
|
|
|
|
|
|
|
void onResize(int width, int height);
|
2022-01-15 21:45:34 +02:00
|
|
|
virtual std::vector<std::tuple<uint8_t*, std::atomic_flag*>> getBuffers() = 0;
|
2021-12-07 13:47:42 +01:00
|
|
|
protected:
|
2021-12-29 23:49:09 +06:00
|
|
|
bool eventDelegate(QEvent* event, bool& result);
|
2021-12-07 13:47:42 +01:00
|
|
|
|
|
|
|
|
QRect source, destination;
|
2021-12-29 23:49:09 +06: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
|
|
|
};
|