-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCubemapQuickRender.h
56 lines (45 loc) · 1.4 KB
/
CubemapQuickRender.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef CUBEMAPQUICKRENDER_H
#define CUBEMAPQUICKRENDER_H
#include <QtQuick/QQuickFramebufferObject>
#include <QImage>
class CubemapFboRender;
class CubemapQuickRender : public QQuickFramebufferObject
{
Q_OBJECT
Q_PROPERTY(Scheme scheme READ scheme WRITE setScheme NOTIFY schemeChanged)
Q_PROPERTY(float yRotation READ yRotation WRITE setYRotation NOTIFY yRotationChanged)
Q_PROPERTY(QSize renderSize READ renderSize NOTIFY renderSizeChanged)
public:
enum class Scheme{
VerticalCross,
HorizontalCross,
VerticalLine,
HorizontalLine,
Horizontal3x2
};
Q_ENUMS(Scheme)
QSize renderSize();
CubemapQuickRender();
Renderer *createRenderer() const;
Scheme scheme() const;
float yRotation() const;
void setScheme(Scheme _scheme);
void setYRotation(float _yRotation);
Q_INVOKABLE void saveToFileCubemap(QString fileName);
Q_INVOKABLE void loadFromFileEquRectMap(QString fileName);
public slots:
void cubemapReady(QImage);
signals:
void schemeChanged(CubemapQuickRender::Scheme);
void imageLoaded(QImage);
void yRotationChanged(float);
void renderSizeChanged(QSize);
private:
void updateRenderSize();
Scheme m_scheme;
QImage m_cubemapImage;
QSize m_renderSize;
int m_faceSideSize;
float m_yRotation;
};
#endif // CUBEMAPQUICKRENDER_H