Qt 5.11 | Qt Quick | C++ Classes | QSGImageNode

Qt 5.11.3 Reference Documentation

# QSGImageNode Class

The QSGImageNode class is provided for convenience to easily draw textured content using the QML scene graph. More...

Header: | #include <QSGImageNode>
qmake: | QT += quick
Since: | Qt 5.8
Inherits: | QSGGeometryNode

- List of all members, including inherited members

## Public Types

enum | TextureCoordinatesTransformFlag { NoTransform, MirrorHorizontally, MirrorVertically }
flags | TextureCoordinatesTransformMode

## Public Functions

virtual | ~QSGImageNode() override
virtual QSGTexture::Filtering | filtering() const = 0
virtual QSGTexture::Filtering | mipmapFiltering() const = 0
virtual bool | ownsTexture() const = 0
virtual QRectF | rect() const = 0
virtual void | setFiltering(QSGTexture::Filtering filtering) = 0
virtual void | setMipmapFiltering(QSGTexture::Filtering filtering) = 0
virtual void | setOwnsTexture(bool owns) = 0
virtual void | setRect(const QRectF &rect) = 0
void | setRect(qreal x, qreal y, qreal w, qreal h)
virtual void | setSourceRect(const QRectF &r) = 0
void | setSourceRect(qreal x, qreal y, qreal w, qreal h)
virtual void | setTexture(QSGTexture *texture) = 0
virtual void | setTextureCoordinatesTransform(QSGImageNode::TextureCoordinatesTransformMode mode) = 0
virtual QRectF | sourceRect() const = 0
virtual QSGTexture * | texture() const = 0
virtual QSGImageNode::TextureCoordinatesTransformMode | textureCoordinatesTransform() const = 0

- 6 public functions inherited from QSGGeometryNode
- 7 public functions inherited from QSGBasicGeometryNode
- 22 public functions inherited from QSGNode

## Static Public Members

void | rebuildGeometry(QSGGeometry *g, QSGTexture *texture, const QRectF &rect, QRectF sourceRect, QSGImageNode::TextureCoordinatesTransformMode texCoordMode)

## Detailed Description

The QSGImageNode class is provided for convenience to easily draw textured content using the QML scene graph.

Warning: 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

### `[override virtual]` QSGImageNode::~QSGImageNode()

Destroys the instance of QSGImageNode. The destructor is virtual.

### `[pure virtual]` QSGTexture::Filtering QSGImageNode::filtering() const

See also setFiltering().

### `[pure virtual]` QSGTexture::Filtering QSGImageNode::mipmapFiltering() const

See also setMipmapFiltering().

### `[pure virtual]` bool QSGImageNode::ownsTexture() const

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

See also setRect().

### `[pure virtual]` void QSGImageNode::setFiltering(QSGTexture::Filtering filtering)

See also filtering().

### `[pure virtual]` void QSGImageNode::setMipmapFiltering(QSGTexture::Filtering filtering)

See also mipmapFiltering().

### `[pure virtual]` void QSGImageNode::setOwnsTexture(bool owns)

See also ownsTexture().

### `[pure virtual]` void QSGImageNode::setRect(const QRectF &rect)

See also rect().

### void QSGImageNode::setRect(qreal x, qreal y, qreal w, qreal h)

### `[pure virtual]` void QSGImageNode::setSourceRect(const QRectF &r)

See also sourceRect().

### void QSGImageNode::setSourceRect(qreal x, qreal y, qreal w, qreal h)

### `[pure virtual]` void QSGImageNode::setTexture(QSGTexture *texture)

See also texture().

### `[pure virtual]` void QSGImageNode::setTextureCoordinatesTransform(QSGImageNode::TextureCoordinatesTransformMode mode)

See also textureCoordinatesTransform().

### `[pure virtual]` QRectF QSGImageNode::sourceRect() const

See also setSourceRect().

### `[pure virtual]` QSGTexture *QSGImageNode::texture() const

See also setTexture().

### `[pure virtual]` QSGImageNode::TextureCoordinatesTransformMode QSGImageNode::textureCoordinatesTransform() const

See also setTextureCoordinatesTransform().