File indexing completed on 2025-01-18 10:07:59
0001
0002
0003
0004 #ifndef QIMAGEREADER_H
0005 #define QIMAGEREADER_H
0006
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qbytearray.h>
0009 #include <QtCore/qcoreapplication.h>
0010 #include <QtGui/qimage.h>
0011 #include <QtGui/qimageiohandler.h>
0012
0013 QT_BEGIN_NAMESPACE
0014
0015
0016 class QColor;
0017 class QIODevice;
0018 class QRect;
0019 class QSize;
0020
0021 class QImageReaderPrivate;
0022 class Q_GUI_EXPORT QImageReader
0023 {
0024 Q_DECLARE_TR_FUNCTIONS(QImageReader)
0025 public:
0026 enum ImageReaderError {
0027 UnknownError,
0028 FileNotFoundError,
0029 DeviceError,
0030 UnsupportedFormatError,
0031 InvalidDataError
0032 };
0033
0034 QImageReader();
0035 explicit QImageReader(QIODevice *device, const QByteArray &format = QByteArray());
0036 explicit QImageReader(const QString &fileName, const QByteArray &format = QByteArray());
0037 ~QImageReader();
0038
0039 void setFormat(const QByteArray &format);
0040 QByteArray format() const;
0041
0042 void setAutoDetectImageFormat(bool enabled);
0043 bool autoDetectImageFormat() const;
0044
0045 void setDecideFormatFromContent(bool ignored);
0046 bool decideFormatFromContent() const;
0047
0048 void setDevice(QIODevice *device);
0049 QIODevice *device() const;
0050
0051 void setFileName(const QString &fileName);
0052 QString fileName() const;
0053
0054 QSize size() const;
0055
0056 QImage::Format imageFormat() const;
0057
0058 QStringList textKeys() const;
0059 QString text(const QString &key) const;
0060
0061 void setClipRect(const QRect &rect);
0062 QRect clipRect() const;
0063
0064 void setScaledSize(const QSize &size);
0065 QSize scaledSize() const;
0066
0067 void setQuality(int quality);
0068 int quality() const;
0069
0070 void setScaledClipRect(const QRect &rect);
0071 QRect scaledClipRect() const;
0072
0073 void setBackgroundColor(const QColor &color);
0074 QColor backgroundColor() const;
0075
0076 bool supportsAnimation() const;
0077
0078 QImageIOHandler::Transformations transformation() const;
0079
0080 void setAutoTransform(bool enabled);
0081 bool autoTransform() const;
0082
0083 QByteArray subType() const;
0084 QList<QByteArray> supportedSubTypes() const;
0085
0086 bool canRead() const;
0087 QImage read();
0088 bool read(QImage *image);
0089
0090 bool jumpToNextImage();
0091 bool jumpToImage(int imageNumber);
0092 int loopCount() const;
0093 int imageCount() const;
0094 int nextImageDelay() const;
0095 int currentImageNumber() const;
0096 QRect currentImageRect() const;
0097
0098 ImageReaderError error() const;
0099 QString errorString() const;
0100
0101 bool supportsOption(QImageIOHandler::ImageOption option) const;
0102
0103 static QByteArray imageFormat(const QString &fileName);
0104 static QByteArray imageFormat(QIODevice *device);
0105 static QList<QByteArray> supportedImageFormats();
0106 static QList<QByteArray> supportedMimeTypes();
0107 static QList<QByteArray> imageFormatsForMimeType(const QByteArray &mimeType);
0108 static int allocationLimit();
0109 static void setAllocationLimit(int mbLimit);
0110
0111 private:
0112 Q_DISABLE_COPY(QImageReader)
0113 QImageReaderPrivate *d;
0114 };
0115
0116 QT_END_NAMESPACE
0117
0118 #endif