CuteLogger
Fast and simple logging solution for Qt based applications
videovectorscopewidget.h
1 /*
2  * Copyright (c) 2019 Meltytech, LLC
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef VIDEOVECTORSCOPEWIDGET_H
19 #define VIDEOVECTORSCOPEWIDGET_H
20 
21 #include "scopewidget.h"
22 
23 #include <QImage>
24 #include <QMutex>
25 
26 class VideoVectorScopeWidget Q_DECL_FINAL : public ScopeWidget
27 {
28  Q_OBJECT
29 
30 public:
31  explicit VideoVectorScopeWidget();
32  virtual ~VideoVectorScopeWidget();
33  QString getTitle() Q_DECL_OVERRIDE;
34 
35 private:
36  enum {
37  BLUE_75 = 0,
38  CYAN_75,
39  GREEN_75,
40  YELLOW_75,
41  RED_75,
42  MAGENTA_75,
43  BLUE_100,
44  CYAN_100,
45  GREEN_100,
46  YELLOW_100,
47  RED_100,
48  MAGENTA_100,
49  COLOR_POINT_COUNT,
50  };
51 
52  // Called in scope thread
53  void refreshScope(const QSize &size, bool full) Q_DECL_OVERRIDE;
54  void drawGraticuleLines(QPainter &p, qreal lineWidth);
55  void drawSkinToneLine(QPainter &p, qreal lineWidth);
56  void drawGraticuleMark(
57  QPainter &p, const QPoint &point, QColor color, qreal lineWidth, qreal LineLength);
58 
59  // Called in UI thread
60  void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
61  void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
62  QRect getCenteredSquare();
63 
64  // Only accessed by the scope thread
65  SharedFrame m_frame;
66  QImage m_renderImg;
67  QImage m_graticuleImg;
68 
69  // Variables accessed from multiple threads (mutex protected)
70  QMutex m_mutex;
71  QImage m_displayImg;
72  QPoint m_points[COLOR_POINT_COUNT];
73  bool m_profileChanged;
74 
75 private slots:
76  void profileChanged();
77 };
78 
79 #endif // VIDEOVECTORSCOPEWIDGET_H
The ScopeWidget provides a common interface for all scopes in Shotcut.
Definition: scopewidget.h:58
virtual QString getTitle()=0
virtual void refreshScope(const QSize &size, bool full)=0
The SharedFrame provides thread safe access to Mlt::Frame data.
Definition: sharedframe.h:50