Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qxbmhandler_p.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// Qt-Security score:significant reason:default
4
5#ifndef QXBMHANDLER_P_H
6#define QXBMHANDLER_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/private/qtguiglobal_p.h>
20#include "QtGui/qimageiohandler.h"
21
22#ifndef QT_NO_IMAGEFORMAT_XBM
23
24QT_BEGIN_NAMESPACE
25
26class QXbmHandler : public QImageIOHandler
27{
28public:
29 QXbmHandler();
30 bool canRead() const override;
31 bool read(QImage *image) override;
32 bool write(const QImage &image) override;
33
34 static bool canRead(QIODevice *device);
35
36 QVariant option(ImageOption option) const override;
37 void setOption(ImageOption option, const QVariant &value) override;
38 bool supportsOption(ImageOption option) const override;
39
40private:
41 bool readHeader();
42 enum State {
43 Ready,
44 ReadHeader,
45 Error
46 };
47 State state;
48 int width;
49 int height;
50 QString fileName;
51};
52
53QT_END_NAMESPACE
54
55#endif // QT_NO_IMAGEFORMAT_XBM
56
57#endif // QXBMHANDLER_P_H