File indexing completed on 2024-04-28 15:25:48

0001 /*
0002     xcf.cpp: A Qt 5 plug-in for reading GIMP XCF image files
0003     SPDX-FileCopyrightText: 2001 lignum Computing Inc. <allen@lignumcomputing.com>
0004     SPDX-FileCopyrightText: 2004 Melchior FRANZ <mfranz@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-or-later
0007 */
0008 
0009 #ifndef KIMG_XCF_P_H
0010 #define KIMG_XCF_P_H
0011 
0012 #include <QImageIOPlugin>
0013 
0014 class XCFHandler : public QImageIOHandler
0015 {
0016 public:
0017     XCFHandler();
0018 
0019     bool canRead() const override;
0020     bool read(QImage *image) override;
0021     bool write(const QImage &image) override;
0022 
0023     bool supportsOption(QImageIOHandler::ImageOption option) const override;
0024     QVariant option(QImageIOHandler::ImageOption option) const override;
0025 
0026     static bool canRead(QIODevice *device);
0027 };
0028 
0029 class XCFPlugin : public QImageIOPlugin
0030 {
0031     Q_OBJECT
0032     Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QImageIOHandlerFactoryInterface" FILE "xcf.json")
0033 
0034 public:
0035     Capabilities capabilities(QIODevice *device, const QByteArray &format) const override;
0036     QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const override;
0037 };
0038 
0039 #endif // KIMG_XCF_P_H