| 1 | /* |
| 2 | kimgio module for SGI images |
| 3 | SPDX-FileCopyrightText: 2004 Melchior FRANZ <mfranz@kde.org> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef KIMG_RGB_P_H |
| 9 | #define KIMG_RGB_P_H |
| 10 | |
| 11 | #include <QImageIOPlugin> |
| 12 | #include <QScopedPointer> |
| 13 | |
| 14 | class SGIImagePrivate; |
| 15 | class RGBHandler : public QImageIOHandler |
| 16 | { |
| 17 | public: |
| 18 | RGBHandler(); |
| 19 | |
| 20 | bool canRead() const override; |
| 21 | bool read(QImage *image) override; |
| 22 | bool write(const QImage &image) override; |
| 23 | |
| 24 | bool supportsOption(QImageIOHandler::ImageOption option) const override; |
| 25 | QVariant option(QImageIOHandler::ImageOption option) const override; |
| 26 | |
| 27 | static bool canRead(QIODevice *device); |
| 28 | |
| 29 | private: |
| 30 | QScopedPointer<SGIImagePrivate> d; |
| 31 | }; |
| 32 | |
| 33 | class RGBPlugin : public QImageIOPlugin |
| 34 | { |
| 35 | Q_OBJECT |
| 36 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "rgb.json" ) |
| 37 | |
| 38 | public: |
| 39 | Capabilities capabilities(QIODevice *device, const QByteArray &format) const override; |
| 40 | QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override; |
| 41 | }; |
| 42 | |
| 43 | #endif // KIMG_RGB_P_H |
| 44 | |