/src/qtbase/src/gui/image/qbitmap.h
Line | Count | Source |
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 QBITMAP_H |
6 | | #define QBITMAP_H |
7 | | |
8 | | #include <QtGui/qtguiglobal.h> |
9 | | #include <QtGui/qpixmap.h> |
10 | | |
11 | | QT_BEGIN_NAMESPACE |
12 | | |
13 | | |
14 | | class QVariant; |
15 | | |
16 | | class Q_GUI_EXPORT QBitmap : public QPixmap |
17 | | { |
18 | | public: |
19 | | QBitmap(); |
20 | | #if QT_DEPRECATED_SINCE(6, 0) |
21 | | QT_DEPRECATED_VERSION_X_6_0("Use fromPixmap instead.") explicit QBitmap(const QPixmap &); |
22 | | #endif |
23 | | QBitmap(int w, int h); |
24 | | explicit QBitmap(const QSize &); |
25 | | explicit QBitmap(const QString &fileName, const char *format = nullptr); |
26 | | ~QBitmap() override; |
27 | | |
28 | | #if QT_DEPRECATED_SINCE(6, 0) |
29 | | QT_DEPRECATED_VERSION_X_6_0("Use fromPixmap instead.") QBitmap &operator=(const QPixmap &); |
30 | | #endif |
31 | 0 | inline void swap(QBitmap &other) { QPixmap::swap(other); } // prevent QBitmap<->QPixmap swaps |
32 | | operator QVariant() const; |
33 | | |
34 | 0 | inline void clear() { fill(Qt::color0); } |
35 | | |
36 | | static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags = Qt::AutoColor); |
37 | | static QBitmap fromImage(QImage &&image, Qt::ImageConversionFlags flags = Qt::AutoColor); |
38 | | static QBitmap fromData(const QSize &size, const uchar *bits, |
39 | | QImage::Format monoFormat = QImage::Format_MonoLSB); |
40 | | static QBitmap fromPixmap(const QPixmap &pixmap); |
41 | | |
42 | | QBitmap transformed(const QTransform &matrix) const; |
43 | | |
44 | | typedef QExplicitlySharedDataPointer<QPlatformPixmap> DataPtr; |
45 | | }; |
46 | | Q_DECLARE_SHARED(QBitmap) |
47 | | |
48 | | QT_END_NAMESPACE |
49 | | |
50 | | #endif // QBITMAP_H |