Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquickrendertarget.h
Go to the documentation of this file.
1// Copyright (C) 2020 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 QQUICKRENDERTARGET_H
5#define QQUICKRENDERTARGET_H
6
7#include <QtQuick/qtquickglobal.h>
8#include <QtCore/qsize.h>
9
10#if QT_CONFIG(vulkan)
11#include <QtGui/qvulkaninstance.h>
12#endif
13
14#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) || defined(Q_QDOC)
16#endif
17
19
22class QPaintDevice;
23
24class Q_QUICK_EXPORT QQuickRenderTarget
25{
26public:
31
32 bool isNull() const;
33
34 qreal devicePixelRatio() const;
35 void setDevicePixelRatio(qreal ratio);
36
37 bool mirrorVertically() const;
38 void setMirrorVertically(bool enable);
39
40#if QT_CONFIG(opengl) || defined(Q_QDOC)
41 static QQuickRenderTarget fromOpenGLTexture(uint textureId, uint format, const QSize &pixelSize, int sampleCount = 1);
42 static QQuickRenderTarget fromOpenGLTexture(uint textureId, const QSize &pixelSize, int sampleCount = 1);
43 static QQuickRenderTarget fromOpenGLRenderBuffer(uint renderbufferId, const QSize &pixelSize, int sampleCount = 1);
44#endif
45
46#if defined(Q_OS_WIN) || defined(Q_QDOC)
47 static QQuickRenderTarget fromD3D11Texture(void *texture, uint format, const QSize &pixelSize, int sampleCount = 1);
48 static QQuickRenderTarget fromD3D11Texture(void *texture, const QSize &pixelSize, int sampleCount = 1);
49 static QQuickRenderTarget fromD3D12Texture(void *texture, int resourceState, uint format, const QSize &pixelSize, int sampleCount = 1);
50#endif
51
52#if defined(Q_OS_MACOS) || defined(Q_OS_IOS) || defined(Q_QDOC)
53 static QQuickRenderTarget fromMetalTexture(MTLTexture *texture, uint format, const QSize &pixelSize, int sampleCount = 1);
54 static QQuickRenderTarget fromMetalTexture(MTLTexture *texture, const QSize &pixelSize, int sampleCount = 1);
55#endif
56
57#if QT_CONFIG(vulkan) || defined(Q_QDOC)
58 static QQuickRenderTarget fromVulkanImage(VkImage image, VkImageLayout layout, VkFormat format, const QSize &pixelSize, int sampleCount = 1);
59 static QQuickRenderTarget fromVulkanImage(VkImage image, VkImageLayout layout, const QSize &pixelSize, int sampleCount = 1);
60#endif
61
62 static QQuickRenderTarget fromRhiRenderTarget(QRhiRenderTarget *renderTarget);
63
64 static QQuickRenderTarget fromPaintDevice(QPaintDevice *device);
65
66private:
67 void detach();
68 bool isEqual(const QQuickRenderTarget &other) const noexcept;
71
72 friend bool operator==(const QQuickRenderTarget &lhs, const QQuickRenderTarget &rhs) noexcept
73 { return lhs.isEqual(rhs); }
74 friend bool operator!=(const QQuickRenderTarget &lhs, const QQuickRenderTarget &rhs) noexcept
75 { return !lhs.isEqual(rhs); }
76};
77
79
80#endif // QQUICKRENDERTARGET_H
static bool isEqual(const aiUVTransform &a, const aiUVTransform &b)
IOBluetoothDevice * device
The QQuickRenderTarget class provides an opaque container for native graphics resources specifying a ...
friend bool operator!=(const QQuickRenderTarget &lhs, const QQuickRenderTarget &rhs) noexcept
friend bool operator==(const QQuickRenderTarget &lhs, const QQuickRenderTarget &rhs) noexcept
\inmodule QtGui
Definition qrhi.h:1135
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
Definition image.cpp:4
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
GLboolean enable
GLenum GLuint texture
GLint GLsizei GLsizei GLenum format
unsigned int uint
Definition qtypes.h:29
double qreal
Definition qtypes.h:92
QVBoxLayout * layout
QSharedPointer< T > other(t)
[5]