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