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//=============================================================================================================
55{
56public:
57 VideoOverlay() = default;
58
59 bool isEnabled() const
60 {
61 return m_enabled;
62 }
63 void setEnabled(bool enabled)
64 {
65 m_enabled = enabled;
66 }
67
69 QVector3D focusPosition() const
70 {
71 return m_focusPosition;
72 }
73 void setFocusPosition(const QVector3D& pos)
74 {
75 m_focusPosition = pos;
76 }
77
79 float sizeMeters() const
80 {
81 return m_size;
82 }
83 void setSizeMeters(float size)
84 {
85 m_size = size;
86 }
87
89 const QImage& frame() const
90 {
91 return m_frame;
92 }
93 bool hasFrame() const
94 {
95 return !m_frame.isNull();
96 }
97
103 void setFrame(const QImage& image)
104 {
105 if (image.isNull())
106 return;
107 m_frame = image;
108 ++m_frameGeneration;
109 }
110
116 quint64 frameGeneration() const
117 {
118 return m_frameGeneration;
119 }
120
122 float opacity() const
123 {
124 return m_opacity;
125 }
126 void setOpacity(float opacity)
127 {
128 m_opacity = opacity;
129 }
130
138 QVector3D upHint() const
139 {
140 return m_upHint;
141 }
142 void setUpHint(const QVector3D& dir)
143 {
144 m_upHint = dir;
145 }
146
147 // ── Depth / topographic relief ──────────────────────────────────
148
150 bool isDepthEnabled() const
151 {
152 return m_depthEnabled;
153 }
154 void setDepthEnabled(bool enabled)
155 {
156 m_depthEnabled = enabled;
157 }
158
164 void setDepthFrame(const QImage& image)
165 {
166 if (image.isNull())
167 return;
168 m_depthFrame = image;
169 ++m_depthFrameGeneration;
170 }
171
172 const QImage& depthFrame() const
173 {
174 return m_depthFrame;
175 }
176 bool hasDepthFrame() const
177 {
178 return !m_depthFrame.isNull();
179 }
180 quint64 depthFrameGeneration() const
181 {
182 return m_depthFrameGeneration;
183 }
184
186 float depthScale() const
187 {
188 return m_depthScale;
189 }
190 void setDepthScale(float scale)
191 {
192 m_depthScale = scale;
193 }
194
196 int depthSteps() const
197 {
198 return m_depthSteps;
199 }
200 void setDepthSteps(int steps)
201 {
202 m_depthSteps = steps;
203 }
204
205private:
206 bool m_enabled = false;
207 QVector3D m_focusPosition = QVector3D(0.0f, 0.05f, 0.08f); // arbitrary default near the top of the head
208 QVector3D m_upHint;
209 float m_size = 0.06f;
210 float m_opacity = 1.0f;
211 QImage m_frame;
212 quint64 m_frameGeneration = 0;
213
214 // Depth / topographic relief
215 bool m_depthEnabled = false;
216 QImage m_depthFrame;
217 quint64 m_depthFrameGeneration = 0;
218 float m_depthScale = 0.25f;
219 int m_depthSteps = 32;
220};
221
222} // namespace DISP3DLIB
223
224#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