SceneSwitcher/plugins/video/area-selection.hpp
WarmUpTill 7d0332dd0e Restructure library and plugins
The "core" macro conditions and actions have been extracted out to the
"base" plugin.

The library now mostly contains functionality which is required across
all plugins and (e.g. definitions for macro segments).

The goal is to reduce the complexity and cross-dependencies and group
the source files in a better way.

This should relsove the "library limit of 65535 objects exceeded" build
issue occuring in some Windows build environments.
2024-01-27 14:10:34 +01:00

70 lines
1.3 KiB
C++

#pragma once
#include <variable-spinbox.hpp>
#include <QWidget>
#include <QSpinBox>
#include <obs-data.h>
#include <opencv2/opencv.hpp>
namespace advss {
struct Size {
void Save(obs_data_t *obj, const char *name) const;
void Load(obs_data_t *obj, const char *name);
cv::Size CV();
NumberVariable<int> width;
NumberVariable<int> height;
};
struct Area {
void Save(obs_data_t *obj, const char *name) const;
void Load(obs_data_t *obj, const char *name);
NumberVariable<int> x;
NumberVariable<int> y;
NumberVariable<int> width;
NumberVariable<int> height;
};
class SizeSelection : public QWidget {
Q_OBJECT
public:
SizeSelection(int min, int max, QWidget *parent = 0);
void SetSize(const Size &);
Size GetSize();
private slots:
void XChanged(const NumberVariable<int> &);
void YChanged(const NumberVariable<int> &);
signals:
void SizeChanged(Size value);
private:
VariableSpinBox *_x;
VariableSpinBox *_y;
friend class AreaSelection;
};
class AreaSelection : public QWidget {
Q_OBJECT
public:
AreaSelection(int min, int max, QWidget *parent = 0);
void SetArea(const Area &);
private slots:
void XSizeChanged(Size value);
void YSizeChanged(Size value);
signals:
void AreaChanged(Area value);
private:
SizeSelection *_x;
SizeSelection *_y;
};
} // namespace advss