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.1-or-later |
6 | */ |
7 | |
8 | #ifndef KIMG_JP2_P_H |
9 | #define KIMG_JP2_P_H |
10 | |
11 | #include <QImageIOPlugin> |
12 | #include <QScopedPointer> |
13 | |
14 | class JP2HandlerPrivate; |
15 | class JP2Handler : public QImageIOHandler |
16 | { |
17 | public: |
18 | JP2Handler(); |
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 | void setOption(ImageOption option, const QVariant &value) override; |
26 | QVariant option(QImageIOHandler::ImageOption option) const override; |
27 | |
28 | static bool canRead(QIODevice *device); |
29 | |
30 | private: |
31 | const QScopedPointer<JP2HandlerPrivate> d; |
32 | }; |
33 | |
34 | class JP2Plugin : public QImageIOPlugin |
35 | { |
36 | Q_OBJECT |
37 | Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "jp2.json" ) |
38 | |
39 | public: |
40 | Capabilities capabilities(QIODevice *device, const QByteArray &format) const override; |
41 | QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override; |
42 | }; |
43 | |
44 | #endif // KIMG_JP2_P_H |
45 | |