File indexing completed on 2024-05-12 07:49:40
0001 /* 0002 This file is part of the KDE project 0003 SPDX-FileCopyrightText: 2023 Ernest Gupik <ernestgupik@wp.pl> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef KIMG_QOI_P_H 0009 #define KIMG_QOI_P_H 0010 0011 #include <QImageIOPlugin> 0012 0013 class QOIHandler : public QImageIOHandler 0014 { 0015 public: 0016 QOIHandler(); 0017 0018 bool canRead() const override; 0019 bool read(QImage *image) override; 0020 bool write(const QImage &image) override; 0021 0022 bool supportsOption(QImageIOHandler::ImageOption option) const override; 0023 QVariant option(QImageIOHandler::ImageOption option) const override; 0024 0025 static bool canRead(QIODevice *device); 0026 }; 0027 0028 class QOIPlugin : public QImageIOPlugin 0029 { 0030 Q_OBJECT 0031 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "qoi.json") 0032 0033 public: 0034 Capabilities capabilities(QIODevice *device, const QByteArray &format) const override; 0035 QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override; 0036 }; 0037 0038 #endif // KIMG_QOI_P_H