QSGImageNode Class▲
-
Header: QSGImageNode
-
Since: Qt 5.8
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Quick)
target_link_libraries(mytarget PRIVATE Qt6::Quick)
-
qmake: QT += quick
-
Inherits: QSGGeometryNode
-
Inherited By:
Detailed Description▲
The image node class must have a texture before being added to the scene graph to be rendered.
Member Type Documentation▲
enum QSGImageNode::TextureCoordinatesTransformFlag▲
flags QSGImageNode::TextureCoordinatesTransformMode
The TextureCoordinatesTransformFlag enum is used to specify the mode used to generate texture coordinates for a textured quad.
Constant |
Value |
Description |
---|---|---|
QSGImageNode::NoTransform |
0x00 |
Texture coordinates are oriented with window coordinates i.e. with origin at top-left. |
QSGImageNode::MirrorHorizontally |
0x01 |
Texture coordinates are inverted in the horizontal axis with respect to window coordinates |
QSGImageNode::MirrorVertically |
0x02 |
Texture coordinates are inverted in the vertical axis with respect to window coordinates |
The TextureCoordinatesTransformMode type is a typedef for QFlags<TextureCoordinatesTransformFlag>. It stores an OR combination of TextureCoordinatesTransformFlag values.
Member Function Documentation▲
[pure virtual] QSGTexture::AnisotropyLevel QSGImageNode::anisotropyLevel() const▲
[pure virtual] QSGTexture::Filtering QSGImageNode::filtering() const▲
[pure virtual] QSGTexture::Filtering QSGImageNode::mipmapFiltering() const▲
[pure virtual] bool QSGImageNode::ownsTexture() const▲
Returns true if the node takes ownership of the texture; otherwise false.
See Also▲
See also setOwnsTexture()
[static] void QSGImageNode::rebuildGeometry(QSGGeometry *g, QSGTexture *texture, const QRectF &rect, QRectF sourceRect, QSGImageNode::TextureCoordinatesTransformMode texCoordMode)▲
Updates the geometry g with the texture, the coordinates in rect, and the texture coordinates from sourceRect.
g is assumed to be a triangle strip of four vertices of type QSGGeometry::TexturedPoint2D.
texCoordMode is used for normalizing the sourceRect.
[pure virtual] QRectF QSGImageNode::rect() const▲
[pure virtual] void QSGImageNode::setAnisotropyLevel(QSGTexture::AnisotropyLevel level)▲
[pure virtual] void QSGImageNode::setFiltering(QSGTexture::Filtering filtering)▲
Sets the filtering to be used for this image node to filtering.
For smooth scaling, use QSGTexture::Linear. For normal scaling, use QSGTexture::Nearest.
See Also▲
See also filtering()
[pure virtual] void QSGImageNode::setMipmapFiltering(QSGTexture::Filtering filtering)▲
Sets the mipmap filtering to be used for this image node to filtering.
For smooth scaling between mip maps, use QSGTexture::Linear. For normal scaling, use QSGTexture::Nearest.
See Also▲
See also mipmapFiltering()
[pure virtual] void QSGImageNode::setOwnsTexture(bool owns)▲
Sets whether the node takes ownership of the texture to owns.
By default, the node does not take ownership of the texture.
See Also▲
See also ownsTexture()
[pure virtual] void QSGImageNode::setRect(const QRectF &rect)▲
void QSGImageNode::setRect(qreal x, qreal y, qreal w, qreal h)▲
This is an overloaded function.
Sets the rectangle of this image node to begin at (x, y) and have width w and height h.
[pure virtual] void QSGImageNode::setSourceRect(const QRectF &rect)▲
void QSGImageNode::setSourceRect(qreal x, qreal y, qreal w, qreal h)▲
This is an overloaded function.
Sets the rectangle of this image node to show its texture from (x, y) and have width w and height h relatively to the QSGTexture::textureSize.
[pure virtual] void QSGImageNode::setTexture(QSGTexture *texture)▲
Sets the texture of this image node to texture.
Use setOwnsTexture() to set whether the node should take ownership of the texture. By default, the node does not take ownership.
An image node must have a texture before being added to the scenegraph to be rendered.
See Also▲
See also texture()
[pure virtual] void QSGImageNode::setTextureCoordinatesTransform(QSGImageNode::TextureCoordinatesTransformMode mode)▲
Sets the method used to generate texture coordinates to mode. This can be used to obtain correct orientation of the texture. This is commonly needed when using a third-party OpenGL library to render to texture as OpenGL has an inverted y-axis relative to Qt Quick.
See Also▲
See also textureCoordinatesTransform()
[pure virtual] QRectF QSGImageNode::sourceRect() const▲
[pure virtual] QSGTexture *QSGImageNode::texture() const▲
[pure virtual] QSGImageNode::TextureCoordinatesTransformMode QSGImageNode::textureCoordinatesTransform() const▲
Returns the mode used to generate texture coordinates for this node.
See Also▲
See also setTextureCoordinatesTransform()