SceneSwitcher/plugins/video/screenshot-dialog.hpp
WarmUpTill 821e768e76
Some checks failed
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
debian-build / build (push) Has been cancelled
Reduce screenshot selection area to area to be checked
2024-11-22 20:52:15 +01:00

43 lines
847 B
C++

#pragma once
#include "screenshot-helper.hpp"
#include "parameter-wrappers.hpp"
#include <optional>
#include <obs.h>
#include <QDialog>
#include <QDialogButtonBox>
#include <QImage>
#include <QLabel>
#include <QRubberBand>
#include <QScrollArea>
namespace advss {
class ScreenshotDialog : public QDialog {
Q_OBJECT
public:
static std::optional<QImage> AskForScreenshot(const VideoInput &,
const AreaParameters &);
private:
ScreenshotDialog(obs_source_t *source, const AreaParameters &area);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
QScrollArea *_scrollArea;
QLabel *_imageLabel;
QPoint _origin;
QRubberBand *_rubberBand = nullptr;
QDialogButtonBox *_buttonBox;
QImage _result;
Screenshot _screenshot;
};
} // namespace advss