Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qssgrenderimage_p.h
Go to the documentation of this file.
1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#ifndef QSSG_RENDER_IMAGE_H
6#define QSSG_RENDER_IMAGE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick3DRuntimeRender/private/qssgrendergraphobject_p.h>
20#include <QtQuick3DRuntimeRender/private/qssgrenderimagetexture_p.h>
21#include <QtQuick3DRuntimeRender/private/qssgrenderbuffermanager_p.h>
22#include <QtQuick3DRuntimeRender/private/qtquick3druntimerenderglobal_p.h>
23#include <QtQuick3DRuntimeRender/private/qssgrendererutil_p.h>
24#include <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
25
26#include <QtGui/QVector2D>
27
30class QSGTexture;
32
33struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderImage : public QSSGRenderGraphObject
34{
35 enum class Flag
36 {
37 Dirty = 1 << 0,
38 TransformDirty = 1 << 1,
39 };
41
42 enum class MappingModes : quint8
43 {
44 Normal = 0, // UV mapping
45 Environment = 1,
46 LightProbe = 2,
47 };
48
49 Q_DISABLE_COPY(QSSGRenderImage)
50
51 QSSGRenderGraphObject *m_parent = nullptr;
52
53 QSSGRenderPath m_imagePath;
54 // The QSGTexture (from sourceItem) is not sharable between Qt Quick render
55 // threads, when the threaded render loop is in use. That's why we allow
56 // this exception here; the (per-QQuickWindow, and so per-render-thread)
57 // BufferManager will refuse to use this if the threads don't match.
58 QSGTexture *m_qsgTexture = nullptr; // overrides m_imagePath and m_rawTextureData when non-null
59 QSSGRenderTextureData *m_rawTextureData = nullptr; // overrides m_imagePath and m_qsgTexture when non-null
60
61 Flags m_flags;
62
63 QVector2D m_scale { 1.0f, 1.0f };
64 QVector2D m_pivot { 0.0f, 0.0f };
65 QVector2D m_position { 0.0f, 0.0f };
66 float m_rotation = 0.0f; // degrees
67 bool m_flipU = false;
68 bool m_flipV = false;
69 int m_indexUV = 0;
70 MappingModes m_mappingMode = MappingModes::Normal;
77 bool m_generateMipmaps = false;
78
79 // Changing any of the above variables is covered by the Dirty flag, while
80 // the texture transform is covered by TransformDirty.
82
83 QSSGRenderImage(QSSGRenderGraphObject::Type type = QSSGRenderGraphObject::Type::Image2D);
85
86 bool clearDirty();
87 void calculateTextureTransform();
88 bool isImageTransformIdentity() const;
89};
90
91Q_DECLARE_OPERATORS_FOR_FLAGS(QSSGRenderImage::Flags)
92
94
95#endif
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtQuick
Definition qsgtexture.h:20
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31
Combined button and popup list for selecting options.
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
Flags
GLenum type
QSSGRenderTextureCoordOp
QSSGRenderTextureFilterOp
unsigned char quint8
Definition qtypes.h:41
QMatrix4x4 m_textureTransform