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
qimagewriter.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 QIMAGEWRITER_H
5#define QIMAGEWRITER_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtCore/qbytearray.h>
9#include <QtCore/qcoreapplication.h>
10#include <QtCore/qlist.h>
11#include <QtGui/qimageiohandler.h>
12
14
15
16class QIODevice;
17class QImage;
18
20class Q_GUI_EXPORT QImageWriter
21{
23public:
30
33 explicit QImageWriter(const QString &fileName, const QByteArray &format = QByteArray());
35
36 void setFormat(const QByteArray &format);
37 QByteArray format() const;
38
39 void setDevice(QIODevice *device);
40 QIODevice *device() const;
41
42 void setFileName(const QString &fileName);
43 QString fileName() const;
44
45 void setQuality(int quality);
46 int quality() const;
47
48 void setCompression(int compression);
49 int compression() const;
50
51 void setSubType(const QByteArray &type);
52 QByteArray subType() const;
53 QList<QByteArray> supportedSubTypes() const;
54
55 void setOptimizedWrite(bool optimize);
56 bool optimizedWrite() const;
57
58 void setProgressiveScanWrite(bool progressive);
59 bool progressiveScanWrite() const;
60
61 QImageIOHandler::Transformations transformation() const;
62 void setTransformation(QImageIOHandler::Transformations orientation);
63
64 void setText(const QString &key, const QString &text);
65
66 bool canWrite() const;
67 bool write(const QImage &image);
68
69 ImageWriterError error() const;
70 QString errorString() const;
71
72 bool supportsOption(QImageIOHandler::ImageOption option) const;
73
74 static QList<QByteArray> supportedImageFormats();
75 static QList<QByteArray> supportedMimeTypes();
76 static QList<QByteArray> imageFormatsForMimeType(const QByteArray &mimeType);
77
78private:
79 Q_DISABLE_COPY(QImageWriter)
81};
82
84
85#endif // QIMAGEWRITER_H
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore \reentrant
Definition qiodevice.h:34
ImageOption
This enum describes the different options supported by QImageIOHandler.
The QImageWriter class provides a format independent interface for writing images to files or other d...
ImageWriterError
This enum describes errors that can occur when writing images with QImageWriter.
\inmodule QtGui
Definition qimage.h:37
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
widget setFormat(format)
QString text
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 type
GLint GLsizei GLsizei GLenum format
GLuint GLenum option
file setFileName("readme.txt")
gzip write("uncompressed data")
insertRed setText("insert red text")