qsgmaterialshader.sip 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. // qsgmaterialshader.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtQuick Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  8. //
  9. // This file may be used under the terms of the GNU General Public License
  10. // version 3.0 as published by the Free Software Foundation and appearing in
  11. // the file LICENSE included in the packaging of this file. Please review the
  12. // following information to ensure the GNU General Public License version 3.0
  13. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  14. //
  15. // If you do not wish to use this file under the terms of the GPL version 3.0
  16. // then you may purchase a commercial license. For more information contact
  17. // info@riverbankcomputing.com.
  18. //
  19. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  20. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  21. class QSGMaterialShader
  22. {
  23. %TypeHeaderCode
  24. #include <qsgmaterialshader.h>
  25. %End
  26. public:
  27. class RenderState
  28. {
  29. %TypeHeaderCode
  30. #include <qsgmaterialshader.h>
  31. %End
  32. public:
  33. enum DirtyState /BaseType=Flag/
  34. {
  35. DirtyMatrix,
  36. DirtyOpacity,
  37. DirtyCachedMaterialData,
  38. DirtyAll,
  39. };
  40. typedef QFlags<QSGMaterialShader::RenderState::DirtyState> DirtyStates;
  41. QSGMaterialShader::RenderState::DirtyStates dirtyStates() const;
  42. bool isMatrixDirty() const;
  43. bool isOpacityDirty() const;
  44. float opacity() const;
  45. QMatrix4x4 combinedMatrix() const;
  46. QMatrix4x4 modelViewMatrix() const;
  47. QMatrix4x4 projectionMatrix() const;
  48. QRect viewportRect() const;
  49. QRect deviceRect() const;
  50. float determinant() const;
  51. float devicePixelRatio() const;
  52. QByteArray *uniformData();
  53. };
  54. struct GraphicsPipelineState
  55. {
  56. %TypeHeaderCode
  57. #include <qsgmaterialshader.h>
  58. %End
  59. enum BlendFactor
  60. {
  61. Zero,
  62. One,
  63. SrcColor,
  64. OneMinusSrcColor,
  65. DstColor,
  66. OneMinusDstColor,
  67. SrcAlpha,
  68. OneMinusSrcAlpha,
  69. DstAlpha,
  70. OneMinusDstAlpha,
  71. ConstantColor,
  72. OneMinusConstantColor,
  73. ConstantAlpha,
  74. OneMinusConstantAlpha,
  75. SrcAlphaSaturate,
  76. Src1Color,
  77. OneMinusSrc1Color,
  78. Src1Alpha,
  79. OneMinusSrc1Alpha,
  80. };
  81. %If (Qt_6_8_0 -)
  82. enum class BlendOp
  83. {
  84. Add,
  85. Subtract,
  86. ReverseSubtract,
  87. Min,
  88. Max,
  89. };
  90. %End
  91. enum ColorMaskComponent /BaseType=Flag/
  92. {
  93. R,
  94. G,
  95. B,
  96. A,
  97. };
  98. typedef QFlags<QSGMaterialShader::GraphicsPipelineState::ColorMaskComponent> ColorMask;
  99. enum CullMode
  100. {
  101. CullNone,
  102. CullFront,
  103. CullBack,
  104. };
  105. %If (Qt_6_4_0 -)
  106. enum PolygonMode
  107. {
  108. Fill,
  109. Line,
  110. };
  111. %End
  112. QColor blendConstant;
  113. bool blendEnable;
  114. QSGMaterialShader::GraphicsPipelineState::ColorMask colorWrite;
  115. QSGMaterialShader::GraphicsPipelineState::CullMode cullMode;
  116. %If (Qt_6_5_0 -)
  117. QSGMaterialShader::GraphicsPipelineState::BlendFactor dstAlpha;
  118. %End
  119. QSGMaterialShader::GraphicsPipelineState::BlendFactor dstColor;
  120. %If (Qt_6_4_0 -)
  121. QSGMaterialShader::GraphicsPipelineState::PolygonMode polygonMode;
  122. %End
  123. %If (Qt_6_5_0 -)
  124. QSGMaterialShader::GraphicsPipelineState::BlendFactor srcAlpha;
  125. %End
  126. QSGMaterialShader::GraphicsPipelineState::BlendFactor srcColor;
  127. %If (Qt_6_8_0 -)
  128. QSGMaterialShader::GraphicsPipelineState::BlendOp opAlpha;
  129. %End
  130. %If (Qt_6_8_0 -)
  131. QSGMaterialShader::GraphicsPipelineState::BlendOp opColor;
  132. %End
  133. %If (Qt_6_5_0 -)
  134. bool separateBlendFactors;
  135. %End
  136. };
  137. enum Flag /BaseType=Flag/
  138. {
  139. UpdatesGraphicsPipelineState,
  140. };
  141. typedef QFlags<QSGMaterialShader::Flag> Flags;
  142. enum Stage
  143. {
  144. VertexStage,
  145. FragmentStage,
  146. };
  147. QSGMaterialShader();
  148. virtual ~QSGMaterialShader();
  149. virtual bool updateUniformData(QSGMaterialShader::RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial);
  150. virtual void updateSampledImage(QSGMaterialShader::RenderState &state, int binding, QSGTexture **texture /Out/, QSGMaterial *newMaterial, QSGMaterial *oldMaterial);
  151. virtual bool updateGraphicsPipelineState(QSGMaterialShader::RenderState &state, QSGMaterialShader::GraphicsPipelineState *ps, QSGMaterial *newMaterial, QSGMaterial *oldMaterial);
  152. QSGMaterialShader::Flags flags() const;
  153. void setFlag(QSGMaterialShader::Flags flags, bool on = true);
  154. void setFlags(QSGMaterialShader::Flags flags);
  155. %If (Qt_6_4_0 -)
  156. int combinedImageSamplerCount(int binding) const;
  157. %End
  158. protected:
  159. void setShaderFileName(QSGMaterialShader::Stage stage, const QString &filename);
  160. %If (Qt_6_8_0 -)
  161. void setShaderFileName(QSGMaterialShader::Stage stage, const QString &filename, int viewCount);
  162. %End
  163. private:
  164. QSGMaterialShader(const QSGMaterialShader &);
  165. };