summaryrefslogtreecommitdiffstats
path: root/src/render/framegraph/qviewport.h
blob: 0a0925daf49ffa42d3aa6b792658939205b19185 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef QT3DRENDER_QVIEWPORT_H
#define QT3DRENDER_QVIEWPORT_H

#include <Qt3DRender/qframegraphnode.h>
#include <QtCore/QRectF>
#include <QtGui/QColor>

QT_BEGIN_NAMESPACE

namespace Qt3DRender {

class QViewportPrivate;

class Q_3DRENDERSHARED_EXPORT QViewport : public QFrameGraphNode
{
    Q_OBJECT
    Q_PROPERTY(QRectF normalizedRect READ normalizedRect WRITE setNormalizedRect NOTIFY normalizedRectChanged)
    Q_PROPERTY(float gamma READ gamma WRITE setGamma NOTIFY gammaChanged REVISION(2, 9))

public:
    explicit QViewport(Qt3DCore::QNode *parent = nullptr);
    ~QViewport();

    QRectF normalizedRect() const;
    float gamma() const;

public Q_SLOTS:
    void setNormalizedRect(const QRectF& normalizedRect);
    void setGamma(float gamma);

Q_SIGNALS:
    void normalizedRectChanged(const QRectF& normalizedRect);
    void gammaChanged(float gamma);

protected:
    explicit QViewport(QViewportPrivate &dd, Qt3DCore::QNode *parent = nullptr);

private:
    Q_DECLARE_PRIVATE(QViewport)
};

} // namespace Qt3DRender

QT_END_NAMESPACE

#endif // QT3DRENDER_QVIEWPORT_H