Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
proceduralskytexturedata_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14
15
16#ifndef PROCEDURALSKYTEXTURE_H
17#define PROCEDURALSKYTEXTURE_H
18
19#include <QtQuick3D/QQuick3DTextureData>
20#include <QtQml/QQmlEngine>
21
22#include <QtGui/QColor>
23#include <QtCore/QByteArray>
24
26
28{
34
39
49
50public:
58
61
62 QColor skyTopColor() const;
63 QColor skyHorizonColor() const;
64 float skyCurve() const;
65 float skyEnergy() const;
66
69 float groundCurve() const;
70 float groundEnergy() const;
71
72 QColor sunColor() const;
73 float sunLatitude() const;
74 float sunLongitude() const;
75 float sunAngleMin() const;
76 float sunAngleMax() const;
77 float sunCurve() const;
78 float sunEnergy() const;
79
81
82public Q_SLOTS:
85 void setSkyCurve(float skyCurve);
86 void setSkyEnergy(float skyEnergy);
87
90 void setGroundCurve(float groundCurve);
91 void setGroundEnergy(float groundEnergy);
92
94 void setSunLatitude(float sunLatitude);
95 void setSunLongitude(float sunLongitude);
96 void setSunAngleMin(float sunAngleMin);
97 void setSunAngleMax(float sunAngleMax);
98 void setSunCurve(float sunCurve);
99 void setSunEnergy(float sunEnergy);
100
102
104
110
115
117
124
126
127private:
128
129 struct LinearColor {
130 float r = 0.0f;
131 float g = 0.0f;
132 float b = 0.0f;
133 float a = 0.0f;
134 LinearColor(const QColor &color);
135 LinearColor() {}
136
137 LinearColor interpolate(const LinearColor &color, float value) const;
138 LinearColor blend(const LinearColor &color) const;
139 quint32 toRGBE9995() const;
140 quint32 toRGBA8() const;
141 quint32 toRGBE8() const;
142 };
143
144 QByteArray generateSkyTexture(int width, int height, QByteArray &imageData, bool isRGBE) const;
145 void scheduleTextureUpdate();
146 QColor m_skyTopColor = QColor(165, 214, 241);
147 QColor m_skyHorizonColor = QColor(214, 234, 250);
148 float m_skyCurve = 0.09f;
149 float m_skyEnergy = 1.0f;
150
151 QColor m_groundBottomColor = QColor(40, 47, 54);
152 QColor m_groundHorizonColor = QColor(108, 101, 95);
153 float m_groundCurve = 0.02f;
154 float m_groundEnergy = 1.0f;
155
156 QColor m_sunColor = QColor(255, 255, 255);
157 float m_sunLatitude = 35.0f;
158 float m_sunLongitude = 0.0f;
159 float m_sunAngleMin = 1.0f;
160 float m_sunAngleMax = 100.0f;
161 float m_sunCurve = 0.05f;
162 float m_sunEnergy = 1.0f;
163
165};
166
168
169#endif // PROCEDURALSKYTEXTURE_H
void groundHorizonColorChanged(QColor groundHorizonColor)
void setGroundHorizonColor(QColor groundHorizonColor)
void sunCurveChanged(float sunCurve)
void setGroundBottomColor(QColor groundBottomColor)
void setSunAngleMax(float sunAngleMax)
void groundCurveChanged(float groundCurve)
void setGroundEnergy(float groundEnergy)
void groundEnergyChanged(float groundEnergy)
void skyEnergyChanged(float skyEnergy)
void setSkyHorizonColor(QColor skyHorizonColor)
void sunAngleMinChanged(float sunAngleMin)
void sunColorChanged(QColor sunColor)
void sunEnergyChanged(float sunEnergy)
void skyCurveChanged(float skyCurve)
void setGroundCurve(float groundCurve)
void sunLatitudeChanged(float sunLatitude)
void textureQualityChanged(SkyTextureQuality textureQuality)
void setTextureQuality(SkyTextureQuality textureQuality)
void setSunLatitude(float sunLatitude)
void sunLongitudeChanged(float sunLongitude)
ProceduralSkyTextureData()
\qmltype ProceduralSkyTextureData \inqmlmodule QtQuick3D.Helpers \inherits TextureData
void setSunAngleMin(float sunAngleMin)
void skyHorizonColorChanged(QColor skyHorizonColor)
void skyTopColorChanged(QColor skyTopColor)
void groundBottomColorChanged(QColor groundBottomColor)
void setSkyTopColor(QColor skyTopColor)
void setSunLongitude(float sunLongitude)
void sunAngleMaxChanged(float sunAngleMax)
\inmodule QtCore
Definition qbytearray.h:57
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\qmltype TextureData \inherits Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DTextureData
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLboolean GLboolean GLboolean b
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLboolean r
[2]
GLint GLsizei width
GLuint color
[2]
GLboolean GLboolean g
#define QML_ELEMENT
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
unsigned int quint32
Definition qtypes.h:50
QByteArray imageData
[15]