1namespace QtAV
2{
3
4class WidgetRenderer : public QWidget, public QtAV::QPainterRenderer
5{
6%TypeHeaderCode
7#include <QtAVWidgets/WidgetRenderer.h>
8%End
9
10public:
11    QColor backgroundColor();
12    void setBackgroundColor(QColor color);
13    QRectF regionOfInterest();
14    void setRegionOfInterest(QRectF region);
15    qreal sourceAspectRatio();
16    qreal outAspectRatio();
17    void setOutAspectRatio(qreal ratio);
18    OutAspectRatioMode outAspectRatioMode();
19    void setOutAspectRatioMode(OutAspectRatioMode mode);
20    int orientation();
21    void setOrientation(int orientation);
22    QRect videoRect();
23    QSize videoFrameSize();
24
25public:
26    WidgetRenderer(QWidget* parent /TransferThis/ = 0, Qt::WindowFlags f = 0);
27    virtual VideoRendererId id();
28    virtual QWidget* widget();
29
30signals:
31    void sourceAspectRatioChanged(qreal value) final;
32    void regionOfInterestChanged();
33    void outAspectRatioChanged();
34    void outAspectRatioModeChanged();
35    void brightnessChanged(qreal value);
36    void contrastChanged(qreal);
37    void hueChanged(qreal);
38    void saturationChanged(qreal);
39    void backgroundColorChanged();
40    void orientationChanged();
41    void videoRectChanged();
42    void videoFrameSizeChanged();
43    void imageReady();
44
45protected:
46    bool receiveFrame(const VideoFrame& frame);
47    void resizeEvent(QResizeEvent *);
48    void paintEvent(QPaintEvent *);
49    bool onSetOrientation(int value);
50};
51typedef WidgetRenderer VideoRenderWidget;
52
53};
54