qvideoframe.sip 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // qvideoframe.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtMultimedia 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. %If (Qt_6_2_0 -)
  22. class QVideoFrame
  23. {
  24. %TypeHeaderCode
  25. #include <qvideoframe.h>
  26. %End
  27. public:
  28. QVideoFrame();
  29. QVideoFrame(const QVideoFrameFormat &format);
  30. %If (Qt_6_8_0 -)
  31. explicit QVideoFrame(const QImage &image);
  32. %End
  33. QVideoFrame(const QVideoFrame &other);
  34. ~QVideoFrame();
  35. enum HandleType
  36. {
  37. NoHandle,
  38. RhiTextureHandle,
  39. };
  40. enum MapMode
  41. {
  42. NotMapped,
  43. ReadOnly,
  44. WriteOnly,
  45. ReadWrite,
  46. };
  47. bool isValid() const;
  48. QVideoFrameFormat::PixelFormat pixelFormat() const;
  49. QVideoFrame::HandleType handleType() const;
  50. QSize size() const;
  51. int width() const;
  52. int height() const;
  53. bool isMapped() const;
  54. bool isReadable() const;
  55. bool isWritable() const;
  56. QVideoFrame::MapMode mapMode() const;
  57. bool map(QVideoFrame::MapMode mode);
  58. void unmap();
  59. int bytesPerLine(int plane) const;
  60. void *bits(int plane) [uchar * (int plane)];
  61. int mappedBytes(int plane) const;
  62. qint64 startTime() const;
  63. void setStartTime(qint64 time);
  64. qint64 endTime() const;
  65. void setEndTime(qint64 time);
  66. int planeCount() const;
  67. bool operator==(const QVideoFrame &other) const;
  68. bool operator!=(const QVideoFrame &other) const;
  69. QVideoFrameFormat surfaceFormat() const;
  70. QImage toImage() const;
  71. struct PaintOptions
  72. {
  73. %TypeHeaderCode
  74. #include <qvideoframe.h>
  75. %End
  76. QColor backgroundColor;
  77. Qt::AspectRatioMode aspectRatioMode;
  78. enum PaintFlag /BaseType=Flag/
  79. {
  80. DontDrawSubtitles,
  81. };
  82. typedef QFlags<QVideoFrame::PaintOptions::PaintFlag> PaintFlags;
  83. QVideoFrame::PaintOptions::PaintFlags paintFlags;
  84. };
  85. QString subtitleText() const;
  86. void setSubtitleText(const QString &text);
  87. void paint(QPainter *painter, const QRectF &rect, const QVideoFrame::PaintOptions &options);
  88. %If (Qt_6_3_0 -)
  89. enum RotationAngle
  90. {
  91. Rotation0,
  92. Rotation90,
  93. Rotation180,
  94. Rotation270,
  95. };
  96. %End
  97. %If (Qt_6_3_0 -)
  98. void setRotationAngle(QVideoFrame::RotationAngle);
  99. %End
  100. %If (Qt_6_3_0 -)
  101. QVideoFrame::RotationAngle rotationAngle() const;
  102. %End
  103. %If (Qt_6_3_0 -)
  104. void setMirrored(bool);
  105. %End
  106. %If (Qt_6_3_0 -)
  107. bool mirrored() const;
  108. %End
  109. %If (Qt_6_7_0 -)
  110. void setRotation(QtVideo::Rotation angle);
  111. %End
  112. %If (Qt_6_7_0 -)
  113. QtVideo::Rotation rotation() const;
  114. %End
  115. %If (Qt_6_8_0 -)
  116. void setStreamFrameRate(qreal rate);
  117. %End
  118. %If (Qt_6_8_0 -)
  119. qreal streamFrameRate() const;
  120. %End
  121. };
  122. %End