OpenShot Library | libopenshot  0.3.3
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
VideoRenderWidget::GetRenderer
VideoRenderer * GetRenderer() const
Definition: VideoRenderWidget.cpp:44
VideoRenderer.h
Header file for Video Renderer class.
VideoRenderWidget
Definition: VideoRenderWidget.h:24
openshot::Fraction
This class represents a fraction.
Definition: Fraction.h:30
VideoRenderWidget::paintEvent
void paintEvent(QPaintEvent *event)
Definition: VideoRenderWidget.cpp:69
VideoRenderWidget::centeredViewport
QRect centeredViewport(int width, int height)
Definition: VideoRenderWidget.cpp:55
VideoRenderWidget::VideoRenderWidget
VideoRenderWidget(QWidget *parent=0)
Definition: VideoRenderWidget.cpp:22
VideoRenderer
Definition: VideoRenderer.h:24
VideoRenderWidget::SetAspectRatio
void SetAspectRatio(openshot::Fraction new_aspect_ratio, openshot::Fraction new_pixel_ratio)
Definition: VideoRenderWidget.cpp:49
VideoRenderWidget::~VideoRenderWidget
~VideoRenderWidget()
Definition: VideoRenderWidget.cpp:40