qimagereader.sip 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. // qimagereader.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 QImageReader
  22. {
  23. %TypeHeaderCode
  24. #include <qimagereader.h>
  25. %End
  26. public:
  27. enum ImageReaderError
  28. {
  29. UnknownError,
  30. FileNotFoundError,
  31. DeviceError,
  32. UnsupportedFormatError,
  33. InvalidDataError,
  34. };
  35. QImageReader();
  36. QImageReader(QIODevice *device, const QByteArray &format = QByteArray());
  37. QImageReader(const QString &fileName, const QByteArray &format = QByteArray());
  38. ~QImageReader();
  39. void setFormat(const QByteArray &format);
  40. QByteArray format() const;
  41. void setDevice(QIODevice *device);
  42. QIODevice *device() const;
  43. void setFileName(const QString &fileName);
  44. QString fileName() const;
  45. QSize size() const;
  46. void setClipRect(const QRect &rect);
  47. QRect clipRect() const;
  48. void setScaledSize(const QSize &size);
  49. QSize scaledSize() const;
  50. void setScaledClipRect(const QRect &rect);
  51. QRect scaledClipRect() const;
  52. bool canRead() const;
  53. QImage read() /ReleaseGIL/;
  54. bool read(QImage *image) /ReleaseGIL/;
  55. bool jumpToNextImage();
  56. bool jumpToImage(int imageNumber);
  57. int loopCount() const;
  58. int imageCount() const;
  59. int nextImageDelay() const;
  60. int currentImageNumber() const;
  61. QRect currentImageRect() const;
  62. QImageReader::ImageReaderError error() const;
  63. QString errorString() const;
  64. static QByteArray imageFormat(const QString &fileName);
  65. static QByteArray imageFormat(QIODevice *device);
  66. static QList<QByteArray> supportedImageFormats();
  67. QStringList textKeys() const;
  68. QString text(const QString &key) const;
  69. void setBackgroundColor(const QColor &color);
  70. QColor backgroundColor() const;
  71. bool supportsAnimation() const;
  72. void setQuality(int quality);
  73. int quality() const;
  74. bool supportsOption(QImageIOHandler::ImageOption option) const;
  75. void setAutoDetectImageFormat(bool enabled);
  76. bool autoDetectImageFormat() const;
  77. QImage::Format imageFormat() const;
  78. void setDecideFormatFromContent(bool ignored);
  79. bool decideFormatFromContent() const;
  80. static QList<QByteArray> supportedMimeTypes();
  81. QByteArray subType() const;
  82. QList<QByteArray> supportedSubTypes() const;
  83. QImageIOHandler::Transformations transformation() const;
  84. void setAutoTransform(bool enabled);
  85. bool autoTransform() const;
  86. static QList<QByteArray> imageFormatsForMimeType(const QByteArray &mimeType);
  87. static int allocationLimit();
  88. static void setAllocationLimit(int mbLimit);
  89. private:
  90. QImageReader(const QImageReader &);
  91. };