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
qsgimagenode.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSGIMAGENODE_H
5#define QSGIMAGENODE_H
6
7#include <QtQuick/qsgnode.h>
8#include <QtQuick/qsgtexture.h>
9
11
12class Q_QUICK_EXPORT QSGImageNode : public QSGGeometryNode
13{
14public:
15 ~QSGImageNode() override = default;
16
17 virtual void setRect(const QRectF &rect) = 0;
18 inline void setRect(qreal x, qreal y, qreal w, qreal h) { setRect(QRectF(x, y, w, h)); }
19 virtual QRectF rect() const = 0;
20
21 virtual void setSourceRect(const QRectF &r) = 0;
23 virtual QRectF sourceRect() const = 0;
24
25 virtual void setTexture(QSGTexture *texture) = 0;
26 virtual QSGTexture *texture() const = 0;
27
28 virtual void setFiltering(QSGTexture::Filtering filtering) = 0;
29 virtual QSGTexture::Filtering filtering() const = 0;
30
31 virtual void setMipmapFiltering(QSGTexture::Filtering filtering) = 0;
33
36
38 NoTransform = 0x00,
39 MirrorHorizontally = 0x01,
40 MirrorVertically = 0x02
41 };
42 Q_DECLARE_FLAGS(TextureCoordinatesTransformMode, TextureCoordinatesTransformFlag)
43
44 virtual void setTextureCoordinatesTransform(TextureCoordinatesTransformMode mode) = 0;
45 virtual TextureCoordinatesTransformMode textureCoordinatesTransform() const = 0;
46
47 virtual void setOwnsTexture(bool owns) = 0;
48 virtual bool ownsTexture() const = 0;
49
50 static void rebuildGeometry(QSGGeometry *g,
52 const QRectF &rect,
53 QRectF sourceRect,
54 TextureCoordinatesTransformMode texCoordMode);
55};
56
57Q_DECLARE_OPERATORS_FOR_FLAGS(QSGImageNode::TextureCoordinatesTransformMode)
58
60
61#endif // QSGIMAGENODE_H
\inmodule QtCore\reentrant
Definition qrect.h:484
The QSGGeometryNode class is used for all rendered content in the scene graph.
Definition qsgnode.h:188
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
Definition qsggeometry.h:15
The QSGImageNode class is provided for convenience to easily draw textured content using the QML scen...
virtual void setSourceRect(const QRectF &r)=0
Sets the source rect of this image node to rect.
TextureCoordinatesTransformFlag
The TextureCoordinatesTransformFlag enum is used to specify the mode used to generate texture coordin...
void setRect(qreal x, qreal y, qreal w, qreal h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual void setFiltering(QSGTexture::Filtering filtering)=0
Sets the filtering to be used for this image node to filtering.
virtual QSGTexture::AnisotropyLevel anisotropyLevel() const =0
Returns this image node's anistropy level.
virtual QSGTexture::Filtering mipmapFiltering() const =0
Returns the mipmap filtering for this image node.
virtual QRectF rect() const =0
Returns the target rect of this image node.
virtual void setRect(const QRectF &rect)=0
Sets the target rect of this image node to rect.
virtual QSGTexture * texture() const =0
Returns the texture for this image node.
void setSourceRect(qreal x, qreal y, qreal w, qreal h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
~QSGImageNode() override=default
virtual QSGTexture::Filtering filtering() const =0
Returns the filtering for this image node.
virtual void setTexture(QSGTexture *texture)=0
Sets the texture of this image node to texture.
virtual void setMipmapFiltering(QSGTexture::Filtering filtering)=0
Sets the mipmap filtering to be used for this image node to filtering.
virtual void setAnisotropyLevel(QSGTexture::AnisotropyLevel level)=0
Sets this image node's anistropy level to level.
virtual QRectF sourceRect() const =0
Returns the source rect of this image node.
\inmodule QtQuick
Definition qsgtexture.h:20
Filtering
Specifies how sampling of texels should filter when texture coordinates are not pixel aligned.
Definition qsgtexture.h:34
AnisotropyLevel
Specifies the anisotropic filtering level to be used when the texture is not screen aligned.
Definition qsgtexture.h:40
rect
[4]
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
GLint GLint GLint GLint GLint x
[0]
GLenum mode
GLenum GLuint GLint level
GLfloat GLfloat GLfloat w
[0]
GLboolean r
[2]
GLenum GLuint texture
GLboolean GLboolean g
GLint y
GLfloat GLfloat GLfloat GLfloat h
double qreal
Definition qtypes.h:187