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
qpixmap_win.cpp
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#include "qbitmap.h"
5#include "qpixmap.h"
6#include <private/qpixmap_win_p.h>
7#include <qpa/qplatformpixmap.h>
8#include "qpixmap_raster_p.h"
9
10#include <qdebug.h>
11#include <QScopedArrayPointer>
12#include <qt_windows.h>
13
14#include <algorithm>
15#include <iterator>
16
18
19template <typename Int>
20static inline Int pad4(Int v)
21{
22 return (v + Int(3)) & ~Int(3);
23}
24
25#ifndef QT_NO_DEBUG_STREAM
26QDebug operator<<(QDebug d, const BITMAPINFOHEADER &bih)
27{
28 QDebugStateSaver saver(d);
29 d.nospace();
30 d << "BITMAPINFOHEADER(" << bih.biWidth << 'x' << qAbs(bih.biHeight)
31 << (bih.biHeight < 0 ? ", top-down" : ", bottom-up")
32 << ", planes=" << bih.biPlanes << ", bitCount=" << bih.biBitCount
33 << ", compression=" << bih.biCompression << ", size="
34 << bih.biSizeImage << ')';
35 return d;
36}
37#endif // !QT_NO_DEBUG_STREAM
38
39static inline void initBitMapInfoHeader(int width, int height, bool topToBottom,
40 DWORD compression, DWORD bitCount,
41 BITMAPINFOHEADER *bih)
42{
43 memset(bih, 0, sizeof(BITMAPINFOHEADER));
44 bih->biSize = sizeof(BITMAPINFOHEADER);
45 bih->biWidth = width;
46 bih->biHeight = topToBottom ? -height : height;
47 bih->biPlanes = 1;
48 bih->biBitCount = WORD(bitCount);
49 bih->biCompression = compression;
50 // scan lines are word-aligned (unless RLE)
51 const DWORD bytesPerLine = pad4(DWORD(width) * bitCount / 8);
52 bih->biSizeImage = bytesPerLine * DWORD(height);
53}
54
56
57struct BITMAPINFO_COLORTABLE256 { // BITMAPINFO with 256 entry color table for Indexed 8 format
58 BITMAPINFOHEADER bmiHeader;
60};
61
62template <class BITMAPINFO_T> // BITMAPINFO, BITMAPINFO_COLORTABLE256
63static inline void initBitMapInfo(int width, int height, bool topToBottom,
64 DWORD compression, DWORD bitCount,
65 BITMAPINFO_T *bmi)
66{
67 initBitMapInfoHeader(width, height, topToBottom, compression, bitCount, &bmi->bmiHeader);
68 memset(bmi->bmiColors, 0, sizeof(bmi->bmiColors));
69}
70
71static inline uchar *getDiBits(HDC hdc, HBITMAP bitmap, int width, int height, bool topToBottom = true)
72{
73 BITMAPINFO bmi;
74 initBitMapInfo(width, height, topToBottom, BI_RGB, 32u, &bmi);
75 uchar *result = new uchar[bmi.bmiHeader.biSizeImage];
76 if (!GetDIBits(hdc, bitmap, 0, UINT(height), result, &bmi, DIB_RGB_COLORS)) {
77 delete [] result;
78 qErrnoWarning("%s: GetDIBits() failed to get bitmap bits.", __FUNCTION__);
79 return nullptr;
80 }
81 return result;
82}
83
84static inline void copyImageDataCreateAlpha(const uchar *data, QImage *target)
85{
86 const uint mask = target->format() == QImage::Format_RGB32 ? 0xff000000 : 0;
87 const int height = target->height();
88 const int width = target->width();
89 const qsizetype bytesPerLine = width * sizeof(QRgb);
90 for (int y = 0; y < height; ++y) {
91 QRgb *dest = reinterpret_cast<QRgb *>(target->scanLine(y));
92 const QRgb *src = reinterpret_cast<const QRgb *>(data + y * bytesPerLine);
93 for (int x = 0; x < width; ++x) {
94 const uint pixel = src[x];
95 if ((pixel & 0xff000000) == 0 && (pixel & 0x00ffffff) != 0)
96 dest[x] = pixel | 0xff000000;
97 else
98 dest[x] = pixel | mask;
99 }
100 }
101}
102
103// Flip RGB triplets from DIB to QImage formats. Scan lines are padded to 32bit
104// both in QImage and DIB.
105static inline void flipRgb3(uchar *p, int width, int height)
106{
107 const int lineSize = 3 * width;
108 const int linePad = pad4(lineSize) - lineSize;
109 for (int y = 0; y < height; ++y) {
110 uchar *end = p + lineSize;
111 for ( ; p < end; p += 3)
112 std::swap(*p, *(p + 2));
113 p += linePad;
114 }
115}
116
117static inline RGBQUAD qRgbToRgbQuad(QRgb qrgb)
118{
119 RGBQUAD result = {BYTE(qBlue(qrgb)), BYTE(qGreen(qrgb)), BYTE(qRed(qrgb)), 0};
120 return result;
121}
122
123static inline QRgb rgbQuadToQRgb(RGBQUAD quad)
124{
125 return QRgb(quad.rgbBlue) + (QRgb(quad.rgbGreen) << 8) + (QRgb(quad.rgbRed) << 16)
126 + 0xff000000;
127}
128
129// Helper for imageFromWinHBITMAP_*(), create image in desired format
130static QImage copyImageData(const BITMAPINFOHEADER &header, const RGBQUAD *colorTableIn,
131 const void *data, QImage::Format format)
132{
133 const QSize size = QSize(header.biWidth, qAbs(header.biHeight));
135
136 int colorTableSize = 0;
137 switch (format) {
139 colorTableSize = 2;
140 break;
142 colorTableSize = Indexed8ColorTableSize;
143 break;
144 default:
145 break;
146 }
147 if (colorTableSize) {
148 Q_ASSERT(colorTableIn);
149 QList<QRgb> colorTable;
150 colorTable.reserve(colorTableSize);
151 std::transform(colorTableIn, colorTableIn + colorTableSize,
152 std::back_inserter(colorTable), rgbQuadToQRgb);
153 image.setColorTable(colorTable);
154 }
155
156 switch (header.biBitCount) {
157 case 32:
158 copyImageDataCreateAlpha(static_cast<const uchar *>(data), &image);
159 break;
160 case 1:
161 case 8:
162 case 16:
163 case 24:
164 Q_ASSERT(DWORD(image.sizeInBytes()) == header.biSizeImage);
165 memcpy(image.bits(), data, header.biSizeImage);
167 image = std::move(image).rgbSwapped();
168 break;
169 default:
170 Q_UNREACHABLE();
171 break;
172 }
173 return image;
174}
175
177{
178 Q_DISABLE_COPY_MOVE(DisplayHdc)
179public:
180 DisplayHdc() : m_displayDc(GetDC(nullptr)) {}
181 ~DisplayHdc() { ReleaseDC(nullptr, m_displayDc); }
182
183 operator HDC() const { return m_displayDc; }
184
185private:
186 const HDC m_displayDc;
187};
188
195
196static HBITMAP qt_createIconMask(QImage bm)
197{
199 const int w = bm.width();
200 const int h = bm.height();
201 const int bpl = ((w+15)/16)*2; // bpl, 16 bit alignment
202 QScopedArrayPointer<uchar> bits(new uchar[size_t(bpl * h)]);
203 bm.invertPixels();
204 for (int y = 0; y < h; ++y)
205 memcpy(bits.data() + y * bpl, bm.constScanLine(y), size_t(bpl));
206 HBITMAP hbm = CreateBitmap(w, h, 1, 1, bits.data());
207 return hbm;
208}
209
211{
212 return qt_createIconMask(bitmap.toImage().convertToFormat(QImage::Format_Mono));
213}
214
215static inline QImage::Format format32(int hbitmapFormat)
216{
217 switch (hbitmapFormat) {
218 case HBitmapNoAlpha:
220 case HBitmapAlpha:
222 default:
223 break;
224 }
226}
227
228HBITMAP qt_imageToWinHBITMAP(const QImage &imageIn, int hbitmapFormat)
229{
230 if (imageIn.isNull())
231 return nullptr;
232
233 // Define the header
234 DWORD compression = 0;
235 DWORD bitCount = 0;
236
237 // Copy over the data
238 QImage image = imageIn;
239 switch (image.format()) {
241 bitCount = 1u;
242 break;
246 compression = BI_RGB;
247 bitCount = 32u;
248 const QImage::Format targetFormat = format32(hbitmapFormat);
249 if (targetFormat != image.format())
250 image = image.convertToFormat(targetFormat);
251 }
252 break;
255 compression = BI_RGB;
256 bitCount = 24u;
257 break;
259 bitCount = 8u;
260 break;
262 bitCount = 16u;
263 break;
264 default: {
266 switch (image.format()) { // Convert to a suitable format.
268 fallbackFormat = QImage::Format_Mono;
269 break;
271 fallbackFormat = QImage::Format_RGB555;
272 break;
274 fallbackFormat = QImage::Format_Indexed8;
275 break;
276 default:
277 break;
278 } // switch conversion format
279 return qt_imageToWinHBITMAP(imageIn.convertToFormat(fallbackFormat), hbitmapFormat);
280 }
281 }
282
283 const int w = image.width();
284 const int h = image.height();
285
286 BITMAPINFO_COLORTABLE256 bmiColorTable256;
287 initBitMapInfo(w, h, true, compression, bitCount, &bmiColorTable256);
288 BITMAPINFO &bmi = reinterpret_cast<BITMAPINFO &>(bmiColorTable256);
289 switch (image.format()) {
290 case QImage::Format_Mono: // Color table with 2 entries
292 std::transform(image.colorTable().constBegin(), image.colorTable().constEnd(),
293 bmiColorTable256.bmiColors, qRgbToRgbQuad);
294 break;
295 default:
296 break;
297 }
298
299 // Create the pixmap
300 uchar *pixels = nullptr;
301 const HBITMAP bitmap = CreateDIBSection(nullptr, &bmi, DIB_RGB_COLORS,
302 reinterpret_cast<void **>(&pixels), nullptr, 0);
303 if (!bitmap) {
304 qErrnoWarning("%s, failed to create dibsection", __FUNCTION__);
305 return nullptr;
306 }
307 if (!pixels) {
308 DeleteObject(bitmap);
309 qErrnoWarning("%s, did not allocate pixel data", __FUNCTION__);
310 return nullptr;
311 }
312 memcpy(pixels, image.constBits(), bmi.bmiHeader.biSizeImage);
313 if (image.format() == QImage::Format_RGB888)
314 flipRgb3(pixels, w, h);
315 return bitmap;
316}
317
342HBITMAP QImage::toHBITMAP() const
343{
344 switch (format()) {
346 return qt_imageToWinHBITMAP(*this, HBitmapAlpha);
349 default:
350 break;
351 }
352 return qt_imageToWinHBITMAP(*this);
353}
354
355HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat)
356{
357 if (p.isNull())
358 return nullptr;
359
360 QPlatformPixmap *platformPixmap = p.handle();
364 data->fromImage(p.toImage(), Qt::AutoColor);
365 return qt_pixmapToWinHBITMAP(QPixmap(data), hbitmapFormat);
366 }
367
368 return qt_imageToWinHBITMAP(*static_cast<QRasterPlatformPixmap*>(platformPixmap)->buffer(), hbitmapFormat);
369}
370
371static QImage::Format imageFromWinHBITMAP_Format(const BITMAPINFOHEADER &header, int hbitmapFormat)
372{
374 switch (header.biBitCount) {
375 case 32:
376 result = hbitmapFormat == HBitmapNoAlpha
378 break;
379 case 24:
381 break;
382 case 16:
384 break;
385 case 8:
387 break;
388 case 1:
390 break;
391 }
392 return result;
393}
394
395// Fast path for creating a QImage directly from a HBITMAP created by CreateDIBSection(),
396// not requiring memory allocation.
397static QImage imageFromWinHBITMAP_DibSection(HBITMAP bitmap, int hbitmapFormat)
398{
399 DIBSECTION dibSection;
400 memset(&dibSection, 0, sizeof(dibSection));
401 dibSection.dsBmih.biSize = sizeof(dibSection.dsBmih);
402
403 if (!GetObject(bitmap, sizeof(dibSection), &dibSection)
404 || !dibSection.dsBm.bmBits
405 || dibSection.dsBmih.biBitCount <= 8 // Cannot access the color table for Indexed8, Mono
406 || dibSection.dsBmih.biCompression != BI_RGB) {
407 return QImage();
408 }
409
410 const QImage::Format imageFormat = imageFromWinHBITMAP_Format(dibSection.dsBmih, hbitmapFormat);
411 if (imageFormat == QImage::Format_Invalid)
412 return QImage();
413
414 return copyImageData(dibSection.dsBmih, nullptr, dibSection.dsBm.bmBits, imageFormat);
415}
416
417// Create QImage from a HBITMAP using GetDIBits(), potentially with conversion.
418static QImage imageFromWinHBITMAP_GetDiBits(HBITMAP bitmap, bool forceQuads, int hbitmapFormat)
419{
420 BITMAPINFO_COLORTABLE256 bmiColorTable256;
421 BITMAPINFO &info = reinterpret_cast<BITMAPINFO &>(bmiColorTable256);
422 memset(&info, 0, sizeof(info));
423 info.bmiHeader.biSize = sizeof(info.bmiHeader);
424
425 DisplayHdc displayDc;
426 if (!GetDIBits(displayDc, bitmap, 0, 1, 0, &info, DIB_RGB_COLORS)) {
427 qErrnoWarning("%s: GetDIBits() failed to query data.", __FUNCTION__);
428 return QImage();
429 }
430
431 if (info.bmiHeader.biHeight > 0) // Force top-down
432 info.bmiHeader.biHeight = -info.bmiHeader.biHeight;
433 info.bmiHeader.biCompression = BI_RGB; // Extract using no compression (can be BI_BITFIELD)
434 size_t allocSize = info.bmiHeader.biSizeImage;
435 if (forceQuads) {
436 info.bmiHeader.biBitCount = 32;
437 allocSize = info.bmiHeader.biWidth * qAbs(info.bmiHeader.biHeight) * 4;
438 }
439
440 const QImage::Format imageFormat = imageFromWinHBITMAP_Format(info.bmiHeader, hbitmapFormat);
441 if (imageFormat == QImage::Format_Invalid) {
442 qWarning().nospace() << __FUNCTION__ << ": unsupported image format:" << info.bmiHeader;
443 return QImage();
444 }
445
446 QScopedArrayPointer<uchar> data(new uchar[allocSize]);
447 if (!GetDIBits(displayDc, bitmap, 0, qAbs(info.bmiHeader.biHeight), data.data(), &info, DIB_RGB_COLORS)) {
448 qErrnoWarning("%s: GetDIBits() failed to get data.", __FUNCTION__);
449 return QImage();
450 }
451 return copyImageData(info.bmiHeader, bmiColorTable256.bmiColors, data.data(), imageFormat);
452}
453
454QImage qt_imageFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat)
455{
457 if (result.isNull())
458 result = imageFromWinHBITMAP_GetDiBits(bitmap, /* forceQuads */ false, hbitmapFormat);
459 return result;
460}
461
481QImage QImage::fromHBITMAP(HBITMAP hbitmap)
482{
483 return qt_imageFromWinHBITMAP(hbitmap);
484}
485
486QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat)
487{
488 return QPixmap::fromImage(imageFromWinHBITMAP_GetDiBits(bitmap, /* forceQuads */ true, hbitmapFormat));
489}
490
506HICON QImage::toHICON(const QImage &mask) const
507{
508 if (!mask.isNull() && mask.format() != QImage::Format_Mono) {
509 qWarning("QImage::toHICON(): Mask must be empty or have format Format_Mono");
510 return nullptr;
511 }
512
513 if (isNull())
514 return nullptr;
515
516 auto effectiveMask = mask;
517 if (effectiveMask.isNull()) {
518 effectiveMask = QImage(size(), QImage::Format_Mono);
519 effectiveMask.fill(Qt::color1);
520 }
521
522 ICONINFO ii;
523 ii.fIcon = true;
524 ii.hbmMask = qt_createIconMask(effectiveMask);
525 ii.hbmColor = qt_imageToWinHBITMAP(*this, HBitmapAlpha);
526 ii.xHotspot = 0;
527 ii.yHotspot = 0;
528
529 HICON hIcon = CreateIconIndirect(&ii);
530
531 DeleteObject(ii.hbmColor);
532 DeleteObject(ii.hbmMask);
533
534 return hIcon;
535}
536
538{
539 QImage mask;
540 QBitmap maskBitmap = p.mask();
541 if (!maskBitmap.isNull())
543 return p.toImage().toHICON(mask);
544}
545
546QImage qt_imageFromWinHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h)
547{
549 if (image.isNull())
550 return image;
551 QScopedArrayPointer<uchar> data(getDiBits(hdc, bitmap, w, h, true));
552 if (data.isNull())
553 return QImage();
555 return image;
556}
557
558static QImage qt_imageFromWinIconHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h)
559{
561 if (image.isNull())
562 return image;
563 QScopedArrayPointer<uchar> data(getDiBits(hdc, bitmap, w, h, true));
564 if (data.isNull())
565 return QImage();
566 memcpy(image.bits(), data.data(), size_t(image.sizeInBytes()));
567 return image;
568}
569
570static inline bool hasAlpha(const QImage &image)
571{
572 const int w = image.width();
573 const int h = image.height();
574 for (int y = 0; y < h; ++y) {
575 const QRgb *scanLine = reinterpret_cast<const QRgb *>(image.scanLine(y));
576 for (int x = 0; x < w; ++x) {
577 if (qAlpha(scanLine[x]) != 0)
578 return true;
579 }
580 }
581 return false;
582}
583
593QImage QImage::fromHICON(HICON icon)
594{
595 HDC screenDevice = GetDC(nullptr);
596 HDC hdc = CreateCompatibleDC(screenDevice);
597 ReleaseDC(nullptr, screenDevice);
598
599 ICONINFO iconinfo;
600 const bool result = GetIconInfo(icon, &iconinfo); //x and y Hotspot describes the icon center
601 if (!result) {
602 qErrnoWarning("QPixmap::fromWinHICON(), failed to GetIconInfo()");
603 DeleteDC(hdc);
604 return {};
605 }
606
607 const int w = int(iconinfo.xHotspot) * 2;
608 const int h = int(iconinfo.yHotspot) * 2;
609
610 BITMAPINFOHEADER bitmapInfo;
611 initBitMapInfoHeader(w, h, false, BI_RGB, 32u, &bitmapInfo);
612 DWORD* bits;
613
614 HBITMAP winBitmap = CreateDIBSection(hdc, reinterpret_cast<BITMAPINFO *>(&bitmapInfo),
615 DIB_RGB_COLORS, reinterpret_cast<VOID **>(&bits),
616 nullptr, 0);
617 HGDIOBJ oldhdc = static_cast<HBITMAP>(SelectObject(hdc, winBitmap));
618 DrawIconEx(hdc, 0, 0, icon, w, h, 0, nullptr, DI_NORMAL);
619 QImage image = qt_imageFromWinIconHBITMAP(hdc, winBitmap, w, h);
620
621 if (!image.isNull() && !hasAlpha(image)) { //If no alpha was found, we use the mask to set alpha values
622 DrawIconEx( hdc, 0, 0, icon, w, h, 0, nullptr, DI_MASK);
623 const QImage mask = qt_imageFromWinIconHBITMAP(hdc, winBitmap, w, h);
624
625 for (int y = 0 ; y < h ; y++){
626 QRgb *scanlineImage = reinterpret_cast<QRgb *>(image.scanLine(y));
627 const QRgb *scanlineMask = mask.isNull() ? nullptr : reinterpret_cast<const QRgb *>(mask.scanLine(y));
628 for (int x = 0; x < w ; x++){
629 if (scanlineMask && qRed(scanlineMask[x]) != 0)
630 scanlineImage[x] = 0; //mask out this pixel
631 else
632 scanlineImage[x] |= 0xff000000; // set the alpha channel to 255
633 }
634 }
635 }
636 //dispose resources created by iconinfo call
637 DeleteObject(iconinfo.hbmMask);
638 DeleteObject(iconinfo.hbmColor);
639
640 SelectObject(hdc, oldhdc); //restore state
641 DeleteObject(winBitmap);
642 DeleteDC(hdc);
643 return image;
644}
645
647{
648 return QPixmap::fromImage(QImage::fromHICON(icon));
649}
650
\inmodule QtGui
Definition qbitmap.h:16
\inmodule QtCore
\inmodule QtCore
\inmodule QtGui
Definition qimage.h:37
QSize size() const
Returns the size of the image, i.e.
int width() const
Returns the width of the image.
uchar * bits()
Returns a pointer to the first pixel data.
Definition qimage.cpp:1698
bool isNull() const
Returns true if it is a null image, otherwise returns false.
Definition qimage.cpp:1222
int height() const
Returns the height of the image.
Format
The following image formats are available in Qt.
Definition qimage.h:41
@ Format_RGB888
Definition qimage.h:55
@ Format_RGB32
Definition qimage.h:46
@ Format_Invalid
Definition qimage.h:42
@ Format_MonoLSB
Definition qimage.h:44
@ Format_RGB555
Definition qimage.h:53
@ Format_Mono
Definition qimage.h:43
@ Format_Indexed8
Definition qimage.h:45
@ Format_ARGB32_Premultiplied
Definition qimage.h:48
@ Format_RGB16
Definition qimage.h:49
@ Format_BGR888
Definition qimage.h:71
@ Format_ARGB32
Definition qimage.h:47
@ Format_Grayscale8
Definition qimage.h:66
QImage() noexcept
Constructs a null image.
Definition qimage.cpp:791
Format format() const
Returns the format of the image.
Definition qimage.cpp:2162
const uchar * constScanLine(int) const
Returns a pointer to the pixel data at the scanline with index i.
Definition qimage.cpp:1678
void invertPixels(InvertMode=InvertRgb)
Inverts all pixel values in the image.
Definition qimage.cpp:1987
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const &
Definition qimage.h:125
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
QImage toImage() const
Converts the pixmap to a QImage.
Definition qpixmap.cpp:408
QBitmap mask() const
Returns true if this pixmap has an alpha channel, or has a mask, otherwise returns false.
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
Definition qpixmap.cpp:1437
The QPlatformPixmap class provides an abstraction for native pixmaps.
void fromImage(const QImage &image, Qt::ImageConversionFlags flags) override
\inmodule QtCore
Definition qsize.h:25
void qErrnoWarning(const char *msg,...)
Combined button and popup list for selecting options.
@ AutoColor
Definition qnamespace.h:478
@ color1
Definition qnamespace.h:29
Definition image.cpp:4
static QString header(const QString &name)
#define qWarning
Definition qlogging.h:166
constexpr T qAbs(const T &t)
Definition qnumeric.h:328
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLuint end
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum src
GLenum GLuint buffer
GLint GLsizei width
GLenum target
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum const void * pixels
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLint GLsizei GLsizei GLenum format
GLint y
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
GLuint64EXT * result
[6]
GLfloat GLfloat p
[1]
HBITMAP qt_imageToWinHBITMAP(const QImage &imageIn, int hbitmapFormat)
static void flipRgb3(uchar *p, int width, int height)
static bool hasAlpha(const QImage &image)
@ Indexed8ColorTableSize
static QImage imageFromWinHBITMAP_GetDiBits(HBITMAP bitmap, bool forceQuads, int hbitmapFormat)
static QImage qt_imageFromWinIconHBITMAP(HDC hdc, HBITMAP bitmap, int w, int h)
static void initBitMapInfoHeader(int width, int height, bool topToBottom, DWORD compression, DWORD bitCount, BITMAPINFOHEADER *bih)
static QT_BEGIN_NAMESPACE Int pad4(Int v)
QPixmap qt_pixmapFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat)
static HBITMAP qt_createIconMask(QImage bm)
static RGBQUAD qRgbToRgbQuad(QRgb qrgb)
static QImage::Format format32(int hbitmapFormat)
HBitmapFormat
@ HBitmapAlpha
@ HBitmapPremultipliedAlpha
@ HBitmapNoAlpha
static QImage copyImageData(const BITMAPINFOHEADER &header, const RGBQUAD *colorTableIn, const void *data, QImage::Format format)
QPixmap qt_pixmapFromWinHICON(HICON icon)
static QImage::Format imageFromWinHBITMAP_Format(const BITMAPINFOHEADER &header, int hbitmapFormat)
QImage qt_imageFromWinHBITMAP(HBITMAP bitmap, int hbitmapFormat)
static QImage imageFromWinHBITMAP_DibSection(HBITMAP bitmap, int hbitmapFormat)
HICON qt_pixmapToWinHICON(const QPixmap &p)
HBITMAP qt_pixmapToWinHBITMAP(const QPixmap &p, int hbitmapFormat)
QDebug operator<<(QDebug d, const BITMAPINFOHEADER &bih)
static uchar * getDiBits(HDC hdc, HBITMAP bitmap, int width, int height, bool topToBottom=true)
static void copyImageDataCreateAlpha(const uchar *data, QImage *target)
static QRgb rgbQuadToQRgb(RGBQUAD quad)
static void initBitMapInfo(int width, int height, bool topToBottom, DWORD compression, DWORD bitCount, BITMAPINFO_T *bmi)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
Definition qrgb.h:13
constexpr int qRed(QRgb rgb)
Definition qrgb.h:18
constexpr int qGreen(QRgb rgb)
Definition qrgb.h:21
constexpr int qBlue(QRgb rgb)
Definition qrgb.h:24
constexpr int qAlpha(QRgb rgb)
Definition qrgb.h:27
static const struct TessellationModeTab quad[]
unsigned char uchar
Definition qtypes.h:32
ptrdiff_t qsizetype
Definition qtypes.h:165
unsigned int uint
Definition qtypes.h:34
static QWindowsDirect2DPlatformPixmap * platformPixmap(QPixmap *p)
QObject::connect nullptr
QHostInfo info
[0]
RGBQUAD bmiColors[Indexed8ColorTableSize]
BITMAPINFOHEADER bmiHeader