]> git.sesse.net Git - kdenlive/blobdiff - src/vectorscope.h
Try to fix timecode error:
[kdenlive] / src / vectorscope.h
index 9e5ad75e7c3c9bcbf6d1a9db63444dfa70ada31a..438efa4c9eec342aaa2ca18e3e0907fbd57d127a 100644 (file)
 #define VECTORSCOPE_H
 
 #include <QtCore>
-#include "renderer.h"
-#include "monitor.h"
 #include "ui_vectorscope_ui.h"
+#include "abstractscopewidget.h"
 
+class ColorPlaneExport;
+class ColorTools;
 class Render;
 class Monitor;
 class Vectorscope_UI;
+class VectorscopeGenerator;
 
-enum PAINT_MODE { PAINT_GREEN = 0, PAINT_ORIG = 1, PAINT_CHROMA = 2, PAINT_YUV = 3, PAINT_BLACK = 4 };
 enum BACKGROUND_MODE { BG_NONE = 0, BG_YUV = 1, BG_CHROMA = 2 };
 
-class Vectorscope : public QWidget, public Ui::Vectorscope_UI {
+class Vectorscope : public AbstractScopeWidget {
     Q_OBJECT
 
 public:
     Vectorscope(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent = 0);
     ~Vectorscope();
-    QImage yuvColorWheel(const QSize& size, const unsigned char Y, const float scaling, const bool modifiedVersion, const bool circleOnly);
+
+    QString widgetName() const;
 
 protected:
-    void paintEvent(QPaintEvent *);
-    void resizeEvent(QResizeEvent *event);
-    void mousePressEvent(QMouseEvent *);
-    void mouseMoveEvent(QMouseEvent *event);
+    void mouseMoveEvent(QMouseEvent *);
+    void leaveEvent(QEvent *);
+
+
+    ///// Implemented methods /////
+    QRect scopeRect();
+    QImage renderHUD(uint accelerationFactor);
+    QImage renderScope(uint accelerationFactor);
+    QImage renderBackground(uint accelerationFactor);
+    bool isHUDDependingOnInput() const;
+    bool isScopeDependingOnInput() const;
+    bool isBackgroundDependingOnInput() const;
 
 private:
-    Monitor *m_projMonitor;
-    Monitor *m_clipMonitor;
-    Render *m_activeRender;
+    Ui::Vectorscope_UI *ui;
+
+    ColorTools *m_colorTools;
+    ColorPlaneExport *m_colorPlaneExport;
 
-//    QMenu m_contextMenu;
     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 m_scaling;
+    /** Custom scaling of the vectorscope */
+    float m_gain;
 
+    QPoint m_centerPoint, pR75, pG75, pB75, pCy75, pMg75, pYl75;
 
-    QPoint mapToCanvas(QRect inside, QPointF point);
-
-    bool circleEnabled;
-    QPoint mousePos;
+    bool m_circleEnabled;
+    QPoint m_mousePos;
 
     /** Updates the dimension. Only necessary when the widget has been resized. */
     void updateDimensions();
-    bool initialDimensionUpdateDone;
-    QRect m_scopeRect;
     int cw;
 
-
-    /** The vectorscope color distribution.
-        Class variable as calculated by a thread. */
-    QImage m_scope;
-    QImage m_wheel;
-
-    void calculateScope();
-    QFuture<void> m_scopeCalcThread;
-    QFuture<QImage> m_wheelCalcThread;
-
-    /** Prods the Scope calculation thread. If it is running, do nothing. If it is not,
-      run a new thread.
-      Returns true if a new thread has been started. */
-    bool prodCalcThread();
-    bool prodWheelThread();
-
     /** 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;
+//    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;
+//    QAtomicInt newChanges;
     /** Counts the number of changes concerning the background wheel */
-    QAtomicInt newWheelChanges;
+//    QAtomicInt newWheelChanges;
 
-signals:
-    void signalScopeCalculationFinished();
-    void signalWheelCalculationFinished();
 
 private slots:
-    void slotMagnifyChanged();
+    void slotGainChanged(int);
     void slotBackgroundChanged();
-    void slotActiveMonitorChanged(bool isClipMonitor);
-    void slotRenderZoneUpdated();
-    void slotScopeCalculationFinished();
-    void slotWheelCalculationFinished();
-    void slotUpdateScope();
-    void slotUpdateWheel();
     void slotExportBackground();
 };