v2.0.0
Loading...
Searching...
No Matches
videooverlay.h
Go to the documentation of this file.
1//=============================================================================================================
19
20#ifndef VIDEOOVERLAY_H
21#define VIDEOOVERLAY_H
22
23//=============================================================================================================
24// INCLUDES
25//=============================================================================================================
26
27#include "../disp3D_global.h"
28
29#include <QImage>
30#include <QVector3D>
31
32//=============================================================================================================
33// DEFINE NAMESPACE DISP3DLIB
34//=============================================================================================================
35
36namespace DISP3DLIB
37{
38
39//=============================================================================================================
53{
54public:
55 VideoOverlay() = default;
56
57 bool isEnabled() const { return m_enabled; }
58 void setEnabled(bool enabled) { m_enabled = enabled; }
59
61 QVector3D focusPosition() const { return m_focusPosition; }
62 void setFocusPosition(const QVector3D &pos) { m_focusPosition = pos; }
63
65 float sizeMeters() const { return m_size; }
66 void setSizeMeters(float size) { m_size = size; }
67
69 const QImage &frame() const { return m_frame; }
70 bool hasFrame() const { return !m_frame.isNull(); }
71
73 void setFrame(const QImage &image)
74 {
75 if (image.isNull())
76 return;
77 m_frame = image;
78 ++m_frameGeneration;
79 }
80
82 quint64 frameGeneration() const { return m_frameGeneration; }
83
85 float opacity() const { return m_opacity; }
86 void setOpacity(float opacity) { m_opacity = opacity; }
87
93 QVector3D upHint() const { return m_upHint; }
94 void setUpHint(const QVector3D &dir) { m_upHint = dir; }
95
96 // ── Depth / topographic relief ──────────────────────────────────
97
99 bool isDepthEnabled() const { return m_depthEnabled; }
100 void setDepthEnabled(bool enabled) { m_depthEnabled = enabled; }
101
103 void setDepthFrame(const QImage &image)
104 {
105 if (image.isNull())
106 return;
107 m_depthFrame = image;
108 ++m_depthFrameGeneration;
109 }
110
111 const QImage &depthFrame() const { return m_depthFrame; }
112 bool hasDepthFrame() const { return !m_depthFrame.isNull(); }
113 quint64 depthFrameGeneration() const { return m_depthFrameGeneration; }
114
116 float depthScale() const { return m_depthScale; }
117 void setDepthScale(float scale) { m_depthScale = scale; }
118
120 int depthSteps() const { return m_depthSteps; }
121 void setDepthSteps(int steps) { m_depthSteps = steps; }
122
123private:
124 bool m_enabled = false;
125 QVector3D m_focusPosition = QVector3D(0.0f, 0.05f, 0.08f); // arbitrary default near the top of the head
126 QVector3D m_upHint;
127 float m_size = 0.06f;
128 float m_opacity = 1.0f;
129 QImage m_frame;
130 quint64 m_frameGeneration = 0;
131
132 // Depth / topographic relief
133 bool m_depthEnabled = false;
134 QImage m_depthFrame;
135 quint64 m_depthFrameGeneration = 0;
136 float m_depthScale = 0.25f;
137 int m_depthSteps = 32;
138};
139
140} // namespace DISP3DLIB
141
142#endif // VIDEOOVERLAY_H
Library export/import macros and namespace marker for the disp3D library.
#define DISP3DSHARED_EXPORT
3-D brain visualisation using the Qt RHI rendering backend.
void setDepthSteps(int steps)
void setEnabled(bool enabled)
QVector3D focusPosition() const
float sizeMeters() const
void setFrame(const QImage &image)
void setDepthFrame(const QImage &image)
void setSizeMeters(float size)
QVector3D upHint() const
Hint direction used as the quad's "up" axis. When set (non-zero), the quad's long edge is perpendicul...
const QImage & frame() const
void setDepthScale(float scale)
void setUpHint(const QVector3D &dir)
void setFocusPosition(const QVector3D &pos)
void setOpacity(float opacity)
quint64 frameGeneration() const
void setDepthEnabled(bool enabled)
quint64 depthFrameGeneration() const
const QImage & depthFrame() const
bool isDepthEnabled() const