4#include <QtQuick/private/qsgcontext_p.h>
5#include <private/qsgadaptationlayer_p.h>
6#include <private/qquickitem_p.h>
7#include <QtQuick/qsgnode.h>
8#include <QtQuick/qsgtexture.h>
10#include <QRandomGenerator>
13#include <private/qquicksprite_p.h>
14#include <private/qquickspriteengine_p.h>
15#include <QSGRendererInterface>
16#include <QtQuick/private/qsgplaintexture_p.h>
17#include <private/qqmlglobal_p.h>
18#include <QtQml/qqmlinfo.h>
19#include <QtCore/QtMath>
27#define UNIFORM_ARRAY_SIZE 64
68 memcpy(
buf->data(),
m.constData(), 64);
72 const float opacity = renderState.
opacity();
73 memcpy(
buf->data() + 64, &opacity, 4);
81 float timestamp = float(
state->timestamp);
82 memcpy(
buf->data() + 72, ×tamp, 4);
84 float *
p =
reinterpret_cast<float *
>(
buf->data() + 80);
105 }
else if (binding == 1) {
146 memcpy(
buf->data(),
m.constData(), 64);
150 const float opacity = renderState.
opacity();
151 memcpy(
buf->data() + 64, &opacity, 4);
157 memcpy(
buf->data() + 68, &
entry, 4);
159 float timestamp = float(
state->timestamp);
160 memcpy(
buf->data() + 72, ×tamp, 4);
210 memcpy(
buf->data(),
m.constData(), 64);
214 const float opacity = renderState.
opacity();
215 memcpy(
buf->data() + 64, &opacity, 4);
221 memcpy(
buf->data() + 68, &
entry, 4);
223 float timestamp = float(
state->timestamp);
224 memcpy(
buf->data() + 72, ×tamp, 4);
226 float *
p =
reinterpret_cast<float *
>(
buf->data() + 80);
247 }
else if (binding == 1) {
288 memcpy(
buf->data(),
m.constData(), 64);
292 const float opacity = renderState.
opacity();
293 memcpy(
buf->data() + 64, &opacity, 4);
299 memcpy(
buf->data() + 68, &
entry, 4);
301 float timestamp = float(
state->timestamp);
302 memcpy(
buf->data() + 72, ×tamp, 4);
305 memcpy(
buf->data() + 76, &
dpr, 4);
383 memcpy(
buf->data(),
m.constData(), 64);
387 const float opacity = renderState.
opacity();
388 memcpy(
buf->data() + 64, &opacity, 4);
394 memcpy(
buf->data() + 68, &
entry, 4);
396 float timestamp = float(
state->timestamp);
397 memcpy(
buf->data() + 72, ×tamp, 4);
400 memcpy(
buf->data() + 76, &
dpr, 4);
679 , m_color_variation(0.0)
682 , m_alphaVariation(0.0)
684 , m_redVariation(0.0)
685 , m_greenVariation(0.0)
686 , m_blueVariation(0.0)
688 , m_rotationVariation(0)
689 , m_rotationVelocity(0)
690 , m_rotationVelocityVariation(0)
691 , m_autoRotation(
false)
695 , m_spritesInterpolate(true)
696 , m_explicitColor(
false)
697 , m_explicitRotation(
false)
698 , m_explicitDeformation(
false)
699 , m_explicitAnimation(
false)
700 , m_bypassOptimizations(
false)
704 , m_entryEffect(Fade)
705 , m_startedImageLoading(0)
707 , m_apiChecked(
false)
709 , m_previousActive(
false)
729 m_material =
nullptr;
730 delete m_outgoingNode;
731 m_outgoingNode =
nullptr;
732 m_apiChecked =
false;
737 if (
image.isEmpty()){
746 m_image.
reset(
new ImageData);
747 if (
image == m_image->source)
749 m_image->source =
image;
757 if (
table.isEmpty()){
759 m_colorTable.
reset();
766 m_colorTable.
reset(
new ImageData);
767 if (
table == m_colorTable->source)
769 m_colorTable->source =
table;
776 if (
table.isEmpty()){
785 m_sizeTable.
reset(
new ImageData);
786 if (
table == m_sizeTable->source)
788 m_sizeTable->source =
table;
795 if (
table.isEmpty()){
796 if (m_opacityTable) {
797 m_opacityTable.
reset();
804 m_opacityTable.
reset(
new ImageData);
805 if (
table == m_opacityTable->source)
807 m_opacityTable->source =
table;
814 if (
color == m_color)
818 m_explicitColor =
true;
824 if (
var == m_color_variation)
826 m_color_variation =
var;
828 m_explicitColor =
true;
834 if (m_alphaVariation !=
arg) {
835 m_alphaVariation =
arg;
838 m_explicitColor =
true;
844 if (m_alpha !=
arg) {
848 m_explicitColor =
true;
854 if (m_redVariation !=
arg) {
855 m_redVariation =
arg;
858 m_explicitColor =
true;
864 if (m_greenVariation !=
arg) {
865 m_greenVariation =
arg;
868 m_explicitColor =
true;
874 if (m_blueVariation !=
arg) {
875 m_blueVariation =
arg;
878 m_explicitColor =
true;
884 if (m_rotation !=
arg) {
888 m_explicitRotation =
true;
894 if (m_rotationVariation !=
arg) {
895 m_rotationVariation =
arg;
898 m_explicitRotation =
true;
904 if (m_rotationVelocity !=
arg) {
905 m_rotationVelocity =
arg;
908 m_explicitRotation =
true;
914 if (m_rotationVelocityVariation !=
arg) {
915 m_rotationVelocityVariation =
arg;
918 m_explicitRotation =
true;
924 if (m_autoRotation !=
arg) {
925 m_autoRotation =
arg;
928 m_explicitRotation =
true;
934 if (m_xVector !=
arg) {
938 m_explicitDeformation =
true;
944 if (m_yVector !=
arg) {
948 m_explicitDeformation =
true;
954 if (m_spritesInterpolate !=
arg) {
955 m_spritesInterpolate =
arg;
962 if (m_bypassOptimizations !=
arg) {
963 m_bypassOptimizations =
arg;
972 if (m_entryEffect !=
arg) {
975 getState(m_material)->
entry = (
qreal) m_entryEffect;
982 m_explicitColor =
false;
985 if (
d->colorOwner ==
this) {
986 d->colorOwner =
nullptr;
991 m_color_variation = 0.0f;
992 m_redVariation = 0.0f;
993 m_blueVariation = 0.0f;
994 m_greenVariation = 0.0f;
996 m_alphaVariation = 0.0f;
1001 m_explicitRotation =
false;
1004 if (
d->rotationOwner ==
this) {
1005 d->rotationOwner =
nullptr;
1010 m_rotationVariation = 0;
1011 m_rotationVelocity = 0;
1012 m_rotationVelocityVariation = 0;
1013 m_autoRotation =
false;
1018 m_explicitDeformation =
false;
1021 if (
d->deformationOwner ==
this) {
1022 d->deformationOwner =
nullptr;
1030 m_xVector =
nullptr;
1031 m_yVector =
nullptr;
1042void QQuickImageParticle::invalidateSceneGraph()
1047void QQuickImageParticle::createEngine()
1050 delete m_spriteEngine;
1051 if (m_sprites.
size()) {
1055 m_explicitAnimation =
true;
1057 m_spriteEngine =
nullptr;
1058 m_explicitAnimation =
false;
1072 ( 2 + 4 + 4 ) *
sizeof(
float),
1086 ( 2 + 4 + 4 ) *
sizeof(
float) + 4 *
sizeof(
uchar),
1101 ( 2 + 4 + 4 ) *
sizeof(
float) + (4 + 4) *
sizeof(
uchar),
1117 (4 + 4 + 4 + 4) *
sizeof(
float) + (4 + 4) *
sizeof(
uchar),
1135 (4 + 4 + 4 + 4 + 3 + 3) *
sizeof(
float) + (4 + 4) *
sizeof(
uchar),
1139void QQuickImageParticle::clearShadows()
1143 m_shadowData.clear();
1152 if (!m_shadowData.contains(datum->
groupId)) {
1155 const int gdSize = gd->
size();
1156 data.reserve(gdSize);
1157 for (
int i = 0;
i < gdSize;
i++) {
1159 *datum = *(gd->
data[
i]);
1169void QQuickImageParticle::checkPerfLevel(PerformanceLevel
level)
1171 if (m_targetPerfLevel <
level) {
1172 m_targetPerfLevel =
level;
1177bool QQuickImageParticle::loadingSomething()
1179 return (m_image && m_image->pix.isLoading())
1180 || (m_colorTable && m_colorTable->pix.isLoading())
1181 || (m_sizeTable && m_sizeTable->pix.isLoading())
1182 || (m_opacityTable && m_opacityTable->pix.isLoading())
1183 || (m_spriteEngine && m_spriteEngine->
isLoading());
1186void QQuickImageParticle::mainThreadFetchImageData()
1190 const auto loadPix = [&](ImageData *
image) {
1200 m_image->pix.clear(
this);
1201 loadPix(m_image.
get());
1208 loadPix(m_colorTable.
get());
1211 loadPix(m_sizeTable.
get());
1214 loadPix(m_opacityTable.
get());
1216 m_startedImageLoading = 2;
1223 if (*passThrough || loadingSomething())
1226 if (m_startedImageLoading == 0) {
1227 m_startedImageLoading = 1;
1229 QQuickImageParticle::staticMetaObject.invokeMethod(
this,
"mainThreadFetchImageData",
Qt::QueuedConnection);
1230 }
else if (m_startedImageLoading == 2) {
1231 finishBuildParticleNodes(passThrough);
1237void QQuickImageParticle::finishBuildParticleNodes(
QSGNode** node)
1244 qmlInfo(
this) <<
"ImageParticle: Too many particles - maximum 16383 per ImageParticle";
1253 if (m_sprites.
size() || m_bypassOptimizations) {
1255 }
else if (m_colorTable || m_sizeTable || m_opacityTable) {
1257 }
else if (m_autoRotation || m_rotation || m_rotationVariation
1258 || m_rotationVelocity || m_rotationVelocityVariation
1259 || m_xVector || m_yVector) {
1261 }
else if (m_alphaVariation || m_alpha != 1.0 || m_color.
isValid() || m_color_variation
1262 || m_redVariation || m_blueVariation || m_greenVariation) {
1273 if (
other->perfLevel > perfLevel) {
1278 perfLevel =
other->perfLevel;
1280 }
else if (
other->perfLevel < perfLevel) {
1296 m_targetPerfLevel = perfLevel;
1300 m_material =
nullptr;
1307 bool imageLoaded =
false;
1308 switch (perfLevel) {
1311 if (!m_spriteEngine) {
1312 qWarning() <<
"ImageParticle: No sprite engine...";
1336 if (m_colorTable->pix.isReady())
1339 qmlWarning(
this) <<
"Error loading color table: " << m_colorTable->pix.error();
1343 if (m_sizeTable->pix.isReady())
1346 qmlWarning(
this) <<
"Error loading size table: " << m_sizeTable->pix.error();
1349 if (m_opacityTable) {
1350 if (m_opacityTable->pix.isReady())
1353 qmlWarning(
this) <<
"Error loading opacity table: " << m_opacityTable->pix.error();
1390 if (!m_image || !m_image->pix.isReady()) {
1415 m_nodes.
insert(groupId, node);
1416 m_idxStarts.
insert(groupId, m_lastIdxStart);
1418 m_lastIdxStart +=
count;
1421 int vCount =
count * 4;
1422 int iCount =
count * 6;
1427 else if (perfLevel ==
Tabled)
1431 else if (perfLevel ==
Colored)
1443 qDebug(
"Using point sprites");
1452 initTexCoords<SpriteVertex>((
SpriteVertex*)
g->vertexData(), vCount);
1453 else if (perfLevel ==
Tabled)
1457 else if (perfLevel ==
Colored)
1458 initTexCoords<ColoredVertex>((
ColoredVertex*)
g->vertexData(), vCount);
1479 if (node == *(m_nodes.
begin()))
1482 (*(m_nodes.
begin()))->appendChildNode(node);
1485 *node = *(m_nodes.
begin());
1492 m_apiChecked =
true;
1503 if (!node && !isRhi)
1511 if (isRhi && !m_rhi) {
1512 qWarning(
"Failed to query QRhi, particles disabled");
1523 delete m_outgoingNode;
1524 m_outgoingNode = node;
1529 m_idxStarts.
clear();
1530 m_startsIdx.
clear();
1533 m_material =
nullptr;
1536 m_startedImageLoading = 0;
1537 }
else if (!m_material) {
1550 }
else if (m_startedImageLoading < 2) {
1556 node = m_outgoingNode;
1557 m_outgoingNode =
nullptr;
1565 if (*node ==
nullptr){
1568 qDebug() <<
"QQuickImageParticle Feature level: " << perfLevel;
1569 qDebug() <<
"QQuickImageParticle Nodes: ";
1578 if (*node ==
nullptr)
1590 spritesUpdate(
time);
1602 bool active =
false;
1610 const bool dirty = active || m_previousActive;
1616 m_previousActive = active;
1620void QQuickImageParticle::spritesUpdate(
qreal time)
1631 QQuickParticleData* datum = (mainDatum->animationOwner ==
this ? mainDatum : getShadowDatum(mainDatum));
1633 for (
int i = 0;
i<m_startsIdx.
size();
i++) {
1634 if (m_startsIdx[
i].second == groupId){
1646 if (m_spritesInterpolate)
1647 progress = std::modf(
frame,&frameAt);
1649 std::modf(
frame,&frameAt);
1654 m_spriteEngine->
advance(spriteIdx);
1671 spriteVertices += datum->
index*4;
1672 for (
int i=0;
i<4;
i++) {
1684void QQuickImageParticle::spriteAdvance(
int spriteIdx)
1686 if (!m_startsIdx.
size())
1691 for (
i = 0;
i<m_startsIdx.
size();
i++) {
1692 if (spriteIdx < m_startsIdx[
i].
first) {
1693 gIdx = m_startsIdx[
i-1].second;
1698 gIdx = m_startsIdx[
i-1].second;
1699 int pIdx = spriteIdx - m_startsIdx[
i-1].
first;
1722 if (m_spriteEngine) {
1723 spriteIdx = m_idxStarts[gIdx] + datum->
index;
1724 if (spriteIdx >= m_spriteEngine->
count())
1725 m_spriteEngine->
setCount(spriteIdx+1);
1734 if (m_explicitAnimation && m_spriteEngine){
1738 writeTo->
animT = writeTo->
t;
1740 if (m_spriteEngine){
1741 m_spriteEngine->
start(spriteIdx);
1754 writeTo->
animT = datum->
t;
1768 if (m_explicitDeformation){
1774 datum->
xx =
ret.x();
1775 datum->
xy =
ret.y();
1778 shadow->
xx =
ret.x();
1779 shadow->
xy =
ret.y();
1785 datum->
yx =
ret.x();
1786 datum->
yy =
ret.y();
1789 shadow->
yx =
ret.x();
1790 shadow->
yy =
ret.y();
1795 if (m_explicitRotation){
1799 m_rotation + (m_rotationVariation
1803 + (m_rotationVelocityVariation
1805 autoRotate = m_autoRotation ? 1 : 0;
1823 if (m_explicitColor) {
1826 const auto rgbColor = m_color.
toRgb();
1856 spriteVertices += pIdx*4;
1857 for (
int i=0;
i<4;
i++){
1860 spriteVertices[
i].
t = datum->
t;
1864 spriteVertices[
i].
vx = datum->
vx;
1865 spriteVertices[
i].
vy = datum->
vy;
1866 spriteVertices[
i].
ax = datum->
ax;
1867 spriteVertices[
i].
ay = datum->
ay;
1870 spriteVertices[
i].
xx = shadow->
xx;
1871 spriteVertices[
i].
xy = shadow->
xy;
1872 spriteVertices[
i].
yx = shadow->
yx;
1873 spriteVertices[
i].
yy = shadow->
yy;
1875 spriteVertices[
i].
xx = datum->
xx;
1876 spriteVertices[
i].
xy = datum->
xy;
1877 spriteVertices[
i].
yx = datum->
yx;
1878 spriteVertices[
i].
yy = datum->
yy;
1891 if (m_explicitColor && datum->
colorOwner !=
this) {
1901 deformableVertices += pIdx*4;
1902 for (
int i=0;
i<4;
i++){
1905 deformableVertices[
i].
t = datum->
t;
1907 deformableVertices[
i].
size = datum->
size;
1909 deformableVertices[
i].
vx = datum->
vx;
1910 deformableVertices[
i].
vy = datum->
vy;
1911 deformableVertices[
i].
ax = datum->
ax;
1912 deformableVertices[
i].
ay = datum->
ay;
1915 deformableVertices[
i].
xx = shadow->
xx;
1916 deformableVertices[
i].
xy = shadow->
xy;
1917 deformableVertices[
i].
yx = shadow->
yx;
1918 deformableVertices[
i].
yy = shadow->
yy;
1920 deformableVertices[
i].
xx = datum->
xx;
1921 deformableVertices[
i].
xy = datum->
xy;
1922 deformableVertices[
i].
yx = datum->
yx;
1923 deformableVertices[
i].
yy = datum->
yy;
1935 if (m_explicitColor && datum->
colorOwner !=
this) {
1944 coloredVertices += pIdx*4;
1945 for (
int i=0;
i<4;
i++){
1948 coloredVertices[
i].
t = datum->
t;
1952 coloredVertices[
i].
vx = datum->
vx;
1953 coloredVertices[
i].
vy = datum->
vy;
1954 coloredVertices[
i].
ax = datum->
ax;
1955 coloredVertices[
i].
ay = datum->
ay;
1956 if (m_explicitColor && datum->
colorOwner !=
this) {
1965 coloredPointVertices += pIdx*1;
1966 for (
int i=0;
i<1;
i++){
1969 coloredPointVertices[
i].
t = datum->
t;
1971 coloredPointVertices[
i].
size = datum->
size;
1973 coloredPointVertices[
i].
vx = datum->
vx;
1974 coloredPointVertices[
i].
vy = datum->
vy;
1975 coloredPointVertices[
i].
ax = datum->
ax;
1976 coloredPointVertices[
i].
ay = datum->
ay;
1977 if (m_explicitColor && datum->
colorOwner !=
this) {
1986 simplePointVertices += pIdx*1;
1987 for (
int i=0;
i<1;
i++){
1990 simplePointVertices[
i].
t = datum->
t;
1992 simplePointVertices[
i].
size = datum->
size;
1994 simplePointVertices[
i].
vx = datum->
vx;
1995 simplePointVertices[
i].
vy = datum->
vy;
1996 simplePointVertices[
i].
ax = datum->
ax;
1997 simplePointVertices[
i].
ay = datum->
ay;
2009#include "moc_qquickimageparticle_p.cpp"
ColoredMaterialRhiShader()
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
ImageMaterialData * state() override
QSGMaterialType * type() const override
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
void updateSampledImage(RenderState &renderState, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *) override
This function is called by the scene graph to prepare use of sampled images in the shader,...
ColoredPointMaterialRhiShader()
bool updateUniformData(RenderState &renderState, QSGMaterial *newMaterial, QSGMaterial *) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
ImageMaterialData * state() override
QSGMaterialType * type() const override
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
float opacityTable[UNIFORM_ARRAY_SIZE]
float sizeTable[UNIFORM_ARRAY_SIZE]
bool updateUniformData(RenderState &renderState, QSGMaterial *newMaterial, QSGMaterial *) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
ParticleSpriteMaterialRhiShader()
void updateSampledImage(RenderState &renderState, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *) override
This function is called by the scene graph to prepare use of sampled images in the shader,...
The QColor class provides colors based on RGB, HSV or CMYK values.
QColor toRgb() const noexcept
Create and returns an RGB QColor based on this color.
bool isValid() const noexcept
Returns true if the color is valid; otherwise returns false.
key_iterator keyEnd() const noexcept
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
key_iterator keyBegin() const noexcept
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QImage scaled(int w, int h, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QRgb pixel(int x, int y) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
@ Format_ARGB32_Premultiplied
qsizetype size() const noexcept
void append(parameter_type t)
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
The QQmlContext class defines a context within a QML engine.
The QQmlEngine class provides an environment for instantiating QML components.
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
virtual QPointF sample(const QPointF &from)
void sceneGraphInvalidated() override
QQmlListProperty< QQuickSprite > sprites
void rotationChanged(qreal arg)
void setYVector(QQuickDirection *arg)
void setColortable(const QUrl &table)
void rotationVelocityChanged(qreal arg)
void setSizetable(const QUrl &table)
QSGNode * updatePaintNode(QSGNode *, UpdatePaintNodeData *) override
Called on the render thread when it is time to sync the state of the item with the scene graph.
void blueVariationChanged(qreal arg)
QQuickImageParticle(QQuickItem *parent=nullptr)
\qmltype ImageParticle \instantiates QQuickImageParticle \inqmlmodule QtQuick.Particles \inherits Par...
void xVectorChanged(QQuickDirection *arg)
void greenVariationChanged(qreal arg)
void setSpritesInterpolate(bool arg)
void buildParticleNodes(QSGNode **)
void setXVector(QQuickDirection *arg)
void setColorVariation(qreal var)
virtual ~QQuickImageParticle()
void setRotation(qreal arg)
void bypassOptimizationsChanged(bool arg)
void setRotationVelocityVariation(qreal arg)
void setAutoRotation(bool arg)
void rotationVariationChanged(qreal arg)
void initialize(int gIdx, int pIdx) override
void spritesInterpolateChanged(bool arg)
void setColor(const QColor &color)
bool prepareNextFrame(QSGNode **)
void setRedVariation(qreal arg)
void alphaVariationChanged(qreal arg)
void setBypassOptimizations(bool arg)
void entryEffectChanged(EntryEffect arg)
void setRotationVelocity(qreal arg)
void redVariationChanged(qreal arg)
void alphaChanged(qreal arg)
void setRotationVariation(qreal arg)
void yVectorChanged(QQuickDirection *arg)
QUrl opacitytable() const
void setOpacitytable(const QUrl &table)
void commit(int gIdx, int pIdx) override
void setBlueVariation(qreal arg)
void setGreenVariation(qreal arg)
void opacitytableChanged()
void autoRotationChanged(bool arg)
void setImage(const QUrl &image)
void setEntryEffect(EntryEffect arg)
void setAlphaVariation(qreal arg)
void colorVariationChanged()
void rotationVelocityVariationChanged(qreal arg)
QSGRenderContext * sceneGraphRenderContext() const
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
QString state() const
\qmlproperty string QtQuick::Item::state
qreal y
Defines the item's y position relative to its parent.
void stateChanged(const QString &)
void update()
Schedules a call to updatePaintNode() for this item.
QQuickImageParticle * deformationOwner
QQuickImageParticle * colorOwner
QQuickParticleGroupData::ID groupId
QQuickImageParticle * animationOwner
QQuickImageParticle * rotationOwner
QVector< QQuickParticleData * > data
const GroupIDs & groupIds() const
QQuickParticleSystem * m_system
QVarLengthArray< QQuickParticleGroupData *, 32 > groupData
int systemSync(QQuickParticlePainter *p)
int spriteDuration(int sprite=0) const
QQuickSprite * sprite(int sprite=0) const
int spriteFrames(int sprite=0) const
int spriteStart(int sprite=0) const
int spriteX(int sprite=0) const
void advance(int index=0) override
void startAssemblingImage()
int spriteState(int sprite=0) const
int spriteHeight(int sprite=0) const
int spriteWidth(int sprite=0) const
int spriteY(int sprite=0) const
QImage assembledImage(int maxSize=2048)
void start(int index=0, int state=0)
uint updateSprites(uint time)
static Q_DECL_CONST_FUNCTION QRandomGenerator * global()
\threadsafe
double bounded(double highest)
Generates one random double in the range between 0 (inclusive) and highest (exclusive).
const QSGGeometry * geometry() const
Returns this node's geometry.
void setGeometry(QSGGeometry *geometry)
Sets the geometry of this node to geometry.
virtual QSGRendererInterface * rendererInterface(QSGRenderContext *renderContext)
Returns a pointer to the (presumably) global renderer interface.
The QSGGeometryNode class is used for all rendered content in the scene graph.
void setMaterial(QSGMaterial *material)
Sets the material of this geometry node to material.
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
void * vertexData()
Returns a pointer to the raw vertex data of this geometry object.
Encapsulates the current rendering state during a call to QSGMaterialShader::updateUniformData() and ...
QByteArray * uniformData()
Returns a pointer to the data for the uniform (constant) buffer in the shader.
QMatrix4x4 combinedMatrix() const
Returns the matrix combined of modelview matrix and project matrix.
bool isMatrixDirty() const
Returns true if the dirtyStates() contain the dirty matrix state, otherwise returns false.
bool isOpacityDirty() const
Returns true if the dirtyStates() contains the dirty opacity state, otherwise returns false.
QRhi * rhi()
Returns the current QRhi.
float opacity() const
\variable QSGMaterialShader::GraphicsPipelineState::blendEnable
QRhiResourceUpdateBatch * resourceUpdateBatch()
Returns a resource update batch to which upload and copy operatoins can be queued.
The QSGMaterialShader class represents a graphics API independent shader program.
void setShaderFileName(Stage stage, const QString &filename)
Sets the filename for the shader for the specified stage.
The QSGMaterial class encapsulates rendering state for a shader program.
void setFlag(Flags flags, bool on=true)
Sets the flags flags on this material if on is true; otherwise clears the attribute.
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
void setFlag(Flag, bool=true)
Sets the flag f on this node if enabled is true; otherwise clears the flag.
static QSGPlainTexture * fromImage(const QImage &image)
QSGContext * sceneGraphContext() const
An interface providing access to some of the graphics API specific internals of the scenegraph.
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
static bool isApiRhiBased(GraphicsApi api)
virtual GraphicsApi graphicsApi() const =0
Returns the graphics API that is in use by the Qt Quick scenegraph.
virtual void * getResource(QQuickWindow *window, Resource resource) const
Queries a graphics resource in window.
GraphicsApi
\value Unknown An unknown graphics API is in use \value Software The Qt Quick 2D Renderer is in use \...
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
constexpr size_type size() const noexcept
SimplePointMaterialRhiShader()
bool updateUniformData(RenderState &renderState, QSGMaterial *newMaterial, QSGMaterial *) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
void updateSampledImage(RenderState &renderState, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *) override
This function is called by the scene graph to prepare use of sampled images in the shader,...
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
QSGMaterialType * type() const override
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
ImageMaterialData * state() override
QSGMaterialType * type() const override
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
ImageMaterialData * state() override
bool updateUniformData(RenderState &renderState, QSGMaterial *newMaterial, QSGMaterial *) override
This function is called by the scene graph to get the contents of the shader program's uniform buffer...
void updateSampledImage(RenderState &renderState, int binding, QSGTexture **texture, QSGMaterial *newMaterial, QSGMaterial *) override
This function is called by the scene graph to prepare use of sampled images in the shader,...
TabledMaterialRhiShader()
QSGMaterialShader * createShader(QSGRendererInterface::RenderMode renderMode) const override
This function returns a new instance of a the QSGMaterialShader implementation used to render geometr...
ImageMaterialData * state() override
QSGMaterialType * type() const override
This function is called by the scene graph to query an identifier that is unique to the QSGMaterialSh...
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Combined button and popup list for selecting options.
constexpr float qDegreesToRadians(float degrees)
constexpr const T & qBound(const T &min, const T &val, const T &max)
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat x1
GLenum GLenum GLsizei count
GLint GLint GLint GLint GLsizei GLsizei GLsizei GLboolean commit
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei GLenum const void * indices
GLfloat GLfloat GLfloat GLfloat h
GLenum GLenum GLsizei void * table
constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
QQmlContext * qmlContext(const QObject *obj)
Q_QML_EXPORT QQmlInfo qmlInfo(const QObject *me)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
static QSGGeometry::Attribute DeformableParticle_Attributes[]
static QSGGeometry::AttributeSet SpriteParticle_AttributeSet
void fillUniformArrayFromImage(float *array, const QImage &img, int size)
static QSGGeometry::Attribute SpriteParticle_Attributes[]
#define UNIFORM_ARRAY_SIZE
static QSGGeometry::AttributeSet SimplePointParticle_AttributeSet
static QSGGeometry::Attribute ColoredParticle_Attributes[]
static QSGGeometry::AttributeSet DeformableParticle_AttributeSet
static QSGGeometry::AttributeSet ColoredParticle_AttributeSet
static QSGGeometry::Attribute ColoredPointParticle_Attributes[]
static QSGGeometry::AttributeSet ColoredPointParticle_AttributeSet
static QSGGeometry::Attribute SimplePointParticle_Attributes[]
void spriteReplace(QQmlListProperty< QQuickSprite > *p, qsizetype idx, QQuickSprite *s)
void spriteAppend(QQmlListProperty< QQuickSprite > *p, QQuickSprite *s)
void spriteRemoveLast(QQmlListProperty< QQuickSprite > *p)
qsizetype spriteCount(QQmlListProperty< QQuickSprite > *p)
QQuickSprite * spriteAt(QQmlListProperty< QQuickSprite > *p, qsizetype idx)
void spriteClear(QQmlListProperty< QQuickSprite > *p)
constexpr int qAlpha(QRgb rgb)
#define QStringLiteral(str)
QImage scaled(const QImage &image)
[0]
The QSGGeometry::AttributeSet describes how the vertices in a QSGGeometry are built up.
The QSGGeometry::Attribute describes a single vertex attribute in a QSGGeometry.
static Attribute create(int pos, int tupleSize, int primitiveType, bool isPosition=false)
Creates a new QSGGeometry::Attribute for attribute register pos with tupleSize.
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent