qimageiohandler.sip 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // qimageiohandler.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 QImageIOHandler
  22. {
  23. %TypeHeaderCode
  24. #include <qimageiohandler.h>
  25. %End
  26. public:
  27. enum ImageOption
  28. {
  29. Size,
  30. ClipRect,
  31. Description,
  32. ScaledClipRect,
  33. ScaledSize,
  34. CompressionRatio,
  35. Gamma,
  36. Quality,
  37. Name,
  38. SubType,
  39. IncrementalReading,
  40. Endianness,
  41. Animation,
  42. BackgroundColor,
  43. SupportedSubTypes,
  44. OptimizedWrite,
  45. ProgressiveScanWrite,
  46. ImageTransformation,
  47. };
  48. QImageIOHandler();
  49. virtual ~QImageIOHandler();
  50. void setDevice(QIODevice *device);
  51. QIODevice *device() const;
  52. void setFormat(const QByteArray &format);
  53. QByteArray format() const;
  54. virtual bool canRead() const = 0;
  55. virtual bool read(QImage *image) = 0;
  56. virtual bool write(const QImage &image);
  57. virtual QVariant option(QImageIOHandler::ImageOption option) const;
  58. virtual void setOption(QImageIOHandler::ImageOption option, const QVariant &value);
  59. virtual bool supportsOption(QImageIOHandler::ImageOption option) const;
  60. virtual bool jumpToNextImage();
  61. virtual bool jumpToImage(int imageNumber);
  62. virtual int loopCount() const;
  63. virtual int imageCount() const;
  64. virtual int nextImageDelay() const;
  65. virtual int currentImageNumber() const;
  66. virtual QRect currentImageRect() const;
  67. enum Transformation /BaseType=Flag/
  68. {
  69. TransformationNone,
  70. TransformationMirror,
  71. TransformationFlip,
  72. TransformationRotate180,
  73. TransformationRotate90,
  74. TransformationMirrorAndRotate90,
  75. TransformationFlipAndRotate90,
  76. TransformationRotate270,
  77. };
  78. typedef QFlags<QImageIOHandler::Transformation> Transformations;
  79. private:
  80. QImageIOHandler(const QImageIOHandler &);
  81. };