pimageformats/imageformats/sai.cpp
2020-07-04 22:51:42 +08:00

62 lines
1.0 KiB
C++

#include "sai_p.h"
#include "sai.hpp"
SAIHandler::SAIHandler()
{
}
bool SAIHandler::canRead() const
{
if (canRead(device())) {
setFormat("sai");
return true;
}
return false;
}
bool SAIHandler::read(QImage *image)
{
Q_UNUSED(image)
return false;
}
bool SAIHandler::write(const QImage &image)
{
Q_UNUSED(image)
return false;
}
bool SAIHandler::canRead(QIODevice *device)
{
if (!device) {
qWarning("SAIHandler::canRead() called with no device");
return false;
}
// FIXME: check
return true;
}
QImageIOPlugin::Capabilities SAIPlugin::capabilities(QIODevice *device, const QByteArray &format) const
{
if (!format.isEmpty()) {
return {};
}
if (!device->isOpen()) {
return {};
}
return Capabilities(CanRead);
}
QImageIOHandler *SAIPlugin::create(QIODevice *device, const QByteArray &format) const
{
QImageIOHandler *handler = new SAIHandler;
handler->setDevice(device);
handler->setFormat(format);
return handler;
}