Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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 QT_CONFIG(metal) || defined(Q_QDOC)
16#endif
17
19
22class QRhiTexture;
23class QPaintDevice;
24
25class Q_QUICK_EXPORT QQuickRenderTarget
26{
27public:
28 enum class Flag {
29 MultisampleResolve = 0x01
30 };
32
37
38 bool isNull() const;
39
40 qreal devicePixelRatio() const;
41 void setDevicePixelRatio(qreal ratio);
42
43 bool mirrorVertically() const;
44 void setMirrorVertically(bool enable);
45
46 QRhiTexture *depthTexture() const;
47 void setDepthTexture(QRhiTexture *texture);
48
49#if QT_CONFIG(opengl) || defined(Q_QDOC)
50 static QQuickRenderTarget fromOpenGLTexture(uint textureId, const QSize &pixelSize, int sampleCount = 1);
51 static QQuickRenderTarget fromOpenGLTexture(uint textureId, uint format, const QSize &pixelSize, int sampleCount = 1);
52 static QQuickRenderTarget fromOpenGLTexture(uint textureId, uint format, const QSize &pixelSize, int sampleCount, int arraySize, Flags flags);
53
54 static QQuickRenderTarget fromOpenGLRenderBuffer(uint renderbufferId, const QSize &pixelSize, int sampleCount = 1);
55#endif
56
57#if defined(Q_OS_WIN) || defined(Q_QDOC)
58 static QQuickRenderTarget fromD3D11Texture(void *texture, const QSize &pixelSize, int sampleCount = 1);
59 static QQuickRenderTarget fromD3D11Texture(void *texture, uint format, const QSize &pixelSize, int sampleCount = 1);
60 static QQuickRenderTarget fromD3D11Texture(void *texture, uint format, const QSize &pixelSize, int sampleCount, Flags flags);
61
62 static QQuickRenderTarget fromD3D12Texture(void *texture, int resourceState, uint format, const QSize &pixelSize, int sampleCount = 1);
63 static QQuickRenderTarget fromD3D12Texture(void *texture, int resourceState, uint format, uint viewFormat, const QSize &pixelSize, int sampleCount, int arraySize, Flags flags);
64#endif
65
66#if QT_CONFIG(metal) || defined(Q_QDOC)
67 static QQuickRenderTarget fromMetalTexture(MTLTexture *texture, const QSize &pixelSize, int sampleCount = 1);
68 static QQuickRenderTarget fromMetalTexture(MTLTexture *texture, uint format, const QSize &pixelSize, int sampleCount = 1);
69 static QQuickRenderTarget fromMetalTexture(MTLTexture *texture, uint format, uint viewFormat, const QSize &pixelSize, int sampleCount, int arraySize, Flags flags);
70#endif
71
72#if QT_CONFIG(vulkan) || defined(Q_QDOC)
73 static QQuickRenderTarget fromVulkanImage(VkImage image, VkImageLayout layout, const QSize &pixelSize, int sampleCount = 1);
74 static QQuickRenderTarget fromVulkanImage(VkImage image, VkImageLayout layout, VkFormat format, const QSize &pixelSize, int sampleCount = 1);
75 static QQuickRenderTarget fromVulkanImage(VkImage image, VkImageLayout layout, VkFormat format, VkFormat viewFormat, const QSize &pixelSize, int sampleCount, int arraySize, Flags flags);
76#endif
77
78 static QQuickRenderTarget fromRhiRenderTarget(QRhiRenderTarget *renderTarget);
79
80 static QQuickRenderTarget fromPaintDevice(QPaintDevice *device);
81
82private:
83 void detach();
84 bool isEqual(const QQuickRenderTarget &other) const noexcept;
87
88 friend bool operator==(const QQuickRenderTarget &lhs, const QQuickRenderTarget &rhs) noexcept
89 { return lhs.isEqual(rhs); }
90 friend bool operator!=(const QQuickRenderTarget &lhs, const QQuickRenderTarget &rhs) noexcept
91 { return !lhs.isEqual(rhs); }
92};
93
94Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickRenderTarget::Flags)
95
97
98#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
Flag
Flags for the static QQuickRenderTarget constructor functions.
friend bool operator==(const QQuickRenderTarget &lhs, const QQuickRenderTarget &rhs) noexcept
\inmodule QtGui
Definition qrhi.h:1158
\inmodule QtGui
Definition qrhi.h:895
\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)
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
Flags
GLbitfield flags
GLboolean enable
GLenum GLuint texture
GLint GLsizei GLsizei GLenum format
unsigned int uint
Definition qtypes.h:34
double qreal
Definition qtypes.h:187
QVBoxLayout * layout
QSharedPointer< T > other(t)
[5]