1/*
2 This file is part of the KDE project
3 SPDX-FileCopyrightText: 2023 Ernest Gupik <ernestgupik@wp.pl>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KIMG_QOI_P_H
9#define KIMG_QOI_P_H
10
11#include <QImageIOPlugin>
12#include <QScopedPointer>
13
14class QOIHandlerPrivate;
15class QOIHandler : public QImageIOHandler
16{
17public:
18 QOIHandler();
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
29private:
30 const QScopedPointer<QOIHandlerPrivate> d;
31};
32
33class QOIPlugin : public QImageIOPlugin
34{
35 Q_OBJECT
36 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "qoi.json")
37
38public:
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_QOI_P_H
44

source code of kimageformats/src/imageformats/qoi_p.h