qimagewriter.sip 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. // qimagewriter.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtGui 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 QImageWriter
  22. {
  23. %TypeHeaderCode
  24. #include <qimagewriter.h>
  25. %End
  26. public:
  27. enum ImageWriterError
  28. {
  29. UnknownError,
  30. DeviceError,
  31. UnsupportedFormatError,
  32. InvalidImageError,
  33. };
  34. QImageWriter();
  35. QImageWriter(QIODevice *device, const QByteArray &format);
  36. QImageWriter(const QString &fileName, const QByteArray &format = QByteArray());
  37. ~QImageWriter();
  38. void setFormat(const QByteArray &format);
  39. QByteArray format() const;
  40. void setDevice(QIODevice *device);
  41. QIODevice *device() const;
  42. void setFileName(const QString &fileName);
  43. QString fileName() const;
  44. void setQuality(int quality);
  45. int quality() const;
  46. bool canWrite() const;
  47. bool write(const QImage &image) /ReleaseGIL/;
  48. QImageWriter::ImageWriterError error() const;
  49. QString errorString() const;
  50. static QList<QByteArray> supportedImageFormats();
  51. void setText(const QString &key, const QString &text);
  52. bool supportsOption(QImageIOHandler::ImageOption option) const;
  53. void setCompression(int compression);
  54. int compression() const;
  55. static QList<QByteArray> supportedMimeTypes();
  56. void setSubType(const QByteArray &type);
  57. QByteArray subType() const;
  58. QList<QByteArray> supportedSubTypes() const;
  59. void setOptimizedWrite(bool optimize);
  60. bool optimizedWrite() const;
  61. void setProgressiveScanWrite(bool progressive);
  62. bool progressiveScanWrite() const;
  63. QImageIOHandler::Transformations transformation() const;
  64. void setTransformation(QImageIOHandler::Transformations orientation);
  65. static QList<QByteArray> imageFormatsForMimeType(const QByteArray &mimeType);
  66. private:
  67. QImageWriter(const QImageWriter &);
  68. };