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