1 /***************************************************************************
2 * Copyright (C) 2010 by Simon Andreas Eugster (simon.eu@gmail.com) *
3 * This file is part of kdenlive. See www.kdenlive.org. *
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 ***************************************************************************/
15 #include "ui_vectorscope_ui.h"
16 #include "abstractscopewidget.h"
18 class ColorPlaneExport;
23 class VectorscopeGenerator;
25 enum BACKGROUND_MODE { BG_NONE = 0, BG_YUV = 1, BG_CHROMA = 2, BG_YPbPr = 3 };
27 class Vectorscope : public AbstractScopeWidget {
31 Vectorscope(Monitor *projMonitor, Monitor *clipMonitor, QWidget *parent = 0);
34 QString widgetName() const;
37 ///// Implemented methods /////
39 QImage renderHUD(uint accelerationFactor);
40 QImage renderScope(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();
51 Ui::Vectorscope_UI *ui;
53 ColorTools *m_colorTools;
54 ColorPlaneExport *m_colorPlaneExport;
56 QActionGroup *m_agColorSpace;
57 QAction *m_aColorSpace_YUV;
58 QAction *m_aColorSpace_YPbPr;
59 QAction *m_aExportBackground;
60 QAction *m_aAxisEnabled;
63 VectorscopeGenerator *m_vectorscopeGenerator;
65 /** How to represent the pixels on the scope (green, original color, ...) */
68 /** Custom scaling of the vectorscope */
71 QPoint m_centerPoint, pR75, pG75, pB75, pCy75, pMg75, pYl75;
72 QPoint qR75, qG75, qB75, qCy75, qMg75, qYl75;
74 /** Updates the dimension. Only necessary when the widget has been resized. */
75 void updateDimensions();
78 /** Counts the number of frames that have been rendered in one of the monitors.
79 The frame number will be reset when the vectorscope starts calculating the
81 // QAtomicInt newFrames;
82 /** Counts the number of other changes that should cause the vectorscope to be
83 recalculated. This is for example a resizeEvent. In this case, no new frames
84 are generated, but the scope has to be updated in any case (also if auto-update
86 // QAtomicInt newChanges;
87 /** Counts the number of changes concerning the background wheel */
88 // QAtomicInt newWheelChanges;
92 void slotGainChanged(int);
93 void slotBackgroundChanged();
94 void slotExportBackground();
95 void slotColorSpaceChanged();
98 #endif // VECTORSCOPE_H