- class QSGImageNode¶
The
QSGImageNode
class is provided for convenience to easily draw textured content using the QML scene graph. More…Synopsis¶
Methods¶
def
setRect()
def
setSourceRect()
Virtual methods¶
def
filtering()
def
ownsTexture()
def
rect()
def
setFiltering()
def
setOwnsTexture()
def
setRect()
def
setSourceRect()
def
setTexture()
def
sourceRect()
def
texture()
Static functions¶
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
Warning
The image node class must have a texture before being added to the scene graph to be rendered.
- class TextureCoordinatesTransformFlag¶
(inherits
enum.Flag
) The TextureCoordinatesTransformFlag enum is used to specify the mode used to generate texture coordinates for a textured quad.Constant
Description
QSGImageNode.NoTransform
Texture coordinates are oriented with window coordinates i.e. with origin at top-left.
QSGImageNode.MirrorHorizontally
Texture coordinates are inverted in the horizontal axis with respect to window coordinates
QSGImageNode.MirrorVertically
Texture coordinates are inverted in the vertical axis with respect to window coordinates
- abstract anisotropyLevel()¶
- Return type:
Returns this image node’s anistropy level.
See also
Returns the filtering for this image node.
See also
Returns the mipmap filtering for this image node.
See also
- abstract ownsTexture()¶
- Return type:
bool
Returns
true
if the node takes ownership of the texture; otherwisefalse
.See also
- static rebuildGeometry(g, texture, rect, sourceRect, texCoordMode)¶
- Parameters:
g –
QSGGeometry
texture –
QSGTexture
rect –
QRectF
sourceRect –
QRectF
texCoordMode – Combination of
TextureCoordinatesTransformFlag
Updates the geometry
g
with thetexture
, the coordinates inrect
, and the texture coordinates fromsourceRect
.g
is assumed to be a triangle strip of four vertices of typeTexturedPoint2D
.texCoordMode
is used for normalizing thesourceRect
.Returns the target rect of this image node.
See also
- abstract setAnisotropyLevel(level)¶
- Parameters:
level –
AnisotropyLevel
Sets this image node’s anistropy level to
level
.See also
Sets the filtering to be used for this image node to
filtering
.For smooth scaling, use
Linear
. For normal scaling, useNearest
.See also
Sets the mipmap filtering to be used for this image node to
filtering
.For smooth scaling between mip maps, use
Linear
. For normal scaling, useNearest
.See also
- abstract setOwnsTexture(owns)¶
- Parameters:
owns – bool
Sets whether the node takes ownership of the texture to
owns
.By default, the node does not take ownership of the texture.
See also
Sets the target rect of this image node to
rect
.See also
- setRect(x, y, w, h)
- Parameters:
x – float
y – float
w – float
h – float
This is an overloaded function.
Sets the rectangle of this image node to begin at (
x
,y
) and have widthw
and heighth
.Sets the source rect of this image node to
rect
.See also
- setSourceRect(x, y, w, h)
- Parameters:
x – float
y – float
w – float
h – float
This is an overloaded function.
Sets the rectangle of this image node to show its texture from (
x
,y
) and have widthw
and heighth
relatively to thetextureSize
.- abstract setTexture(texture)¶
- Parameters:
texture –
QSGTexture
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.Warning
An image node must have a texture before being added to the scenegraph to be rendered.
See also
- abstract setTextureCoordinatesTransform(mode)¶
- Parameters:
mode – Combination of
TextureCoordinatesTransformFlag
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
Returns the source rect of this image node.
See also
- abstract texture()¶
- Return type:
Returns the texture for this image node.
See also
- abstract textureCoordinatesTransform()¶
- Return type:
Combination of
TextureCoordinatesTransformFlag
Returns the mode used to generate texture coordinates for this node.
See also