OpenShot Library | libopenshot 0.3.3
Loading...
Searching...
No Matches
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
24class VideoRenderWidget : public QWidget
25{
26 Q_OBJECT
27
28private:
29 VideoRenderer *renderer;
30 QImage image;
31 openshot::Fraction aspect_ratio;
32 openshot::Fraction pixel_ratio;
33
34public:
35 VideoRenderWidget(QWidget *parent = 0);
37
39 void SetAspectRatio(openshot::Fraction new_aspect_ratio, openshot::Fraction new_pixel_ratio);
40
41protected:
42 void paintEvent(QPaintEvent *event);
43
44 QRect centeredViewport(int width, int height);
45
46private 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)
This class represents a fraction.
Definition Fraction.h:30