1// Copyright (C) 2016 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 QRENDERCAPTURE_H
5#define QRENDERCAPTURE_H
6
7#include <Qt3DRender/QFrameGraphNode>
8#include <QtGui/QImage>
9
10QT_BEGIN_NAMESPACE
11
12namespace Qt3DRender {
13
14class QRenderCapturePrivate;
15class QRenderCaptureReplyPrivate;
16
17class Q_3DRENDERSHARED_EXPORT QRenderCaptureReply : public QObject
18{
19 Q_OBJECT
20 Q_PROPERTY(QImage image READ image CONSTANT)
21 Q_PROPERTY(int captureId READ captureId CONSTANT)
22 Q_PROPERTY(bool complete READ isComplete NOTIFY completed)
23
24public:
25
26 QImage image() const;
27 Q_DECL_DEPRECATED int captureId() const;
28 bool isComplete() const;
29
30 Q_INVOKABLE bool saveImage(const QString &fileName) const;
31
32Q_SIGNALS:
33 void completed();
34
35private:
36 Q_DECLARE_PRIVATE(QRenderCaptureReply)
37
38 QRenderCaptureReply(QObject *parent = nullptr);
39
40 friend class QRenderCapturePrivate;
41};
42
43class Q_3DRENDERSHARED_EXPORT QRenderCapture : public QFrameGraphNode
44{
45 Q_OBJECT
46public:
47 explicit QRenderCapture(Qt3DCore::QNode *parent = nullptr);
48
49 Qt3DRender::QRenderCaptureReply *requestCapture(int captureId);
50 Q_REVISION(9) Q_INVOKABLE Qt3DRender::QRenderCaptureReply *requestCapture();
51 Q_REVISION(10) Q_INVOKABLE Qt3DRender::QRenderCaptureReply *requestCapture(const QRect &rect);
52
53private:
54 Q_DECLARE_PRIVATE(QRenderCapture)
55};
56
57} // Qt3DRender
58
59QT_END_NAMESPACE
60
61#endif // QRENDERCAPTURE_H
62

source code of qt3d/src/render/framegraph/qrendercapture.h