![]() |
Qt 6.x
The Qt SDK
|
The QQuickRenderTarget class provides an opaque container for native graphics resources specifying a render target, and associated metadata. More...
#include <qquickrendertarget.h>
Public Member Functions | |
QQuickRenderTarget () | |
Constructs a default QQuickRenderTarget that does not reference any native objects. | |
~QQuickRenderTarget () | |
Destructor. | |
QQuickRenderTarget (const QQuickRenderTarget &other) | |
QQuickRenderTarget & | operator= (const QQuickRenderTarget &other) |
bool | isNull () const |
qreal | devicePixelRatio () const |
void | setDevicePixelRatio (qreal ratio) |
Sets the device pixel ratio for this render target to ratio. | |
bool | mirrorVertically () const |
void | setMirrorVertically (bool enable) |
Sets the size of the render target contents should be mirrored vertically to enable when drawing. | |
Static Public Member Functions | |
static QQuickRenderTarget | fromRhiRenderTarget (QRhiRenderTarget *renderTarget) |
static QQuickRenderTarget | fromPaintDevice (QPaintDevice *device) |
Friends | |
class | QQuickRenderTargetPrivate |
bool | operator== (const QQuickRenderTarget &lhs, const QQuickRenderTarget &rhs) noexcept |
bool | operator!= (const QQuickRenderTarget &lhs, const QQuickRenderTarget &rhs) noexcept |
The QQuickRenderTarget class provides an opaque container for native graphics resources specifying a render target, and associated metadata.
Definition at line 24 of file qquickrendertarget.h.
QQuickRenderTarget::QQuickRenderTarget | ( | ) |
Constructs a default QQuickRenderTarget that does not reference any native objects.
Definition at line 43 of file qquickrendertarget.cpp.
QQuickRenderTarget::~QQuickRenderTarget | ( | ) |
Destructor.
Definition at line 77 of file qquickrendertarget.cpp.
References QBasicAtomicInteger< T >::deref(), and QQuickRenderTargetPrivate::ref.
QQuickRenderTarget::QQuickRenderTarget | ( | const QQuickRenderTarget & | other | ) |
Definition at line 59 of file qquickrendertarget.cpp.
References QBasicAtomicInteger< T >::ref(), and QQuickRenderTargetPrivate::ref.
qreal QQuickRenderTarget::devicePixelRatio | ( | ) | const |
The default device pixel ratio is 1.0.
Definition at line 102 of file qquickrendertarget.cpp.
References QQuickRenderTargetPrivate::devicePixelRatio.
|
static |
This option of redirecting rendering to a QPaintDevice is available only when running with the software
backend of Qt Quick.
Definition at line 671 of file qquickrendertarget.cpp.
References d, device, and QQuickRenderTargetPrivate::get().
|
static |
format specifies the native internal format of the texture. Only texture formats that are supported by Qt's rendering infrastructure should be used.
pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.
sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.
The texture is used as the first color attachment of the render target used by the Qt Quick scenegraph. A depth-stencil buffer, if applicable, is created and used automatically.
The OpenGL object name textureId must be a valid name in the rendering context used by the Qt Quick scenegraph.
format specifies the DXGI_FORMAT of the texture. Only texture formats that are supported by Qt's rendering infrastructure should be used.
pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.
sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.
The texture is used as the first color attachment of the render target used by the Qt Quick scenegraph. A depth-stencil buffer, if applicable, is created and used automatically.
format specifies the MTLPixelFormat of the texture. Only texture formats that are supported by Qt's rendering infrastructure should be used.
pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.
sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.
The texture is used as the first color attachment of the render target used by the Qt Quick scenegraph. A depth-stencil buffer, if applicable, is created and used automatically.
format specifies the VkFormat of the image. Only image formats that are supported by Qt's rendering infrastructure should be used.
pixelSize specifies the size of the image, in pixels. Currently only 2D textures are supported.
sampleCount specific the number of samples. 0 or 1 means no multisampling, while a value like 4 or 8 states that the native object is a multisample texture.
The image is used as the first color attachment of the render target used by the Qt Quick scenegraph. A depth-stencil buffer, if applicable, is created and used automatically.
renderTarget will in most cases be a QRhiTextureRenderTarget, which allows directing the Qt Quick scene's rendering into a QRhiTexture.
Definition at line 639 of file qquickrendertarget.cpp.
References d, QQuickRenderTargetPrivate::get(), QRhiRenderTarget::pixelSize(), qWarning, and QRhiRenderTarget::sampleCount().
Referenced by QSGRhiSupport::grabOffscreen().
bool QQuickRenderTarget::isNull | ( | ) | const |
Definition at line 87 of file qquickrendertarget.cpp.
References QQuickRenderTargetPrivate::type.
Referenced by QQuickWindowPrivate::ensureCustomRenderTarget(), and QQuickWindowPrivate::renderSceneGraph().
bool QQuickRenderTarget::mirrorVertically | ( | ) | const |
The default value is {false}
.
Definition at line 137 of file qquickrendertarget.cpp.
References QQuickRenderTargetPrivate::mirrorVertically.
Referenced by QQuickWindowPrivate::renderSceneGraph().
QQuickRenderTarget & QQuickRenderTarget::operator= | ( | const QQuickRenderTarget & | other | ) |
Definition at line 68 of file qquickrendertarget.cpp.
References other(), and qAtomicAssign().
Sets the device pixel ratio for this render target to ratio.
This is the ratio between {device pixels} and {device independent pixels}.
Note that the specified device pixel ratio value will be ignored if QQuickRenderControl::renderWindow() is re-implemented to return a valid QWindow.
Definition at line 119 of file qquickrendertarget.cpp.
References QQuickRenderTargetPrivate::devicePixelRatio.
void QQuickRenderTarget::setMirrorVertically | ( | bool | enable | ) |
Sets the size of the render target contents should be mirrored vertically to enable when drawing.
This allows easy integration of third-party rendering code that does not follow the standard expectations.
software
backend.Definition at line 154 of file qquickrendertarget.cpp.
References QQuickRenderTargetPrivate::mirrorVertically.
|
friend |
Definition at line 74 of file qquickrendertarget.h.
|
friend |
Definition at line 72 of file qquickrendertarget.h.
|
friend |
Definition at line 70 of file qquickrendertarget.h.