8#include <QtCore/QVariant>
9#include <QtCore/QDebug>
10#include <QtGui/QImage>
14QTgaHandler::QTgaHandler()
34 qWarning(
"QTgaHandler::canRead(): %s", qPrintable(tga->errorMessage()));
41 qWarning(
"QTgaHandler::canRead() called with no device");
47 if (device->isSequential())
49 qint64 pos = device->pos();
63 *image = tga->readImage();
64 return !image->isNull();
69 if (option == Size && canRead()) {
71 }
else if (option == CompressionRatio) {
72 return tga->compression();
73 }
else if (option == ImageFormat) {
74 return QImage::Format_ARGB32;
87 return option == CompressionRatio
89 || option == ImageFormat;
QTgaFile(QIODevice *)
Construct a new QTgaFile object getting data from device.
void setOption(ImageOption option, const QVariant &value) override
Sets the option option with the value value.
QVariant option(ImageOption option) const override
Returns the value assigned to option as a QVariant.
bool read(QImage *image) override
Read an image from the device, and stores it in image.
bool supportsOption(ImageOption option) const override
Returns true if the QImageIOHandler supports the option option; otherwise returns false.
bool canRead() const override
Returns true if an image can be read from the device (i.e., the image format is supported,...