Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qimagereader.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QIMAGEREADER_H
5#define QIMAGEREADER_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtCore/qbytearray.h>
9#include <QtCore/qcoreapplication.h>
10#include <QtGui/qimage.h>
11#include <QtGui/qimageiohandler.h>
12
14
15
16class QColor;
17class QIODevice;
18class QRect;
19class QSize;
20
22class Q_GUI_EXPORT QImageReader
23{
25public:
33
36 explicit QImageReader(const QString &fileName, const QByteArray &format = QByteArray());
38
39 void setFormat(const QByteArray &format);
40 QByteArray format() const;
41
42 void setAutoDetectImageFormat(bool enabled);
43 bool autoDetectImageFormat() const;
44
45 void setDecideFormatFromContent(bool ignored);
46 bool decideFormatFromContent() const;
47
48 void setDevice(QIODevice *device);
49 QIODevice *device() const;
50
51 void setFileName(const QString &fileName);
52 QString fileName() const;
53
54 QSize size() const;
55
56 QImage::Format imageFormat() const;
57
58 QStringList textKeys() const;
59 QString text(const QString &key) const;
60
61 void setClipRect(const QRect &rect);
62 QRect clipRect() const;
63
64 void setScaledSize(const QSize &size);
65 QSize scaledSize() const;
66
67 void setQuality(int quality);
68 int quality() const;
69
70 void setScaledClipRect(const QRect &rect);
71 QRect scaledClipRect() const;
72
73 void setBackgroundColor(const QColor &color);
74 QColor backgroundColor() const;
75
76 bool supportsAnimation() const;
77
78 QImageIOHandler::Transformations transformation() const;
79
80 void setAutoTransform(bool enabled);
81 bool autoTransform() const;
82
83 QByteArray subType() const;
84 QList<QByteArray> supportedSubTypes() const;
85
86 bool canRead() const;
87 QImage read();
88 bool read(QImage *image);
89
90 bool jumpToNextImage();
91 bool jumpToImage(int imageNumber);
92 int loopCount() const;
93 int imageCount() const;
94 int nextImageDelay() const;
95 int currentImageNumber() const;
96 QRect currentImageRect() const;
97
98 ImageReaderError error() const;
99 QString errorString() const;
100
101 bool supportsOption(QImageIOHandler::ImageOption option) const;
102
103 static QByteArray imageFormat(const QString &fileName);
104 static QByteArray imageFormat(QIODevice *device);
105 static QList<QByteArray> supportedImageFormats();
106 static QList<QByteArray> supportedMimeTypes();
107 static QList<QByteArray> imageFormatsForMimeType(const QByteArray &mimeType);
108 static int allocationLimit();
109 static void setAllocationLimit(int mbLimit);
110
111private:
112 Q_DISABLE_COPY(QImageReader)
114};
115
117
118#endif // QIMAGEREADER_H
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
\inmodule QtCore \reentrant
Definition qiodevice.h:34
ImageOption
This enum describes the different options supported by QImageIOHandler.
The QImageReader class provides a format independent interface for reading images from files or other...
ImageReaderError
This enum describes the different types of errors that can occur when reading images with QImageReade...
\inmodule QtGui
Definition qimage.h:37
Format
The following image formats are available in Qt.
Definition qimage.h:41
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
widget setFormat(format)
QString text
rect
[4]
Combined button and popup list for selecting options.
Definition image.cpp:4
#define Q_DECLARE_TR_FUNCTIONS(context)
DBusConnection const char DBusError * error
typedef QByteArray(EGLAPIENTRYP PFNQGSGETDISPLAYSPROC)()
const char * mimeType
GLuint64 key
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint color
[2]
GLint GLsizei GLsizei GLenum format
GLuint GLenum option
ReturnedValue read(const char *data)
file setFileName("readme.txt")