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 KIMG_PFM_P_H |
9 | #define KIMG_PFM_P_H |
10 | |
11 | #include <QImageIOPlugin> |
12 | #include <QScopedPointer> |
13 | |
14 | class PFMHandlerPrivate; |
15 | class PFMHandler : public QImageIOHandler |
16 | { |
17 | public: |
18 | PFMHandler(); |
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<PFMHandlerPrivate> d; |
30 | }; |
31 | |
32 | class PFMPlugin : public QImageIOPlugin |
33 | { |
34 | Q_OBJECT |
35 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "pfm.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 // KIMG_PFM_P_H |
43 | |