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 ***************************************************************************/
14 #include "ui_vectorscope_ui.h"
15 #include "abstractgfxscopewidget.h"
17 class ColorPlaneExport;
21 class VectorscopeGenerator;
23 enum BACKGROUND_MODE { BG_NONE = 0, BG_YUV = 1, BG_CHROMA = 2, BG_YPbPr = 3 };
26 \brief Displays the vectorscope of a frame.
28 \see VectorscopeGenerator for more details about the vectorscope.
30 class Vectorscope : public AbstractGfxScopeWidget {
34 explicit Vectorscope(QWidget *parent = 0);
37 QString widgetName() const;
40 ///// Implemented methods /////
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();
54 Ui::Vectorscope_UI *ui;
56 ColorTools *m_colorTools;
57 ColorPlaneExport *m_colorPlaneExport;
59 QActionGroup *m_agColorSpace;
60 QAction *m_aColorSpace_YUV;
61 QAction *m_aColorSpace_YPbPr;
62 QAction *m_aExportBackground;
63 QAction *m_aAxisEnabled;
67 VectorscopeGenerator *m_vectorscopeGenerator;
69 /** How to represent the pixels on the scope (green, original color, ...) */
72 /** Custom scaling of the vectorscope */
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. */
81 /** Updates the dimension. Only necessary when the widget has been resized. */
82 void updateDimensions();
87 void slotGainChanged(int);
88 void slotBackgroundChanged();
89 void slotExportBackground();
90 void slotColorSpaceChanged();
93 #endif // VECTORSCOPE_H