]> git.sesse.net Git - kdenlive/blobdiff - src/vectorscope.h
Pre-select the first parameter on effects with not other parameter selected to be...
[kdenlive] / src / vectorscope.h
index d9a2922d2abebdacd4d09e076d9f2568be0c25f1..a126e73f7db912f4976e601c7632329762c071ec 100644 (file)
@@ -1,5 +1,6 @@
 /***************************************************************************
  *   Copyright (C) 2010 by Simon Andreas Eugster (simon.eu@gmail.com)      *
+ *   This file is part of kdenlive. See www.kdenlive.org.                  *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
  *   it under the terms of the GNU General Public License as published by  *
 #ifndef VECTORSCOPE_H
 #define VECTORSCOPE_H
 
-#include "renderer.h"
+#include <QtCore>
 #include "ui_vectorscope_ui.h"
+#include "abstractscopewidget.h"
 
+class ColorPlaneExport;
+class ColorTools;
 class Render;
+class Monitor;
 class Vectorscope_UI;
+class VectorscopeGenerator;
 
-enum PAINT_MODE { GREEN = 0, ORIG = 1, CHROMA = 2 };
+enum BACKGROUND_MODE { BG_NONE = 0, BG_YUV = 1, BG_CHROMA = 2, BG_YPbPr = 3 };
 
-class Vectorscope : public QWidget, public Ui::Vectorscope_UI {
+class Vectorscope : public AbstractScopeWidget {
     Q_OBJECT
 
 public:
-    Vectorscope(Render *projRender, Render *clipRender, QWidget *parent = 0);
+    Vectorscope(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent = 0);
     ~Vectorscope();
 
+    QString widgetName() const;
+
 protected:
-    void paintEvent(QPaintEvent *);
-    void mousePressEvent(QMouseEvent *);
-    void mouseMoveEvent(QMouseEvent *event);
+    ///// Implemented methods /////
+    QRect scopeRect();
+    QImage renderHUD(uint accelerationFactor);
+    QImage renderScope(uint accelerationFactor, const QImage);
+    QImage renderBackground(uint accelerationFactor);
+    bool isHUDDependingOnInput() const;
+    bool isScopeDependingOnInput() const;
+    bool isBackgroundDependingOnInput() const;
+    virtual void readConfig();
+
+    ///// Other /////
+    void writeConfig();
 
 private:
-    Render *m_projRender;
-    Render *m_clipRender;
-    Render *m_activeRender;
-    QImage m_scope;
+    Ui::Vectorscope_UI *ui;
+
+    ColorTools *m_colorTools;
+    ColorPlaneExport *m_colorPlaneExport;
+
+    QActionGroup *m_agColorSpace;
+    QAction *m_aColorSpace_YUV;
+    QAction *m_aColorSpace_YPbPr;
+    QAction *m_aExportBackground;
+    QAction *m_aAxisEnabled;
+    QAction *m_a75PBox;
+
+    VectorscopeGenerator *m_vectorscopeGenerator;
+
+    /** How to represent the pixels on the scope (green, original color, ...) */
     int iPaintMode;
-    float scaling;
-    QPoint mapToCanvas(QRect inside, QPointF point);
 
-    bool circleOnly;
-    QPoint mousePos;
+    /** Custom scaling of the vectorscope */
+    float m_gain;
 
-private slots:
-    void slotPaintModeChanged(int index);
-    void slotMagnifyChanged();
-    void slotActiveMonitorChanged(bool isClipMonitor);
+    QPoint m_centerPoint, pR75, pG75, pB75, pCy75, pMg75, pYl75;
+    QPoint qR75, qG75, qB75, qCy75, qMg75, qYl75;
+
+    /** Updates the dimension. Only necessary when the widget has been resized. */
+    void updateDimensions();
+    int cw;
+
+    /** Counts the number of frames that have been rendered in one of the monitors.
+      The frame number will be reset when the vectorscope starts calculating the
+      current frame. */
+//    QAtomicInt newFrames;
+    /** Counts the number of other changes that should cause the vectorscope to be
+      recalculated. This is for example a resizeEvent. In this case, no new frames
+      are generated, but the scope has to be updated in any case (also if auto-update
+      is not enabled). */
+//    QAtomicInt newChanges;
+    /** Counts the number of changes concerning the background wheel */
+//    QAtomicInt newWheelChanges;
 
+
+private slots:
+    void slotGainChanged(int);
+    void slotBackgroundChanged();
+    void slotExportBackground();
+    void slotColorSpaceChanged();
 };
 
 #endif // VECTORSCOPE_H