1// Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
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 QT3DRENDER_QBLITFRAMEBUFFER_H
5#define QT3DRENDER_QBLITFRAMEBUFFER_H
6
7#include <Qt3DRender/qframegraphnode.h>
8#include <Qt3DRender/qrendertargetoutput.h>
9#include <Qt3DRender/qrendertarget.h>
10#include <QtCore/QRect>
11
12QT_BEGIN_NAMESPACE
13
14namespace Qt3DRender {
15
16class QBlitFramebufferPrivate;
17
18class Q_3DRENDERSHARED_EXPORT QBlitFramebuffer : public QFrameGraphNode
19{
20 Q_OBJECT
21 Q_PROPERTY(Qt3DRender::QRenderTarget *source READ source WRITE setSource NOTIFY sourceChanged)
22 Q_PROPERTY(Qt3DRender::QRenderTarget *destination READ destination WRITE setDestination NOTIFY destinationChanged)
23 Q_PROPERTY(QRectF sourceRect READ sourceRect WRITE setSourceRect NOTIFY sourceRectChanged)
24 Q_PROPERTY(QRectF destinationRect READ destinationRect WRITE setDestinationRect NOTIFY destinationRectChanged)
25 Q_PROPERTY(Qt3DRender::QRenderTargetOutput::AttachmentPoint sourceAttachmentPoint READ sourceAttachmentPoint WRITE setSourceAttachmentPoint NOTIFY sourceAttachmentPointChanged)
26 Q_PROPERTY(Qt3DRender::QRenderTargetOutput::AttachmentPoint destinationAttachmentPoint READ destinationAttachmentPoint WRITE setDestinationAttachmentPoint NOTIFY destinationAttachmentPointChanged)
27 Q_PROPERTY(InterpolationMethod interpolationMethod READ interpolationMethod WRITE setInterpolationMethod NOTIFY interpolationMethodChanged)
28public:
29 enum InterpolationMethod {
30 Nearest = 0,
31 Linear,
32 };
33 Q_ENUM(InterpolationMethod) // LCOV_EXCL_LINE
34
35 explicit QBlitFramebuffer(Qt3DCore::QNode *parent = nullptr);
36 ~QBlitFramebuffer();
37
38 QRenderTarget *source() const;
39 QRenderTarget *destination() const;
40 QRectF sourceRect() const;
41 QRectF destinationRect() const;
42 Qt3DRender::QRenderTargetOutput::AttachmentPoint sourceAttachmentPoint() const;
43 Qt3DRender::QRenderTargetOutput::AttachmentPoint destinationAttachmentPoint() const;
44 InterpolationMethod interpolationMethod() const;
45
46 void setSource(QRenderTarget *source);
47 void setDestination(QRenderTarget *destination);
48 void setSourceRect(const QRectF &sourceRect);
49 void setDestinationRect(const QRectF &destinationRect);
50 void setSourceAttachmentPoint(Qt3DRender::QRenderTargetOutput::AttachmentPoint sourceAttachmentPoint);
51 void setDestinationAttachmentPoint(Qt3DRender::QRenderTargetOutput::AttachmentPoint destinationAttachmentPoint);
52 void setInterpolationMethod(InterpolationMethod interpolationMethod);
53
54Q_SIGNALS:
55 void sourceChanged();
56 void destinationChanged();
57 void sourceRectChanged();
58 void destinationRectChanged();
59 void sourceAttachmentPointChanged();
60 void destinationAttachmentPointChanged();
61 void interpolationMethodChanged();
62
63protected:
64 explicit QBlitFramebuffer(QBlitFramebufferPrivate &dd, Qt3DCore::QNode *parent = nullptr);
65
66private:
67 Q_DECLARE_PRIVATE(QBlitFramebuffer)
68};
69
70} // namespace Qt3DRender
71
72QT_END_NAMESPACE
73
74#endif // QT3DRENDER_QBLITFRAMEBUFFER_H
75

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