]> git.sesse.net Git - kdenlive/blob - src/vectorscope.h
de552524d836697bd585e8c62ef88ec633821da5
[kdenlive] / src / vectorscope.h
1 /***************************************************************************
2  *   Copyright (C) 2010 by Simon Andreas Eugster (simon.eu@gmail.com)      *
3  *   This file is part of kdenlive. See www.kdenlive.org.                  *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  ***************************************************************************/
10
11 #ifndef VECTORSCOPE_H
12 #define VECTORSCOPE_H
13
14 #include <QtCore>
15 #include "ui_vectorscope_ui.h"
16 #include "abstractscopewidget.h"
17
18 class ColorPlaneExport;
19 class ColorTools;
20 class Render;
21 class Monitor;
22 class Vectorscope_UI;
23 class VectorscopeGenerator;
24
25 enum BACKGROUND_MODE { BG_NONE = 0, BG_YUV = 1, BG_CHROMA = 2 };
26
27 class Vectorscope : public AbstractScopeWidget {
28     Q_OBJECT
29
30 public:
31     Vectorscope(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent = 0);
32     ~Vectorscope();
33
34     QString widgetName() const;
35
36 protected:
37     void mouseMoveEvent(QMouseEvent *);
38
39
40     ///// Implemented methods /////
41     QRect scopeRect();
42     QImage renderHUD(uint accelerationFactor);
43     QImage renderScope(uint accelerationFactor);
44     QImage renderBackground(uint accelerationFactor);
45     bool isHUDDependingOnInput() const;
46     bool isScopeDependingOnInput() const;
47     bool isBackgroundDependingOnInput() const;
48
49 private:
50     Ui::Vectorscope_UI *ui;
51
52     ColorTools *m_colorTools;
53     ColorPlaneExport *m_colorPlaneExport;
54
55     QAction *m_aExportBackground;
56     QAction *m_aAxisEnabled;
57     QAction *m_a75PBox;
58
59     VectorscopeGenerator *m_vectorscopeGenerator;
60
61     /** How to represent the pixels on the scope (green, original color, ...) */
62     int iPaintMode;
63
64     /** Custom scaling of the vectorscope */
65     float m_gain;
66
67     QPoint m_centerPoint, pR75, pG75, pB75, pCy75, pMg75, pYl75;
68
69     bool m_circleEnabled;
70     QPoint m_mousePos;
71
72     /** Updates the dimension. Only necessary when the widget has been resized. */
73     void updateDimensions();
74     int cw;
75
76     /** Counts the number of frames that have been rendered in one of the monitors.
77       The frame number will be reset when the vectorscope starts calculating the
78       current frame. */
79 //    QAtomicInt newFrames;
80     /** Counts the number of other changes that should cause the vectorscope to be
81       recalculated. This is for example a resizeEvent. In this case, no new frames
82       are generated, but the scope has to be updated in any case (also if auto-update
83       is not enabled). */
84 //    QAtomicInt newChanges;
85     /** Counts the number of changes concerning the background wheel */
86 //    QAtomicInt newWheelChanges;
87
88
89 private slots:
90     void slotGainChanged(int);
91     void slotBackgroundChanged();
92     void slotExportBackground();
93 };
94
95 #endif // VECTORSCOPE_H