2015-11-01 05:10:05 +02:00
|
|
|
/*
|
|
|
|
QImageIO Routines to read/write WebP images.
|
|
|
|
|
|
|
|
Copyright (c) 2012,2013 Martin Koller <kollix@aon.at>
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) version 3, or any
|
|
|
|
later version accepted by the membership of KDE e.V. (or its
|
|
|
|
successor approved by the membership of KDE e.V.), which shall
|
|
|
|
act as a proxy defined in Section 6 of version 3 of the license.
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WEBP_H
|
|
|
|
#define WEBP_H
|
|
|
|
|
2022-06-12 04:00:21 +03:00
|
|
|
#include <QStringList>
|
2015-11-01 05:10:05 +02:00
|
|
|
#include <QImageIOHandler>
|
|
|
|
|
|
|
|
class WebPHandler : public QImageIOHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
WebPHandler();
|
|
|
|
|
2021-08-01 00:01:13 +03:00
|
|
|
bool canRead() const final;
|
|
|
|
bool read(QImage *image) final;
|
|
|
|
bool write(const QImage &image) final;
|
2015-11-01 05:10:05 +02:00
|
|
|
|
2021-08-01 00:01:13 +03:00
|
|
|
QByteArray name() const final;
|
2015-11-01 05:10:05 +02:00
|
|
|
|
2022-02-27 23:13:43 +02:00
|
|
|
bool supportsOption(QImageIOHandler::ImageOption option) const final;
|
|
|
|
QVariant option(QImageIOHandler::ImageOption option) const final;
|
|
|
|
void setOption(QImageIOHandler::ImageOption option, const QVariant &value) final;
|
2015-11-01 05:10:05 +02:00
|
|
|
|
|
|
|
static bool canRead(QIODevice *device);
|
|
|
|
|
2022-10-18 17:29:58 +03:00
|
|
|
bool jumpToNextImage() final;
|
|
|
|
bool jumpToImage(int imageNumber) final;
|
|
|
|
int loopCount() const final;
|
|
|
|
int imageCount() const final;
|
|
|
|
int nextImageDelay() const final;
|
|
|
|
int currentImageNumber() const final;
|
|
|
|
|
2015-11-01 05:10:05 +02:00
|
|
|
private:
|
2022-10-18 17:29:58 +03:00
|
|
|
int m_quality;
|
|
|
|
int m_loopcount;
|
|
|
|
int m_imagecount;
|
|
|
|
int m_imagedelay;
|
|
|
|
int m_currentimage;
|
2015-11-01 05:10:05 +02:00
|
|
|
};
|
|
|
|
|
2021-08-01 00:01:13 +03:00
|
|
|
|
|
|
|
class WebPPlugin : public QImageIOPlugin
|
|
|
|
{
|
|
|
|
public:
|
2022-06-12 04:00:21 +03:00
|
|
|
QStringList keys() const;
|
2022-03-03 02:56:52 +02:00
|
|
|
QList<QByteArray> mimeTypes() const;
|
2021-08-01 00:01:13 +03:00
|
|
|
Capabilities capabilities(QIODevice *device, const QByteArray &format) const final;
|
|
|
|
QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const final;
|
|
|
|
};
|
|
|
|
|
2015-11-01 05:10:05 +02:00
|
|
|
#endif
|