]> git.sesse.net Git - kdenlive/blobdiff - src/videoglwidget.cpp
reindent.sh ;)
[kdenlive] / src / videoglwidget.cpp
index 8fa6b344230261f68a3fbef14cd84e40123b812a..36eec01e8f3003ced015c04aa6e06474423b86b4 100644 (file)
@@ -8,12 +8,12 @@
 #endif
 
 VideoGLWidget::VideoGLWidget(QWidget *parent)
- : QGLWidget(parent)
- , m_image_width(0)
- , m_image_height(0)
- , m_texture(0)
, m_display_ratio(4.0/3.0)
- , m_backgroundColor(Qt::gray)
       : QGLWidget(parent)
       , m_image_width(0)
       , m_image_height(0)
       , m_texture(0)
       , m_display_ratio(4.0 / 3.0)
       , m_backgroundColor(Qt::gray)
 {
 }
 
@@ -52,19 +52,15 @@ void VideoGLWidget::resizeGL(int width, int height)
 
     // Special case optimisation to negate odd effect of sample aspect ratio
     // not corresponding exactly with image resolution.
-    if ((int)(this_aspect * 1000) == (int)(m_display_ratio * 1000))
-    {
+    if ((int)(this_aspect * 1000) == (int)(m_display_ratio * 1000)) {
         w = width;
         h = height;
     }
     // Use OpenGL to normalise sample aspect ratio
-    else if (height * m_display_ratio > width)
-    {
+    else if (height * m_display_ratio > width) {
         w = width;
         h = width / m_display_ratio;
-    }
-    else
-    {
+    } else {
         w = height * m_display_ratio;
         h = height;
     }
@@ -81,18 +77,17 @@ void VideoGLWidget::resizeGL(int width, int height)
 void VideoGLWidget::paintGL()
 {
     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-    if (m_texture)
-    {
+    if (m_texture) {
         glEnable(GL_TEXTURE_RECTANGLE_EXT);
         glBegin(GL_QUADS);
-            glTexCoord2i(0, 0);
-            glVertex2i(x, y);
-            glTexCoord2i(m_image_width, 0);
-            glVertex2i(x + w, y);
-            glTexCoord2i(m_image_width, m_image_height);
-            glVertex2i(x + w, y + h);
-            glTexCoord2i(0, m_image_height);
-            glVertex2i(x, y + h);
+        glTexCoord2i(0, 0);
+        glVertex2i(x, y);
+        glTexCoord2i(m_image_width, 0);
+        glVertex2i(x + w, y);
+        glTexCoord2i(m_image_width, m_image_height);
+        glVertex2i(x + w, y + h);
+        glTexCoord2i(0, m_image_height);
+        glVertex2i(x, y + h);
         glEnd();
         glDisable(GL_TEXTURE_RECTANGLE_EXT);
     }
@@ -112,6 +107,6 @@ void VideoGLWidget::showImage(QImage image)
     glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     glTexParameterf(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
     glTexImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, GL_RGBA8, m_image_width, m_image_height, 0, GL_RGBA,
-        GL_UNSIGNED_BYTE, image.bits());
+                 GL_UNSIGNED_BYTE, image.bits());
     updateGL();
 }