File indexing completed on 2024-05-12 04:34:49

0001 /* ============================================================
0002 * Date        : 2010-07-02
0003 * Description : Image saver class for libksane image data.
0004 *
0005 * SPDX-FileCopyrightText: 2010-2012 Kåre Särs <kare.sars@iki .fi>
0006 * SPDX-FileCopyrightText: 2014 Gregor Mitsch : port to KDE5 frameworks
0007 *
0008 * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0009 *
0010 * ============================================================ */
0011 
0012 #ifndef SkanliteImageSaver_h
0013 #define SkanliteImageSaver_h
0014 
0015 #include <QByteArray>
0016 #include <QThread>
0017 #include <QString>
0018 
0019 class SkanliteImageSaver : public QThread
0020 {
0021     Q_OBJECT
0022 public:
0023     explicit SkanliteImageSaver(QObject *parent = nullptr);
0024     ~SkanliteImageSaver() override;
0025 
0026     bool saveQImage(const QUrl &url, const QString &name, const QImage &image, const QString& fileFormat, int quality);
0027 Q_SIGNALS:
0028     void imageSaved(const QUrl &url, const QString &name, bool success);
0029 
0030 protected:
0031     void run() override;
0032 
0033 private:
0034     struct Private;
0035     Private *const d;
0036 };
0037 
0038 #endif
0039