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 QPIXMAP_RASTER_P_H |
5 | #define QPIXMAP_RASTER_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtGui/private/qtguiglobal_p.h> |
19 | #include <qpa/qplatformpixmap.h> |
20 | |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class Q_GUI_EXPORT QRasterPlatformPixmap : public QPlatformPixmap |
25 | { |
26 | public: |
27 | QRasterPlatformPixmap(PixelType type); |
28 | ~QRasterPlatformPixmap(); |
29 | |
30 | QPlatformPixmap *createCompatiblePlatformPixmap() const override; |
31 | |
32 | void resize(int width, int height) override; |
33 | bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags) override; |
34 | void fromImage(const QImage &image, Qt::ImageConversionFlags flags) override; |
35 | void fromImageInPlace(QImage &image, Qt::ImageConversionFlags flags) override; |
36 | void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags) override; |
37 | |
38 | void copy(const QPlatformPixmap *data, const QRect &rect) override; |
39 | bool scroll(int dx, int dy, const QRect &rect) override; |
40 | void fill(const QColor &color) override; |
41 | bool hasAlphaChannel() const override; |
42 | QImage toImage() const override; |
43 | QImage toImage(const QRect &rect) const override; |
44 | QPaintEngine* paintEngine() const override; |
45 | QImage* buffer() override; |
46 | qreal devicePixelRatio() const override; |
47 | void setDevicePixelRatio(qreal scaleFactor) override; |
48 | |
49 | |
50 | protected: |
51 | int metric(QPaintDevice::PaintDeviceMetric metric) const override; |
52 | void createPixmapForImage(QImage sourceImage, Qt::ImageConversionFlags flags); |
53 | void setImage(const QImage &image); |
54 | QImage image; |
55 | static QImage::Format systemNativeFormat(); |
56 | |
57 | private: |
58 | friend class QPixmap; |
59 | friend class QBitmap; |
60 | friend class QPixmapCacheEntry; |
61 | friend class QRasterPaintEngine; |
62 | }; |
63 | |
64 | QT_END_NAMESPACE |
65 | |
66 | #endif // QPIXMAP_RASTER_P_H |
67 | |
68 | |
69 | |