Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qblendfunctions.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// Qt-Security score:significant reason:default
4
5#include <qmath.h>
7
9
11{
12 inline uchar alpha(uchar src) const { return src; }
13 inline quint16 bytemul(quint16 spix) const { return spix; }
14};
15
16
18{
20 m_alpha255 = (m_alpha256 * 255) >> 8;
21 };
22 inline uchar alpha(uchar src) const { return (src * m_alpha256) >> 8; }
23 inline quint16 bytemul(quint16 x) const {
24 uint t = (((x & 0x07e0)*m_alpha255) >> 8) & 0x07e0;
25 t |= (((x & 0xf81f)*(m_alpha255>>2)) >> 6) & 0xf81f;
26 return t;
27 }
30};
31
32
33/************************************************************************
34 RGB16 (565) format target format
35 ************************************************************************/
36
38 inline void write(quint16 *dst, quint16 src) { *dst = src; }
39
40 inline void flush(void *) {}
41};
42
44 inline Blend_RGB16_on_RGB16_ConstAlpha(quint32 alpha) {
45 m_alpha = (alpha * 255) >> 8;
46 m_ialpha = 255 - m_alpha;
47 }
48
49 inline void write(quint16 *dst, quint16 src) {
50 *dst = BYTE_MUL_RGB16(src, m_alpha) + BYTE_MUL_RGB16(*dst, m_ialpha);
51 }
52
53 inline void flush(void *) {}
54
57};
58
60 inline void write(quint16 *dst, quint32 src) {
61 const quint8 alpha = qAlpha(src);
62 if (alpha) {
63 quint16 s = qConvertRgb32To16(src);
64 if (alpha < 255)
65 s += BYTE_MUL_RGB16(*dst, 255 - alpha);
66 *dst = s;
67 }
68 }
69
70 inline void flush(void *) {}
71};
72
75 m_alpha = (alpha * 255) >> 8;
76 }
77
78 inline void write(quint16 *dst, quint32 src) {
79 src = BYTE_MUL(src, m_alpha);
80 const quint8 alpha = qAlpha(src);
81 if (alpha) {
82 quint16 s = qConvertRgb32To16(src);
83 if (alpha < 255)
84 s += BYTE_MUL_RGB16(*dst, 255 - alpha);
85 *dst = s;
86 }
87 }
88
89 inline void flush(void *) {}
90
92};
93
94void qt_scale_image_rgb16_on_rgb16(uchar *destPixels, int dbpl,
95 const uchar *srcPixels, int sbpl, int srch,
96 const QRectF &targetRect,
97 const QRectF &sourceRect,
98 const QRect &clip,
99 int const_alpha)
100{
101#ifdef QT_DEBUG_DRAW
102 printf("qt_scale_rgb16_on_rgb16: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n",
103 destPixels, dbpl, srcPixels, sbpl,
104 targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(),
105 sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(),
106 const_alpha);
107#endif
108 if (const_alpha == 256) {
110 qt_scale_image_16bit<quint16>(destPixels, dbpl, srcPixels, sbpl, srch,
111 targetRect, sourceRect, clip, noAlpha);
112 } else {
113 Blend_RGB16_on_RGB16_ConstAlpha constAlpha(const_alpha);
114 qt_scale_image_16bit<quint16>(destPixels, dbpl, srcPixels, sbpl, srch,
115 targetRect, sourceRect, clip, constAlpha);
116 }
117}
118
119void qt_scale_image_argb32_on_rgb16(uchar *destPixels, int dbpl,
120 const uchar *srcPixels, int sbpl, int srch,
121 const QRectF &targetRect,
122 const QRectF &sourceRect,
123 const QRect &clip,
124 int const_alpha)
125{
126#ifdef QT_DEBUG_DRAW
127 printf("qt_scale_argb32_on_rgb16: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n",
128 destPixels, dbpl, srcPixels, sbpl,
129 targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(),
130 sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(),
131 const_alpha);
132#endif
133 if (const_alpha == 256) {
135 qt_scale_image_16bit<quint32>(destPixels, dbpl, srcPixels, sbpl, srch,
136 targetRect, sourceRect, clip, noAlpha);
137 } else {
138 Blend_ARGB32_on_RGB16_SourceAndConstAlpha constAlpha(const_alpha);
139 qt_scale_image_16bit<quint32>(destPixels, dbpl, srcPixels, sbpl, srch,
140 targetRect, sourceRect, clip, constAlpha);
141 }
142}
143
144void qt_blend_rgb16_on_rgb16(uchar *dst, int dbpl,
145 const uchar *src, int sbpl,
146 int w, int h,
147 int const_alpha)
148{
149#ifdef QT_DEBUG_DRAW
150 printf("qt_blend_rgb16_on_rgb16: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
151 dst, dbpl, src, sbpl, w, h, const_alpha);
152#endif
153
154 if (const_alpha == 256) {
155 int length = w << 1;
156 while (--h >= 0) {
157 memcpy(dst, src, length);
158 dst += dbpl;
159 src += sbpl;
160 }
161 } else if (const_alpha != 0) {
162 quint16 *d = (quint16 *) dst;
163 const quint16 *s = (const quint16 *) src;
164 quint8 a = (255 * const_alpha) >> 8;
165 quint8 ia = 255 - a;
166 while (--h >= 0) {
167 for (int x=0; x<w; ++x) {
168 d[x] = BYTE_MUL_RGB16(s[x], a) + BYTE_MUL_RGB16(d[x], ia);
169 }
170 d = (quint16 *)(((uchar *) d) + dbpl);
171 s = (const quint16 *)(((const uchar *) s) + sbpl);
172 }
173 }
174}
175
176
177void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl,
178 const uchar *srcPixels, int sbpl,
179 int w, int h,
180 int const_alpha)
181{
182 quint16 *dst = (quint16 *) destPixels;
183 const quint32 *src = (const quint32 *) srcPixels;
184
185 const_alpha = (const_alpha * 255) >> 8;
186 for (int y=0; y<h; ++y) {
187 for (int i = 0; i < w; ++i) {
188 uint s = src[i];
189 s = BYTE_MUL(s, const_alpha);
190 int alpha = qAlpha(s);
191 s = qConvertRgb32To16(s);
192 s += BYTE_MUL_RGB16(dst[i], 255 - alpha);
193 dst[i] = s;
194 }
195 dst = (quint16 *)(((uchar *) dst) + dbpl);
196 src = (const quint32 *)(((const uchar *) src) + sbpl);
197 }
198}
199
200static void qt_blend_argb32_on_rgb16(uchar *destPixels, int dbpl,
201 const uchar *srcPixels, int sbpl,
202 int w, int h,
203 int const_alpha)
204{
205 if (const_alpha != 256) {
206 qt_blend_argb32_on_rgb16_const_alpha(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
207 return;
208 }
209
210 quint16 *dst = (quint16 *) destPixels;
211 const quint32 *src = (const quint32 *) srcPixels;
212
213 for (int y=0; y<h; ++y) {
214 for (int x=0; x<w; ++x) {
215
216 quint32 spix = src[x];
217 quint32 alpha = spix >> 24;
218
219 if (alpha == 255) {
220 dst[x] = qConvertRgb32To16(spix);
221 } else if (alpha != 0) {
222 quint32 dpix = dst[x];
223
224 quint32 sia = 255 - alpha;
225
226 quint32 sr = (spix >> 8) & 0xf800;
227 quint32 sg = (spix >> 5) & 0x07e0;
228 quint32 sb = (spix >> 3) & 0x001f;
229
230 quint32 dr = (dpix & 0x0000f800);
231 quint32 dg = (dpix & 0x000007e0);
232 quint32 db = (dpix & 0x0000001f);
233
234 quint32 siar = dr * sia;
235 quint32 siag = dg * sia;
236 quint32 siab = db * sia;
237
238 quint32 rr = sr + ((siar + (siar>>8) + (0x80 << 8)) >> 8);
239 quint32 rg = sg + ((siag + (siag>>8) + (0x80 << 3)) >> 8);
240 quint32 rb = sb + ((siab + (siab>>8) + (0x80 >> 3)) >> 8);
241
242 dst[x] = (rr & 0xf800)
243 | (rg & 0x07e0)
244 | (rb);
245 }
246 }
247 dst = (quint16 *) (((uchar *) dst) + dbpl);
248 src = (const quint32 *) (((const uchar *) src) + sbpl);
249 }
250}
251
252
253static void qt_blend_rgb32_on_rgb16(uchar *destPixels, int dbpl,
254 const uchar *srcPixels, int sbpl,
255 int w, int h,
256 int const_alpha)
257{
258#ifdef QT_DEBUG_DRAW
259 printf("qt_blend_rgb32_on_rgb16: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
260 destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
261#endif
262
263 if (const_alpha != 256) {
264 qt_blend_argb32_on_rgb16(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
265 return;
266 }
267
268 const quint32 *src = (const quint32 *) srcPixels;
269 int srcExtraStride = (sbpl >> 2) - w;
270
271 int dstJPL = dbpl / 2;
272
273 quint16 *dst = (quint16 *) destPixels;
274 quint16 *dstEnd = dst + dstJPL * h;
275
276 int dstExtraStride = dstJPL - w;
277
278 while (dst < dstEnd) {
279 const quint32 *srcEnd = src + w;
280 while (src < srcEnd) {
281 *dst = qConvertRgb32To16(*src);
282 ++dst;
283 ++src;
284 }
285 dst += dstExtraStride;
286 src += srcExtraStride;
287 }
288}
289
290
291
292/************************************************************************
293 RGB32 (-888) format target format
294 ************************************************************************/
295
296static void qt_blend_argb32_on_argb32(uchar *destPixels, int dbpl,
297 const uchar *srcPixels, int sbpl,
298 int w, int h,
299 int const_alpha)
300{
301#ifdef QT_DEBUG_DRAW
302 fprintf(stdout, "qt_blend_argb32_on_argb32: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
303 destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
304 fflush(stdout);
305#endif
306
307 const uint *src = (const uint *) srcPixels;
308 uint *dst = (uint *) destPixels;
309 if (const_alpha == 256) {
310 for (int y=0; y<h; ++y) {
311 for (int x=0; x<w; ++x) {
312 uint s = src[x];
313 if (s >= 0xff000000)
314 dst[x] = s;
315 else if (s != 0)
316 dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
317 }
318 dst = (quint32 *)(((uchar *) dst) + dbpl);
319 src = (const quint32 *)(((const uchar *) src) + sbpl);
320 }
321 } else if (const_alpha != 0) {
322 const_alpha = (const_alpha * 255) >> 8;
323 for (int y=0; y<h; ++y) {
324 for (int x=0; x<w; ++x) {
325 uint s = BYTE_MUL(src[x], const_alpha);
326 dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s));
327 }
328 dst = (quint32 *)(((uchar *) dst) + dbpl);
329 src = (const quint32 *)(((const uchar *) src) + sbpl);
330 }
331 }
332}
333
334
335void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl,
336 const uchar *srcPixels, int sbpl,
337 int w, int h,
338 int const_alpha)
339{
340#ifdef QT_DEBUG_DRAW
341 fprintf(stdout, "qt_blend_rgb32_on_rgb32: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n",
342 destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha);
343 fflush(stdout);
344#endif
345 const uint *src = (const uint *) srcPixels;
346 uint *dst = (uint *) destPixels;
347 if (const_alpha == 256) {
348 const int len = w * 4;
349 for (int y = 0; y < h; ++y) {
350 memcpy(dst, src, len);
351 dst = (quint32 *)(((uchar *) dst) + dbpl);
352 src = (const quint32 *)(((const uchar *) src) + sbpl);
353 }
354 return;
355 } else if (const_alpha != 0) {
356 const_alpha = (const_alpha * 255) >> 8;
357 int ialpha = 255 - const_alpha;
358 for (int y=0; y<h; ++y) {
359 for (int x=0; x<w; ++x)
360 dst[x] = INTERPOLATE_PIXEL_255(dst[x], ialpha, src[x], const_alpha);
361 dst = (quint32 *)(((uchar *) dst) + dbpl);
362 src = (const quint32 *)(((const uchar *) src) + sbpl);
363 }
364 }
365}
366
368 inline void write(quint32 *dst, quint32 src) { *dst = src; }
369
370 inline void flush(void *) {}
371};
372
374 inline Blend_RGB32_on_RGB32_ConstAlpha(quint32 alpha) {
375 m_alpha = (alpha * 255) >> 8;
376 m_ialpha = 255 - m_alpha;
377 }
378
379 inline void write(quint32 *dst, quint32 src) {
380 *dst = INTERPOLATE_PIXEL_255(src, m_alpha, *dst, m_ialpha);
381 }
382
383 inline void flush(void *) {}
384
387};
388
390 inline void write(quint32 *dst, quint32 src)
391 {
392 blend_pixel(*dst, src);
393 }
394
395 inline void flush(void *) {}
396};
397
400 {
401 m_alpha = (alpha * 255) >> 8;
402 }
403
404 inline void write(quint32 *dst, quint32 src)
405 {
406 blend_pixel(*dst, src, m_alpha);
407 }
408
409 inline void flush(void *) {}
410
412};
413
414void qt_scale_image_rgb32_on_rgb32(uchar *destPixels, int dbpl,
415 const uchar *srcPixels, int sbpl, int srch,
416 const QRectF &targetRect,
417 const QRectF &sourceRect,
418 const QRect &clip,
419 int const_alpha)
420{
421#ifdef QT_DEBUG_DRAW
422 printf("qt_scale_rgb32_on_rgb32: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n",
423 destPixels, dbpl, srcPixels, sbpl,
424 targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(),
425 sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(),
426 const_alpha);
427#endif
428 if (const_alpha == 256) {
430 qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, srch,
431 targetRect, sourceRect, clip, noAlpha);
432 } else {
433 Blend_RGB32_on_RGB32_ConstAlpha constAlpha(const_alpha);
434 qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, srch,
435 targetRect, sourceRect, clip, constAlpha);
436 }
437}
438
439void qt_scale_image_argb32_on_argb32(uchar *destPixels, int dbpl,
440 const uchar *srcPixels, int sbpl, int srch,
441 const QRectF &targetRect,
442 const QRectF &sourceRect,
443 const QRect &clip,
444 int const_alpha)
445{
446#ifdef QT_DEBUG_DRAW
447 printf("qt_scale_argb32_on_argb32: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n",
448 destPixels, dbpl, srcPixels, sbpl,
449 targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(),
450 sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(),
451 const_alpha);
452#endif
453 if (const_alpha == 256) {
455 qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, srch,
456 targetRect, sourceRect, clip, sourceAlpha);
457 } else {
458 Blend_ARGB32_on_ARGB32_SourceAndConstAlpha constAlpha(const_alpha);
459 qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, srch,
460 targetRect, sourceRect, clip, constAlpha);
461 }
462}
463
464void qt_transform_image_rgb16_on_rgb16(uchar *destPixels, int dbpl,
465 const uchar *srcPixels, int sbpl,
466 const QRectF &targetRect,
467 const QRectF &sourceRect,
468 const QRect &clip,
469 const QTransform &targetRectTransform,
470 int const_alpha)
471{
472 if (const_alpha == 256) {
474 qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl,
475 reinterpret_cast<const quint16 *>(srcPixels), sbpl,
476 targetRect, sourceRect, clip, targetRectTransform, noAlpha);
477 } else {
478 Blend_RGB16_on_RGB16_ConstAlpha constAlpha(const_alpha);
479 qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl,
480 reinterpret_cast<const quint16 *>(srcPixels), sbpl,
481 targetRect, sourceRect, clip, targetRectTransform, constAlpha);
482 }
483}
484
485void qt_transform_image_argb32_on_rgb16(uchar *destPixels, int dbpl,
486 const uchar *srcPixels, int sbpl,
487 const QRectF &targetRect,
488 const QRectF &sourceRect,
489 const QRect &clip,
490 const QTransform &targetRectTransform,
491 int const_alpha)
492{
493 if (const_alpha == 256) {
495 qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl,
496 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
497 targetRect, sourceRect, clip, targetRectTransform, noAlpha);
498 } else {
499 Blend_ARGB32_on_RGB16_SourceAndConstAlpha constAlpha(const_alpha);
500 qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl,
501 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
502 targetRect, sourceRect, clip, targetRectTransform, constAlpha);
503 }
504}
505
506
507void qt_transform_image_rgb32_on_rgb32(uchar *destPixels, int dbpl,
508 const uchar *srcPixels, int sbpl,
509 const QRectF &targetRect,
510 const QRectF &sourceRect,
511 const QRect &clip,
512 const QTransform &targetRectTransform,
513 int const_alpha)
514{
515 if (const_alpha == 256) {
517 qt_transform_image(reinterpret_cast<quint32 *>(destPixels), dbpl,
518 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
519 targetRect, sourceRect, clip, targetRectTransform, noAlpha);
520 } else {
521 Blend_RGB32_on_RGB32_ConstAlpha constAlpha(const_alpha);
522 qt_transform_image(reinterpret_cast<quint32 *>(destPixels), dbpl,
523 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
524 targetRect, sourceRect, clip, targetRectTransform, constAlpha);
525 }
526}
527
528void qt_transform_image_argb32_on_argb32(uchar *destPixels, int dbpl,
529 const uchar *srcPixels, int sbpl,
530 const QRectF &targetRect,
531 const QRectF &sourceRect,
532 const QRect &clip,
533 const QTransform &targetRectTransform,
534 int const_alpha)
535{
536 if (const_alpha == 256) {
538 qt_transform_image(reinterpret_cast<quint32 *>(destPixels), dbpl,
539 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
540 targetRect, sourceRect, clip, targetRectTransform, sourceAlpha);
541 } else {
542 Blend_ARGB32_on_ARGB32_SourceAndConstAlpha constAlpha(const_alpha);
543 qt_transform_image(reinterpret_cast<quint32 *>(destPixels), dbpl,
544 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
545 targetRect, sourceRect, clip, targetRectTransform, constAlpha);
546 }
547}
548
549SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats];
550SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats];
551SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats];
552
554{
555 qScaleFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_scale_image_rgb32_on_rgb32;
556 qScaleFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32;
557 qScaleFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_scale_image_rgb32_on_rgb32;
558 qScaleFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32;
559 qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16;
560 qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16;
561#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
562 qScaleFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_scale_image_rgb32_on_rgb32;
563 qScaleFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_scale_image_argb32_on_argb32;
564 qScaleFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_scale_image_rgb32_on_rgb32;
565 qScaleFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_scale_image_argb32_on_argb32;
566#endif
567
568 qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32;
569 qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32;
570 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32;
571 qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32;
572 qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb16;
573 qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16;
574 qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16;
575#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
576 qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32;
577 qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32;
578 qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32;
579 qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32;
580#endif
581
582 qTransformFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_transform_image_rgb32_on_rgb32;
583 qTransformFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_argb32;
584 qTransformFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_transform_image_rgb32_on_rgb32;
585 qTransformFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_argb32;
586 qTransformFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_rgb16;
587 qTransformFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_transform_image_rgb16_on_rgb16;
588#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
589 qTransformFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_transform_image_rgb32_on_rgb32;
590 qTransformFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_transform_image_argb32_on_argb32;
591 qTransformFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_transform_image_rgb32_on_rgb32;
592 qTransformFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_transform_image_argb32_on_argb32;
593#endif
594}
595
596QT_END_NAMESPACE
Combined button and popup list for selecting options.
SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]
void qt_scale_image_argb32_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int srch, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, int const_alpha)
static void qt_blend_argb32_on_argb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
void qInitBlendFunctions()
void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
static void qt_blend_rgb32_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]
void qt_transform_image_rgb32_on_rgb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
void qt_scale_image_argb32_on_argb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int srch, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, int const_alpha)
void qt_transform_image_argb32_on_argb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
void qt_transform_image_rgb16_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
void qt_transform_image_argb32_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
void qt_scale_image_rgb16_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int srch, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, int const_alpha)
void qt_scale_image_rgb32_on_rgb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int srch, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, int const_alpha)
SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]
void qt_blend_rgb16_on_rgb16(uchar *dst, int dbpl, const uchar *src, int sbpl, int w, int h, int const_alpha)
static void qt_blend_argb32_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
void(* SrcOverBlendFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, int w, int h, int const_alpha)
void(* SrcOverScaleFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, int srch, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clipRect, int const_alpha)
void(* SrcOverTransformFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clipRect, const QTransform &targetRectTransform, int const_alpha)
void write(quint32 *dst, quint32 src)
void write(quint32 *dst, quint32 src)
void write(quint16 *dst, quint32 src)
void write(quint16 *dst, quint32 src)
void write(quint16 *dst, quint16 src)
void write(quint16 *dst, quint16 src)
void write(quint32 *dst, quint32 src)
void write(quint32 *dst, quint32 src)
quint16 bytemul(quint16 x) const
uchar alpha(uchar src) const
quint16 bytemul(quint16 spix) const
uchar alpha(uchar src) const