qimagecapture.sip 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. // qimagecapture.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 QImageCapture : public QObject
  23. {
  24. %TypeHeaderCode
  25. #include <qimagecapture.h>
  26. %End
  27. public:
  28. enum Error
  29. {
  30. NoError,
  31. NotReadyError,
  32. ResourceError,
  33. OutOfSpaceError,
  34. NotSupportedFeatureError,
  35. FormatError,
  36. };
  37. enum Quality
  38. {
  39. VeryLowQuality,
  40. LowQuality,
  41. NormalQuality,
  42. HighQuality,
  43. VeryHighQuality,
  44. };
  45. enum FileFormat
  46. {
  47. UnspecifiedFormat,
  48. JPEG,
  49. PNG,
  50. WebP,
  51. Tiff,
  52. };
  53. explicit QImageCapture(QObject *parent /TransferThis/ = 0);
  54. virtual ~QImageCapture();
  55. bool isAvailable() const;
  56. QMediaCaptureSession *captureSession() const;
  57. QImageCapture::Error error() const;
  58. QString errorString() const;
  59. bool isReadyForCapture() const;
  60. QImageCapture::FileFormat fileFormat() const;
  61. void setFileFormat(QImageCapture::FileFormat format);
  62. static QList<QImageCapture::FileFormat> supportedFormats();
  63. static QString fileFormatName(QImageCapture::FileFormat c);
  64. static QString fileFormatDescription(QImageCapture::FileFormat c);
  65. QSize resolution() const;
  66. void setResolution(const QSize &);
  67. void setResolution(int width, int height);
  68. QImageCapture::Quality quality() const;
  69. void setQuality(QImageCapture::Quality quality);
  70. QMediaMetaData metaData() const;
  71. void setMetaData(const QMediaMetaData &metaData);
  72. void addMetaData(const QMediaMetaData &metaData);
  73. public slots:
  74. int captureToFile(const QString &location = QString());
  75. int capture();
  76. signals:
  77. void errorChanged();
  78. void errorOccurred(int id, QImageCapture::Error error, const QString &errorString);
  79. void readyForCaptureChanged(bool ready);
  80. void metaDataChanged();
  81. void fileFormatChanged();
  82. void qualityChanged();
  83. void resolutionChanged();
  84. void imageExposed(int id);
  85. void imageCaptured(int id, const QImage &preview);
  86. void imageAvailable(int id, const QVideoFrame &frame);
  87. void imageSaved(int id, const QString &fileName);
  88. };
  89. %End