| 1 | /* |
| 2 | This file is part of the KDE project |
| 3 | SPDX-FileCopyrightText: 2024 Mirco Miranda <mircomir@outlook.com> |
| 4 | |
| 5 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 6 | */ |
| 7 | |
| 8 | #ifndef SIMG_SCITEX_P_H |
| 9 | #define SIMG_SCITEX_P_H |
| 10 | |
| 11 | #include <QImageIOPlugin> |
| 12 | #include <QScopedPointer> |
| 13 | |
| 14 | class ScitexHandlerPrivate; |
| 15 | class ScitexHandler : public QImageIOHandler |
| 16 | { |
| 17 | public: |
| 18 | ScitexHandler(); |
| 19 | |
| 20 | bool canRead() const override; |
| 21 | bool read(QImage *image) override; |
| 22 | |
| 23 | bool supportsOption(QImageIOHandler::ImageOption option) const override; |
| 24 | QVariant option(QImageIOHandler::ImageOption option) const override; |
| 25 | |
| 26 | static bool canRead(QIODevice *device); |
| 27 | |
| 28 | private: |
| 29 | const QScopedPointer<ScitexHandlerPrivate> d; |
| 30 | }; |
| 31 | |
| 32 | class ScitexPlugin : public QImageIOPlugin |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "sct.json" ) |
| 36 | |
| 37 | public: |
| 38 | Capabilities capabilities(QIODevice *device, const QByteArray &format) const override; |
| 39 | QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override; |
| 40 | }; |
| 41 | |
| 42 | #endif // SIMG_SCITEX_P_H |
| 43 | |