RGB: added options support

- Added support for `Size` and `Format` options and slightly improved format detection from canRead().
- Removed conversion to ARGB32 on load (improved performace with RGBA images).
- Added result checks on writing.

With this MR, all plugins have minimal support for options.
This commit is contained in:
Mirco Miranda
2024-08-25 21:00:08 +00:00
committed by Albert Astals Cid
parent d02dcb064b
commit 2405a09e36
4 changed files with 249 additions and 127 deletions

View File

@@ -9,7 +9,9 @@
#define KIMG_RGB_P_H
#include <QImageIOPlugin>
#include <QScopedPointer>
class SGIImagePrivate;
class RGBHandler : public QImageIOHandler
{
public:
@@ -19,7 +21,13 @@ public:
bool read(QImage *image) override;
bool write(const QImage &image) override;
bool supportsOption(QImageIOHandler::ImageOption option) const override;
QVariant option(QImageIOHandler::ImageOption option) const override;
static bool canRead(QIODevice *device);
private:
QScopedPointer<SGIImagePrivate> d;
};
class RGBPlugin : public QImageIOPlugin