18#include <qpa/qplatformintegration.h>
19#include <private/qguiapplication_p.h>
23#include <qpa/qplatformpixmap.h>
24#include <private/qcolortransform_p.h>
25#include <private/qmemrotate_p.h>
26#include <private/qimagescale_p.h>
27#include <private/qpixellayout_p.h>
28#include <private/qsimd_p.h>
32#include <private/qpaintengine_raster_p.h>
34#include <private/qimage_p.h>
35#include <private/qfont_p.h>
40#include <private/qthreadpool_p.h>
43#include <qtgui_tracepoints_p.h>
56#if defined(Q_CC_DEC) && defined(__alpha) && (__DECCXX_VER-0 >= 50190001)
57#pragma message disable narrowptr
61#define QIMAGE_SANITYCHECK_MEMORY(image) \
62 if ((image).isNull()) { \
63 qWarning("QImage: out of memory, returning null image"); \
68 "#include <qimagereader.h>"
72"ENUM { } QImage::Format;" \
73"FLAGS { } Qt::ImageConversionFlags;"
86 return 1 + serial.fetchAndAddRelaxed(1);
123 auto d = std::make_unique<QImageData>();
128 d->colortable.resize(2);
140 d->has_alpha_clut =
false;
141 d->is_cached =
false;
143 d->bytes_per_line =
params.bytesPerLine;
145 d->data = (
uchar *)malloc(
d->nbytes);
166#if defined(_M_ARM) && defined(_MSC_VER)
167#pragma optimize("", off)
172 bool has_alpha_pixels =
false;
182 has_alpha_pixels =
true;
187 for (
int y=0;
y<
height && !has_alpha_pixels; ++
y) {
188 uint alphaAnd = 0xff000000;
190 alphaAnd &=
reinterpret_cast<const uint*
>(
bits)[
x];
191 has_alpha_pixels = (alphaAnd != 0xff000000);
199 for (
int y=0;
y<
height && !has_alpha_pixels; ++
y) {
200 uchar alphaAnd = 0xff;
202 alphaAnd &=
bits[
x * 4+ 3];
203 has_alpha_pixels = (alphaAnd != 0xff);
211 for (
int y=0;
y<
height && !has_alpha_pixels; ++
y) {
212 uint alphaAnd = 0xc0000000;
214 alphaAnd &=
reinterpret_cast<const uint*
>(
bits)[
x];
215 has_alpha_pixels = (alphaAnd != 0xc0000000);
225 for (
int y=0;
y<
height && !has_alpha_pixels; ++
y) {
226 uchar alphaAnd = 0xff;
227 while (
bits < end_bits) {
231 has_alpha_pixels = (alphaAnd != 0xff);
241 for (
int y=0;
y<
height && !has_alpha_pixels; ++
y) {
242 uchar alphaAnd = 0xfc;
243 while (
bits < end_bits) {
247 has_alpha_pixels = (alphaAnd != 0xfc);
255 for (
int y=0;
y<
height && !has_alpha_pixels; ++
y) {
258 alphaAnd &=
reinterpret_cast<const ushort*
>(
bits)[
x];
259 has_alpha_pixels = (alphaAnd != 0xf000);
266 for (
int y=0;
y<
height && !has_alpha_pixels; ++
y) {
276 for (
int y = 0;
y <
height && !has_alpha_pixels; ++
y) {
285 for (
int y = 0;
y <
height && !has_alpha_pixels; ++
y) {
287 has_alpha_pixels |= ((
float *)
bits)[
x * 4 + 3] < 1.0f;
314 return has_alpha_pixels;
316#if defined(_M_ARM) && defined(_MSC_VER)
317#pragma optimize("", on)
817 if (bpl < min_bytes_per_line)
821 params.bytesPerLine = bpl;
822 if (qMulOverflow<qsizetype>(bpl,
height, &
params.totalSize))
830 d->ro_data = readOnly;
837 d->bytes_per_line =
params.bytesPerLine;
982#ifndef QT_NO_IMAGEFORMAT_XPM
1009 qWarning(
"QImage::QImage(), XPM is not supported");
1025 if (
image.paintingActive()) {
1027 image.copy().swap(*
this);
1057 if (
image.paintingActive()) {
1136 if (d && invalidateCache)
1145 dst->devicePixelRatio =
src->devicePixelRatio;
1153 dst->colorSpace =
src->colorSpace;
1158 dst->setDotsPerMeterX(
src.dotsPerMeterX());
1159 dst->setDotsPerMeterY(
src.dotsPerMeterY());
1160 dst->setDevicePixelRatio(
src.devicePixelRatio());
1161 const auto textKeys =
src.textKeys();
1162 for (
const auto &
key: textKeys)
1230 if (
w <= 0 ||
h <= 0)
1252 int pixels_to_copy =
qMax(
w - dx, 0);
1255 else if (pixels_to_copy > d->
width -
x)
1256 pixels_to_copy = d->
width -
x;
1257 int lines_to_copy =
qMax(
h - dy, 0);
1260 else if (lines_to_copy > d->
height -
y)
1261 lines_to_copy = d->
height -
y;
1263 bool byteAligned =
true;
1265 byteAligned = !(dx & 7) && !(
x & 7) && !(pixels_to_copy & 7);
1271 for (
int i = 0;
i < lines_to_copy; ++
i) {
1272 memcpy(dest,
src, bytes_to_copy);
1274 dest +=
image.d->bytes_per_line;
1279 for (
int i = 0;
i < lines_to_copy; ++
i) {
1280 for (
int j = 0;
j < pixels_to_copy; ++
j) {
1281 if (
src[(
x +
j) >> 3] & (0x80 >> ((
x +
j) & 7)))
1282 dest[(dx +
j) >> 3] |= (0x80 >> ((dx +
j) & 7));
1284 dest[(dx +
j) >> 3] &= ~(0x80 >> ((dx +
j) & 7));
1287 dest +=
image.d->bytes_per_line;
1293 for (
int i = 0;
i < lines_to_copy; ++
i) {
1294 for (
int j = 0;
j < pixels_to_copy; ++
j) {
1295 if (
src[(
x +
j) >> 3] & (0x1 << ((
x +
j) & 7)))
1296 dest[(dx +
j) >> 3] |= (0x1 << ((dx +
j) & 7));
1298 dest[(dx +
j) >> 3] &= ~(0x1 << ((dx +
j) & 7));
1301 dest +=
image.d->bytes_per_line;
1333 return d ? d->
width : 0;
1345 return d ? d->
height : 0;
1387 return d ? d->
depth : 0;
1528 return d ? d->
nbytes : 0;
1578 qWarning(
"QImage::setColor: Index out of bound %d",
i);
1699 return d ? d->
data :
nullptr;
1715 return d ? d->
data :
nullptr;
1751 if (d->
depth == 1) {
1760 qt_rectfill<quint8>(d->
data,
pixel, 0, 0,
1763 }
else if (d->
depth == 16) {
1769 }
else if (d->
depth == 24) {
1782 ::memcpy(&cu, &cf,
sizeof(
quint64));
1783 qt_rectfill<quint64>(
reinterpret_cast<quint64*
>(d->
data), cu,
1800 pixel |= 0xff000000;
1802#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
1803 pixel |= 0xff000000;
1805 pixel |= 0x000000ff;
1808 pixel |= 0xc0000000;
1905 qt_rectfill<quint64>(
reinterpret_cast<quint64*
>(d->
data), opaque,
1913 qt_rectfill<quint64>(
reinterpret_cast<quint64 *
>(d->
data),
color.rgba64().premultiplied(),
1926 if (
depth() == 64) {
1929 c16 = c16.premultiplied();
1935 c32 = c32.premultiplied();
1990 }
else if (
depth() > 32) {
2023 float *
p =
reinterpret_cast<float *
>(
data);
2024 for (
int x = 0;
x < d->
width; ++
x) {
2034 }
else if (
depth() == 64) {
2057#if Q_BYTE_ORDER == Q_BIG_ENDIAN
2058 xorbits = 0xffffff00;
2061 xorbits = 0x00ffffff;
2069 xorbits = 0x00ffffff;
2073 xorbits = 0x3fffffff;
2084 if (originalFormat != d->
format) {
2119 qWarning(
"QImage::setColorCount: null image");
2192#if QT_CONFIG(raster_fp)
2194 converter = convert_generic_over_rgba32f;
2242 return abs(
r1 -
r2) + abs(g1 - g2) + abs(b1 - b2) + abs(
a1 -
a2);
2247 int current_distance = INT_MAX;
2248 for (
int i=0;
i<clut.
size(); ++
i) {
2250 if (
dist < current_distance) {
2251 current_distance =
dist;
2265 int h =
src.height();
2266 int w =
src.width();
2271 for (
int y=0;
y<
h; ++
y) {
2272 const QRgb *src_pixels = (
const QRgb *)
src.scanLine(
y);
2274 for (
int x=0;
x<
w; ++
x) {
2275 int src_pixel = src_pixels[
x];
2287 for (
int y=0;
y<
h; ++
y) {
2288 const QRgb *src_pixels = (
const QRgb *)
src.scanLine(
y);
2289 for (
int x=0;
x<
w; ++
x) {
2290 int src_pixel = src_pixels[
x];
2439 if (!d || x < 0 || x >= d->
width || y < 0 || y >=
height()) {
2440 qWarning(
"QImage::pixelIndex: coordinate (%d,%d) out of range",
x,
y);
2446 return (*(
s + (
x >> 3)) >> (7- (
x & 7))) & 1;
2448 return (*(
s + (
x >> 3)) >> (
x & 7)) & 1;
2452 qWarning(
"QImage::pixelIndex: Not applicable for %d-bpp images (no palette)", d->
depth);
2480 if (!d || x < 0 || x >= d->
width || y < 0 || y >= d->
height) {
2481 qWarning(
"QImage::pixel: coordinate (%d,%d) out of range",
x,
y);
2490 index = (*(
s + (
x >> 3)) >> (
~x & 7)) & 1;
2493 index = (*(
s + (
x >> 3)) >> (
x & 7)) & 1;
2503 qWarning(
"QImage::pixel: color table index %d out of range.",
index);
2511 return 0xff000000 |
reinterpret_cast<const QRgb *
>(
s)[
x];
2514 return reinterpret_cast<const QRgb *
>(
s)[
x];
2544 return *
layout->fetchToARGB32PM(&
result,
s,
x, 1,
nullptr,
nullptr);
2575 if (!d || x < 0 || x >=
width() || y < 0 || y >=
height()) {
2576 qWarning(
"QImage::setPixel: coordinate (%d,%d) out of range",
x,
y);
2584 if (index_or_rgb > 1) {
2585 qWarning(
"QImage::setPixel: Index %d out of range", index_or_rgb);
2587 if (index_or_rgb==0)
2588 *(
s + (
x >> 3)) &= ~(1 << (
x & 7));
2590 *(
s + (
x >> 3)) |= (1 << (
x & 7));
2592 if (index_or_rgb==0)
2593 *(
s + (
x >> 3)) &= ~(1 << (7-(
x & 7)));
2595 *(
s + (
x >> 3)) |= (1 << (7-(
x & 7)));
2600 qWarning(
"QImage::setPixel: Index %d out of range", index_or_rgb);
2603 s[
x] = index_or_rgb;
2608 ((
uint *)
s)[
x] = 0xff000000 | index_or_rgb;
2612 ((
uint *)
s)[
x] = index_or_rgb;
2664 layout->storeFromRGB32(
s, &index_or_rgb,
x, 1,
nullptr,
nullptr);
2666 layout->storeFromARGB32PM(
s, &index_or_rgb,
x, 1,
nullptr,
nullptr);
2693 if (!d || x < 0 || x >= d->
width || y < 0 || y >=
height()) {
2694 qWarning(
"QImage::pixelColor: coordinate (%d,%d) out of range",
x,
y);
2725 color.setRgbF(
p.red(),
p.green(),
p.blue(),
p.alpha());
2735 color.setRgbF(
p.red(),
p.green(),
p.blue(),
p.alpha());
2744 c =
c.unpremultiplied();
2772 if (!d || x < 0 || x >=
width() || y < 0 || y >=
height()) {
2773 qWarning(
"QImage::setPixelColor: coordinate (%d,%d) out of range",
x,
y);
2777 if (!
color.isValid()) {
2778 qWarning(
"QImage::setPixelColor: color is invalid");
2787 c =
c.premultiplied();
2794 qWarning(
"QImage::setPixelColor: called on monochrome or indexed format");
2822 c16f = c16f.premultiplied();
2835 c32f = c32f.premultiplied();
2876#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
2883 for (
int i = 0;
i < d->
width; ++
i) {
2892 for (
int i = 0;
i < d->
width; ++
i) {
2904 const auto fetch =
layout->fetchToARGB32PM;
2908 while (x < d->
width) {
2911 for (
int i = 0;
i < l; ++
i) {
2998 qWarning(
"QImage::scaled: Image is a null image");
3005 newSize.
scale(
s, aspectMode);
3008 if (newSize ==
size())
3035 qWarning(
"QImage::scaleWidth: Image is a null image");
3065 qWarning(
"QImage::scaleHeight: Image is a null image");
3100 if (d->
depth == 1) {
3107 if (!
mask.isNull()) {
3114#ifndef QT_NO_IMAGE_HEURISTIC_MASK
3144 if (d->
depth != 32) {
3149#define PIX(x,y) (*((const QRgb*)scanLine(y)+x) & 0x00ffffff)
3161 if (background !=
PIX(
w-1,0) &&
3162 background !=
PIX(0,
h-1) &&
3163 background !=
PIX(
w-1,
h-1)) {
3164 background =
PIX(
w-1,0);
3165 if (background !=
PIX(
w-1,
h-1) &&
3166 background !=
PIX(0,
h-1) &&
3168 background =
PIX(
w-1,
h-1);
3174 uchar *ypp, *ypc, *ypn;
3177 ypn =
m.scanLine(0);
3179 for (
y = 0;
y <
h;
y++) {
3184 for (
x = 0;
x <
w;
x++) {
3187 if ((
x == 0 ||
y == 0 ||
x ==
w-1 ||
y ==
h-1 ||
3188 !(*(ypc + ((
x-1) >> 3)) & (1 << ((
x-1) & 7))) ||
3189 !(*(ypc + ((
x+1) >> 3)) & (1 << ((
x+1) & 7))) ||
3190 !(*(ypp + (
x >> 3)) & (1 << (
x & 7))) ||
3191 !(*(ypn + (
x >> 3)) & (1 << (
x & 7)))) &&
3192 ( (*(ypc + (
x >> 3)) & (1 << (
x & 7)))) &&
3193 ((*
p & 0x00ffffff) == background)) {
3195 *(ypc + (
x >> 3)) &= ~(1 << (
x & 7));
3203 ypn =
m.scanLine(0);
3205 for (
y = 0;
y <
h;
y++) {
3210 for (
x = 0;
x <
w;
x++) {
3211 if ((*
p & 0x00ffffff) != background) {
3213 *(ypc + ((
x-1) >> 3)) |= (1 << ((
x-1) & 7));
3215 *(ypc + ((
x+1) >> 3)) |= (1 << ((
x+1) & 7));
3217 *(ypp + (
x >> 3)) |= (1 << (
x & 7));
3219 *(ypn + (
x >> 3)) |= (1 << (
x & 7));
3250 uchar *
s = maskImage.bits();
3254 if (
depth() == 32) {
3257 for (
int w = 0;
w < d->
width;
w++) {
3259 *(
s + (
w >> 3)) |= (1 << (
w & 7));
3261 s += maskImage.bytesPerLine();
3265 for (
int w = 0;
w < d->
width;
w++) {
3267 *(
s + (
w >> 3)) |= (1 << (
w & 7));
3269 s += maskImage.bytesPerLine();
3273 maskImage.invertPixels();
3304 int dstXIncr,
int dstYIncr,
3311 const int srcYEnd =
dstY0 ?
h / 2 :
h;
3313 T *srcPtr = (T *) (
src->data +
srcY *
src->bytes_per_line);
3314 T *dstPtr = (T *) (
dst->data +
dstY *
dst->bytes_per_line);
3316 std::swap(srcPtr[
srcX], dstPtr[
dstX]);
3321 int srcXEnd2 =
w / 2;
3322 T *srcPtr = (T *) (
src->data +
srcY *
src->bytes_per_line);
3324 std::swap(srcPtr[
srcX], srcPtr[
dstX]);
3328 T *srcPtr = (T *) (
src->data +
srcY *
src->bytes_per_line);
3329 T *dstPtr = (T *) (
dst->data +
dstY *
dst->bytes_per_line);
3338 const int data_bytes_per_line =
w * (
depth / 8);
3340 uint *srcPtr =
reinterpret_cast<uint *
>(
src->data);
3341 uint *dstPtr =
reinterpret_cast<uint *
>(
dst->data + (
h - 1) *
dst->bytes_per_line);
3343 const int uint_per_line = (data_bytes_per_line + 3) >> 2;
3344 for (
int y = 0;
y <
h; ++
y) {
3346 for (
int x = 0;
x < uint_per_line;
x++) {
3347 const uint d = dstPtr[
x];
3348 const uint s = srcPtr[
x];
3352 srcPtr +=
src->bytes_per_line >> 2;
3353 dstPtr -=
dst->bytes_per_line >> 2;
3358 uchar *dstPtr =
dst->data + (
h - 1) *
dst->bytes_per_line;
3359 for (
int y = 0;
y <
h; ++
y) {
3360 memcpy(dstPtr, srcPtr, data_bytes_per_line);
3361 srcPtr +=
src->bytes_per_line;
3362 dstPtr -=
dst->bytes_per_line;
3371 int h =
src->height;
3374 if (
src->depth == 1) {
3379 if (vertical && !horizontal) {
3385 int dstX0 = 0, dstXIncr = 1;
3386 int dstY0 = 0, dstYIncr = 1;
3424 if (horizontal &&
dst->depth == 1) {
3426 const int shift = 8 - (
dst->width % 8);
3428 for (
int y = 0;
y <
h; ++
y) {
3439 p[-1] |= (*
p & (128 >>
i)) >> (7 -
i);
3444 p[-1] |= (*
p & (1 <<
i)) << (7 -
i);
3467 if ((d->
width <= 1 && d->
height <= 1) || (!horizontal && !vertical))
3492 if (!d || (d->
width <= 1 && d->
height <= 1) || (!horizontal && !vertical))
3531 qWarning(
"Trying to rb-swap an image format where it doesn't make sense");
3569 for (
int i = 0;
i <
res.d->colortable.size();
i++) {
3571 res.d->colortable[
i] =
QRgb(((
c << 16) & 0xff0000) | ((
c >> 16) & 0xff) | (
c & 0xff00ff00));
3577#if Q_BYTE_ORDER == Q_BIG_ENDIAN
3586 *
q = ((
c << 16) & 0xff000000) | ((
c >> 16) & 0xff00) | (
c & 0x00ff00ff);
3607 *
q = ((
c << 16) & 0xff0000) | ((
c >> 16) & 0xff) | (
c & 0xff00ff00);
3622 *
q = ((
c << 11) & 0xf800) | ((
c >> 11) & 0x1f) | (
c & 0x07e0);
3666 d->
colortable[
i] =
QRgb(((
c << 16) & 0xff0000) | ((
c >> 16) & 0xff) | (
c & 0xff00ff00));
3672#if Q_BYTE_ORDER == Q_BIG_ENDIAN
3678 *
p = ((
c << 16) & 0xff000000) | ((
c >> 16) & 0xff00) | (
c & 0x00ff00ff);
3695 *
p = ((
c << 16) & 0xff0000) | ((
c >> 16) & 0xff) | (
c & 0xff00ff00);
3706 *
p = ((
c << 11) & 0xf800) | ((
c >> 11) & 0x1f) | (
c & 0x07e0);
3875 return d->
doImageIO(
this, &writer, quality);
3894 return d->
doImageIO(
this, &writer, quality);
3902 if (quality > 100 || quality < -1)
3903 qWarning(
"QImage::save: Quality out of range [-1, 100]");
3917#if !defined(QT_NO_DATASTREAM)
3931 if (
s.version() >= 5) {
3932 if (
image.isNull()) {
3940 QImageWriter writer(
s.device(),
s.version() == 1 ?
"bmp" :
"png");
3957 if (
s.version() >= 5) {
3966 if (
image.isNull() &&
s.version() >= 5)
4016 for (
int y=0;
y<
h; ++
y) {
4017 for (
int x=0;
x<
w; ++
x) {
4025 for(
int l = 0; l < d->
height; l++) {
4028 const uint *
p2 =
reinterpret_cast<const uint*
>(
i.scanLine(l));
4030 if ((*
p1++ & 0x00ffffff) != (*
p2++ & 0x00ffffff))
4054 return !(*
this ==
i);
4100 if (!d || !
x || d->
dpmx ==
x)
4122 if (!d || !
y || d->
dpmy ==
y)
4192 tmp +=
it.key() +
": "_L1 +
it.value().simplified() +
"\n\n"_L1;
4245 if (platformIntegration)
4341#define IWX_MSB(b) if (trigx < maxws && trigy < maxhs) { \
4342 if (*(sptr+sbpl*(trigy>>12)+(trigx>>15)) & \
4343 (1 << (7-((trigx>>12)&7)))) \
4350#define IWX_LSB(b) if (trigx < maxws && trigy < maxhs) { \
4351 if (*(sptr+sbpl*(trigy>>12)+(trigx>>15)) & \
4352 (1 << ((trigx>>12)&7))) \
4359#define IWX_PIX(b) if (trigx < maxws && trigy < maxhs) { \
4360 if ((*(sptr+sbpl*(trigy>>12)+(trigx>>15)) & \
4361 (1 << (7-((trigx>>12)&7)))) == 0) \
4371 int m11 = int(trueMat.
m11()*4096.0);
4372 int m12 = int(trueMat.
m12()*4096.0);
4373 int m21 = int(trueMat.
m21()*4096.0);
4374 int m22 = int(trueMat.
m22()*4096.0);
4375 int dx =
qRound(trueMat.
dx()*4096.0);
4376 int dy =
qRound(trueMat.
dy()*4096.0);
4378 int m21ydx = dx + (
xoffset<<16) + (m11 + m21) / 2;
4379 int m22ydy = dy + (m12 + m22) / 2;
4382 uint maxws = sWidth<<12;
4383 uint maxhs = sHeight<<12;
4385 for (
int y=0;
y<dHeight;
y++) {
4388 uchar *maxp = dptr + dbpl;
4392 while (dptr < maxp) {
4393 if (trigx < maxws && trigy < maxhs)
4394 *dptr = *(sptr+sbpl*(trigy>>12)+(trigx>>12));
4402 while (dptr < maxp) {
4403 if (trigx < maxws && trigy < maxhs)
4404 *((
ushort*)dptr) = *((
const ushort *)(sptr+sbpl*(trigy>>12) +
4414 while (dptr < maxp) {
4415 if (trigx < maxws && trigy < maxhs) {
4416 const uchar *
p2 = sptr+sbpl*(trigy>>12) + ((trigx>>12)*3);
4428 while (dptr < maxp) {
4429 if (trigx < maxws && trigy < maxhs)
4430 *((
uint*)dptr) = *((
const uint *)(sptr+sbpl*(trigy>>12) +
4445 while (dptr < maxp) {
4458 while (dptr < maxp) {
4532 if (!d || alphaChannel.
isNull())
4536 qWarning(
"QImage::setAlphaChannel: "
4537 "Unable to set alpha channel while image is being painted on");
4542 if (d->
format == alphaFormat)
4552 sourceImage = alphaChannel;
4650 switch (
src.format()) {
4653#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
4657#if QT_CONFIG(raster_64bit)
4666#if QT_CONFIG(raster_fp)
4680 if (
src.hasAlphaChannel())
4697 if (
image.colorCount() > 0)
4698 out.setColorTable(
image.colorTable());
4703 memrotate(
image.constBits(),
w,
h,
image.bytesPerLine(),
out.bits(),
out.bytesPerLine());
4705 for (
int y=0;
y<
h; ++
y) {
4706 if (
image.colorCount())
4707 for (
int x=0;
x<
w; ++
x)
4710 for (
int x=0;
x<
w; ++
x)
4721 return image.mirrored(
true,
true);
4727 if (
image.colorCount() > 0)
4728 out.setColorTable(
image.colorTable());
4731 memrotate(
image.constBits(),
w,
h,
image.bytesPerLine(),
out.bits(),
out.bytesPerLine());
4741 if (
image.colorCount() > 0)
4742 out.setColorTable(
image.colorTable());
4747 memrotate(
image.constBits(),
w,
h,
image.bytesPerLine(),
out.bits(),
out.bytesPerLine());
4749 for (
int y=0;
y<
h; ++
y) {
4750 if (
image.colorCount())
4751 for (
int x=0;
x<
w; ++
x)
4754 for (
int x=0;
x<
w; ++
x)
4805 bool complex_xform =
false;
4806 bool scale_xform =
false;
4807 bool nonpaintable_scale_xform =
false;
4811 else if (mat.
m11() == -1. && mat.
m22() == -1.)
4819 if (hd * 2 < hs || wd * 2 < ws)
4820 nonpaintable_scale_xform =
true;
4823 if (mat.
m12() == 1. && mat.
m21() == -1.)
4825 else if (mat.
m12() == -1. && mat.
m21() == 1.)
4831 QRect r =
a.boundingRect().toAlignedRect();
4834 complex_xform =
true;
4837 if (wd == 0 || hd == 0)
4844#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
4848#if QT_CONFIG(raster_64bit)
4853 if (mat.
m11() > 0.0F && mat.
m22() > 0.0F)
4860 if (nonpaintable_scale_xform
4861#
if QT_CONFIG(thread) && !defined(Q_OS_WASM)
4862 || (ws * hs) >= (1<<20)
4865 if (mat.
m11() < 0.0F && mat.
m22() < 0.0F) {
4867 }
else if (mat.
m11() < 0.0F) {
4869 }
else if (mat.
m22() < 0.0F) {
4890 QImage dImage(wd, hd, target_format);
4902 if (dImage.d->colortable.size() < 256) {
4904 dImage.d->colortable.append(0x0);
4905 memset(dImage.bits(), dImage.d->colortable.size() - 1, dImage.d->nbytes);
4907 memset(dImage.bits(), 0, dImage.d->nbytes);
4910 memset(dImage.bits(), 0x00, dImage.d->nbytes);
4924 p.setTransform(mat);
4925 p.drawImage(
QPoint(0, 0), sImage);
4935 qt_xForm_helper(mat, 0,
type, bpp, dImage.bits(), dbpl, 0, hd, sptr, sbpl, ws, hs);
5005 qWarning() <<
"QImage::convertToColorSpace: Output colorspace is not valid";
5068 }
else if (
depth() > 32) {
5100 std::function<
void(
int,
int)> transformSegment;
5103 transformSegment = [&](
int yStart,
int yEnd) {
5104 for (
int y = yStart;
y < yEnd; ++
y) {
5109 }
else if (
depth() > 32) {
5110 transformSegment = [&](
int yStart,
int yEnd) {
5111 for (
int y = yStart;
y < yEnd; ++
y) {
5117 transformSegment = [&](
int yStart,
int yEnd) {
5118 for (
int y = yStart;
y < yEnd; ++
y) {
5125#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
5134 threadPool->
start([&,
y, yn]() {
5135 transformSegment(
y,
y + yn);
5143 transformSegment(0,
height());
5145 if (oldFormat !=
format())
5146 *
this = std::move(*this).convertToFormat(oldFormat);
5158 if (!
d || !
d->colorSpace.isValid())
5177 if (!
d || !
d->colorSpace.isValid())
5180 return std::move(*
this);
5194 return converter(
this,
flags);
5200#if QT_CONFIG(raster_fp)
5202 return convert_generic_inplace_over_rgba32f(
this, newFormat,
flags);
5221#ifndef QT_NO_DEBUG_STREAM
5231 dbg <<
i.size() <<
",format=" <<
i.format() <<
",depth=" <<
i.depth();
5233 dbg <<
",colorCount=" <<
i.colorCount();
5234 const int bytesPerLine =
i.bytesPerLine();
5235 dbg <<
",devicePixelRatio=" <<
i.devicePixelRatio()
5236 <<
",bytesPerLine=" << bytesPerLine <<
",sizeInBytes=" <<
i.sizeInBytes();
5237 if (dbg.verbosity() > 2 &&
i.height() > 0) {
5238 const int outputLength =
qMin(bytesPerLine, 24);
5240 <<
QByteArray(
reinterpret_cast<const char *
>(
i.scanLine(0)), outputLength).
toHex()
5732 for (
int i = 0;
i < NImageFormats;
i++) {
5736 return Format_Invalid;
5756 const auto textKeys =
image.textKeys();
5768 for (
const auto &pair : pairs) {
5769 int index = pair.indexOf(u
':');
5770 if (
index >= 0 && pair.indexOf(u
' ') <
index) {
5771 if (!pair.trimmed().isEmpty())
5772 text.
insert(
"Description"_L1, pair.toString().simplified());
5775 if (!
key.trimmed().isEmpty())
5784#include "moc_qimage.cpp"
IOBluetoothDevice * device
T loadRelaxed() const noexcept
\inmodule QtCore \reentrant
QByteArray toHex(char separator='\0') const
Returns a hex encoded copy of the byte array.
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
The QColorSpace class provides a color space abstraction.
QColorTransform transformationToColorSpace(const QColorSpace &colorspace) const
Generates and returns a color space transformation from this color space to colorspace.
bool isValid() const noexcept
Returns true if the color space is valid.
The QColor class provides colors based on RGB, HSV or CMYK values.
QRgb rgba() const noexcept
Returns the RGB value of the color, including its alpha.
\inmodule QtCore\reentrant
static QPlatformIntegration * platformIntegration()
\inmodule QtCore \reentrant
@ TransformationRotate270
static void executeImageHooks(qint64 key)
The QImageReader class provides a format independent interface for reading images from files or other...
QImage read()
Reads an image from the device.
The QImageWriter class provides a format independent interface for writing images to files or other d...
QString errorString() const
Returns a human readable description of the last error that occurred.
bool write(const QImage &image)
Writes the image image to the assigned device or file name.
void setQuality(int quality)
Sets the quality setting of the image format to quality.
void setDotsPerMeterY(int)
Sets the number of pixels that fit vertically in a physical meter, to y.
bool loadFromData(QByteArrayView data, const char *format=nullptr)
void detachMetadata(bool invalidateCache=false)
int dotsPerMeterX() const
Returns the number of pixels that fit horizontally in a physical meter.
int bitPlaneCount() const
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false.
void convertToColorSpace(const QColorSpace &)
bool valid(int x, int y) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QImage createAlphaMask(Qt::ImageConversionFlags flags=Qt::AutoColor) const
QImage scaled(int w, int h, Qt::AspectRatioMode aspectMode=Qt::IgnoreAspectRatio, Qt::TransformationMode mode=Qt::FastTransformation) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setAlphaChannel(const QImage &alphaChannel)
Sets the alpha channel of this image to the given alphaChannel.
QColorSpace colorSpace() const
void setText(const QString &key, const QString &value)
Sets the image text to the given text and associate it with the given key.
static QPixelFormat toPixelFormat(QImage::Format format) noexcept
Converts format into a QPixelFormat.
qsizetype bytesPerLine() const
Returns the number of bytes per image scanline.
void setPixel(int x, int y, uint index_or_rgb)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QImage colorTransformed(const QColorTransform &transform) const &
void setPixelColor(int x, int y, const QColor &c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QList< QRgb > colorTable() const
Returns a list of the colors contained in the image's color table, or an empty list if the image does...
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
QRgb pixel(int x, int y) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QImage transformed(const QTransform &matrix, Qt::TransformationMode mode=Qt::FastTransformation) const
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
QImage createHeuristicMask(bool clipTight=true) const
qsizetype sizeInBytes() const
bool allGray() const
Returns true if all the colors in the image are shades of gray (i.e.
QImage smoothScaled(int w, int h) const
void rgbSwapped_inplace()
QRgb color(int i) const
Returns the color in the color table at index i.
QSize size() const
Returns the size of the image, i.e.
bool isGrayscale() const
For 32-bit images, this function is equivalent to allGray().
void convertTo(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor)
QImage convertedToColorSpace(const QColorSpace &) const
bool operator==(const QImage &) const
Returns true if this image and the given image have the same contents; otherwise returns false.
int width() const
Returns the width of the image.
bool save(const QString &fileName, const char *format=nullptr, int quality=-1) const
Saves the image to the file with the given fileName, using the given image file format and quality fa...
uchar * bits()
Returns a pointer to the first pixel data.
bool isNull() const
Returns true if it is a null image, otherwise returns false.
void applyColorTransform(const QColorTransform &transform)
int height() const
Returns the height of the image.
void setColorTable(const QList< QRgb > &colors)
QImage createMaskFromColor(QRgb color, Qt::MaskMode mode=Qt::MaskInColor) const
QPaintEngine * paintEngine() const override
bool convertToFormat_inplace(Format format, Qt::ImageConversionFlags flags)
Format
The following image formats are available in Qt.
@ Format_RGBA32FPx4_Premultiplied
@ Format_RGBA64_Premultiplied
@ Format_ARGB6666_Premultiplied
@ Format_ARGB8555_Premultiplied
@ Format_RGBA8888_Premultiplied
@ Format_ARGB8565_Premultiplied
@ Format_RGBA16FPx4_Premultiplied
@ Format_A2BGR30_Premultiplied
@ Format_ARGB32_Premultiplied
@ Format_A2RGB30_Premultiplied
@ Format_ARGB4444_Premultiplied
virtual int metric(PaintDeviceMetric metric) const override
QImage() noexcept
Constructs a null image.
void fill(uint pixel)
Fills the entire image with the given pixelValue.
QImage mirrored(bool horizontally=false, bool vertically=true) const &
QPixelFormat pixelFormat() const noexcept
Returns the QImage::Format as a QPixelFormat.
QColor pixelColor(int x, int y) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QImage scaledToHeight(int h, Qt::TransformationMode mode=Qt::FastTransformation) const
Returns a scaled copy of the image.
Format format() const
Returns the format of the image.
bool operator!=(const QImage &) const
Returns true if this image and the given image have different contents; otherwise returns false.
static QImage fromData(QByteArrayView data, const char *format=nullptr)
bool load(QIODevice *device, const char *format)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const uchar * constScanLine(int) const
Returns a pointer to the pixel data at the scanline with index i.
QStringList textKeys() const
Returns the text keys for this image.
void setColor(int i, QRgb c)
Sets the color at the given index in the color table, to the given to colorValue.
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the image.
void mirrored_inplace(bool horizontal, bool vertical)
qreal devicePixelRatio() const
Returns the device pixel ratio for the image.
void setDotsPerMeterX(int)
Sets the number of pixels that fit horizontally in a physical meter, to x.
QImage rgbSwapped_helper() const
int dotsPerMeterY() const
Returns the number of pixels that fit vertically in a physical meter.
static QImage::Format toImageFormat(QPixelFormat format) noexcept
Converts format into a QImage::Format.
const uchar * constBits() const
Returns a pointer to the first pixel data.
int colorCount() const
Returns the depth of the image.
QSizeF deviceIndependentSize() const
Returns the size of the image in device independent pixels.
QImage mirrored_helper(bool horizontal, bool vertical) const
QString text(const QString &key=QString()) const
Returns the image text associated with the given key.
QImage & operator=(const QImage &)
Move-assigns other to this QImage instance.
~QImage()
Destroys the image and cleans up.
int pixelIndex(int x, int y) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QImage convertToFormat_helper(Format format, Qt::ImageConversionFlags flags) const
InvertMode
This enum type is used to describe how pixel values should be inverted in the invertPixels() function...
static QTransform trueMatrix(const QTransform &, int w, int h)
Returns a copy of the image that is transformed using the given transformation matrix and transformat...
QImage scaledToWidth(int w, Qt::TransformationMode mode=Qt::FastTransformation) const
[9]
void setColorSpace(const QColorSpace &)
QPoint offset() const
Returns the number of pixels by which the image is intended to be offset by when positioning relative...
bool reinterpretAsFormat(Format f)
void setOffset(const QPoint &)
Sets the number of pixels by which the image is intended to be offset by when positioning relative to...
int devType() const override
void invertPixels(InvertMode=InvertRgb)
Inverts all pixel values in the image.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const &
qint64 cacheKey() const
Returns a number that identifies the contents of this QImage object.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
void resize(qsizetype size)
iterator insert(const Key &key, const T &value)
T value(const Key &key, const T &defaultValue=T()) const
QList< Key > keys() const
@ PdmDevicePixelRatioScaled
static qreal devicePixelRatioFScale()
bool isActive() const
Returns true if the paint engine is actively drawing; otherwise returns false.
The QPainter class performs low-level painting on widgets and other paint devices.
void setCompositionMode(CompositionMode mode)
Sets the composition mode to the given mode.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
@ CompositionMode_DestinationIn
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
The QPolygonF class provides a list of points using floating point precision.
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr int width() const noexcept
Returns the width of the rectangle.
void setAlpha(quint16 _alpha)
static constexpr QRgba64 fromArgb32(uint rgb)
static constexpr QRgbaFloat fromArgb32(uint rgb)
constexpr Q_ALWAYS_INLINE QRgbaFloat unpremultiplied() const
void acquire(int n=1)
Tries to acquire n resources guarded by the semaphore.
void release(int n=1)
Releases n resources guarded by the semaphore.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr int & rheight() noexcept
Returns a reference to the height.
void scale(int w, int h, Qt::AspectRatioMode mode) noexcept
Scales the size to a rectangle with the given width and height, according to the specified mode:
constexpr int & rwidth() noexcept
Returns a reference to the width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
void chop(qsizetype n)
Removes n characters from the end of the string.
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString & insert(qsizetype i, QChar c)
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
static QThreadPool * qtGuiInstance()
Returns the QThreadPool instance for Qt Gui.
void start(QRunnable *runnable, int priority=0)
Reserves a thread and uses it to run runnable, unless this thread will make the current thread count ...
bool contains(const QThread *thread) const
static QThread * currentThread()
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
\keyword 16-bit Floating Point Support\inmodule QtCore \inheaderfile QFloat16
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
QFuture< QtPrivate::MapResultType< Sequence, MapFunctor > > mapped(QThreadPool *pool, Sequence &&sequence, MapFunctor &&map)
QTextStream & ws(QTextStream &stream)
Calls \l {QTextStream::}{skipWhiteSpace()} on stream and returns stream.
static jboolean copy(JNIEnv *, jobject)
#define Q_BASIC_ATOMIC_INITIALIZER(a)
static QT_WARNING_DISABLE_FLOAT_COMPARE ShiftResult shift(const QBezier *orig, QBezier *shifted, qreal offset, qreal threshold)
#define QT_WARNING_DISABLE_MSVC(number)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
static constexpr int BufferSize
ushort qConvertRgb32To16(uint c)
QRgb qConvertRgb16To32(uint c)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
int qRound(qfloat16 d) noexcept
Q_GUI_EXPORT int qt_defaultDpiX()
Q_GUI_EXPORT int qt_defaultDpiY()
static QImage rotated90(const QImage &src)
static void copyMetadata(QImageData *dst, const QImageData *src)
static void rgbSwapped_generic(int width, int height, const QImage *src, QImage *dst, const QPixelLayout *layout)
QDataStream & operator<<(QDataStream &s, const QImage &image)
[0]
bool qt_xForm_helper(const QTransform &trueMat, int xoffset, int type, int depth, uchar *dptr, qsizetype dbpl, int p_inc, int dHeight, const uchar *sptr, qsizetype sbpl, int sWidth, int sHeight)
QImage Q_TRACE_INSTRUMENT(qtgui) QImage
bool qt_read_xpm_image_or_array(QIODevice *device, const char *const *source, QImage &image)
static int next_qimage_serial_number()
#define QIMAGE_SANITYCHECK_MEMORY(image)
static QImage convertWithPalette(const QImage &src, QImage::Format format, const QList< QRgb > &clut)
void do_flip(QImageData *dst, QImageData *src, int w, int h, int depth)
static void copyPhysicalMetadata(QImageData *dst, const QImageData *src)
Q_GUI_EXPORT void qt_imageTransform(QImage &src, QImageIOHandler::Transformations orient)
static QImage rotated270(const QImage &src)
QMap< QString, QString > qt_getImageText(const QImage &image, const QString &description)
void do_mirror(QImageData *dst, QImageData *src, bool horizontal, bool vertical)
static int pixel_distance(QRgb p1, QRgb p2)
static int closestMatch(QRgb pixel, const QList< QRgb > &clut)
static constexpr QPixelFormat pixelformats[]
static QImage rotated180(const QImage &src)
QDataStream & operator>>(QDataStream &s, QImage &image)
QMap< QString, QString > qt_getImageTextFromDescription(const QString &description)
void(* QImageCleanupFunction)(void *)
Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormats]
static const uchar bitflip[256]
const uchar * qt_get_bitflip_array()
void dither_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags, bool fromalpha)
void convert_generic_over_rgb64(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags flags)
bool convert_generic_inplace_over_rgb64(QImageData *data, QImage::Format dst_format, Qt::ImageConversionFlags)
int qt_depthForFormat(QImage::Format format)
Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormats]
bool qt_fpColorPrecision(QImage::Format format)
bool(* InPlace_Image_Converter)(QImageData *data, Qt::ImageConversionFlags)
InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QImage::NImageFormats]
QImage::Format qt_alphaVersion(QImage::Format format)
bool qt_highColorPrecision(QImage::Format format, bool opaque=false)
void(* Image_Converter)(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
QImage::Format qt_alphaVersionForPainting(QImage::Format format)
bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::ImageConversionFlags)
QImage qSmoothScaleImage(const QImage &src, int dw, int dh)
static ControlElement< T > * ptr(QWidget *widget)
MemRotateFunc qMemRotateFunctions[QPixelLayout::BPPCount][3]
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLint GLint GLint GLint dstX0
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLint GLint GLint GLint GLint x
[0]
GLint GLenum GLsizei GLsizei GLsizei depth
GLenum GLint GLint GLint GLint GLuint GLenum GLint GLint GLint dstY
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLint GLint GLint srcY
GLenum GLint GLint GLint GLint GLuint GLenum GLint GLint dstX
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLint GLsizei GLsizei GLenum format
GLint GLint GLint GLint GLint dstY0
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLsizei GLchar * source
GLuint GLenum GLenum transform
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * table
QPixelLayout qPixelLayouts[QImage::NImageFormats]
QRgba64 qConvertA2rgb30ToRgb64< PixelOrderBGR >(uint rgb)
unsigned int qConvertRgb64ToRgb30< PixelOrderBGR >(QRgba64 c)
QRgb qConvertA2rgb30ToArgb32< PixelOrderBGR >(uint c)
void(QT_FASTCALL * RbSwapFunc)(uchar *dst, const uchar *src, int count)
static quint32 RGBA2ARGB(quint32 x)
uint qConvertRgb32ToRgb30< PixelOrderRGB >(QRgb c)
QRgba64 qConvertA2rgb30ToRgb64< PixelOrderRGB >(uint rgb)
uint qConvertArgb32ToA2rgb30< PixelOrderBGR >(QRgb c)
uint qConvertRgb32ToRgb30< PixelOrderBGR >(QRgb c)
QRgb qConvertA2rgb30ToArgb32< PixelOrderRGB >(uint c)
static quint32 ARGB2RGBA(quint32 x)
unsigned int qConvertRgb64ToRgb30< PixelOrderRGB >(QRgba64 c)
void(* MemRotateFunc)(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
uint qConvertArgb32ToA2rgb30< PixelOrderRGB >(QRgb c)
uint qRgbSwapRgb30(uint c)
static QT_BEGIN_NAMESPACE const QRgb colors[][14]
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
constexpr bool qIsGray(QRgb rgb)
QT_BEGIN_NAMESPACE typedef unsigned int QRgb
constexpr QRgb qRgb(int r, int g, int b)
constexpr int qRed(QRgb rgb)
constexpr int qGreen(QRgb rgb)
constexpr int qBlue(QRgb rgb)
constexpr QRgb qPremultiply(QRgb x)
constexpr int qAlpha(QRgb rgb)
constexpr QRgba64 qRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
static uint toArgb32(QRgba64 rgba64)
#define qPrintable(string)
#define QT_CONFIG(feature)
#define Q_TRACE_PARAM_REPLACE(in, out)
#define Q_TRACE_METADATA(provider, metadata)
#define Q_TRACE_PREFIX(provider, prefix)
#define Q_TRACE_SCOPE(x,...)
unsigned long long quint64
ReturnedValue read(const char *data)
std::uniform_real_distribution dist(1, 2.5)
[2]
QTextStream out(stdout)
[7]
bool checkForAlphaPixels() const
bool doImageIO(const QImage *image, QImageWriter *io, int quality) const
static QImageData * get(QImage &img) noexcept
static ImageSizeParameters calculateImageParameters(qsizetype width, qsizetype height, qsizetype depth)
bool convertInPlace(QImage::Format newFormat, Qt::ImageConversionFlags)
static QImageData * create(const QSize &size, QImage::Format format)
QPaintEngine * paintEngine
QMap< QString, QString > text
QImageCleanupFunction cleanupFunction