]> git.sesse.net Git - kdenlive/blob - src/videoglwidget.h
Fix issues with OpenGL aspect ration / corruption and DVD wizard monitor
[kdenlive] / src / videoglwidget.h
1
2 #ifndef VIDEOGLWIDGET_H
3 #define VIDEOGLWIDGET_H
4
5 #include <QGLWidget>
6
7 class VideoGLWidget : public QGLWidget
8 {
9     Q_OBJECT
10
11 public:
12     VideoGLWidget(QWidget *parent = 0);
13     ~VideoGLWidget();
14     void activateMonitor();
15     QSize minimumSizeHint() const;
16     QSize sizeHint() const;
17     void setImageAspectRatio(double ratio) {
18         m_display_ratio = ratio;
19     }
20     void setBackgroundColor(QColor color) {
21         m_backgroundColor = color;
22     }
23
24 private:
25     int x, y, w, h;
26     int m_image_width, m_image_height;
27     GLuint m_texture;
28     double m_display_ratio;
29     QColor m_backgroundColor;
30     Qt::WindowFlags m_baseFlags;
31
32 public slots:
33     void showImage(QImage image);
34
35 protected:
36     void initializeGL();
37     void resizeGL(int width, int height);
38     void resizeEvent(QResizeEvent* event);
39     void paintGL();
40     void mouseDoubleClickEvent(QMouseEvent * event);
41 };
42
43 #endif