82#include <private/qfactoryloader_p.h>
85#include <private/qbmphandler_p.h>
86#include <private/qppmhandler_p.h>
87#include <private/qxbmhandler_p.h>
88#include <private/qxpmhandler_p.h>
89#ifndef QT_NO_IMAGEFORMAT_PNG
90#include <private/qpnghandler_p.h>
93#include <private/qimagereaderwriterhelpers_p.h>
108#ifndef QT_NO_IMAGEFORMATPLUGIN
113 const PluginKeyMap
keyMap = l->keyMap();
114 int suffixPluginIndex = -1;
123#ifndef QT_NO_IMAGEFORMATPLUGIN
126 suffixPluginIndex =
index;
134#ifndef QT_NO_IMAGEFORMATPLUGIN
135 if (suffixPluginIndex != -1) {
148 if (!handler && !testFormat.
isEmpty()) {
150#ifndef QT_NO_IMAGEFORMAT_PNG
151 }
else if (testFormat ==
"png") {
154#ifndef QT_NO_IMAGEFORMAT_BMP
155 }
else if (testFormat ==
"bmp") {
157 }
else if (testFormat ==
"dib") {
160#ifndef QT_NO_IMAGEFORMAT_XPM
161 }
else if (testFormat ==
"xpm") {
164#ifndef QT_NO_IMAGEFORMAT_XBM
165 }
else if (testFormat ==
"xbm") {
169#ifndef QT_NO_IMAGEFORMAT_PPM
170 }
else if (testFormat ==
"pbm" || testFormat ==
"pbmraw" || testFormat ==
"pgm"
171 || testFormat ==
"pgmraw" || testFormat ==
"ppm" || testFormat ==
"ppmraw") {
178#ifndef QT_NO_IMAGEFORMATPLUGIN
180 const int keyCount =
keyMap.size();
181 for (
int i = 0;
i < keyCount; ++
i) {
182 QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(
i));
256 errorString = QImageWriter::tr(
"Device is not set");
268 errorString = QImageWriter::tr(
"Device not writable");
273 errorString = QImageWriter::tr(
"Unsupported image format");
658 d->
errorString = QImageWriter::tr(
"Image is empty");
733 d->
errorString = QImageWriter::tr(
"Unsupported image format");
IOBluetoothDevice * device
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
bool flush()
Flushes any buffered data to the file.
\inmodule QtCore \reentrant
QString suffix() const
Returns the suffix (extension) of the file.
bool remove()
Removes the file specified by fileName().
QString fileName() const override
Returns the name set by setFileName() or to the QFile constructors.
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool isEmpty() const
\inmodule QtCore \reentrant
virtual bool open(QIODeviceBase::OpenMode mode)
Opens the device and sets its OpenMode to mode.
bool isOpen() const
Returns true if the device is open; otherwise returns false.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
bool isWritable() const
Returns true if data can be written to the device; otherwise returns false.
The QImageIOHandler class defines the common image I/O interface for all image formats in Qt.
ImageOption
This enum describes the different options supported by QImageIOHandler.
virtual bool write(const QImage &image)
Writes the image image to the assigned device.
virtual void setOption(ImageOption option, const QVariant &value)
Sets the option option with the value value.
virtual bool supportsOption(ImageOption option) const
Returns true if the QImageIOHandler supports the option option; otherwise returns false.
virtual QVariant option(ImageOption option) const
Returns the value assigned to option as a QVariant.
void setDevice(QIODevice *device)
Sets the device of the QImageIOHandler to device.
void setFormat(const QByteArray &format)
Sets the format of the QImageIOHandler to format.
virtual QImageIOHandler * create(QIODevice *device, const QByteArray &format=QByteArray()) const =0
Creates and returns a QImageIOHandler subclass, with device and format set.
virtual Capabilities capabilities(QIODevice *device, const QByteArray &format) const =0
Returns the capabilities of the plugin, based on the data in device and the format format.
QImageWriterPrivate(QImageWriter *qq)
bool progressiveScanWrite
QImageWriter::ImageWriterError imageWriterError
QImageIOHandler::Transformations transformation
QImageIOHandler * handler
The QImageWriter class provides a format independent interface for writing images to files or other d...
void setDevice(QIODevice *device)
Sets QImageWriter's device to device.
QString errorString() const
Returns a human readable description of the last error that occurred.
QString fileName() const
If the currently assigned device is a file, or if setFileName() has been called, this function return...
QIODevice * device() const
Returns the device currently assigned to QImageWriter, or \nullptr if no device has been assigned.
QImageWriter()
Constructs an empty QImageWriter object.
void setCompression(int compression)
This is an image format specific function that set the compression of an image.
bool write(const QImage &image)
Writes the image image to the assigned device or file name.
bool canWrite() const
Returns true if QImageWriter can write the image; i.e., the image format is supported and the assigne...
void setTransformation(QImageIOHandler::Transformations orientation)
bool supportsOption(QImageIOHandler::ImageOption option) const
static QList< QByteArray > supportedMimeTypes()
Returns the list of MIME types supported by QImageWriter.
int quality() const
Returns the quality setting of the image format.
ImageWriterError
This enum describes errors that can occur when writing images with QImageWriter.
void setSubType(const QByteArray &type)
void setFileName(const QString &fileName)
Sets the file name of QImageWriter to fileName.
bool optimizedWrite() const
QList< QByteArray > supportedSubTypes() const
bool progressiveScanWrite() const
QByteArray subType() const
~QImageWriter()
Destructs the QImageWriter object.
QByteArray format() const
Returns the format QImageWriter uses for writing images.
static QList< QByteArray > imageFormatsForMimeType(const QByteArray &mimeType)
void setOptimizedWrite(bool optimize)
static QList< QByteArray > supportedImageFormats()
Returns the list of image formats supported by QImageWriter.
void setQuality(int quality)
Sets the quality setting of the image format to quality.
ImageWriterError error() const
Returns the type of error that last occurred.
int compression() const
Returns the compression of the image.
void setFormat(const QByteArray &format)
Sets the format QImageWriter will use when writing images, to format.
void setProgressiveScanWrite(bool progressive)
void setText(const QString &key, const QString &text)
QImageIOHandler::Transformations transformation() const
\macro QT_RESTRICTED_CAST_FROM_ASCII
QByteArray toLatin1() const &
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
QString simplified() const &
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString toLower() const &
QList< QByteArray > imageFormatsForMimeType(const QByteArray &mimeType, Capability cap)
QSharedPointer< QFactoryLoader > pluginLoader()
QList< QByteArray > supportedImageFormats(Capability cap)
QList< QByteArray > supportedMimeTypes(Capability cap)
Combined button and popup list for selecting options.
Q_GUI_EXPORT void qt_imageTransform(QImage &src, QImageIOHandler::Transformations orient)
static QImageIOHandler * createWriteHandlerHelper(QIODevice *device, const QByteArray &format)
void qt_imageTransform(QImage &src, QImageIOHandler::Transformations orient)
GLint GLsizei GLsizei GLenum format
GLuint GLenum GLenum transform
GLdouble GLdouble GLdouble GLdouble q
static const struct @437 keyMap[]
settings remove("monkey")