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
qimageiohandler.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 QIMAGEIOHANDLER_H
5#define QIMAGEIOHANDLER_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtGui/qimage.h>
9#include <QtCore/qiodevice.h>
10#include <QtCore/qplugin.h>
11#include <QtCore/qfactoryinterface.h>
12#include <QtCore/qscopedpointer.h>
13
15
16
17class QImage;
18class QRect;
19class QSize;
20class QVariant;
21
23class Q_GUI_EXPORT QImageIOHandler
24{
25 Q_DECLARE_PRIVATE(QImageIOHandler)
26public:
28 virtual ~QImageIOHandler();
29
30 void setDevice(QIODevice *device);
31 QIODevice *device() const;
32
33 void setFormat(const QByteArray &format);
34 void setFormat(const QByteArray &format) const;
35 QByteArray format() const;
36
37 virtual bool canRead() const = 0;
38 virtual bool read(QImage *image) = 0;
39 virtual bool write(const QImage &image);
40
62
64 TransformationNone = 0,
65 TransformationMirror = 1,
66 TransformationFlip = 2,
67 TransformationRotate180 = TransformationMirror | TransformationFlip,
68 TransformationRotate90 = 4,
69 TransformationMirrorAndRotate90 = TransformationMirror | TransformationRotate90,
70 TransformationFlipAndRotate90 = TransformationFlip | TransformationRotate90,
71 TransformationRotate270 = TransformationRotate180 | TransformationRotate90
72 };
73 Q_DECLARE_FLAGS(Transformations, Transformation)
74
75 virtual QVariant option(ImageOption option) const;
76 virtual void setOption(ImageOption option, const QVariant &value);
77 virtual bool supportsOption(ImageOption option) const;
78
79 // incremental loading
80 virtual bool jumpToNextImage();
81 virtual bool jumpToImage(int imageNumber);
82 virtual int loopCount() const;
83 virtual int imageCount() const;
84 virtual int nextImageDelay() const;
85 virtual int currentImageNumber() const;
86 virtual QRect currentImageRect() const;
87
88 static bool allocateImage(QSize size, QImage::Format format, QImage *image);
89
90protected:
92 QScopedPointer<QImageIOHandlerPrivate> d_ptr;
93private:
94 Q_DISABLE_COPY(QImageIOHandler)
95};
96
97#ifndef QT_NO_IMAGEFORMATPLUGIN
98
99#define QImageIOHandlerFactoryInterface_iid "org.qt-project.Qt.QImageIOHandlerFactoryInterface"
100
101class Q_GUI_EXPORT QImageIOPlugin : public QObject
102{
104public:
105 explicit QImageIOPlugin(QObject *parent = nullptr);
107
109 CanRead = 0x1,
110 CanWrite = 0x2,
111 CanReadIncremental = 0x4
112 };
113 Q_DECLARE_FLAGS(Capabilities, Capability)
114
115 virtual Capabilities capabilities(QIODevice *device, const QByteArray &format) const = 0;
117};
118
120
121#endif // QT_NO_IMAGEFORMATPLUGIN
122
124
125#endif // QIMAGEIOHANDLER_H
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore \reentrant
Definition qiodevice.h:34
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.
QScopedPointer< QImageIOHandlerPrivate > d_ptr
virtual bool canRead() const =0
Returns true if an image can be read from the device (i.e., the image format is supported,...
virtual bool read(QImage *image)=0
Read an image from the device, and stores it in image.
\inmodule QtGui
Capability
This enum describes the capabilities of a QImageIOPlugin.
\inmodule QtGui
Definition qimage.h:37
Format
The following image formats are available in Qt.
Definition qimage.h:41
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
Definition qvariant.h:65
widget setFormat(format)
Combined button and popup list for selecting options.
Definition image.cpp:4
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_FLAGS(Flags, Enum)
Definition qflags.h:174
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
Definition qflags.h:194
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum format
GLuint GLenum option
#define Q_OBJECT
gzip write("uncompressed data")
view create()