qblendequationarguments.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
  4. ** Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies).
  5. ** Contact: https://www.qt.io/licensing/
  6. **
  7. ** This file is part of the Qt3D module of the Qt Toolkit.
  8. **
  9. ** $QT_BEGIN_LICENSE:LGPL$
  10. ** Commercial License Usage
  11. ** Licensees holding valid commercial Qt licenses may use this file in
  12. ** accordance with the commercial license agreement provided with the
  13. ** Software or, alternatively, in accordance with the terms contained in
  14. ** a written agreement between you and The Qt Company. For licensing terms
  15. ** and conditions see https://www.qt.io/terms-conditions. For further
  16. ** information use the contact form at https://www.qt.io/contact-us.
  17. **
  18. ** GNU Lesser General Public License Usage
  19. ** Alternatively, this file may be used under the terms of the GNU Lesser
  20. ** General Public License version 3 as published by the Free Software
  21. ** Foundation and appearing in the file LICENSE.LGPL3 included in the
  22. ** packaging of this file. Please review the following information to
  23. ** ensure the GNU Lesser General Public License version 3 requirements
  24. ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
  25. **
  26. ** GNU General Public License Usage
  27. ** Alternatively, this file may be used under the terms of the GNU
  28. ** General Public License version 2.0 or (at your option) the GNU General
  29. ** Public license version 3 or any later version approved by the KDE Free
  30. ** Qt Foundation. The licenses are as published by the Free Software
  31. ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
  32. ** included in the packaging of this file. Please review the following
  33. ** information to ensure the GNU General Public License requirements will
  34. ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
  35. ** https://www.gnu.org/licenses/gpl-3.0.html.
  36. **
  37. ** $QT_END_LICENSE$
  38. **
  39. ****************************************************************************/
  40. #ifndef QT3DRENDER_QBLENDEQUATIONARGUMENTS_H
  41. #define QT3DRENDER_QBLENDEQUATIONARGUMENTS_H
  42. #include <Qt3DRender/qrenderstate.h>
  43. QT_BEGIN_NAMESPACE
  44. namespace Qt3DRender {
  45. class QBlendEquationArgumentsPrivate;
  46. class QT3DRENDERSHARED_EXPORT QBlendEquationArguments : public QRenderState
  47. {
  48. Q_OBJECT
  49. Q_PROPERTY(Blending sourceRgb READ sourceRgb WRITE setSourceRgb NOTIFY sourceRgbChanged)
  50. Q_PROPERTY(Blending sourceAlpha READ sourceAlpha WRITE setSourceAlpha NOTIFY sourceAlphaChanged)
  51. Q_PROPERTY(Blending destinationRgb READ destinationRgb WRITE setDestinationRgb NOTIFY destinationRgbChanged)
  52. Q_PROPERTY(Blending destinationAlpha READ destinationAlpha WRITE setDestinationAlpha NOTIFY destinationAlphaChanged)
  53. Q_PROPERTY(int bufferIndex READ bufferIndex WRITE setBufferIndex NOTIFY bufferIndexChanged)
  54. public:
  55. enum Blending
  56. {
  57. Zero = 0,
  58. One = 1,
  59. SourceColor = 0x0300,
  60. SourceAlpha = 0x0302,
  61. Source1Alpha,
  62. Source1Color,
  63. DestinationColor = 0x0306,
  64. DestinationAlpha = 0x0304,
  65. SourceAlphaSaturate = 0x0308,
  66. ConstantColor = 0x8001,
  67. ConstantAlpha = 0x8003,
  68. OneMinusSourceColor = 0x0301,
  69. OneMinusSourceAlpha = 0x0303,
  70. OneMinusDestinationAlpha = 0x0305,
  71. OneMinusDestinationColor = 0x0307,
  72. OneMinusConstantColor = 0x8002,
  73. OneMinusConstantAlpha = 0x8004,
  74. OneMinusSource1Alpha,
  75. OneMinusSource1Color0
  76. };
  77. Q_ENUM(Blending)
  78. explicit QBlendEquationArguments(Qt3DCore::QNode *parent = nullptr);
  79. ~QBlendEquationArguments();
  80. Blending sourceRgb() const;
  81. Blending destinationRgb() const;
  82. Blending sourceAlpha() const;
  83. Blending destinationAlpha() const;
  84. int bufferIndex() const;
  85. public Q_SLOTS:
  86. void setSourceRgb(Blending sourceRgb);
  87. void setDestinationRgb(Blending destinationRgb);
  88. void setSourceAlpha(Blending sourceAlpha);
  89. void setDestinationAlpha(Blending destinationAlpha);
  90. void setSourceRgba(Blending sourceRgba);
  91. void setDestinationRgba(Blending destinationRgba);
  92. void setBufferIndex(int index);
  93. Q_SIGNALS:
  94. void sourceRgbChanged(Blending sourceRgb);
  95. void sourceAlphaChanged(Blending sourceAlpha);
  96. void destinationRgbChanged(Blending destinationRgb);
  97. void destinationAlphaChanged(Blending destinationAlpha);
  98. void sourceRgbaChanged(Blending sourceRgba);
  99. void destinationRgbaChanged(Blending destinationRgba);
  100. void bufferIndexChanged(int index);
  101. protected:
  102. explicit QBlendEquationArguments(QBlendEquationArgumentsPrivate &dd, Qt3DCore::QNode *parent = nullptr);
  103. private:
  104. Q_DECLARE_PRIVATE(QBlendEquationArguments)
  105. Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE;
  106. };
  107. } // namespace Qt3DRender
  108. QT_END_NAMESPACE
  109. #endif // QT3DRENDER_QBLENDEQUATIONARGUMENTS_H