OpenShot Library | libopenshot  0.3.0
VideoRenderWidget.h
Go to the documentation of this file.
1 
9 // Copyright (c) 2008-2019 OpenShot Studios, LLC
10 //
11 // SPDX-License-Identifier: LGPL-3.0-or-later
12 
13 #ifndef OPENSHOT_VIDEO_RENDERER_WIDGET_H
14 #define OPENSHOT_VIDEO_RENDERER_WIDGET_H
15 
16 #include "../Fraction.h"
17 #include "VideoRenderer.h"
18 
19 #include <QWidget>
20 #include <QImage>
21 #include <QPaintEvent>
22 #include <QRect>
23 
24 class VideoRenderWidget : public QWidget
25 {
26  Q_OBJECT
27 
28 private:
29  VideoRenderer *renderer;
30  QImage image;
31  openshot::Fraction aspect_ratio;
32  openshot::Fraction pixel_ratio;
33 
34 public:
35  VideoRenderWidget(QWidget *parent = 0);
37 
38  VideoRenderer *GetRenderer() const;
39  void SetAspectRatio(openshot::Fraction new_aspect_ratio, openshot::Fraction new_pixel_ratio);
40 
41 protected:
42  void paintEvent(QPaintEvent *event);
43 
44  QRect centeredViewport(int width, int height);
45 
46 private slots:
47  void present(const QImage &image);
48 
49 };
50 
51 #endif // OPENSHOT_VIDEO_RENDERER_WIDGET_H
Header file for Video Renderer class.
QRect centeredViewport(int width, int height)
VideoRenderer * GetRenderer() const
void paintEvent(QPaintEvent *event)
void SetAspectRatio(openshot::Fraction new_aspect_ratio, openshot::Fraction new_pixel_ratio)
VideoRenderWidget(QWidget *parent=0)
This class represents a fraction.
Definition: Fraction.h:30