#ifndef PYTHONQTWRAPPER_QIMAGEIOHANDLER_H #define PYTHONQTWRAPPER_QIMAGEIOHANDLER_H #include #include #include #include #include #include #include #include #include #include class PythonQtShell_QImageIOHandler : public QImageIOHandler { public: PythonQtShell_QImageIOHandler():QImageIOHandler(),_wrapper(NULL) {}; virtual bool canRead() const; virtual int currentImageNumber() const; virtual QRect currentImageRect() const; virtual int imageCount() const; virtual bool jumpToImage(int imageNumber); virtual bool jumpToNextImage(); virtual int loopCount() const; virtual QByteArray name() const; virtual int nextImageDelay() const; virtual QVariant option(QImageIOHandler::ImageOption option) const; virtual bool read(QImage* image); virtual void setOption(QImageIOHandler::ImageOption option, const QVariant& value); virtual bool supportsOption(QImageIOHandler::ImageOption option) const; virtual bool write(const QImage& image); PythonQtInstanceWrapper* _wrapper; }; class PythonQtPublicPromoter_QImageIOHandler : public QImageIOHandler { public: inline bool promoted_write(const QImage& image) { return QImageIOHandler::write(image); } inline bool promoted_supportsOption(QImageIOHandler::ImageOption option) const { return QImageIOHandler::supportsOption(option); } inline QVariant promoted_option(QImageIOHandler::ImageOption option) const { return QImageIOHandler::option(option); } inline int promoted_currentImageNumber() const { return QImageIOHandler::currentImageNumber(); } inline QRect promoted_currentImageRect() const { return QImageIOHandler::currentImageRect(); } inline bool promoted_jumpToImage(int imageNumber) { return QImageIOHandler::jumpToImage(imageNumber); } inline bool promoted_jumpToNextImage() { return QImageIOHandler::jumpToNextImage(); } inline void promoted_setOption(QImageIOHandler::ImageOption option, const QVariant& value) { QImageIOHandler::setOption(option, value); } inline int promoted_imageCount() const { return QImageIOHandler::imageCount(); } inline int promoted_nextImageDelay() const { return QImageIOHandler::nextImageDelay(); } inline int promoted_loopCount() const { return QImageIOHandler::loopCount(); } }; class PythonQtWrapper_QImageIOHandler : public QObject { Q_OBJECT public: Q_ENUMS(ImageOption ) enum ImageOption{ Size = QImageIOHandler::Size, ClipRect = QImageIOHandler::ClipRect, Description = QImageIOHandler::Description, ScaledClipRect = QImageIOHandler::ScaledClipRect, ScaledSize = QImageIOHandler::ScaledSize, CompressionRatio = QImageIOHandler::CompressionRatio, Gamma = QImageIOHandler::Gamma, Quality = QImageIOHandler::Quality, Name = QImageIOHandler::Name, SubType = QImageIOHandler::SubType, IncrementalReading = QImageIOHandler::IncrementalReading, Endianness = QImageIOHandler::Endianness, Animation = QImageIOHandler::Animation, BackgroundColor = QImageIOHandler::BackgroundColor}; public slots: QImageIOHandler* new_QImageIOHandler(); void delete_QImageIOHandler(QImageIOHandler* obj) { delete obj; } QByteArray format(QImageIOHandler* theWrappedObject) const; void setDevice(QImageIOHandler* theWrappedObject, QIODevice* device); bool write(QImageIOHandler* theWrappedObject, const QImage& image); QIODevice* device(QImageIOHandler* theWrappedObject) const; bool supportsOption(QImageIOHandler* theWrappedObject, QImageIOHandler::ImageOption option) const; QVariant option(QImageIOHandler* theWrappedObject, QImageIOHandler::ImageOption option) const; int currentImageNumber(QImageIOHandler* theWrappedObject) const; QRect currentImageRect(QImageIOHandler* theWrappedObject) const; bool jumpToImage(QImageIOHandler* theWrappedObject, int imageNumber); bool jumpToNextImage(QImageIOHandler* theWrappedObject); void setFormat(QImageIOHandler* theWrappedObject, const QByteArray& format); void setOption(QImageIOHandler* theWrappedObject, QImageIOHandler::ImageOption option, const QVariant& value); int imageCount(QImageIOHandler* theWrappedObject) const; int nextImageDelay(QImageIOHandler* theWrappedObject) const; int loopCount(QImageIOHandler* theWrappedObject) const; }; #endif // PYTHONQTWRAPPER_QIMAGEIOHANDLER_H