]> git.sesse.net Git - kdenlive/blob - src/scopes/colorscopes/abstractgfxscopewidget.h
a4ff72c1523521286193ab05e4841a0b6f7ea9f7
[kdenlive] / src / scopes / colorscopes / abstractgfxscopewidget.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 ABSTRACTGFXSCOPEWIDGET_H
12 #define ABSTRACTGFXSCOPEWIDGET_H
13
14 #include <QtCore>
15 #include <QtCore/QString>
16 #include <QWidget>
17
18 #include "../abstractscopewidget.h"
19
20 class QMenu;
21
22
23 /**
24 \brief Abstract class for scopes analyzing image frames.
25 */
26 class AbstractGfxScopeWidget : public AbstractScopeWidget
27 {
28     Q_OBJECT
29
30 public:
31     explicit AbstractGfxScopeWidget(bool trackMouse = false, QWidget *parent = 0);
32     virtual ~AbstractGfxScopeWidget(); // Must be virtual because of inheritance, to avoid memory leaks
33
34 protected:
35     ///// Variables /////
36
37     /** @brief Scope renderer. Must emit signalScopeRenderingFinished()
38         when calculation has finished, to allow multi-threading.
39         accelerationFactor hints how much faster than usual the calculation should be accomplished, if possible. */
40     virtual QImage renderGfxScope(uint accelerationFactor, const QImage) = 0;
41
42     virtual QImage renderScope(uint accelerationFactor);
43
44     void mouseReleaseEvent(QMouseEvent *);
45
46 private:
47     QImage m_scopeImage;
48     QMutex m_mutex;
49
50 public slots:
51     /** @brief Must be called when the active monitor has shown a new frame.
52       This slot must be connected in the implementing class, it is *not*
53       done in this abstract class. */
54     void slotRenderZoneUpdated(const QImage);
55
56 protected slots:
57     virtual void slotAutoRefreshToggled(bool autoRefresh);
58
59 signals:
60     void signalFrameRequest(const QString widgetName);
61
62 };
63
64 #endif // ABSTRACTGFXSCOPEWIDGET_H