Loading...
Searching...
No Matches
VideoRenderWidget.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_VIDEO_RENDERER_WIDGET_H
#define OPENSHOT_VIDEO_RENDERER_WIDGET_H
#include "../Fraction.h"
#include "VideoRenderer.h"
#include <QWidget>
#include <QImage>
#include <QPaintEvent>
#include <QRect>
class VideoRenderWidget : public QWidget
{
Q_OBJECT
private:
VideoRenderer *renderer;
QImage image;
openshot::Fraction aspect_ratio;
openshot::Fraction pixel_ratio;
public:
VideoRenderWidget(QWidget *parent = 0);
~VideoRenderWidget();
VideoRenderer *GetRenderer() const;
void SetAspectRatio(openshot::Fraction new_aspect_ratio, openshot::Fraction new_pixel_ratio);
protected:
void paintEvent(QPaintEvent *event);
QRect centeredViewport(int width, int height);
private slots:
void present(const QImage &image);
};
#endif // OPENSHOT_VIDEO_RENDERER_WIDGET_H
Fraction.h
Header file for Fraction class.
VideoRenderer.h
Header file for Video Renderer class.
VideoRenderWidget::centeredViewport
QRect centeredViewport(int width, int height)
Definition VideoRenderWidget.cpp:55
VideoRenderWidget::GetRenderer
VideoRenderer * GetRenderer() const
Definition VideoRenderWidget.cpp:44
VideoRenderWidget::~VideoRenderWidget
~VideoRenderWidget()
Definition VideoRenderWidget.cpp:40
VideoRenderWidget::paintEvent
void paintEvent(QPaintEvent *event)
Definition VideoRenderWidget.cpp:69
VideoRenderWidget::SetAspectRatio
void SetAspectRatio(openshot::Fraction new_aspect_ratio, openshot::Fraction new_pixel_ratio)
Definition VideoRenderWidget.cpp:49
VideoRenderWidget::VideoRenderWidget
VideoRenderWidget(QWidget *parent=0)
Definition VideoRenderWidget.cpp:22
VideoRenderer
Definition VideoRenderer.h:25
openshot::Fraction
This class represents a fraction.
Definition Fraction.h:30