1// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2// Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QT3DRENDER_QBLENDEQUATIONARGUMENTS_H
6#define QT3DRENDER_QBLENDEQUATIONARGUMENTS_H
7
8#include <Qt3DRender/qrenderstate.h>
9
10QT_BEGIN_NAMESPACE
11
12namespace Qt3DRender {
13
14class QBlendEquationArgumentsPrivate;
15
16class Q_3DRENDERSHARED_EXPORT QBlendEquationArguments : public QRenderState
17{
18 Q_OBJECT
19 Q_PROPERTY(Blending sourceRgb READ sourceRgb WRITE setSourceRgb NOTIFY sourceRgbChanged)
20 Q_PROPERTY(Blending sourceAlpha READ sourceAlpha WRITE setSourceAlpha NOTIFY sourceAlphaChanged)
21 Q_PROPERTY(Blending destinationRgb READ destinationRgb WRITE setDestinationRgb NOTIFY destinationRgbChanged)
22 Q_PROPERTY(Blending destinationAlpha READ destinationAlpha WRITE setDestinationAlpha NOTIFY destinationAlphaChanged)
23 Q_PROPERTY(int bufferIndex READ bufferIndex WRITE setBufferIndex NOTIFY bufferIndexChanged)
24
25public:
26
27 enum Blending
28 {
29 Zero = 0,
30 One = 1,
31 SourceColor = 0x0300,
32 SourceAlpha = 0x0302,
33 Source1Alpha, // ### Qt 6: Fix -> has same value as OneMinusSourceAlpha
34 Source1Color, // ### Qt 6: Fix -> has same value as DestinationAlpha
35 DestinationColor = 0x0306,
36 DestinationAlpha = 0x0304,
37 SourceAlphaSaturate = 0x0308,
38 ConstantColor = 0x8001,
39 ConstantAlpha = 0x8003,
40 OneMinusSourceColor = 0x0301,
41 OneMinusSourceAlpha = 0x0303,
42 OneMinusDestinationAlpha = 0x0305,
43 OneMinusDestinationColor = 0x0307,
44 OneMinusConstantColor = 0x8002,
45 OneMinusConstantAlpha = 0x8004,
46 OneMinusSource1Alpha,
47 OneMinusSource1Color,
48 OneMinusSource1Color0 = OneMinusSource1Color // ### Qt 6: Remove
49 };
50 Q_ENUM(Blending) // LCOV_EXCL_LINE
51
52 explicit QBlendEquationArguments(Qt3DCore::QNode *parent = nullptr);
53 ~QBlendEquationArguments();
54
55 Blending sourceRgb() const;
56 Blending destinationRgb() const;
57 Blending sourceAlpha() const;
58 Blending destinationAlpha() const;
59 int bufferIndex() const;
60
61public Q_SLOTS:
62 void setSourceRgb(Blending sourceRgb);
63 void setDestinationRgb(Blending destinationRgb);
64 void setSourceAlpha(Blending sourceAlpha);
65 void setDestinationAlpha(Blending destinationAlpha);
66 void setSourceRgba(Blending sourceRgba);
67 void setDestinationRgba(Blending destinationRgba);
68 void setBufferIndex(int index);
69
70Q_SIGNALS:
71 void sourceRgbChanged(Blending sourceRgb);
72 void sourceAlphaChanged(Blending sourceAlpha);
73 void destinationRgbChanged(Blending destinationRgb);
74 void destinationAlphaChanged(Blending destinationAlpha);
75 void sourceRgbaChanged(Blending sourceRgba);
76 void destinationRgbaChanged(Blending destinationRgba);
77 void bufferIndexChanged(int index);
78
79protected:
80 explicit QBlendEquationArguments(QBlendEquationArgumentsPrivate &dd, Qt3DCore::QNode *parent = nullptr);
81
82private:
83 Q_DECLARE_PRIVATE(QBlendEquationArguments)
84};
85
86} // namespace Qt3DRender
87
88QT_END_NAMESPACE
89
90#endif // QT3DRENDER_QBLENDEQUATIONARGUMENTS_H
91

source code of qt3d/src/render/renderstates/qblendequationarguments.h