1 /*
2  * DQt - D bindings for the Qt Toolkit
3  *
4  * GNU Lesser General Public License Usage
5  * This file may be used under the terms of the GNU Lesser
6  * General Public License version 3 as published by the Free Software
7  * Foundation and appearing in the file LICENSE.LGPL3 included in the
8  * packaging of this file. Please review the following information to
9  * ensure the GNU Lesser General Public License version 3 requirements
10  * will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
11  */
12 module qt.gui.bitmap;
13 extern(C++):
14 
15 import qt.config;
16 import qt.core.global;
17 import qt.core.namespace;
18 import qt.core.shareddata;
19 import qt.core.size;
20 import qt.core.string;
21 import qt.core.typeinfo;
22 import qt.core.variant;
23 import qt.gui.color;
24 import qt.gui.image;
25 import qt.gui.pixmap;
26 import qt.gui.transform;
27 import qt.helpers;
28 
29 
30 /// Binding for C++ class [QBitmap](https://doc.qt.io/qt-6/qbitmap.html).
31 @Q_RELOCATABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QBitmap
32 {
33     public QPixmap base0;
34     alias base0 this;
35 public:
36     @disable this();
37     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
38     ref typeof(this) rawConstructor();
39     static typeof(this) create()
40     {
41         typeof(this) r = typeof(this).init;
42         r.rawConstructor();
43         return r;
44     }
45 
46 /+ #if QT_DEPRECATED_SINCE(6, 0) +/
47     /+ QT_DEPRECATED_VERSION_X_6_0("Use fromPixmap instead.") +/ /+ explicit +/this(ref const(QPixmap) );
48 /+ #endif +/
49     this(int w, int h);
50     /+ explicit +/this(ref const(QSize) );
51     /+ explicit +/this(ref const(QString) fileName, const(char)* format = null);
52 
53 /+ #if QT_DEPRECATED_SINCE(6, 0) +/
54     /+/+ QT_DEPRECATED_VERSION_X_6_0("Use fromPixmap instead.") +/ ref QBitmap operator =(ref const(QPixmap) );+/
55 /+ #endif +/
56     /+ inline void swap(QBitmap &other) { QPixmap::swap(other); } +/ // prevent QBitmap<->QPixmap swaps
57     /+auto opCast(T : QVariant)() const;+/
58 
59     pragma(inline, true) void clear() { auto tmp = QColor(qt.core.namespace.GlobalColor.color0); fill(tmp); }
60 
61     static QBitmap fromImage(ref const(QImage) image, /+ Qt:: +/qt.core.namespace.ImageConversionFlags flags = /+ Qt:: +/qt.core.namespace.ImageConversionFlag.AutoColor);
62     /+ static QBitmap fromImage(QImage &&image, Qt::ImageConversionFlags flags = Qt::AutoColor); +/
63     static QBitmap fromData(ref const(QSize) size, const(uchar)* bits,
64                                 QImage.Format monoFormat = QImage.Format.Format_MonoLSB);
65     static QBitmap fromPixmap(ref const(QPixmap) pixmap);
66 
67     QBitmap transformed(ref const(QTransform) matrix) const;
68 
69     alias DataPtr = QExplicitlySharedDataPointer!(QPlatformPixmap);
70     mixin(CREATE_CONVENIENCE_WRAPPERS);
71 }
72 /+ Q_DECLARE_SHARED(QBitmap) +/
73