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 "abstractgfxscopewidget.h"
18 class ColorPlaneExport;
22 class VectorscopeGenerator;
24 enum BACKGROUND_MODE { BG_NONE = 0, BG_YUV = 1, BG_CHROMA = 2, BG_YPbPr = 3 };
27 \brief Displays the vectorscope of a frame.
29 \see VectorscopeGenerator for more details about the vectorscope.
31 class Vectorscope : public AbstractGfxScopeWidget {
35 Vectorscope(QWidget *parent = 0);
38 QString widgetName() const;
41 ///// Implemented methods /////
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();
55 Ui::Vectorscope_UI *ui;
57 ColorTools *m_colorTools;
58 ColorPlaneExport *m_colorPlaneExport;
60 QActionGroup *m_agColorSpace;
61 QAction *m_aColorSpace_YUV;
62 QAction *m_aColorSpace_YPbPr;
63 QAction *m_aExportBackground;
64 QAction *m_aAxisEnabled;
68 VectorscopeGenerator *m_vectorscopeGenerator;
70 /** How to represent the pixels on the scope (green, original color, ...) */
73 /** Custom scaling of the vectorscope */
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. */
82 /** Updates the dimension. Only necessary when the widget has been resized. */
83 void updateDimensions();
88 void slotGainChanged(int);
89 void slotBackgroundChanged();
90 void slotExportBackground();
91 void slotColorSpaceChanged();
94 #endif // VECTORSCOPE_H