qquickimageprovider.sip 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. // qquickimageprovider.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtQuick 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 QQuickTextureFactory : public QObject
  22. {
  23. %TypeHeaderCode
  24. #include <qquickimageprovider.h>
  25. %End
  26. public:
  27. QQuickTextureFactory();
  28. virtual ~QQuickTextureFactory();
  29. virtual QSGTexture *createTexture(QQuickWindow *window) const = 0 /Factory/;
  30. virtual QSize textureSize() const = 0;
  31. virtual int textureByteCount() const = 0;
  32. virtual QImage image() const;
  33. static QQuickTextureFactory *textureFactoryForImage(const QImage &image) /Factory/;
  34. };
  35. class QQuickImageProvider : public QQmlImageProviderBase
  36. {
  37. %TypeHeaderCode
  38. #include <qquickimageprovider.h>
  39. %End
  40. public:
  41. QQuickImageProvider(QQmlImageProviderBase::ImageType type, QQmlImageProviderBase::Flags flags = QQmlImageProviderBase::Flags());
  42. virtual ~QQuickImageProvider();
  43. virtual QQmlImageProviderBase::ImageType imageType() const;
  44. virtual QQmlImageProviderBase::Flags flags() const;
  45. virtual QImage requestImage(const QString &id, QSize *size /Out/, const QSize &requestedSize);
  46. virtual QPixmap requestPixmap(const QString &id, QSize *size /Out/, const QSize &requestedSize);
  47. virtual QQuickTextureFactory *requestTexture(const QString &id, QSize *size /Out/, const QSize &requestedSize) /Factory/;
  48. };
  49. class QQuickImageResponse : public QObject
  50. {
  51. %TypeHeaderCode
  52. #include <qquickimageprovider.h>
  53. %End
  54. public:
  55. QQuickImageResponse();
  56. virtual ~QQuickImageResponse();
  57. virtual QQuickTextureFactory *textureFactory() const = 0 /Factory/;
  58. virtual QString errorString() const;
  59. public slots:
  60. virtual void cancel();
  61. signals:
  62. void finished();
  63. };
  64. class QQuickAsyncImageProvider : public QQuickImageProvider
  65. {
  66. %TypeHeaderCode
  67. #include <qquickimageprovider.h>
  68. %End
  69. public:
  70. QQuickAsyncImageProvider();
  71. virtual ~QQuickAsyncImageProvider();
  72. virtual QQuickImageResponse *requestImageResponse(const QString &id, const QSize &requestedSize) = 0 /Factory/;
  73. };