4#include <private/qguiapplication_p.h>
5#include <private/qcolortransform_p.h>
6#include <private/qcolortrclut_p.h>
7#include <private/qcmyk_p.h>
8#include <private/qdrawhelper_p.h>
9#include <private/qendian_p.h>
10#include <private/qpixellayout_p.h>
11#include <private/qsimd_p.h>
12#include <private/qimage_p.h>
19#include <private/qthreadpool_p.h>
23#define QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
34 for (
int i = 0;
i < 256; ++
i) {
57 0, 128, 64, 192, 32, 160, 96, 224, 16, 144, 80, 208, 48, 176, 112, 240,
58 8, 136, 72, 200, 40, 168, 104, 232, 24, 152, 88, 216, 56, 184, 120, 248,
59 4, 132, 68, 196, 36, 164, 100, 228, 20, 148, 84, 212, 52, 180, 116, 244,
60 12, 140, 76, 204, 44, 172, 108, 236, 28, 156, 92, 220, 60, 188, 124, 252,
61 2, 130, 66, 194, 34, 162, 98, 226, 18, 146, 82, 210, 50, 178, 114, 242,
62 10, 138, 74, 202, 42, 170, 106, 234, 26, 154, 90, 218, 58, 186, 122, 250,
63 6, 134, 70, 198, 38, 166, 102, 230, 22, 150, 86, 214, 54, 182, 118, 246,
64 14, 142, 78, 206, 46, 174, 110, 238, 30, 158, 94, 222, 62, 190, 126, 254,
65 1, 129, 65, 193, 33, 161, 97, 225, 17, 145, 81, 209, 49, 177, 113, 241,
66 9, 137, 73, 201, 41, 169, 105, 233, 25, 153, 89, 217, 57, 185, 121, 249,
67 5, 133, 69, 197, 37, 165, 101, 229, 21, 149, 85, 213, 53, 181, 117, 245,
68 13, 141, 77, 205, 45, 173, 109, 237, 29, 157, 93, 221, 61, 189, 125, 253,
69 3, 131, 67, 195, 35, 163, 99, 227, 19, 147, 83, 211, 51, 179, 115, 243,
70 11, 139, 75, 203, 43, 171, 107, 235, 27, 155, 91, 219, 59, 187, 123, 251,
71 7, 135, 71, 199, 39, 167, 103, 231, 23, 151, 87, 215, 55, 183, 119, 247,
72 15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255
89 for (
int y=0;
y<
h; ++
y) {
91 for (
int x=0;
x<
w; ++
x)
101#if !defined(__ARM_NEON__) || !(Q_BYTE_ORDER == Q_LITTLE_ENDIAN)
116 d[
i] = 0xff000000 |
src[
i];
128#ifdef QT_COMPILER_SUPPORTS_SSE4_1
131#elif defined(__ARM_NEON__) && (Q_BYTE_ORDER == Q_LITTLE_ENDIAN)
148 store = destLayout->storeFromRGB32;
154#ifdef QT_COMPILER_SUPPORTS_SSE4_1
156 store = storeRGB32FromARGB32PM_sse4;
159#elif defined(__ARM_NEON__) && (Q_BYTE_ORDER == Q_LITTLE_ENDIAN)
160 store = storeRGB32FromARGB32PM_neon;
167 !destLayout->hasAlphaChannel && destLayout->storeFromRGB32) {
173 store = destLayout->storeFromRGB32;
176 auto convertSegment = [=](
int yStart,
int yEnd) {
179 const uchar *srcData =
src->data +
src->bytes_per_line * yStart;
185 for (
int y = yStart;
y < yEnd; ++
y) {
188 while (x < src->
width) {
190 int l =
src->width -
x;
195 const uint *
ptr = fetch(
buffer, srcData,
x, l,
nullptr, ditherPtr);
196 store(destData,
ptr,
x, l,
nullptr, ditherPtr);
199 srcData +=
src->bytes_per_line;
204#ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
210 return convertSegment(0,
src->height);
216 threadPool->
start([&,
y, yn]() {
217 convertSegment(
y,
y + yn);
224 convertSegment(0,
src->height);
238 auto convertSegment = [=](
int yStart,
int yEnd) {
241 const uchar *srcData =
src->data + yStart *
src->bytes_per_line;
243 for (
int y = yStart;
y < yEnd; ++
y) {
245 while (x < src->
width) {
246 int l =
src->width -
x;
252 store(destData,
ptr,
x, l,
nullptr,
nullptr);
255 srcData +=
src->bytes_per_line;
259#ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
265 return convertSegment(0,
src->height);
271 threadPool->
start([&,
y, yn]() {
272 convertSegment(
y,
y + yn);
279 convertSegment(0,
src->height);
283#if QT_CONFIG(raster_fp)
292 auto convertSegment = [=](
int yStart,
int yEnd) {
295 const uchar *srcData =
src->data + yStart *
src->bytes_per_line;
297 for (
int y = yStart;
y < yEnd; ++
y) {
299 while (x < src->
width) {
300 int l =
src->width -
x;
301 if (dest->
depth == 128)
306 store(destData,
ptr,
x, l,
nullptr,
nullptr);
309 srcData +=
src->bytes_per_line;
313#ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
319 return convertSegment(0,
src->height);
325 threadPool->
start([&,
y, yn]() {
326 convertSegment(
y,
y + yn);
333 convertSegment(0,
src->height);
344 if (
data->depth < destDepth)
356 if (
data->depth != destDepth) {
367 store = destLayout->storeFromRGB32;
372#ifdef QT_COMPILER_SUPPORTS_SSE4_1
374 store = storeRGB32FromARGB32PM_sse4;
377#elif defined(__ARM_NEON__) && (Q_BYTE_ORDER == Q_LITTLE_ENDIAN)
378 store = storeRGB32FromARGB32PM_neon;
385 !destLayout->hasAlphaChannel && destLayout->storeFromRGB32) {
391 store = destLayout->storeFromRGB32;
394 auto convertSegment = [=](
int yStart,
int yEnd) {
398 uchar *destData = srcData;
403 for (
int y = yStart;
y < yEnd; ++
y) {
406 while (x < data->
width) {
408 int l =
data->width -
x;
413 const uint *
ptr = fetch(
buffer, srcData,
x, l,
nullptr, ditherPtr);
414 store(destData,
ptr,
x, l,
nullptr, ditherPtr);
417 srcData +=
data->bytes_per_line;
418 destData +=
params.bytesPerLine;
421#ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
430 threadPool->
start([&,
y, yn]() {
431 convertSegment(
y,
y + yn);
437 if (
data->bytes_per_line !=
params.bytesPerLine) {
444 if (srcData != destData)
445 memmove(destData, srcData,
params.bytesPerLine * yn);
451 convertSegment(0,
data->height);
454 void *newData = realloc(
data->data,
params.totalSize);
461 data->depth = destDepth;
462 data->format = dst_format;
471 if (
data->depth < destDepth)
478 if (
data->depth != destDepth) {
487 destLayout->hasAlphaChannel && !destLayout->premultiplied) {
493 auto convertSegment = [=](
int yStart,
int yEnd) {
497 uchar *destData = srcData;
498 for (
int y = yStart;
y < yEnd; ++
y) {
500 while (x < data->
width) {
501 int l =
data->width -
x;
507 store(destData,
ptr,
x, l,
nullptr,
nullptr);
510 srcData +=
data->bytes_per_line;
511 destData +=
params.bytesPerLine;
514#ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
523 threadPool->
start([&,
y, yn]() {
524 convertSegment(
y,
y + yn);
530 if (
data->bytes_per_line !=
params.bytesPerLine) {
537 if (srcData != destData)
538 memmove(destData, srcData,
params.bytesPerLine * yn);
544 convertSegment(0,
data->height);
547 void *newData = realloc(
data->data,
params.totalSize);
554 data->depth = destDepth;
555 data->format = dst_format;
559#if QT_CONFIG(raster_fp)
565 if (
data->depth < destDepth)
572 if (
data->depth != destDepth) {
581 destLayout->hasAlphaChannel && !destLayout->premultiplied) {
587 auto convertSegment = [=](
int yStart,
int yEnd) {
591 uchar *destData = srcData;
592 for (
int y = yStart;
y < yEnd; ++
y) {
594 while (x < data->
width) {
595 int l =
data->width -
x;
601 store(destData,
ptr,
x, l,
nullptr,
nullptr);
604 srcData +=
data->bytes_per_line;
605 destData +=
params.bytesPerLine;
608#ifdef QT_USE_THREAD_PARALLEL_IMAGE_CONVERSIONS
617 threadPool->
start([&,
y, yn]() {
618 convertSegment(
y,
y + yn);
624 if (
data->bytes_per_line !=
params.bytesPerLine) {
631 if (srcData != destData)
632 memmove(destData, srcData,
params.bytesPerLine * yn);
638 convertSegment(0,
data->height);
641 void *newData = realloc(
data->data,
params.totalSize);
648 data->depth = destDepth;
649 data->format = dst_format;
659 const int src_bpl =
src->bytes_per_line;
664 for (
int i = 0;
i <
src->height; ++
i) {
665 memcpy(dest_data, src_data, src_bpl);
667 dest_data += dest_bpl;
671template<QImage::Format Format>
682 while ((
quintptr(src_data) & 0x3) && pixel <
len) {
683 *dest_data = 0xff000000 | (src_data[0] << 16) | (src_data[1] << 8) | (src_data[2]);
690 for (; pixel + 3 <
len; pixel += 4) {
692 const quint32 src1 = src_packed[0];
693 const quint32 src2 = src_packed[1];
694 const quint32 src3 = src_packed[2];
696 dest_data[0] = 0xff000000 | (src1 >> 8);
697 dest_data[1] = 0xff000000 | (src1 << 16) | (src2 >> 16);
698 dest_data[2] = 0xff000000 | (src2 << 8) | (src3 >> 24);
699 dest_data[3] = 0xff000000 | src3;
706 for (; pixel <
len; ++pixel) {
707 *dest_data = 0xff000000 | (src_data[0] << 16) | (src_data[1] << 8) | (src_data[2]);
717 while ((
quintptr(src_data) & 0x3) && pixel <
len) {
718 *dest_data =
ARGB2RGBA(0xff000000 | (src_data[0] << 16) | (src_data[1] << 8) | (src_data[2]));
725 for (; pixel + 3 <
len; pixel += 4) {
727 const quint32 src1 = src_packed[0];
728 const quint32 src2 = src_packed[1];
729 const quint32 src3 = src_packed[2];
731#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
732 dest_data[0] = 0xff000000 | src1;
733 dest_data[1] = 0xff000000 | (src1 >> 24) | (src2 << 8);
734 dest_data[2] = 0xff000000 | (src2 >> 16) | (src3 << 16);
735 dest_data[3] = 0xff000000 | (src3 >> 8);
737 dest_data[0] = 0xff | src1;
738 dest_data[1] = 0xff | (src1 << 24) | (src2 >> 8);
739 dest_data[2] = 0xff | (src2 << 16) | (src3 >> 16);
740 dest_data[3] = 0xff | (src3 << 8);
748 for (; pixel <
len; ++pixel) {
749 *dest_data =
ARGB2RGBA(0xff000000 | (src_data[0] << 16) | (src_data[1] << 8) | (src_data[2]));
773 for (
int i = 0;
i <
src->height; ++
i) {
774 line_converter(dest_data, src_data,
src->width);
775 src_data +=
src->bytes_per_line;
787 const int src_pad = (
src->bytes_per_line >> 2) -
src->width;
792 for (
int i = 0;
i <
src->height; ++
i) {
794 while (src_data <
end) {
795 *dest_data =
ARGB2RGBA(0xff000000 | *src_data);
800 dest_data += dest_pad;
811 const int src_pad = (
src->bytes_per_line >> 2) -
src->width;
816 for (
int i = 0;
i <
src->height; ++
i) {
818 while (src_data <
end) {
824 dest_data += dest_pad;
828template<QImage::Format DestFormat>
833 const int pad = (
data->bytes_per_line >> 2) -
data->width;
837 for (
int i = 0;
i <
data->height; ++
i) {
839 while (rgb_data <
end) {
846 data->format = DestFormat;
857 const int src_pad = (
src->bytes_per_line >> 2) -
src->width;
862 for (
int i = 0;
i <
src->height; ++
i) {
864 while (src_data <
end) {
870 dest_data += dest_pad;
874template<QImage::Format DestFormat>
879 const int pad = (
data->bytes_per_line >> 2) -
data->width;
883 for (
int i = 0;
i <
data->height; ++
i) {
885 while (rgb_data <
end) {
891 data->format = DestFormat;
908 for (
int i = 0;
i <
src->height; ++
i) {
909 func(dest_data, src_data,
src->width);
924 for (
int i = 0;
i <
data->height; ++
i) {
925 func(line_data, line_data,
data->width);
929 switch (
data->format) {
956template<QtPixelOrder PixelOrder,
bool RGBA>
967 const int src_pad = (
src->bytes_per_line >> 2) -
src->width;
972 for (
int i = 0;
i <
src->height; ++
i) {
974 while (src_data <
end) {
980 *dest_data = (qConvertRgb32ToRgb30<PixelOrder>(
c) & 0x3fffffff) | (
alpha << 30);
985 dest_data += dest_pad;
989template<QtPixelOrder PixelOrder,
bool RGBA>
995 const int pad = (
data->bytes_per_line >> 2) -
data->width;
998 for (
int i = 0;
i <
data->height; ++
i) {
1000 while (rgb_data <
end) {
1006 *rgb_data = (qConvertRgb32ToRgb30<PixelOrder>(
c) & 0x3fffffff) | (
alpha << 30);
1019 const uint a = rgb30 >> 30;
1024 uint rgb = rgb30 & 0x3fffffff;
1026 return (
a << 30) |
rgb;
1029 uint rgb = rgb30 & 0x3fffffff;
1030 rgb += (
rgb >> 1) & 0x5ff7fdff;
1031 return (
a << 30) |
rgb;
1036 Q_UNREACHABLE_RETURN(0);
1039template<
bool rgbswap>
1047 const int src_pad = (
src->bytes_per_line >> 2) -
src->width;
1052 for (
int i = 0;
i <
src->height; ++
i) {
1054 while (src_data <
end) {
1060 src_data += src_pad;
1061 dest_data += dest_pad;
1065template<
bool rgbswap>
1070 const int pad = (
data->bytes_per_line >> 2) -
data->width;
1073 for (
int i = 0;
i <
data->height; ++
i) {
1075 while (rgb_data <
end) {
1103template<QtPixelOrder PixelOrder,
bool RGBA>
1111 const int src_pad = (
src->bytes_per_line >> 2) -
src->width;
1116 for (
int i = 0;
i <
src->height; ++
i) {
1118 while (src_data <
end) {
1125 src_data += src_pad;
1126 dest_data += dest_pad;
1130template<QtPixelOrder PixelOrder,
bool RGBA>
1135 const int pad = (
data->bytes_per_line >> 2) -
data->width;
1138 for (
int i = 0;
i <
data->height; ++
i) {
1140 while (rgb_data <
end) {
1162 const int src_pad = (
src->bytes_per_line >> 2) -
src->width;
1167 for (
int i = 0;
i <
src->height; ++
i) {
1169 while (src_data <
end) {
1170 *dest_data =
RGBA2ARGB(*src_data) | 0xff000000;
1174 src_data += src_pad;
1175 dest_data += dest_pad;
1193 while (src_data <
end) {
1194 *dest_data =
bitflip[*src_data];
1205 const int src_pad = (
src->bytes_per_line >> 2) -
src->width;
1210 for (
int i = 0;
i <
src->height; ++
i) {
1212 while (src_data <
end) {
1213 *dest_data = *src_data | 0xff000000;
1217 src_data += src_pad;
1218 dest_data += dest_pad;
1222template<QImage::Format DestFormat>
1228 const int pad = (
data->bytes_per_line >> 2) -
data->width;
1231 for (
int i = 0;
i <
data->height; ++
i) {
1233 while (rgb_data <
end) {
1234 *rgb_data = *rgb_data | 0xff000000;
1239 data->format = DestFormat;
1245#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
1252 const int src_pad = (
src->bytes_per_line >> 2) -
src->width;
1257 for (
int i = 0;
i <
src->height; ++
i) {
1259 while (src_data <
end) {
1260 *dest_data = *src_data | 0x000000ff;
1264 src_data += src_pad;
1265 dest_data += dest_pad;
1272#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
1273 return mask_alpha_converter_inplace<QImage::Format_RGBX8888>(
data,
flags);
1277 const int pad = (
data->bytes_per_line >> 2) -
data->width;
1280 for (
int i = 0;
i <
data->height; ++
i) {
1282 while (rgb_data <
end) {
1283 *rgb_data = *rgb_data | 0x000000fff;
1305 for (
int i = 0;
i <
src->height; ++
i) {
1306 uint *
d =
reinterpret_cast<uint *
>(destData);
1308 qt_convertRGBA64ToARGB32<RGBA>(
d,
s,
src->width);
1309 srcData +=
src->bytes_per_line;
1327 for (
int i = 0;
i <
src->height; ++
i) {
1328 fetch(
reinterpret_cast<QRgba64 *
>(dest_data), src_data, 0,
src->width,
nullptr,
nullptr);
1329 src_data +=
src->bytes_per_line;
1341 const int src_pad = (
src->bytes_per_line >> 3) -
src->width;
1346 for (
int i = 0;
i <
src->height; ++
i) {
1348 while (src_data <
end) {
1349 *dest_data = *src_data;
1354 src_data += src_pad;
1355 dest_data += dest_pad;
1363 const int pad = (
data->bytes_per_line >> 3) -
data->width;
1366 for (
int i = 0;
i <
data->height; ++
i) {
1368 while (rgb_data <
end) {
1391 for (
int i = 0;
i <
src->height; ++
i) {
1392 const quint16 *src_line =
reinterpret_cast<const quint16 *
>(src_data);
1394 for (
int j = 0;
j <
src->width; ++
j) {
1403template<
bool Premultiplied>
1421 QColorTransformPrivate::TransformFlags
flags = Premultiplied
1425 for (
int i = 0;
i <
src->height; ++
i) {
1426 const QRgb *src_line =
reinterpret_cast<const QRgb *
>(src_data);
1427 tfd->applyReturnGray(dest_data, src_line,
src->width,
flags);
1433template<
bool Premultiplied>
1451 QColorTransformPrivate::TransformFlags
flags = Premultiplied
1456 for (
int i = 0;
i <
src->height; ++
i) {
1457 const QRgb *src_line =
reinterpret_cast<const QRgb *
>(src_data);
1460 while (j < src->
width) {
1462 for (
int k = 0; k <
len; ++k)
1464 tfd->applyReturnGray(dest_line +
j, tmp_line,
len,
flags);
1472template<
bool Premultiplied>
1490 QColorTransformPrivate::TransformFlags
flags = Premultiplied
1495 for (
int i = 0;
i <
src->height; ++
i) {
1496 const QRgba64 *src_line =
reinterpret_cast<const QRgba64 *
>(src_data);
1497 uchar *dest_line = dest_data;
1499 while (j < src->
width) {
1501 tfd->applyReturnGray(gray_line, src_line +
j,
len,
flags);
1502 for (
int k = 0; k <
len; ++k)
1511template<
bool Premultiplied>
1529 QColorTransformPrivate::TransformFlags
flags = Premultiplied
1533 for (
int i = 0;
i <
src->height; ++
i) {
1534 const QRgba64 *src_line =
reinterpret_cast<const QRgba64 *
>(src_data);
1536 tfd->applyReturnGray(dest_line, src_line,
src->width,
flags);
1542template<
bool MaskAlpha>
1550 const int src_pad = (
src->bytes_per_line >> 3) -
src->width;
1555 for (
int i = 0;
i <
src->height; ++
i) {
1557 while (src_data <
end) {
1560 dest_data->setAlpha(1.0f);
1564 src_data += src_pad;
1565 dest_data += dest_pad;
1569template<
bool MaskAlpha>
1574 const int pad = (
data->bytes_per_line >> 3) -
data->width;
1577 for (
int i = 0;
i <
data->height; ++
i) {
1579 while (rgb_data <
end) {
1582 rgb_data->setAlpha(1.0f);
1593 QList<QRgb> colorTable = ctbl;
1596 for (
int i = 0;
i < colorTable.size(); ++
i)
1597 if (
qAlpha(colorTable.at(
i)) != 0xff)
1598 colorTable[
i] = colorTable.at(
i) | 0xff000000;
1601 for (
int i = 0;
i < colorTable.size(); ++
i)
1612 Qt::ImageConversionFlags
flags,
bool fromalpha)
1618 dst->colortable.clear();
1619 dst->colortable.append(0xffffffff);
1620 dst->colortable.append(0xff000000);
1622 enum { Threshold, Ordered,
Diffuse } dithermode;
1628 dithermode = Ordered;
1630 dithermode = Threshold;
1633 dithermode = Threshold;
1635 dithermode = Ordered;
1641 int h =
src->height;
1644 bool use_gray = (
d == 8);
1649 for (
int i = 0;
i <
src->colortable.size();
i++)
1650 gray[
i] = (255 - (
src->colortable.at(
i) >> 24));
1654 for (
int i = 0;
i <
src->colortable.size();
i++)
1664 switch (dithermode) {
1666 QScopedArrayPointer<int> lineBuffer(
new int[
w * 2]);
1667 int *line1 = lineBuffer.data();
1668 int *line2 = lineBuffer.data() +
w;
1669 int bmwidth = (
w+7)/8;
1672 int wbytes =
w * (
d/8);
1682 *b2++ = 255 - (*(
const uint*)
p >> 24);
1692 for (
int y=0;
y<
h;
y++) {
1693 int *tmp = line1; line1 = line2; line2 = tmp;
1694 bool not_last_line =
y <
h - 1;
1695 if (not_last_line) {
1696 p =
src->data + (
y+1)*
src->bytes_per_line;
1705 *b2++ = 255 - (*(
const uint*)
p >> 24);
1719 memset(
p, 0, bmwidth);
1723 for (
int x=1;
x<=
w;
x++) {
1736 const int e7 = ((err * 7) + 8) >> 4;
1737 const int e5 = ((err * 5) + 8) >> 4;
1738 const int e3 = ((err * 3) + 8) >> 4;
1739 const int e1 = err - (e7 + e5 + e3);
1742 if (not_last_line) {
1755 memset(
dst->data, 0,
dst->nbytes);
1757 for (
int i=0;
i<
h;
i++) {
1786 dst_data += dst_bpl;
1787 src_data += src_bpl;
1789 }
else if (
d == 8) {
1790 for (
int i=0;
i<
h;
i++) {
1791 const uchar *
p = src_data;
1806 dst_data += dst_bpl;
1807 src_data += src_bpl;
1812 memset(
dst->data, 0,
dst->nbytes);
1814 for (
int i=0;
i<
h;
i++) {
1821 if ((*
p++ >> 24) >= 128)
1842 dst_data += dst_bpl;
1843 src_data += src_bpl;
1847 for (
int i=0;
i<
h;
i++) {
1848 const uchar *
p = src_data;
1853 if (gray[*
p++] < 128)
1862 dst_data += dst_bpl;
1863 src_data += src_bpl;
1872 int bpl = (
dst->width + 7) *
dst->depth / 8;
1873 int pad =
dst->bytes_per_line - bpl;
1874 for (
int y=0;
y<
dst->height; ++
y) {
1875 for (
int x=0;
x<bpl; ++
x) {
1922 const int tablesize = 997;
1926 if (!
dst->colortable.isEmpty()) {
1927 QList<QRgb> ctbl =
dst->colortable;
1928 dst->colortable.resize(256);
1931 for (
int i = 0;
i <
dst->colortable.size(); ++
i) {
1933 QRgb p = ctbl.at(
i) | alpha_mask;
1934 int hash =
p % tablesize;
1959 dst->colortable.resize(256);
1962 for (
int y = 0;
y <
src->height;
y++) {
1965 for (
int x = 0;
x <
src->width; ++
x) {
1967 int hash =
p % tablesize;
1996 src_data +=
src->bytes_per_line;
1997 dest_data +=
dst->bytes_per_line;
2000 int numColors = do_quant ? 256 :
pix;
2002 dst->colortable.resize(numColors);
2009#define INDEXOF(r,g,b) (((r)*(MAX_G+1)+(g))*(MAX_B+1)+(b))
2011 for (
int rc=0; rc<=
MAX_R; rc++)
2013 for (
int bc=0; bc<=
MAX_B; bc++)
2019 for (
int y = 0;
y <
src->height;
y++) {
2025#define DITHER(p,m) ((uchar) ((p * (m) + 127) / 255))
2035 src_data +=
src->bytes_per_line;
2036 dest_data +=
dst->bytes_per_line;
2042 QScopedArrayPointer<int> lineBuffer(
new int[
src->width * 9]);
2043 line1[0] = lineBuffer.data();
2044 line2[0] = lineBuffer.data() +
src->width;
2045 line1[1] = lineBuffer.data() +
src->width * 2;
2046 line2[1] = lineBuffer.data() +
src->width * 3;
2047 line1[2] = lineBuffer.data() +
src->width * 4;
2048 line2[2] = lineBuffer.data() +
src->width * 5;
2049 pv[0] = lineBuffer.data() +
src->width * 6;
2050 pv[1] = lineBuffer.data() +
src->width * 7;
2051 pv[2] = lineBuffer.data() +
src->width * 8;
2054 for (
int y = 0;
y <
src->height;
y++) {
2055 const uchar*
q = src_data;
2056 const uchar* q2 =
y <
src->height - 1 ?
q +
src->bytes_per_line :
src->data;
2058 for (
int chan = 0; chan < 3; chan++) {
2059 int *l1 = (
y&1) ? line2[chan] : line1[chan];
2060 int *l2 = (
y&1) ? line1[chan] : line2[chan];
2062 for (
int i = 0;
i <
src->width;
i++)
2063 l1[
i] =
q[
i*4+chan+endian];
2065 if (
y+1 <
src->height) {
2066 for (
int i = 0;
i <
src->width;
i++)
2067 l2[
i] = q2[
i*4+chan+endian];
2071 for (
int x = 0;
x <
src->width;
x++) {
2073 int err = l1[
x] -
pix * 255 / 5;
2077 if (
x + 1<
src->width) {
2078 l1[
x+1] += (err*7)>>4;
2083 l2[
x-1]+=(err*3)>>4;
2086 for (
int x =
src->width;
x-- > 0;) {
2088 int err = l1[
x] -
pix * 255 / 5;
2093 l1[
x-1] += (err*7)>>4;
2097 if (
x + 1 <
src->width)
2098 l2[
x+1]+=(err*3)>>4;
2103 for (
int x = 0;
x <
src->width;
x++) {
2107 for (
int x = 0;
x <
src->width;
x++) {
2111 src_data +=
src->bytes_per_line;
2112 dest_data +=
dst->bytes_per_line;
2115 for (
int y = 0;
y <
src->height;
y++) {
2124#define DITHER(p, d, m) ((uchar) ((((256 * (m) + (m) + 1)) * (p) + (d)) >> 16))
2136 src_data +=
src->bytes_per_line;
2137 dest_data +=
dst->bytes_per_line;
2143 const int trans = 216;
2145 dst->colortable[trans] = 0;
2150 for (
int y = 0;
y <
src->height;
y++) {
2151 for (
int x = 0;
x <
src->width ;
x++) {
2152 if (!(mask_data[
x>>3] & (0x80 >> (
x & 7))))
2153 dst_data[
x] = trans;
2155 mask_data +=
mask->bytes_per_line;
2156 dst_data +=
dst->bytes_per_line;
2158 dst->has_alpha_clut =
true;
2191 if (colorTable.size() == 0) {
2192 colorTable.resize(256);
2193 for (
int i=0;
i<256; ++
i)
2196 if (colorTable.size() < 256) {
2197 int tableSize = colorTable.size();
2198 colorTable.resize(256);
2200 for (
int i=tableSize;
i<256; ++
i)
2201 colorTable[
i] = fallbackColor;
2207 const QRgb *colorTablePtr = colorTable.constData();
2208 for (
int y = 0;
y <
src->height;
y++) {
2209 uint *
p =
reinterpret_cast<uint *
>(dest_data);
2210 const uchar *
b = src_data;
2214 *
p++ = colorTablePtr[*
b++];
2216 src_data +=
src->bytes_per_line;
2233 if (colorTable.size() < 2) {
2234 if (colorTable.size() == 0)
2235 colorTable << 0xff000000;
2236 colorTable << 0xffffffff;
2242 for (
int y = 0;
y < dest->
height;
y++) {
2244 for (
int x = 0;
x < dest->
width;
x++)
2245 *
p++ = colorTable.at((src_data[
x>>3] >> (7 - (
x & 7))) & 1);
2247 src_data +=
src->bytes_per_line;
2251 for (
int y = 0;
y < dest->
height;
y++) {
2253 for (
int x = 0;
x < dest->
width;
x++)
2254 *
p++ = colorTable.at((src_data[
x>>3] >> (
x & 7)) & 1);
2256 src_data +=
src->bytes_per_line;
2270 QList<QRgb> ctbl =
src->colortable;
2271 if (ctbl.size() > 2) {
2273 }
else if (ctbl.size() < 2) {
2274 if (ctbl.size() == 0)
2285 for (
int y = 0;
y < dest->
height;
y++) {
2287 for (
int x = 0;
x < dest->
width;
x++)
2288 *
p++ = (src_data[
x>>3] >> (7 - (
x & 7))) & 1;
2289 src_data +=
src->bytes_per_line;
2293 for (
int y = 0;
y < dest->
height;
y++) {
2295 for (
int x = 0;
x < dest->
width;
x++)
2296 *
p++ = (src_data[
x>>3] >> (
x & 7)) & 1;
2297 src_data +=
src->bytes_per_line;
2306 memcpy(dest->
data,
src->data,
src->bytes_per_line *
src->height);
2310 for (
int y = 0;
y <
src->height; ++
y) {
2311 memcpy(ddata, sdata,
src->width);
2312 sdata +=
src->bytes_per_line;
2324 const QList<QRgb> &
colors =
src->colortable;
2325 bool simpleCase = (
colors.size() == 256);
2326 for (
int i = 0;
i <
colors.size(); ++
i) {
2329 simpleCase = simpleCase && (
alpha ==
i);
2337 for (
int y = 0;
y <
src->height; ++
y) {
2338 for (
int x = 0;
x <
src->width; ++
x)
2340 sdata +=
src->bytes_per_line;
2352 const QList<QRgb> &
colors =
src->colortable;
2353 bool simpleCase = (
colors.size() == 256);
2354 for (
int i = 0;
i <
colors.size() && simpleCase; ++
i) {
2365 for (
int i = 0;
i <
colors.size(); ++
i) {
2372 for (
int y = 0;
y <
src->height; ++
y) {
2373 for (
int x = 0;
x <
src->width; ++
x)
2375 sdata +=
src->bytes_per_line;
2385 const QList<QRgb> &
colors =
data->colortable;
2386 if (
colors.size() != 256)
2388 for (
int i = 0;
i <
colors.size(); ++
i) {
2393 data->colortable.clear();
2404 const QList<QRgb> &
colors =
data->colortable;
2405 if (
colors.size() != 256)
2407 for (
int i = 0;
i <
colors.size(); ++
i) {
2412 data->colortable.clear();
2425 dest->
colortable = defaultColorTables->alpha;
2442 data->colortable = defaultColorTables->alpha;
2452 data->colortable = defaultColorTables->gray;
2458template <
bool SourceIsPremultiplied>
2470 for (
int y = 0;
y <
src->height; ++
y) {
2471 const QRgb *srcRgba =
reinterpret_cast<const QRgb *
>(src_data);
2472 uint *destCmyk =
reinterpret_cast<uint *
>(dest_data);
2474 for (
int x = 0;
x <
src->width; ++
x) {
2475 QRgb sourcePixel = srcRgba[
x];
2476 if constexpr (SourceIsPremultiplied)
2482 src_data +=
src->bytes_per_line;;
2610#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
2634 mask_alpha_converter_inplace<QImage::Format_ARGB32>;
2636 mask_alpha_converter_inplace<QImage::Format_ARGB32_Premultiplied>;
2639 mask_alpha_converter_inplace<QImage::Format_RGB32>;
2641 convert_ARGB_to_RGBA_inplace<QImage::Format_RGBX8888>;
2643 convert_ARGB_to_RGBA_inplace<QImage::Format_RGBA8888>;
2645 convert_ARGB_to_A2RGB30_inplace<PixelOrderBGR, false>;
2647 convert_ARGB_to_A2RGB30_inplace<PixelOrderRGB, false>;
2650 convert_ARGB_to_RGBA_inplace<QImage::Format_RGBA8888_Premultiplied>;
2656 convert_RGBA_to_ARGB_inplace<QImage::Format_RGB32>;
2658 convert_RGBA_to_ARGB_inplace<QImage::Format_ARGB32>;
2660 convert_RGBA_to_ARGB_inplace<QImage::Format_ARGB32_Premultiplied>;
2662 convert_passthrough_inplace<QImage::Format_RGBA8888>;
2664 convert_passthrough_inplace<QImage::Format_RGBA8888_Premultiplied>;
2667 convert_RGBA_to_ARGB_inplace<QImage::Format_RGB32>;
2669 convert_RGBA_to_ARGB_inplace<QImage::Format_ARGB32>;
2673 convert_ARGB_to_A2RGB30_inplace<PixelOrderBGR, true>;
2675 convert_ARGB_to_A2RGB30_inplace<PixelOrderRGB, true>;
2678 convert_RGBA_to_ARGB_inplace<QImage::Format_ARGB32_Premultiplied>;
2681 convert_passthrough_inplace<QImage::Format_A2BGR30_Premultiplied>;
2688 convert_A2RGB30_PM_to_ARGB_inplace<PixelOrderBGR, false>;
2690 convert_A2RGB30_PM_to_ARGB_inplace<PixelOrderBGR, true>;
2692 convert_A2RGB30_PM_to_RGB30_inplace<false>;
2694 convert_A2RGB30_PM_to_RGB30_inplace<true>;
2703 convert_passthrough_inplace<QImage::Format_A2RGB30_Premultiplied>;
2706 convert_A2RGB30_PM_to_ARGB_inplace<PixelOrderRGB, false>;
2708 convert_A2RGB30_PM_to_ARGB_inplace<PixelOrderRGB, true>;
2710 convert_A2RGB30_PM_to_RGB30_inplace<true>;
2714 convert_A2RGB30_PM_to_RGB30_inplace<false>;
2722 convert_passthrough_inplace<QImage::Format_RGBA64>;
2724 convert_passthrough_inplace<QImage::Format_RGBA64_Premultiplied>;
2733 convert_passthrough_inplace<QImage::Format_RGBA16FPx4>;
2735 convert_passthrough_inplace<QImage::Format_RGBA16FPx4_Premultiplied>;
2738 convert_passthrough_inplace<QImage::Format_RGBA32FPx4>;
2740 convert_passthrough_inplace<QImage::Format_RGBA32FPx4_Premultiplied>;
2743#if defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSSE3)
2755#if defined(__ARM_NEON__)
2762#if defined(__MIPS_DSPR2__)
static QCmyk32 fromRgba(QRgb rgba) noexcept
static const QColorSpacePrivate * get(const QColorSpace &colorSpace)
The QColorSpace class provides a color space abstraction.
bool isValid() const noexcept
Returns true if the color space is valid.
QRgb toLinear(QRgb rgb32) const
static QGuiApplicationPrivate * instance()
Format
The following image formats are available in Qt.
@ Format_RGBA32FPx4_Premultiplied
@ Format_RGBA64_Premultiplied
@ Format_RGBA8888_Premultiplied
@ Format_RGBA16FPx4_Premultiplied
@ Format_A2BGR30_Premultiplied
@ Format_ARGB32_Premultiplied
@ Format_A2RGB30_Premultiplied
void setAlpha(quint16 _alpha)
static constexpr QRgba64 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.
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()
QHash< int, QWidget * > hash
[35multi]
Combined button and popup list for selecting options.
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
static constexpr uint qt_div_257(uint x)
static uint BYTE_MUL(uint x, uint a)
const uint qt_bayer_matrix[16][16]
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
bool convert_generic_inplace_over_rgb64(QImageData *data, QImage::Format dst_format, Qt::ImageConversionFlags)
static void convert_RGB_to_Indexed8(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)
Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImageFormats]
void(QT_FASTCALL * Rgb888ToRgbConverter)(quint32 *dst, const uchar *src, int len)
static void convert_rgbswap_generic(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static const uchar bitflip[256]
static void convert_Mono_to_Indexed8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void swap_bit_order(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static bool convert_rgbswap_generic_inplace(QImageData *data, Qt::ImageConversionFlags)
static bool convert_ARGB_to_RGBA_inplace(QImageData *data, Qt::ImageConversionFlags)
static bool mask_alpha_converter_inplace(QImageData *data, Qt::ImageConversionFlags)
static void convert_Indexed8_to_Alpha8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_ARGB_to_A2RGB30(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
void qGamma_correct_back_to_linear_cs(QImage *image)
static void convert_ARGB_to_Indexed8(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)
static bool convert_RGBA64_to_RGBx64_inplace(QImageData *data, Qt::ImageConversionFlags)
static void convert_RGBA_to_ARGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void qInitImageConversions()
static bool convert_passthrough_inplace(QImageData *data, Qt::ImageConversionFlags)
static void convert_A2RGB30_PM_to_RGB30(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_RGBA16FPM_to_RGBA16F(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static bool convert_A2RGB30_PM_to_RGB30_inplace(QImageData *data, Qt::ImageConversionFlags)
static bool convert_RGBA_to_ARGB_inplace(QImageData *data, Qt::ImageConversionFlags)
static void convert_X_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)
static uint qUnpremultiplyRgb30(uint rgb30)
static void convert_Mono_to_X32(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_passthrough(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static QList< QRgb > fix_color_table(const QList< QRgb > &ctbl, QImage::Format format)
InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QImage::NImageFormats]
static bool convert_Indexed8_to_Grayscale8_inplace(QImageData *data, Qt::ImageConversionFlags)
static void mask_alpha_converter(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_ARGB_PM_to_Indexed8(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)
const uchar * qt_get_bitflip_array()
static bool convert_Indexed8_to_Alpha8_inplace(QImageData *data, Qt::ImageConversionFlags)
static void convert_gray16_to_RGBA64(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
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)
static bool convert_BGR30_to_A2RGB30_inplace(QImageData *data, Qt::ImageConversionFlags flags)
static bool convert_Alpha8_to_Indexed8_inplace(QImageData *data, Qt::ImageConversionFlags)
static void convert_ARGB_to_gray16(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgbx8888(quint32 *dest_data, const uchar *src_data, int len)
static bool convert_RGBA16FPM_to_RGBA16F_inplace(QImageData *data, Qt::ImageConversionFlags)
static void copy_8bit_pixels(QImageData *dest, const QImageData *src)
static void convert_Indexed8_to_Grayscale8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void QT_FASTCALL storeRGB32FromARGB32(uchar *dest, const uint *src, int index, int count, const QList< QRgb > *, QDitherInfo *)
static void convert_ARGB32_to_CMYK8888(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static bool convert_ARGB_to_A2RGB30_inplace(QImageData *data, Qt::ImageConversionFlags)
static void convert_ARGB_PM_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags)
static bool convert_A2RGB30_PM_to_ARGB_inplace(QImageData *data, Qt::ImageConversionFlags)
static void mask_alpha_converter_RGBx(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags flags)
static void convert_ARGB_to_RGBx(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
Q_CONSTRUCTOR_FUNCTION(qInitImageConversions)
static void convert_RGBA64_to_gray16(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static bool convert_Grayscale8_to_Indexed8_inplace(QImageData *data, Qt::ImageConversionFlags)
static const uint *QT_FASTCALL fetchRGB32ToARGB32PM(uint *buffer, const uchar *src, int index, int count, const QList< QRgb > *, QDitherInfo *)
static void convert_Alpha8_to_Indexed8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_ARGB_to_gray8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_Indexed8_to_X32(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_A2RGB30_PM_to_ARGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags flags)
Q_GUI_EXPORT void QT_FASTCALL qt_convert_rgb888_to_rgb32(quint32 *dest_data, const uchar *src_data, int len)
static bool mask_alpha_converter_rgbx_inplace(QImageData *data, Qt::ImageConversionFlags flags)
bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::ImageConversionFlags flags)
static void convert_ARGB32_to_RGBA64(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_RGBA64_to_gray8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_RGBA64_to_RGBx64(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_Grayscale8_to_Indexed8(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void QT_FASTCALL storeRGB32FromARGB32PM(uchar *dest, const uint *src, int index, int count, const QList< QRgb > *, QDitherInfo *)
static void convert_RGBA_to_RGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_RGB888_to_RGB(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_ARGB_to_RGBA(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
static void convert_RGBA64_to_ARGB32(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
void convert_RGB888_to_RGB32_mips_dspr2(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
bool convert_ARGB_to_ARGB_PM_inplace_mips_dspr2(QImageData *data, Qt::ImageConversionFlags)
int qt_depthForFormat(QImage::Format format)
bool(* InPlace_Image_Converter)(QImageData *data, Qt::ImageConversionFlags)
bool qt_highColorPrecision(QImage::Format format, bool opaque=false)
void(* Image_Converter)(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags)
constexpr QImage::Format qt_toPremultipliedFormat(QImage::Format format)
static ControlElement< T > * ptr(QWidget *widget)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLenum GLsizei const GLchar * buf
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
GLfloat GLfloat GLfloat GLfloat h
GLdouble GLdouble GLdouble GLdouble q
GLfloat GLfloat GLfloat alpha
GLenum GLenum GLsizei void * table
QPixelLayout qPixelLayouts[]
ConvertAndStorePixelsFunc64 qStoreFromRGBA64PM[]
void(QT_FASTCALL * RbSwapFunc)(uchar *dst, const uchar *src, int count)
static quint32 RGBA2ARGB(quint32 x)
const uint *(QT_FASTCALL * FetchAndConvertPixelsFunc)(uint *buffer, const uchar *src, int index, int count, const QList< QRgb > *clut, QDitherInfo *dither)
const QRgba64 *(QT_FASTCALL * FetchAndConvertPixelsFunc64)(QRgba64 *buffer, const uchar *src, int index, int count, const QList< QRgb > *clut, QDitherInfo *dither)
static quint32 ARGB2RGBA(quint32 x)
void(QT_FASTCALL * ConvertAndStorePixelsFuncFP)(uchar *dest, const QRgbaFloat32 *src, int index, int count, const QList< QRgb > *clut, QDitherInfo *dither)
const QRgbaFloat32 *(QT_FASTCALL * FetchAndConvertPixelsFuncFP)(QRgbaFloat32 *buffer, const uchar *src, int index, int count, const QList< QRgb > *clut, QDitherInfo *dither)
void(QT_FASTCALL * ConvertAndStorePixelsFunc)(uchar *dest, const uint *src, int index, int count, const QList< QRgb > *clut, QDitherInfo *dither)
void(QT_FASTCALL * ConvertAndStorePixelsFunc64)(uchar *dest, const QRgba64 *src, int index, int count, const QList< QRgb > *clut, QDitherInfo *dither)
uint qRgbSwapRgb30(uint c)
static QT_BEGIN_NAMESPACE const QRgb colors[][14]
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 qGray(int r, int g, int b)
QRgb qUnpremultiply(QRgb p)
constexpr QRgb qRgba(int r, int g, int b, int a)
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)
#define qCpuHasFeature(feature)
void gc(QV4::ExecutionEngine &engine, GCFlags flags)
static bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent, int *x, int *y)
static ImageSizeParameters calculateImageParameters(qsizetype width, qsizetype height, qsizetype depth)
static QImageData * create(const QSize &size, QImage::Format format)
FetchAndConvertPixelsFunc64 fetchToRGBA64PM
FetchAndConvertPixelsFunc fetchToARGB32PM