#pragma once #include #include #include #include #include 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 width; NumberVariable height; }; struct Area { void Save(obs_data_t *obj, const char *name) const; void Load(obs_data_t *obj, const char *name); NumberVariable x; NumberVariable y; NumberVariable width; NumberVariable 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 &); void YChanged(const NumberVariable &); 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