]> git.sesse.net Git - kdenlive/blob - src/scopes/colorscopes/vectorscope.h
Fix includes
[kdenlive] / src / scopes / colorscopes / 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 "ui_vectorscope_ui.h"
15 #include "abstractgfxscopewidget.h"
16
17 class ColorPlaneExport;
18 class ColorTools;
19
20 class Vectorscope_UI;
21 class VectorscopeGenerator;
22
23 enum BACKGROUND_MODE { BG_NONE = 0, BG_YUV = 1, BG_CHROMA = 2, BG_YPbPr = 3 };
24
25 /**
26    \brief Displays the vectorscope of a frame.
27
28    \see VectorscopeGenerator for more details about the vectorscope.
29    */
30 class Vectorscope : public AbstractGfxScopeWidget {
31     Q_OBJECT
32
33 public:
34     explicit Vectorscope(QWidget *parent = 0);
35     ~Vectorscope();
36
37     QString widgetName() const;
38
39 protected:
40     ///// Implemented methods /////
41     QRect scopeRect();
42     QImage renderHUD(uint accelerationFactor);
43     QImage renderGfxScope(uint accelerationFactor, const QImage &);
44     QImage renderBackground(uint accelerationFactor);
45     bool isHUDDependingOnInput() const;
46     bool isScopeDependingOnInput() const;
47     bool isBackgroundDependingOnInput() const;
48     virtual void readConfig();
49
50     ///// Other /////
51     void writeConfig();
52
53 private:
54     Ui::Vectorscope_UI *ui;
55
56     ColorTools *m_colorTools;
57     ColorPlaneExport *m_colorPlaneExport;
58
59     QActionGroup *m_agColorSpace;
60     QAction *m_aColorSpace_YUV;
61     QAction *m_aColorSpace_YPbPr;
62     QAction *m_aExportBackground;
63     QAction *m_aAxisEnabled;
64     QAction *m_a75PBox;
65     QAction *m_aIQLines;
66
67     VectorscopeGenerator *m_vectorscopeGenerator;
68
69     /** How to represent the pixels on the scope (green, original color, ...) */
70     int iPaintMode;
71
72     /** Custom scaling of the vectorscope */
73     float m_gain;
74
75     QPoint m_centerPoint, pR75, pG75, pB75, pCy75, pMg75, pYl75;
76     QPoint qR75, qG75, qB75, qCy75, qMg75, qYl75;
77     /** Unlike the scopeRect, this rect represents the overall visible rectangle
78         and not only the square touching the Vectorscope's circle. */
79     QRect m_visibleRect;
80
81     /** Updates the dimension. Only necessary when the widget has been resized. */
82     void updateDimensions();
83     int cw;
84
85
86 private slots:
87     void slotGainChanged(int);
88     void slotBackgroundChanged();
89     void slotExportBackground();
90     void slotColorSpaceChanged();
91 };
92
93 #endif // VECTORSCOPE_H