OpenCoverage

qcompositionfunctions.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qcompositionfunctions.cpp
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtGui module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#include <qglobal.h>-
41#include <private/qdrawhelper_p.h>-
42#include <private/qrgba64_p.h>-
43-
44QT_BEGIN_NAMESPACE-
45-
46# define PRELOAD_INIT(x)-
47# define PRELOAD_INIT2(x,y)-
48# define PRELOAD_COND(x)-
49# define PRELOAD_COND2(x,y)-
50-
51/* The constant alpha factor describes an alpha factor that gets applied-
52 to the result of the composition operation combining it with the destination.-
53-
54 The intent is that if const_alpha == 0. we get back dest, and if const_alpha == 1.-
55 we get the unmodified operation-
56-
57 result = src op dest-
58 dest = result * const_alpha + dest * (1. - const_alpha)-
59-
60 This means that in the comments below, the first line is the const_alpha==255 case, the-
61 second line the general one.-
62-
63 In the lines below:-
64 s == src, sa == alpha(src), sia = 1 - alpha(src)-
65 d == dest, da == alpha(dest), dia = 1 - alpha(dest)-
66 ca = const_alpha, cia = 1 - const_alpha-
67-
68 The methods exist in two variants. One where we have a constant source, the other-
69 where the source is an array of pixels.-
70*/-
71-
72/*-
73 result = 0-
74 d = d * cia-
75*/-
76#define comp_func_Clear_impl(dest, length, const_alpha)\-
77{\-
78 if (const_alpha == 255) {\-
79 QT_MEMFILL_UINT(dest, length, 0);\-
80 } else {\-
81 int ialpha = 255 - const_alpha;\-
82 PRELOAD_INIT(dest)\-
83 for (int i = 0; i < length; ++i) {\-
84 PRELOAD_COND(dest)\-
85 dest[i] = BYTE_MUL(dest[i], ialpha);\-
86 }\-
87 }\-
88}-
89-
90void QT_FASTCALL comp_func_solid_Clear(uint *dest, int length, uint, uint const_alpha)-
91{-
92 comp_func_Clear_impl(dest, length, const_alpha);
never executed: end of block
never executed: end of block
never executed: end of block
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
93}-
94-
95void QT_FASTCALL comp_func_solid_Clear_rgb64(QRgba64 *dest, int length, QRgba64, uint const_alpha)-
96{-
97 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
98 qt_memfill64((quint64*)dest, 0, length);
never executed: qt_memfill64((quint64*)dest, 0, length);
0
99 else {-
100 int ialpha = 255 - const_alpha;-
101 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
102 dest[i] = multiplyAlpha255(dest[i], ialpha);-
103 }
never executed: end of block
0
104 }
never executed: end of block
0
105}-
106-
107void QT_FASTCALL comp_func_Clear(uint *dest, const uint *, int length, uint const_alpha)-
108{-
109 comp_func_Clear_impl(dest, length, const_alpha);
never executed: end of block
never executed: end of block
never executed: end of block
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
110}-
111-
112void QT_FASTCALL comp_func_Clear_rgb64(QRgba64 *dest, const QRgba64 *, int length, uint const_alpha)-
113{-
114 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
115 qt_memfill64((quint64*)dest, 0, length);
never executed: qt_memfill64((quint64*)dest, 0, length);
0
116 else {-
117 int ialpha = 255 - const_alpha;-
118 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
119 dest[i] = multiplyAlpha255(dest[i], ialpha);-
120 }
never executed: end of block
0
121 }
never executed: end of block
0
122}-
123-
124/*-
125 result = s-
126 dest = s * ca + d * cia-
127*/-
128void QT_FASTCALL comp_func_solid_Source(uint *dest, int length, uint color, uint const_alpha)-
129{-
130 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
131 QT_MEMFILL_UINT(dest, length, color);-
132 } else {
never executed: end of block
0
133 int ialpha = 255 - const_alpha;-
134 color = BYTE_MUL(color, const_alpha);-
135 PRELOAD_INIT(dest)-
136 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
137 PRELOAD_COND(dest)-
138 dest[i] = color + BYTE_MUL(dest[i], ialpha);-
139 }
never executed: end of block
0
140 }
never executed: end of block
0
141}-
142-
143void QT_FASTCALL comp_func_solid_Source_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
144{-
145 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
146 qt_memfill64((quint64*)dest, color, length);
never executed: qt_memfill64((quint64*)dest, color, length);
0
147 else {-
148 int ialpha = 255 - const_alpha;-
149 color = multiplyAlpha255(color, const_alpha);-
150 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
151 dest[i] = color + multiplyAlpha255(dest[i], ialpha);-
152 }
never executed: end of block
0
153 }
never executed: end of block
0
154}-
155-
156void QT_FASTCALL comp_func_Source(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
157{-
158 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
159 ::memcpy(dest, src, length * sizeof(uint));-
160 } else {
never executed: end of block
0
161 int ialpha = 255 - const_alpha;-
162 PRELOAD_INIT2(dest, src)-
163 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
164 PRELOAD_COND2(dest, src)-
165 dest[i] = INTERPOLATE_PIXEL_255(src[i], const_alpha, dest[i], ialpha);-
166 }
never executed: end of block
0
167 }
never executed: end of block
0
168}-
169-
170void QT_FASTCALL comp_func_Source_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
171{-
172 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
173 ::memcpy(dest, src, length * sizeof(quint64));
never executed: ::memcpy(dest, src, length * sizeof(quint64));
0
174 else {-
175 int ialpha = 255 - const_alpha;-
176 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
177 dest[i] = interpolate255(src[i], const_alpha, dest[i], ialpha);-
178 }
never executed: end of block
0
179 }
never executed: end of block
0
180}-
181-
182void QT_FASTCALL comp_func_solid_Destination(uint *, int, uint, uint)-
183{-
184}-
185-
186void QT_FASTCALL comp_func_solid_Destination_rgb64(QRgba64 *, int, QRgba64, uint)-
187{-
188}-
189-
190void QT_FASTCALL comp_func_Destination(uint *, const uint *, int, uint)-
191{-
192}-
193-
194void QT_FASTCALL comp_func_Destination_rgb64(QRgba64 *, const QRgba64 *, int, uint)-
195{-
196}-
197-
198/*-
199 result = s + d * sia-
200 dest = (s + d * sia) * ca + d * cia-
201 = s * ca + d * (sia * ca + cia)-
202 = s * ca + d * (1 - sa*ca)-
203*/-
204void QT_FASTCALL comp_func_solid_SourceOver(uint *dest, int length, uint color, uint const_alpha)-
205{-
206 if ((const_alpha & qAlpha(color)) == 255) {
(const_alpha &...color)) == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
207 QT_MEMFILL_UINT(dest, length, color);-
208 } else {
never executed: end of block
0
209 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
210 color = BYTE_MUL(color, const_alpha);
never executed: color = BYTE_MUL(color, const_alpha);
0
211 PRELOAD_INIT(dest)-
212 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
213 PRELOAD_COND(dest)-
214 dest[i] = color + BYTE_MUL(dest[i], qAlpha(~color));-
215 }
never executed: end of block
0
216 }
never executed: end of block
0
217}-
218-
219void QT_FASTCALL comp_func_solid_SourceOver_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
220{-
221 if (const_alpha == 255 && color.isOpaque()) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
color.isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
0
222 qt_memfill64((quint64*)dest, color, length);-
223 } else {
never executed: end of block
0
224 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
225 color = multiplyAlpha255(color, const_alpha);
never executed: color = multiplyAlpha255(color, const_alpha);
0
226 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
227 dest[i] = color + multiplyAlpha65535(dest[i], 65535 - color.alpha());-
228 }
never executed: end of block
0
229 }
never executed: end of block
0
230}-
231-
232void QT_FASTCALL comp_func_SourceOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
233{-
234 PRELOAD_INIT2(dest, src)-
235 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
236 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
237 PRELOAD_COND2(dest, src)-
238 uint s = src[i];-
239 if (s >= 0xff000000)
s >= 0xff000000Description
TRUEnever evaluated
FALSEnever evaluated
0
240 dest[i] = s;
never executed: dest[i] = s;
0
241 else if (s != 0)
s != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
242 dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));
never executed: dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));
0
243 }
never executed: end of block
0
244 } else {
never executed: end of block
0
245 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
246 PRELOAD_COND2(dest, src)-
247 uint s = BYTE_MUL(src[i], const_alpha);-
248 dest[i] = s + BYTE_MUL(dest[i], qAlpha(~s));-
249 }
never executed: end of block
0
250 }
never executed: end of block
0
251}-
252-
253void QT_FASTCALL comp_func_SourceOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
254{-
255 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
256 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
257 QRgba64 s = src[i];-
258 if (s.isOpaque())
s.isOpaque()Description
TRUEnever evaluated
FALSEnever evaluated
0
259 dest[i] = s;
never executed: dest[i] = s;
0
260 else if (!s.isTransparent())
!s.isTransparent()Description
TRUEnever evaluated
FALSEnever evaluated
0
261 dest[i] = s + multiplyAlpha65535(dest[i], 65535 - s.alpha());
never executed: dest[i] = s + multiplyAlpha65535(dest[i], 65535 - s.alpha());
0
262 }
never executed: end of block
0
263 } else {
never executed: end of block
0
264 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
265 QRgba64 s = multiplyAlpha255(src[i], const_alpha);-
266 dest[i] = s + multiplyAlpha65535(dest[i], 65535 - s.alpha());-
267 }
never executed: end of block
0
268 }
never executed: end of block
0
269}-
270-
271/*-
272 result = d + s * dia-
273 dest = (d + s * dia) * ca + d * cia-
274 = d + s * dia * ca-
275*/-
276void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest, int length, uint color, uint const_alpha)-
277{-
278 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
279 color = BYTE_MUL(color, const_alpha);
never executed: color = BYTE_MUL(color, const_alpha);
0
280 PRELOAD_INIT(dest)-
281 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
282 PRELOAD_COND(dest)-
283 uint d = dest[i];-
284 dest[i] = d + BYTE_MUL(color, qAlpha(~d));-
285 }
never executed: end of block
0
286}
never executed: end of block
0
287-
288void QT_FASTCALL comp_func_solid_DestinationOver_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
289{-
290 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
291 color = multiplyAlpha255(color, const_alpha);
never executed: color = multiplyAlpha255(color, const_alpha);
0
292 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
293 QRgba64 d = dest[i];-
294 dest[i] = d + multiplyAlpha65535(color, 65535 - d.alpha());-
295 }
never executed: end of block
0
296}
never executed: end of block
0
297-
298void QT_FASTCALL comp_func_DestinationOver(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
299{-
300 PRELOAD_INIT2(dest, src)-
301 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
302 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
303 PRELOAD_COND2(dest, src)-
304 uint d = dest[i];-
305 dest[i] = d + BYTE_MUL(src[i], qAlpha(~d));-
306 }
never executed: end of block
0
307 } else {
never executed: end of block
0
308 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
309 PRELOAD_COND2(dest, src)-
310 uint d = dest[i];-
311 uint s = BYTE_MUL(src[i], const_alpha);-
312 dest[i] = d + BYTE_MUL(s, qAlpha(~d));-
313 }
never executed: end of block
0
314 }
never executed: end of block
0
315}-
316-
317void QT_FASTCALL comp_func_DestinationOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
318{-
319 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
320 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
321 QRgba64 d = dest[i];-
322 dest[i] = d + multiplyAlpha65535(src[i], 65535 - d.alpha());-
323 }
never executed: end of block
0
324 } else {
never executed: end of block
0
325 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
326 QRgba64 d = dest[i];-
327 QRgba64 s = multiplyAlpha255(src[i], const_alpha);-
328 dest[i] = d + multiplyAlpha65535(s, 65535 - d.alpha());-
329 }
never executed: end of block
0
330 }
never executed: end of block
0
331}-
332-
333/*-
334 result = s * da-
335 dest = s * da * ca + d * cia-
336*/-
337void QT_FASTCALL comp_func_solid_SourceIn(uint *dest, int length, uint color, uint const_alpha)-
338{-
339 PRELOAD_INIT(dest)-
340 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
341 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
342 PRELOAD_COND(dest)-
343 dest[i] = BYTE_MUL(color, qAlpha(dest[i]));-
344 }
never executed: end of block
0
345 } else {
never executed: end of block
0
346 color = BYTE_MUL(color, const_alpha);-
347 uint cia = 255 - const_alpha;-
348 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
349 PRELOAD_COND(dest)-
350 uint d = dest[i];-
351 dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(d), d, cia);-
352 }
never executed: end of block
0
353 }
never executed: end of block
0
354}-
355-
356void QT_FASTCALL comp_func_solid_SourceIn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
357{-
358 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
359 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
360 dest[i] = multiplyAlpha65535(color, dest[i].alpha());-
361 }
never executed: end of block
0
362 } else {
never executed: end of block
0
363 uint ca = const_alpha * 257;-
364 uint cia = 65535 - ca;-
365 color = multiplyAlpha65535(color, ca);-
366 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
367 QRgba64 d = dest[i];-
368 dest[i] = interpolate65535(color, d.alpha(), d, cia);-
369 }
never executed: end of block
0
370 }
never executed: end of block
0
371}-
372-
373void QT_FASTCALL comp_func_SourceIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
374{-
375 PRELOAD_INIT2(dest, src)-
376 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
377 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
378 PRELOAD_COND2(dest, src)-
379 dest[i] = BYTE_MUL(src[i], qAlpha(dest[i]));-
380 }
never executed: end of block
0
381 } else {
never executed: end of block
0
382 uint cia = 255 - const_alpha;-
383 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
384 PRELOAD_COND2(dest, src)-
385 uint d = dest[i];-
386 uint s = BYTE_MUL(src[i], const_alpha);-
387 dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, cia);-
388 }
never executed: end of block
0
389 }
never executed: end of block
0
390}-
391-
392void QT_FASTCALL comp_func_SourceIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
393{-
394 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
395 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
396 dest[i] = multiplyAlpha65535(src[i], dest[i].alpha());-
397 }
never executed: end of block
0
398 } else {
never executed: end of block
0
399 uint ca = const_alpha * 257;-
400 uint cia = 65535 - ca;-
401 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
402 QRgba64 d = dest[i];-
403 QRgba64 s = multiplyAlpha65535(src[i], ca);-
404 dest[i] = interpolate65535(s, d.alpha(), d, cia);-
405 }
never executed: end of block
0
406 }
never executed: end of block
0
407}-
408-
409/*-
410 result = d * sa-
411 dest = d * sa * ca + d * cia-
412 = d * (sa * ca + cia)-
413*/-
414void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest, int length, uint color, uint const_alpha)-
415{-
416 uint a = qAlpha(color);-
417 if (const_alpha != 255) {
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
418 a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;-
419 }
never executed: end of block
0
420 PRELOAD_INIT(dest)-
421 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
422 PRELOAD_COND(dest)-
423 dest[i] = BYTE_MUL(dest[i], a);-
424 }
never executed: end of block
0
425}
never executed: end of block
0
426-
427void QT_FASTCALL comp_func_solid_DestinationIn_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
428{-
429 uint a = color.alpha();-
430 uint ca64k = const_alpha * 257;-
431 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
432 a = qt_div_65535(a * ca64k) + 65535 - ca64k;
never executed: a = qt_div_65535(a * ca64k) + 65535 - ca64k;
0
433 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
434 dest[i] = multiplyAlpha65535(dest[i], a);-
435 }
never executed: end of block
0
436}
never executed: end of block
0
437-
438void QT_FASTCALL comp_func_DestinationIn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
439{-
440 PRELOAD_INIT2(dest, src)-
441 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
442 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
443 PRELOAD_COND2(dest, src)-
444 dest[i] = BYTE_MUL(dest[i], qAlpha(src[i]));-
445 }
never executed: end of block
0
446 } else {
never executed: end of block
0
447 int cia = 255 - const_alpha;-
448 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
449 PRELOAD_COND2(dest, src)-
450 uint a = BYTE_MUL(qAlpha(src[i]), const_alpha) + cia;-
451 dest[i] = BYTE_MUL(dest[i], a);-
452 }
never executed: end of block
0
453 }
never executed: end of block
0
454}-
455-
456void QT_FASTCALL comp_func_DestinationIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
457{-
458 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
459 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
460 dest[i] = multiplyAlpha65535(dest[i], src[i].alpha());-
461 }
never executed: end of block
0
462 } else {
never executed: end of block
0
463 uint ca = const_alpha * 257;-
464 uint cia = 65535 - ca;-
465 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
466 uint a = qt_div_65535(src[i].alpha() * ca) + cia;-
467 dest[i] = multiplyAlpha65535(dest[i], a);-
468 }
never executed: end of block
0
469 }
never executed: end of block
0
470}-
471-
472/*-
473 result = s * dia-
474 dest = s * dia * ca + d * cia-
475*/-
476-
477void QT_FASTCALL comp_func_solid_SourceOut(uint *dest, int length, uint color, uint const_alpha)-
478{-
479 PRELOAD_INIT(dest)-
480 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
481 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
482 PRELOAD_COND(dest)-
483 dest[i] = BYTE_MUL(color, qAlpha(~dest[i]));-
484 }
never executed: end of block
0
485 } else {
never executed: end of block
0
486 color = BYTE_MUL(color, const_alpha);-
487 int cia = 255 - const_alpha;-
488 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
489 PRELOAD_COND(dest)-
490 uint d = dest[i];-
491 dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, cia);-
492 }
never executed: end of block
0
493 }
never executed: end of block
0
494}-
495-
496void QT_FASTCALL comp_func_solid_SourceOut_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
497{-
498 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
499 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
500 dest[i] = multiplyAlpha65535(color, 65535 - dest[i].alpha());-
501 }
never executed: end of block
0
502 } else {
never executed: end of block
0
503 uint ca = const_alpha * 257;-
504 uint cia = 65535 - ca;-
505 color = multiplyAlpha65535(color, ca);-
506 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
507 QRgba64 d = dest[i];-
508 dest[i] = interpolate65535(color, 65535 - d.alpha(), d, cia);-
509 }
never executed: end of block
0
510 }
never executed: end of block
0
511}-
512-
513void QT_FASTCALL comp_func_SourceOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
514{-
515 PRELOAD_INIT2(dest, src)-
516 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
517 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
518 PRELOAD_COND2(dest, src)-
519 dest[i] = BYTE_MUL(src[i], qAlpha(~dest[i]));-
520 }
never executed: end of block
0
521 } else {
never executed: end of block
0
522 int cia = 255 - const_alpha;-
523 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
524 PRELOAD_COND2(dest, src)-
525 uint s = BYTE_MUL(src[i], const_alpha);-
526 uint d = dest[i];-
527 dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, cia);-
528 }
never executed: end of block
0
529 }
never executed: end of block
0
530}-
531-
532void QT_FASTCALL comp_func_SourceOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
533{-
534 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
535 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
536 dest[i] = multiplyAlpha65535(src[i], 65535 - dest[i].alpha());-
537 }
never executed: end of block
0
538 } else {
never executed: end of block
0
539 uint ca = const_alpha * 257;-
540 uint cia = 65535 - ca;-
541 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
542 QRgba64 d = dest[i];-
543 QRgba64 s = multiplyAlpha65535(src[i], ca);-
544 dest[i] = interpolate65535(s, 65535 - d.alpha(), d, cia);-
545 }
never executed: end of block
0
546 }
never executed: end of block
0
547}-
548-
549/*-
550 result = d * sia-
551 dest = d * sia * ca + d * cia-
552 = d * (sia * ca + cia)-
553*/-
554void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest, int length, uint color, uint const_alpha)-
555{-
556 uint a = qAlpha(~color);-
557 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
558 a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
never executed: a = BYTE_MUL(a, const_alpha) + 255 - const_alpha;
0
559 PRELOAD_INIT(dest)-
560 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
561 PRELOAD_COND(dest)-
562 dest[i] = BYTE_MUL(dest[i], a);-
563 }
never executed: end of block
0
564}
never executed: end of block
0
565-
566void QT_FASTCALL comp_func_solid_DestinationOut_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
567{-
568 uint a = 65535 - color.alpha();-
569 uint ca64k = const_alpha * 257;-
570 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
571 a = qt_div_65535(a * ca64k) + 65535 - ca64k;
never executed: a = qt_div_65535(a * ca64k) + 65535 - ca64k;
0
572 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
573 dest[i] = multiplyAlpha65535(dest[i], a);-
574 }
never executed: end of block
0
575}
never executed: end of block
0
576-
577void QT_FASTCALL comp_func_DestinationOut(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
578{-
579 PRELOAD_INIT2(dest, src)-
580 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
581 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
582 PRELOAD_COND2(dest, src)-
583 dest[i] = BYTE_MUL(dest[i], qAlpha(~src[i]));-
584 }
never executed: end of block
0
585 } else {
never executed: end of block
0
586 int cia = 255 - const_alpha;-
587 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
588 PRELOAD_COND2(dest, src)-
589 uint sia = BYTE_MUL(qAlpha(~src[i]), const_alpha) + cia;-
590 dest[i] = BYTE_MUL(dest[i], sia);-
591 }
never executed: end of block
0
592 }
never executed: end of block
0
593}-
594-
595void QT_FASTCALL comp_func_DestinationOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
596{-
597 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
598 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
599 dest[i] = multiplyAlpha65535(dest[i], 65535 - src[i].alpha());-
600 }
never executed: end of block
0
601 } else {
never executed: end of block
0
602 uint ca = const_alpha * 257;-
603 uint cia = 65535 - ca;-
604 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
605 uint a = qt_div_65535((65535 - src[i].alpha()) * ca) + cia;-
606 dest[i] = multiplyAlpha65535(dest[i], a);-
607 }
never executed: end of block
0
608 }
never executed: end of block
0
609}-
610-
611/*-
612 result = s*da + d*sia-
613 dest = s*da*ca + d*sia*ca + d *cia-
614 = s*ca * da + d * (sia*ca + cia)-
615 = s*ca * da + d * (1 - sa*ca)-
616*/-
617void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest, int length, uint color, uint const_alpha)-
618{-
619 if (const_alpha != 255) {
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
620 color = BYTE_MUL(color, const_alpha);-
621 }
never executed: end of block
0
622 uint sia = qAlpha(~color);-
623 PRELOAD_INIT(dest)-
624 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
625 PRELOAD_COND(dest)-
626 dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(dest[i]), dest[i], sia);-
627 }
never executed: end of block
0
628}
never executed: end of block
0
629-
630void QT_FASTCALL comp_func_solid_SourceAtop_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
631{-
632 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
633 color = multiplyAlpha255(color, const_alpha);
never executed: color = multiplyAlpha255(color, const_alpha);
0
634 uint sia = 65535 - color.alpha();-
635 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
636 dest[i] = interpolate65535(color, dest[i].alpha(), dest[i], sia);-
637 }
never executed: end of block
0
638}
never executed: end of block
0
639-
640void QT_FASTCALL comp_func_SourceAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
641{-
642 PRELOAD_INIT2(dest, src)-
643 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
644 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
645 PRELOAD_COND2(dest, src)-
646 uint s = src[i];-
647 uint d = dest[i];-
648 dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));-
649 }
never executed: end of block
0
650 } else {
never executed: end of block
0
651 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
652 PRELOAD_COND2(dest, src)-
653 uint s = BYTE_MUL(src[i], const_alpha);-
654 uint d = dest[i];-
655 dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(d), d, qAlpha(~s));-
656 }
never executed: end of block
0
657 }
never executed: end of block
0
658}-
659-
660void QT_FASTCALL comp_func_SourceAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
661{-
662 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
663 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
664 QRgba64 s = src[i];-
665 QRgba64 d = dest[i];-
666 dest[i] = interpolate65535(s, d.alpha(), d, 65535 - s.alpha());-
667 }
never executed: end of block
0
668 } else {
never executed: end of block
0
669 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
670 QRgba64 s = multiplyAlpha255(src[i], const_alpha);-
671 QRgba64 d = dest[i];-
672 dest[i] = interpolate65535(s, d.alpha(), d, 65535 - s.alpha());-
673 }
never executed: end of block
0
674 }
never executed: end of block
0
675}-
676-
677/*-
678 result = d*sa + s*dia-
679 dest = d*sa*ca + s*dia*ca + d *cia-
680 = s*ca * dia + d * (sa*ca + cia)-
681*/-
682void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest, int length, uint color, uint const_alpha)-
683{-
684 uint a = qAlpha(color);-
685 if (const_alpha != 255) {
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
686 color = BYTE_MUL(color, const_alpha);-
687 a = qAlpha(color) + 255 - const_alpha;-
688 }
never executed: end of block
0
689 PRELOAD_INIT(dest)-
690 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
691 PRELOAD_COND(dest)-
692 uint d = dest[i];-
693 dest[i] = INTERPOLATE_PIXEL_255(d, a, color, qAlpha(~d));-
694 }
never executed: end of block
0
695}
never executed: end of block
0
696-
697void QT_FASTCALL comp_func_solid_DestinationAtop_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
698{-
699 uint a = color.alpha();-
700 if (const_alpha != 255) {
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
701 color = multiplyAlpha255(color, const_alpha);-
702 a = color.alpha() + 65535 - (const_alpha * 257);-
703 }
never executed: end of block
0
704 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
705 QRgba64 d = dest[i];-
706 dest[i] = interpolate65535(d, a, color, 65535 - d.alpha());-
707 }
never executed: end of block
0
708}
never executed: end of block
0
709-
710void QT_FASTCALL comp_func_DestinationAtop(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
711{-
712 PRELOAD_INIT2(dest, src)-
713 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
714 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
715 PRELOAD_COND2(dest, src)-
716 uint s = src[i];-
717 uint d = dest[i];-
718 dest[i] = INTERPOLATE_PIXEL_255(d, qAlpha(s), s, qAlpha(~d));-
719 }
never executed: end of block
0
720 } else {
never executed: end of block
0
721 int cia = 255 - const_alpha;-
722 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
723 PRELOAD_COND2(dest, src)-
724 uint s = BYTE_MUL(src[i], const_alpha);-
725 uint d = dest[i];-
726 uint a = qAlpha(s) + cia;-
727 dest[i] = INTERPOLATE_PIXEL_255(d, a, s, qAlpha(~d));-
728 }
never executed: end of block
0
729 }
never executed: end of block
0
730}-
731-
732void QT_FASTCALL comp_func_DestinationAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
733{-
734 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
735 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
736 QRgba64 s = src[i];-
737 QRgba64 d = dest[i];-
738 dest[i] = interpolate65535(d, s.alpha(), s, 65535 - d.alpha());-
739 }
never executed: end of block
0
740 } else {
never executed: end of block
0
741 int ca = const_alpha * 257;-
742 int cia = 65535 - ca;-
743 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
744 QRgba64 s = multiplyAlpha65535(src[i], ca);-
745 QRgba64 d = dest[i];-
746 uint a = s.alpha() + cia;-
747 dest[i] = interpolate65535(d, a, s, 65535 - d.alpha());-
748 }
never executed: end of block
0
749 }
never executed: end of block
0
750}-
751-
752/*-
753 result = d*sia + s*dia-
754 dest = d*sia*ca + s*dia*ca + d *cia-
755 = s*ca * dia + d * (sia*ca + cia)-
756 = s*ca * dia + d * (1 - sa*ca)-
757*/-
758void QT_FASTCALL comp_func_solid_XOR(uint *dest, int length, uint color, uint const_alpha)-
759{-
760 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
761 color = BYTE_MUL(color, const_alpha);
never executed: color = BYTE_MUL(color, const_alpha);
0
762 uint sia = qAlpha(~color);-
763-
764 PRELOAD_INIT(dest)-
765 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
766 PRELOAD_COND(dest)-
767 uint d = dest[i];-
768 dest[i] = INTERPOLATE_PIXEL_255(color, qAlpha(~d), d, sia);-
769 }
never executed: end of block
0
770}
never executed: end of block
0
771-
772void QT_FASTCALL comp_func_solid_XOR_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
773{-
774 if (const_alpha != 255)
const_alpha != 255Description
TRUEnever evaluated
FALSEnever evaluated
0
775 color = multiplyAlpha255(color, const_alpha);
never executed: color = multiplyAlpha255(color, const_alpha);
0
776 uint sia = 65535 - color.alpha();-
777 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
778 QRgba64 d = dest[i];-
779 dest[i] = interpolate65535(color, 65535 - d.alpha(), d, sia);-
780 }
never executed: end of block
0
781}
never executed: end of block
0
782-
783void QT_FASTCALL comp_func_XOR(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
784{-
785 PRELOAD_INIT2(dest, src)-
786 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
787 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
788 PRELOAD_COND2(dest, src)-
789 uint d = dest[i];-
790 uint s = src[i];-
791 dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));-
792 }
never executed: end of block
0
793 } else {
never executed: end of block
0
794 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
795 PRELOAD_COND2(dest, src)-
796 uint d = dest[i];-
797 uint s = BYTE_MUL(src[i], const_alpha);-
798 dest[i] = INTERPOLATE_PIXEL_255(s, qAlpha(~d), d, qAlpha(~s));-
799 }
never executed: end of block
0
800 }
never executed: end of block
0
801}-
802-
803void QT_FASTCALL comp_func_XOR_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
804{-
805 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
806 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
807 QRgba64 d = dest[i];-
808 QRgba64 s = src[i];-
809 dest[i] = interpolate65535(s, 65535 - d.alpha(), d, 65535 - s.alpha());-
810 }
never executed: end of block
0
811 } else {
never executed: end of block
0
812 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
813 QRgba64 d = dest[i];-
814 QRgba64 s = multiplyAlpha255(src[i], const_alpha);-
815 dest[i] = interpolate65535(s, 65535 - d.alpha(), d, 65535 - s.alpha());-
816 }
never executed: end of block
0
817 }
never executed: end of block
0
818}-
819-
820struct QFullCoverage {-
821 inline void store(uint *dest, const uint src) const-
822 {-
823 *dest = src;-
824 }
never executed: end of block
0
825};-
826-
827struct QPartialCoverage {-
828 inline QPartialCoverage(uint const_alpha)-
829 : ca(const_alpha)-
830 , ica(255 - const_alpha)-
831 {-
832 }
never executed: end of block
0
833-
834 inline void store(uint *dest, const uint src) const-
835 {-
836 *dest = INTERPOLATE_PIXEL_255(src, ca, *dest, ica);-
837 }
never executed: end of block
0
838-
839private:-
840 const uint ca;-
841 const uint ica;-
842};-
843-
844static inline int mix_alpha(int da, int sa)-
845{-
846 return 255 - ((255 - sa) * (255 - da) >> 8);
never executed: return 255 - ((255 - sa) * (255 - da) >> 8);
0
847}-
848-
849/*-
850 Dca' = Sca.Da + Dca.Sa + Sca.(1 - Da) + Dca.(1 - Sa)-
851 = Sca + Dca-
852*/-
853template <typename T>-
854Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Plus_impl(uint *dest, int length, uint color, const T &coverage)-
855{-
856 uint s = color;-
857-
858 PRELOAD_INIT(dest)-
859 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
860 PRELOAD_COND(dest)-
861 uint d = dest[i];-
862 d = comp_func_Plus_one_pixel(d, s);-
863 coverage.store(&dest[i], d);-
864 }
never executed: end of block
0
865}
never executed: end of block
0
866-
867template <typename T>-
868Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Plus_impl_rgb64(QRgba64 *dest, int length, QRgba64 color, const T &coverage)-
869{-
870 QRgba64 s = color;-
871 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
872 QRgba64 d = dest[i];-
873 d = comp_func_Plus_one_pixel(d, s);-
874 coverage.store(&dest[i], d);-
875 }
never executed: end of block
0
876}
never executed: end of block
0
877-
878void QT_FASTCALL comp_func_solid_Plus(uint *dest, int length, uint color, uint const_alpha)-
879{-
880 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
881 comp_func_solid_Plus_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_Plus_impl(dest, length, color, QFullCoverage());
0
882 else-
883 comp_func_solid_Plus_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_Plus_impl(dest, length, color, QPartialCoverage(const_alpha));
0
884}-
885-
886void QT_FASTCALL comp_func_solid_Plus_rgb64(QRgba64 *dest, int length, QRgba64 color, uint const_alpha)-
887{-
888 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
889 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
890 dest[i] = addWithSaturation(dest[i], color);-
891 }
never executed: end of block
0
892 } else {
never executed: end of block
0
893 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
894 QRgba64 d = addWithSaturation(dest[i], color);-
895 dest[i] = interpolate255(d, const_alpha, dest[i], 255 - const_alpha);-
896 }
never executed: end of block
0
897 }
never executed: end of block
0
898}-
899-
900template <typename T>-
901Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Plus_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
902{-
903 PRELOAD_INIT2(dest, src)-
904 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
905 PRELOAD_COND2(dest, src)-
906 uint d = dest[i];-
907 uint s = src[i];-
908-
909 d = comp_func_Plus_one_pixel(d, s);-
910-
911 coverage.store(&dest[i], d);-
912 }
never executed: end of block
0
913}
never executed: end of block
0
914-
915void QT_FASTCALL comp_func_Plus(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
916{-
917 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
918 comp_func_Plus_impl(dest, src, length, QFullCoverage());
never executed: comp_func_Plus_impl(dest, src, length, QFullCoverage());
0
919 else-
920 comp_func_Plus_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_Plus_impl(dest, src, length, QPartialCoverage(const_alpha));
0
921}-
922-
923void QT_FASTCALL comp_func_Plus_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha)-
924{-
925 if (const_alpha == 255) {
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
926 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
927 dest[i] = addWithSaturation(dest[i], src[i]);-
928 }
never executed: end of block
0
929 } else {
never executed: end of block
0
930 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
931 QRgba64 d = addWithSaturation(dest[i], src[i]);-
932 dest[i] = interpolate255(d, const_alpha, dest[i], 255 - const_alpha);-
933 }
never executed: end of block
0
934 }
never executed: end of block
0
935}-
936-
937/*-
938 Dca' = Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)-
939*/-
940static inline int multiply_op(int dst, int src, int da, int sa)-
941{-
942 return qt_div_255(src * dst + src * (255 - da) + dst * (255 - sa));
never executed: return qt_div_255(src * dst + src * (255 - da) + dst * (255 - sa));
0
943}-
944-
945template <typename T>-
946Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Multiply_impl(uint *dest, int length, uint color, const T &coverage)-
947{-
948 int sa = qAlpha(color);-
949 int sr = qRed(color);-
950 int sg = qGreen(color);-
951 int sb = qBlue(color);-
952-
953 PRELOAD_INIT(dest)-
954 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
955 PRELOAD_COND(dest)-
956 uint d = dest[i];-
957 int da = qAlpha(d);-
958-
959#define OP(a, b) multiply_op(a, b, da, sa)-
960 int r = OP( qRed(d), sr);-
961 int b = OP( qBlue(d), sb);-
962 int g = OP(qGreen(d), sg);-
963 int a = mix_alpha(da, sa);-
964#undef OP-
965-
966 coverage.store(&dest[i], qRgba(r, g, b, a));-
967 }
never executed: end of block
0
968}
never executed: end of block
0
969-
970void QT_FASTCALL comp_func_solid_Multiply(uint *dest, int length, uint color, uint const_alpha)-
971{-
972 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
973 comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
0
974 else-
975 comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
0
976}-
977-
978template <typename T>-
979Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Multiply_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
980{-
981 PRELOAD_INIT2(dest, src)-
982 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
983 PRELOAD_COND2(dest, src)-
984 uint d = dest[i];-
985 uint s = src[i];-
986-
987 int da = qAlpha(d);-
988 int sa = qAlpha(s);-
989-
990#define OP(a, b) multiply_op(a, b, da, sa)-
991 int r = OP( qRed(d), qRed(s));-
992 int b = OP( qBlue(d), qBlue(s));-
993 int g = OP(qGreen(d), qGreen(s));-
994 int a = mix_alpha(da, sa);-
995#undef OP-
996-
997 coverage.store(&dest[i], qRgba(r, g, b, a));-
998 }
never executed: end of block
0
999}
never executed: end of block
0
1000-
1001void QT_FASTCALL comp_func_Multiply(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1002{-
1003 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1004 comp_func_Multiply_impl(dest, src, length, QFullCoverage());
never executed: comp_func_Multiply_impl(dest, src, length, QFullCoverage());
0
1005 else-
1006 comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1007}-
1008-
1009/*-
1010 Dca' = (Sca.Da + Dca.Sa - Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa)-
1011 = Sca + Dca - Sca.Dca-
1012*/-
1013template <typename T>-
1014Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Screen_impl(uint *dest, int length, uint color, const T &coverage)-
1015{-
1016 int sa = qAlpha(color);-
1017 int sr = qRed(color);-
1018 int sg = qGreen(color);-
1019 int sb = qBlue(color);-
1020-
1021 PRELOAD_INIT(dest)-
1022 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1023 PRELOAD_COND(dest)-
1024 uint d = dest[i];-
1025 int da = qAlpha(d);-
1026-
1027#define OP(a, b) 255 - qt_div_255((255-a) * (255-b))-
1028 int r = OP( qRed(d), sr);-
1029 int b = OP( qBlue(d), sb);-
1030 int g = OP(qGreen(d), sg);-
1031 int a = mix_alpha(da, sa);-
1032#undef OP-
1033-
1034 coverage.store(&dest[i], qRgba(r, g, b, a));-
1035 }
never executed: end of block
0
1036}
never executed: end of block
0
1037-
1038void QT_FASTCALL comp_func_solid_Screen(uint *dest, int length, uint color, uint const_alpha)-
1039{-
1040 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1041 comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
0
1042 else-
1043 comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1044}-
1045-
1046template <typename T>-
1047Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Screen_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1048{-
1049 PRELOAD_INIT2(dest, src)-
1050 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1051 PRELOAD_COND2(dest, src)-
1052 uint d = dest[i];-
1053 uint s = src[i];-
1054-
1055 int da = qAlpha(d);-
1056 int sa = qAlpha(s);-
1057-
1058#define OP(a, b) 255 - (((255-a) * (255-b)) >> 8)-
1059 int r = OP( qRed(d), qRed(s));-
1060 int b = OP( qBlue(d), qBlue(s));-
1061 int g = OP(qGreen(d), qGreen(s));-
1062 int a = mix_alpha(da, sa);-
1063#undef OP-
1064-
1065 coverage.store(&dest[i], qRgba(r, g, b, a));-
1066 }
never executed: end of block
0
1067}
never executed: end of block
0
1068-
1069void QT_FASTCALL comp_func_Screen(uint *dest, const uint *src, int length, uint const_alpha)-
1070{-
1071 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1072 comp_func_Screen_impl(dest, src, length, QFullCoverage());
never executed: comp_func_Screen_impl(dest, src, length, QFullCoverage());
0
1073 else-
1074 comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1075}-
1076-
1077/*-
1078 if 2.Dca < Da-
1079 Dca' = 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)-
1080 otherwise-
1081 Dca' = Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa)-
1082*/-
1083static inline int overlay_op(int dst, int src, int da, int sa)-
1084{-
1085 const int temp = src * (255 - da) + dst * (255 - sa);-
1086 if (2 * dst < da)
2 * dst < daDescription
TRUEnever evaluated
FALSEnever evaluated
0
1087 return qt_div_255(2 * src * dst + temp);
never executed: return qt_div_255(2 * src * dst + temp);
0
1088 else-
1089 return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp);
never executed: return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp);
0
1090}-
1091-
1092template <typename T>-
1093Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Overlay_impl(uint *dest, int length, uint color, const T &coverage)-
1094{-
1095 int sa = qAlpha(color);-
1096 int sr = qRed(color);-
1097 int sg = qGreen(color);-
1098 int sb = qBlue(color);-
1099-
1100 PRELOAD_INIT(dest)-
1101 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1102 PRELOAD_COND(dest)-
1103 uint d = dest[i];-
1104 int da = qAlpha(d);-
1105-
1106#define OP(a, b) overlay_op(a, b, da, sa)-
1107 int r = OP( qRed(d), sr);-
1108 int b = OP( qBlue(d), sb);-
1109 int g = OP(qGreen(d), sg);-
1110 int a = mix_alpha(da, sa);-
1111#undef OP-
1112-
1113 coverage.store(&dest[i], qRgba(r, g, b, a));-
1114 }
never executed: end of block
0
1115}
never executed: end of block
0
1116-
1117void QT_FASTCALL comp_func_solid_Overlay(uint *dest, int length, uint color, uint const_alpha)-
1118{-
1119 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1120 comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
0
1121 else-
1122 comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1123}-
1124-
1125template <typename T>-
1126Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Overlay_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1127{-
1128 PRELOAD_INIT2(dest, src)-
1129 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1130 PRELOAD_COND2(dest, src)-
1131 uint d = dest[i];-
1132 uint s = src[i];-
1133-
1134 int da = qAlpha(d);-
1135 int sa = qAlpha(s);-
1136-
1137#define OP(a, b) overlay_op(a, b, da, sa)-
1138 int r = OP( qRed(d), qRed(s));-
1139 int b = OP( qBlue(d), qBlue(s));-
1140 int g = OP(qGreen(d), qGreen(s));-
1141 int a = mix_alpha(da, sa);-
1142#undef OP-
1143-
1144 coverage.store(&dest[i], qRgba(r, g, b, a));-
1145 }
never executed: end of block
0
1146}
never executed: end of block
0
1147-
1148void QT_FASTCALL comp_func_Overlay(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1149{-
1150 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1151 comp_func_Overlay_impl(dest, src, length, QFullCoverage());
never executed: comp_func_Overlay_impl(dest, src, length, QFullCoverage());
0
1152 else-
1153 comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1154}-
1155-
1156/*-
1157 Dca' = min(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa)-
1158 Da' = Sa + Da - Sa.Da-
1159*/-
1160static inline int darken_op(int dst, int src, int da, int sa)-
1161{-
1162 return qt_div_255(qMin(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
never executed: return qt_div_255(qMin(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
0
1163}-
1164-
1165template <typename T>-
1166Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Darken_impl(uint *dest, int length, uint color, const T &coverage)-
1167{-
1168 int sa = qAlpha(color);-
1169 int sr = qRed(color);-
1170 int sg = qGreen(color);-
1171 int sb = qBlue(color);-
1172-
1173 PRELOAD_INIT(dest)-
1174 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1175 PRELOAD_COND(dest)-
1176 uint d = dest[i];-
1177 int da = qAlpha(d);-
1178-
1179#define OP(a, b) darken_op(a, b, da, sa)-
1180 int r = OP( qRed(d), sr);-
1181 int b = OP( qBlue(d), sb);-
1182 int g = OP(qGreen(d), sg);-
1183 int a = mix_alpha(da, sa);-
1184#undef OP-
1185-
1186 coverage.store(&dest[i], qRgba(r, g, b, a));-
1187 }
never executed: end of block
0
1188}
never executed: end of block
0
1189-
1190void QT_FASTCALL comp_func_solid_Darken(uint *dest, int length, uint color, uint const_alpha)-
1191{-
1192 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1193 comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
0
1194 else-
1195 comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1196}-
1197-
1198template <typename T>-
1199Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Darken_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1200{-
1201 PRELOAD_INIT2(dest, src)-
1202 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1203 PRELOAD_COND2(dest, src)-
1204 uint d = dest[i];-
1205 uint s = src[i];-
1206-
1207 int da = qAlpha(d);-
1208 int sa = qAlpha(s);-
1209-
1210#define OP(a, b) darken_op(a, b, da, sa)-
1211 int r = OP( qRed(d), qRed(s));-
1212 int b = OP( qBlue(d), qBlue(s));-
1213 int g = OP(qGreen(d), qGreen(s));-
1214 int a = mix_alpha(da, sa);-
1215#undef OP-
1216-
1217 coverage.store(&dest[i], qRgba(r, g, b, a));-
1218 }
never executed: end of block
0
1219}
never executed: end of block
0
1220-
1221void QT_FASTCALL comp_func_Darken(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1222{-
1223 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1224 comp_func_Darken_impl(dest, src, length, QFullCoverage());
never executed: comp_func_Darken_impl(dest, src, length, QFullCoverage());
0
1225 else-
1226 comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1227}-
1228-
1229/*-
1230 Dca' = max(Sca.Da, Dca.Sa) + Sca.(1 - Da) + Dca.(1 - Sa)-
1231 Da' = Sa + Da - Sa.Da-
1232*/-
1233static inline int lighten_op(int dst, int src, int da, int sa)-
1234{-
1235 return qt_div_255(qMax(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
never executed: return qt_div_255(qMax(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
0
1236}-
1237-
1238template <typename T>-
1239Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Lighten_impl(uint *dest, int length, uint color, const T &coverage)-
1240{-
1241 int sa = qAlpha(color);-
1242 int sr = qRed(color);-
1243 int sg = qGreen(color);-
1244 int sb = qBlue(color);-
1245-
1246 PRELOAD_INIT(dest)-
1247 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1248 PRELOAD_COND(dest)-
1249 uint d = dest[i];-
1250 int da = qAlpha(d);-
1251-
1252#define OP(a, b) lighten_op(a, b, da, sa)-
1253 int r = OP( qRed(d), sr);-
1254 int b = OP( qBlue(d), sb);-
1255 int g = OP(qGreen(d), sg);-
1256 int a = mix_alpha(da, sa);-
1257#undef OP-
1258-
1259 coverage.store(&dest[i], qRgba(r, g, b, a));-
1260 }
never executed: end of block
0
1261}
never executed: end of block
0
1262-
1263void QT_FASTCALL comp_func_solid_Lighten(uint *dest, int length, uint color, uint const_alpha)-
1264{-
1265 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1266 comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
0
1267 else-
1268 comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1269}-
1270-
1271template <typename T>-
1272Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Lighten_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1273{-
1274 PRELOAD_INIT2(dest, src)-
1275 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1276 PRELOAD_COND2(dest, src)-
1277 uint d = dest[i];-
1278 uint s = src[i];-
1279-
1280 int da = qAlpha(d);-
1281 int sa = qAlpha(s);-
1282-
1283#define OP(a, b) lighten_op(a, b, da, sa)-
1284 int r = OP( qRed(d), qRed(s));-
1285 int b = OP( qBlue(d), qBlue(s));-
1286 int g = OP(qGreen(d), qGreen(s));-
1287 int a = mix_alpha(da, sa);-
1288#undef OP-
1289-
1290 coverage.store(&dest[i], qRgba(r, g, b, a));-
1291 }
never executed: end of block
0
1292}
never executed: end of block
0
1293-
1294void QT_FASTCALL comp_func_Lighten(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1295{-
1296 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1297 comp_func_Lighten_impl(dest, src, length, QFullCoverage());
never executed: comp_func_Lighten_impl(dest, src, length, QFullCoverage());
0
1298 else-
1299 comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1300}-
1301-
1302/*-
1303 if Sca.Da + Dca.Sa >= Sa.Da-
1304 Dca' = Sa.Da + Sca.(1 - Da) + Dca.(1 - Sa)-
1305 otherwise-
1306 Dca' = Dca.Sa/(1-Sca/Sa) + Sca.(1 - Da) + Dca.(1 - Sa)-
1307*/-
1308static inline int color_dodge_op(int dst, int src, int da, int sa)-
1309{-
1310 const int sa_da = sa * da;-
1311 const int dst_sa = dst * sa;-
1312 const int src_da = src * da;-
1313-
1314 const int temp = src * (255 - da) + dst * (255 - sa);-
1315 if (src_da + dst_sa >= sa_da)
src_da + dst_sa >= sa_daDescription
TRUEnever evaluated
FALSEnever evaluated
0
1316 return qt_div_255(sa_da + temp);
never executed: return qt_div_255(sa_da + temp);
0
1317 else-
1318 return qt_div_255(255 * dst_sa / (255 - 255 * src / sa) + temp);
never executed: return qt_div_255(255 * dst_sa / (255 - 255 * src / sa) + temp);
0
1319}-
1320-
1321template <typename T>-
1322Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorDodge_impl(uint *dest, int length, uint color, const T &coverage)-
1323{-
1324 int sa = qAlpha(color);-
1325 int sr = qRed(color);-
1326 int sg = qGreen(color);-
1327 int sb = qBlue(color);-
1328-
1329 PRELOAD_INIT(dest)-
1330 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1331 PRELOAD_COND(dest)-
1332 uint d = dest[i];-
1333 int da = qAlpha(d);-
1334-
1335#define OP(a,b) color_dodge_op(a, b, da, sa)-
1336 int r = OP( qRed(d), sr);-
1337 int b = OP( qBlue(d), sb);-
1338 int g = OP(qGreen(d), sg);-
1339 int a = mix_alpha(da, sa);-
1340#undef OP-
1341-
1342 coverage.store(&dest[i], qRgba(r, g, b, a));-
1343 }
never executed: end of block
0
1344}
never executed: end of block
0
1345-
1346void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest, int length, uint color, uint const_alpha)-
1347{-
1348 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1349 comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
0
1350 else-
1351 comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1352}-
1353-
1354template <typename T>-
1355Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorDodge_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1356{-
1357 PRELOAD_INIT2(dest, src)-
1358 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1359 PRELOAD_COND2(dest, src)-
1360 uint d = dest[i];-
1361 uint s = src[i];-
1362-
1363 int da = qAlpha(d);-
1364 int sa = qAlpha(s);-
1365-
1366#define OP(a, b) color_dodge_op(a, b, da, sa)-
1367 int r = OP( qRed(d), qRed(s));-
1368 int b = OP( qBlue(d), qBlue(s));-
1369 int g = OP(qGreen(d), qGreen(s));-
1370 int a = mix_alpha(da, sa);-
1371#undef OP-
1372-
1373 coverage.store(&dest[i], qRgba(r, g, b, a));-
1374 }
never executed: end of block
0
1375}
never executed: end of block
0
1376-
1377void QT_FASTCALL comp_func_ColorDodge(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1378{-
1379 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1380 comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
never executed: comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
0
1381 else-
1382 comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1383}-
1384-
1385/*-
1386 if Sca.Da + Dca.Sa <= Sa.Da-
1387 Dca' = Sca.(1 - Da) + Dca.(1 - Sa)-
1388 otherwise-
1389 Dca' = Sa.(Sca.Da + Dca.Sa - Sa.Da)/Sca + Sca.(1 - Da) + Dca.(1 - Sa)-
1390*/-
1391static inline int color_burn_op(int dst, int src, int da, int sa)-
1392{-
1393 const int src_da = src * da;-
1394 const int dst_sa = dst * sa;-
1395 const int sa_da = sa * da;-
1396-
1397 const int temp = src * (255 - da) + dst * (255 - sa);-
1398-
1399 if (src == 0 || src_da + dst_sa <= sa_da)
src == 0Description
TRUEnever evaluated
FALSEnever evaluated
src_da + dst_sa <= sa_daDescription
TRUEnever evaluated
FALSEnever evaluated
0
1400 return qt_div_255(temp);
never executed: return qt_div_255(temp);
0
1401 return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp);
never executed: return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp);
0
1402}-
1403-
1404template <typename T>-
1405Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_ColorBurn_impl(uint *dest, int length, uint color, const T &coverage)-
1406{-
1407 int sa = qAlpha(color);-
1408 int sr = qRed(color);-
1409 int sg = qGreen(color);-
1410 int sb = qBlue(color);-
1411-
1412 PRELOAD_INIT(dest)-
1413 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1414 PRELOAD_COND(dest)-
1415 uint d = dest[i];-
1416 int da = qAlpha(d);-
1417-
1418#define OP(a, b) color_burn_op(a, b, da, sa)-
1419 int r = OP( qRed(d), sr);-
1420 int b = OP( qBlue(d), sb);-
1421 int g = OP(qGreen(d), sg);-
1422 int a = mix_alpha(da, sa);-
1423#undef OP-
1424-
1425 coverage.store(&dest[i], qRgba(r, g, b, a));-
1426 }
never executed: end of block
0
1427}
never executed: end of block
0
1428-
1429void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest, int length, uint color, uint const_alpha)-
1430{-
1431 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1432 comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
0
1433 else-
1434 comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1435}-
1436-
1437template <typename T>-
1438Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_ColorBurn_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1439{-
1440 PRELOAD_INIT2(dest, src)-
1441 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1442 PRELOAD_COND2(dest, src)-
1443 uint d = dest[i];-
1444 uint s = src[i];-
1445-
1446 int da = qAlpha(d);-
1447 int sa = qAlpha(s);-
1448-
1449#define OP(a, b) color_burn_op(a, b, da, sa)-
1450 int r = OP( qRed(d), qRed(s));-
1451 int b = OP( qBlue(d), qBlue(s));-
1452 int g = OP(qGreen(d), qGreen(s));-
1453 int a = mix_alpha(da, sa);-
1454#undef OP-
1455-
1456 coverage.store(&dest[i], qRgba(r, g, b, a));-
1457 }
never executed: end of block
0
1458}
never executed: end of block
0
1459-
1460void QT_FASTCALL comp_func_ColorBurn(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1461{-
1462 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1463 comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
never executed: comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
0
1464 else-
1465 comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1466}-
1467-
1468/*-
1469 if 2.Sca < Sa-
1470 Dca' = 2.Sca.Dca + Sca.(1 - Da) + Dca.(1 - Sa)-
1471 otherwise-
1472 Dca' = Sa.Da - 2.(Da - Dca).(Sa - Sca) + Sca.(1 - Da) + Dca.(1 - Sa)-
1473*/-
1474static inline uint hardlight_op(int dst, int src, int da, int sa)-
1475{-
1476 const uint temp = src * (255 - da) + dst * (255 - sa);-
1477-
1478 if (2 * src < sa)
2 * src < saDescription
TRUEnever evaluated
FALSEnever evaluated
0
1479 return qt_div_255(2 * src * dst + temp);
never executed: return qt_div_255(2 * src * dst + temp);
0
1480 else-
1481 return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp);
never executed: return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp);
0
1482}-
1483-
1484template <typename T>-
1485Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_HardLight_impl(uint *dest, int length, uint color, const T &coverage)-
1486{-
1487 int sa = qAlpha(color);-
1488 int sr = qRed(color);-
1489 int sg = qGreen(color);-
1490 int sb = qBlue(color);-
1491-
1492 PRELOAD_INIT(dest)-
1493 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1494 PRELOAD_COND(dest)-
1495 uint d = dest[i];-
1496 int da = qAlpha(d);-
1497-
1498#define OP(a, b) hardlight_op(a, b, da, sa)-
1499 int r = OP( qRed(d), sr);-
1500 int b = OP( qBlue(d), sb);-
1501 int g = OP(qGreen(d), sg);-
1502 int a = mix_alpha(da, sa);-
1503#undef OP-
1504-
1505 coverage.store(&dest[i], qRgba(r, g, b, a));-
1506 }
never executed: end of block
0
1507}
never executed: end of block
0
1508-
1509void QT_FASTCALL comp_func_solid_HardLight(uint *dest, int length, uint color, uint const_alpha)-
1510{-
1511 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1512 comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
0
1513 else-
1514 comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1515}-
1516-
1517template <typename T>-
1518Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_HardLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1519{-
1520 PRELOAD_INIT2(dest, src)-
1521 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1522 PRELOAD_COND2(dest, src)-
1523 uint d = dest[i];-
1524 uint s = src[i];-
1525-
1526 int da = qAlpha(d);-
1527 int sa = qAlpha(s);-
1528-
1529#define OP(a, b) hardlight_op(a, b, da, sa)-
1530 int r = OP( qRed(d), qRed(s));-
1531 int b = OP( qBlue(d), qBlue(s));-
1532 int g = OP(qGreen(d), qGreen(s));-
1533 int a = mix_alpha(da, sa);-
1534#undef OP-
1535-
1536 coverage.store(&dest[i], qRgba(r, g, b, a));-
1537 }
never executed: end of block
0
1538}
never executed: end of block
0
1539-
1540void QT_FASTCALL comp_func_HardLight(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1541{-
1542 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1543 comp_func_HardLight_impl(dest, src, length, QFullCoverage());
never executed: comp_func_HardLight_impl(dest, src, length, QFullCoverage());
0
1544 else-
1545 comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1546}-
1547-
1548/*-
1549 if 2.Sca <= Sa-
1550 Dca' = Dca.(Sa + (2.Sca - Sa).(1 - Dca/Da)) + Sca.(1 - Da) + Dca.(1 - Sa)-
1551 otherwise if 2.Sca > Sa and 4.Dca <= Da-
1552 Dca' = Dca.Sa + Da.(2.Sca - Sa).(4.Dca/Da.(4.Dca/Da + 1).(Dca/Da - 1) + 7.Dca/Da) + Sca.(1 - Da) + Dca.(1 - Sa)-
1553 otherwise if 2.Sca > Sa and 4.Dca > Da-
1554 Dca' = Dca.Sa + Da.(2.Sca - Sa).((Dca/Da)^0.5 - Dca/Da) + Sca.(1 - Da) + Dca.(1 - Sa)-
1555*/-
1556static inline int soft_light_op(int dst, int src, int da, int sa)-
1557{-
1558 const int src2 = src << 1;-
1559 const int dst_np = da != 0 ? (255 * dst) / da : 0;
da != 0Description
TRUEnever evaluated
FALSEnever evaluated
0
1560 const int temp = (src * (255 - da) + dst * (255 - sa)) * 255;-
1561-
1562 if (src2 < sa)
src2 < saDescription
TRUEnever evaluated
FALSEnever evaluated
0
1563 return (dst * (sa * 255 + (src2 - sa) * (255 - dst_np)) + temp) / 65025;
never executed: return (dst * (sa * 255 + (src2 - sa) * (255 - dst_np)) + temp) / 65025;
0
1564 else if (4 * dst <= da)
4 * dst <= daDescription
TRUEnever evaluated
FALSEnever evaluated
0
1565 return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025;
never executed: return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025;
0
1566 else {-
1567 return (dst * sa * 255 + da * (src2 - sa) * (int(qSqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025;
never executed: return (dst * sa * 255 + da * (src2 - sa) * (int(qSqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025;
0
1568 }-
1569}-
1570-
1571template <typename T>-
1572Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_SoftLight_impl(uint *dest, int length, uint color, const T &coverage)-
1573{-
1574 int sa = qAlpha(color);-
1575 int sr = qRed(color);-
1576 int sg = qGreen(color);-
1577 int sb = qBlue(color);-
1578-
1579 PRELOAD_INIT(dest)-
1580 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1581 PRELOAD_COND(dest)-
1582 uint d = dest[i];-
1583 int da = qAlpha(d);-
1584-
1585#define OP(a, b) soft_light_op(a, b, da, sa)-
1586 int r = OP( qRed(d), sr);-
1587 int b = OP( qBlue(d), sb);-
1588 int g = OP(qGreen(d), sg);-
1589 int a = mix_alpha(da, sa);-
1590#undef OP-
1591-
1592 coverage.store(&dest[i], qRgba(r, g, b, a));-
1593 }
never executed: end of block
0
1594}
never executed: end of block
0
1595-
1596void QT_FASTCALL comp_func_solid_SoftLight(uint *dest, int length, uint color, uint const_alpha)-
1597{-
1598 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1599 comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
0
1600 else-
1601 comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1602}-
1603-
1604template <typename T>-
1605Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_SoftLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1606{-
1607 PRELOAD_INIT2(dest, src)-
1608 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1609 PRELOAD_COND2(dest, src)-
1610 uint d = dest[i];-
1611 uint s = src[i];-
1612-
1613 int da = qAlpha(d);-
1614 int sa = qAlpha(s);-
1615-
1616#define OP(a, b) soft_light_op(a, b, da, sa)-
1617 int r = OP( qRed(d), qRed(s));-
1618 int b = OP( qBlue(d), qBlue(s));-
1619 int g = OP(qGreen(d), qGreen(s));-
1620 int a = mix_alpha(da, sa);-
1621#undef OP-
1622-
1623 coverage.store(&dest[i], qRgba(r, g, b, a));-
1624 }
never executed: end of block
0
1625}
never executed: end of block
0
1626-
1627void QT_FASTCALL comp_func_SoftLight(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1628{-
1629 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1630 comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
never executed: comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
0
1631 else-
1632 comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1633}-
1634-
1635/*-
1636 Dca' = abs(Dca.Sa - Sca.Da) + Sca.(1 - Da) + Dca.(1 - Sa)-
1637 = Sca + Dca - 2.min(Sca.Da, Dca.Sa)-
1638*/-
1639static inline int difference_op(int dst, int src, int da, int sa)-
1640{-
1641 return src + dst - qt_div_255(2 * qMin(src * da, dst * sa));
never executed: return src + dst - qt_div_255(2 * qMin(src * da, dst * sa));
0
1642}-
1643-
1644template <typename T>-
1645Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_solid_Difference_impl(uint *dest, int length, uint color, const T &coverage)-
1646{-
1647 int sa = qAlpha(color);-
1648 int sr = qRed(color);-
1649 int sg = qGreen(color);-
1650 int sb = qBlue(color);-
1651-
1652 PRELOAD_INIT(dest)-
1653 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1654 PRELOAD_COND(dest)-
1655 uint d = dest[i];-
1656 int da = qAlpha(d);-
1657-
1658#define OP(a, b) difference_op(a, b, da, sa)-
1659 int r = OP( qRed(d), sr);-
1660 int b = OP( qBlue(d), sb);-
1661 int g = OP(qGreen(d), sg);-
1662 int a = mix_alpha(da, sa);-
1663#undef OP-
1664-
1665 coverage.store(&dest[i], qRgba(r, g, b, a));-
1666 }
never executed: end of block
0
1667}
never executed: end of block
0
1668-
1669void QT_FASTCALL comp_func_solid_Difference(uint *dest, int length, uint color, uint const_alpha)-
1670{-
1671 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1672 comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
0
1673 else-
1674 comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1675}-
1676-
1677template <typename T>-
1678Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Difference_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1679{-
1680 PRELOAD_INIT2(dest, src)-
1681 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1682 PRELOAD_COND2(dest, src)-
1683 uint d = dest[i];-
1684 uint s = src[i];-
1685-
1686 int da = qAlpha(d);-
1687 int sa = qAlpha(s);-
1688-
1689#define OP(a, b) difference_op(a, b, da, sa)-
1690 int r = OP( qRed(d), qRed(s));-
1691 int b = OP( qBlue(d), qBlue(s));-
1692 int g = OP(qGreen(d), qGreen(s));-
1693 int a = mix_alpha(da, sa);-
1694#undef OP-
1695-
1696 coverage.store(&dest[i], qRgba(r, g, b, a));-
1697 }
never executed: end of block
0
1698}
never executed: end of block
0
1699-
1700void QT_FASTCALL comp_func_Difference(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1701{-
1702 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1703 comp_func_Difference_impl(dest, src, length, QFullCoverage());
never executed: comp_func_Difference_impl(dest, src, length, QFullCoverage());
0
1704 else-
1705 comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1706}-
1707-
1708/*-
1709 Dca' = (Sca.Da + Dca.Sa - 2.Sca.Dca) + Sca.(1 - Da) + Dca.(1 - Sa)-
1710*/-
1711template <typename T>-
1712Q_STATIC_TEMPLATE_FUNCTION inline void QT_FASTCALL comp_func_solid_Exclusion_impl(uint *dest, int length, uint color, const T &coverage)-
1713{-
1714 int sa = qAlpha(color);-
1715 int sr = qRed(color);-
1716 int sg = qGreen(color);-
1717 int sb = qBlue(color);-
1718-
1719 PRELOAD_INIT(dest)-
1720 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1721 PRELOAD_COND(dest)-
1722 uint d = dest[i];-
1723 int da = qAlpha(d);-
1724-
1725#define OP(a, b) (a + b - qt_div_255(2*(a*b)))-
1726 int r = OP( qRed(d), sr);-
1727 int b = OP( qBlue(d), sb);-
1728 int g = OP(qGreen(d), sg);-
1729 int a = mix_alpha(da, sa);-
1730#undef OP-
1731-
1732 coverage.store(&dest[i], qRgba(r, g, b, a));-
1733 }
never executed: end of block
0
1734}
never executed: end of block
0
1735-
1736void QT_FASTCALL comp_func_solid_Exclusion(uint *dest, int length, uint color, uint const_alpha)-
1737{-
1738 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1739 comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
never executed: comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
0
1740 else-
1741 comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
never executed: comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
0
1742}-
1743-
1744template <typename T>-
1745Q_STATIC_TEMPLATE_FUNCTION inline void comp_func_Exclusion_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)-
1746{-
1747 PRELOAD_INIT2(dest, src)-
1748 for (int i = 0; i < length; ++i) {
i < lengthDescription
TRUEnever evaluated
FALSEnever evaluated
0
1749 PRELOAD_COND2(dest, src)-
1750 uint d = dest[i];-
1751 uint s = src[i];-
1752-
1753 int da = qAlpha(d);-
1754 int sa = qAlpha(s);-
1755-
1756#define OP(a, b) (a + b - ((a*b) >> 7))-
1757 int r = OP( qRed(d), qRed(s));-
1758 int b = OP( qBlue(d), qBlue(s));-
1759 int g = OP(qGreen(d), qGreen(s));-
1760 int a = mix_alpha(da, sa);-
1761#undef OP-
1762-
1763 coverage.store(&dest[i], qRgba(r, g, b, a));-
1764 }
never executed: end of block
0
1765}
never executed: end of block
0
1766-
1767void QT_FASTCALL comp_func_Exclusion(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha)-
1768{-
1769 if (const_alpha == 255)
const_alpha == 255Description
TRUEnever evaluated
FALSEnever evaluated
0
1770 comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
never executed: comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
0
1771 else-
1772 comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
never executed: comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
0
1773}-
1774-
1775void QT_FASTCALL rasterop_solid_SourceOrDestination(uint *dest,-
1776 int length,-
1777 uint color,-
1778 uint const_alpha)-
1779{-
1780 Q_UNUSED(const_alpha);-
1781 while (length--)
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1782 *dest++ |= color;
never executed: *dest++ |= color;
0
1783}
never executed: end of block
0
1784-
1785void QT_FASTCALL rasterop_SourceOrDestination(uint *Q_DECL_RESTRICT dest,-
1786 const uint *Q_DECL_RESTRICT src,-
1787 int length,-
1788 uint const_alpha)-
1789{-
1790 Q_UNUSED(const_alpha);-
1791 while (length--)
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1792 *dest++ |= *src++;
never executed: *dest++ |= *src++;
0
1793}
never executed: end of block
0
1794-
1795void QT_FASTCALL rasterop_solid_SourceAndDestination(uint *dest,-
1796 int length,-
1797 uint color,-
1798 uint const_alpha)-
1799{-
1800 Q_UNUSED(const_alpha);-
1801 color |= 0xff000000;-
1802 while (length--)
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1803 *dest++ &= color;
never executed: *dest++ &= color;
0
1804}
never executed: end of block
0
1805-
1806void QT_FASTCALL rasterop_SourceAndDestination(uint *Q_DECL_RESTRICT dest,-
1807 const uint *Q_DECL_RESTRICT src,-
1808 int length,-
1809 uint const_alpha)-
1810{-
1811 Q_UNUSED(const_alpha);-
1812 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1813 *dest = (*src & *dest) | 0xff000000;-
1814 ++dest; ++src;-
1815 }
never executed: end of block
0
1816}
never executed: end of block
0
1817-
1818void QT_FASTCALL rasterop_solid_SourceXorDestination(uint *dest,-
1819 int length,-
1820 uint color,-
1821 uint const_alpha)-
1822{-
1823 Q_UNUSED(const_alpha);-
1824 color &= 0x00ffffff;-
1825 while (length--)
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1826 *dest++ ^= color;
never executed: *dest++ ^= color;
0
1827}
never executed: end of block
0
1828-
1829void QT_FASTCALL rasterop_SourceXorDestination(uint *Q_DECL_RESTRICT dest,-
1830 const uint *Q_DECL_RESTRICT src,-
1831 int length,-
1832 uint const_alpha)-
1833{-
1834 Q_UNUSED(const_alpha);-
1835 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1836 *dest = (*src ^ *dest) | 0xff000000;-
1837 ++dest; ++src;-
1838 }
never executed: end of block
0
1839}
never executed: end of block
0
1840-
1841void QT_FASTCALL rasterop_solid_NotSourceAndNotDestination(uint *dest,-
1842 int length,-
1843 uint color,-
1844 uint const_alpha)-
1845{-
1846 Q_UNUSED(const_alpha);-
1847 color = ~color;-
1848 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1849 *dest = (color & ~(*dest)) | 0xff000000;-
1850 ++dest;-
1851 }
never executed: end of block
0
1852}
never executed: end of block
0
1853-
1854void QT_FASTCALL rasterop_NotSourceAndNotDestination(uint *Q_DECL_RESTRICT dest,-
1855 const uint *Q_DECL_RESTRICT src,-
1856 int length,-
1857 uint const_alpha)-
1858{-
1859 Q_UNUSED(const_alpha);-
1860 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1861 *dest = (~(*src) & ~(*dest)) | 0xff000000;-
1862 ++dest; ++src;-
1863 }
never executed: end of block
0
1864}
never executed: end of block
0
1865-
1866void QT_FASTCALL rasterop_solid_NotSourceOrNotDestination(uint *dest,-
1867 int length,-
1868 uint color,-
1869 uint const_alpha)-
1870{-
1871 Q_UNUSED(const_alpha);-
1872 color = ~color | 0xff000000;-
1873 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1874 *dest = color | ~(*dest);-
1875 ++dest;-
1876 }
never executed: end of block
0
1877}
never executed: end of block
0
1878-
1879void QT_FASTCALL rasterop_NotSourceOrNotDestination(uint *Q_DECL_RESTRICT dest,-
1880 const uint *Q_DECL_RESTRICT src,-
1881 int length,-
1882 uint const_alpha)-
1883{-
1884 Q_UNUSED(const_alpha);-
1885 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1886 *dest = ~(*src) | ~(*dest) | 0xff000000;-
1887 ++dest; ++src;-
1888 }
never executed: end of block
0
1889}
never executed: end of block
0
1890-
1891void QT_FASTCALL rasterop_solid_NotSourceXorDestination(uint *dest,-
1892 int length,-
1893 uint color,-
1894 uint const_alpha)-
1895{-
1896 Q_UNUSED(const_alpha);-
1897 color = ~color & 0x00ffffff;-
1898 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1899 *dest = color ^ (*dest);-
1900 ++dest;-
1901 }
never executed: end of block
0
1902}
never executed: end of block
0
1903-
1904void QT_FASTCALL rasterop_NotSourceXorDestination(uint *Q_DECL_RESTRICT dest,-
1905 const uint *Q_DECL_RESTRICT src,-
1906 int length,-
1907 uint const_alpha)-
1908{-
1909 Q_UNUSED(const_alpha);-
1910 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1911 *dest = ((~(*src)) ^ (*dest)) | 0xff000000;-
1912 ++dest; ++src;-
1913 }
never executed: end of block
0
1914}
never executed: end of block
0
1915-
1916void QT_FASTCALL rasterop_solid_NotSource(uint *dest, int length,-
1917 uint color, uint const_alpha)-
1918{-
1919 Q_UNUSED(const_alpha);-
1920 qt_memfill(dest, ~color | 0xff000000, length);-
1921}
never executed: end of block
0
1922-
1923void QT_FASTCALL rasterop_NotSource(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src,-
1924 int length, uint const_alpha)-
1925{-
1926 Q_UNUSED(const_alpha);-
1927 while (length--)
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1928 *dest++ = ~(*src++) | 0xff000000;
never executed: *dest++ = ~(*src++) | 0xff000000;
0
1929}
never executed: end of block
0
1930-
1931void QT_FASTCALL rasterop_solid_NotSourceAndDestination(uint *dest,-
1932 int length,-
1933 uint color,-
1934 uint const_alpha)-
1935{-
1936 Q_UNUSED(const_alpha);-
1937 color = ~color | 0xff000000;-
1938 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1939 *dest = color & *dest;-
1940 ++dest;-
1941 }
never executed: end of block
0
1942}
never executed: end of block
0
1943-
1944void QT_FASTCALL rasterop_NotSourceAndDestination(uint *Q_DECL_RESTRICT dest,-
1945 const uint *Q_DECL_RESTRICT src,-
1946 int length,-
1947 uint const_alpha)-
1948{-
1949 Q_UNUSED(const_alpha);-
1950 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1951 *dest = (~(*src) & *dest) | 0xff000000;-
1952 ++dest; ++src;-
1953 }
never executed: end of block
0
1954}
never executed: end of block
0
1955-
1956void QT_FASTCALL rasterop_solid_SourceAndNotDestination(uint *dest,-
1957 int length,-
1958 uint color,-
1959 uint const_alpha)-
1960{-
1961 Q_UNUSED(const_alpha);-
1962 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1963 *dest = (color & ~(*dest)) | 0xff000000;-
1964 ++dest;-
1965 }
never executed: end of block
0
1966}
never executed: end of block
0
1967-
1968void QT_FASTCALL rasterop_SourceAndNotDestination(uint *Q_DECL_RESTRICT dest,-
1969 const uint *Q_DECL_RESTRICT src,-
1970 int length,-
1971 uint const_alpha)-
1972{-
1973 Q_UNUSED(const_alpha);-
1974 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1975 *dest = (*src & ~(*dest)) | 0xff000000;-
1976 ++dest; ++src;-
1977 }
never executed: end of block
0
1978}
never executed: end of block
0
1979-
1980void QT_FASTCALL rasterop_NotSourceOrDestination(uint *Q_DECL_RESTRICT dest,-
1981 const uint *Q_DECL_RESTRICT src,-
1982 int length,-
1983 uint const_alpha)-
1984{-
1985 Q_UNUSED(const_alpha);-
1986 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
1987 *dest = (~(*src) | *dest) | 0xff000000;-
1988 ++dest; ++src;-
1989 }
never executed: end of block
0
1990}
never executed: end of block
0
1991-
1992void QT_FASTCALL rasterop_solid_NotSourceOrDestination(uint *Q_DECL_RESTRICT dest,-
1993 int length,-
1994 uint color,-
1995 uint const_alpha)-
1996{-
1997 Q_UNUSED(const_alpha);-
1998 color = ~color | 0xff000000;-
1999 while (length--)
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
2000 *dest++ |= color;
never executed: *dest++ |= color;
0
2001}
never executed: end of block
0
2002-
2003void QT_FASTCALL rasterop_SourceOrNotDestination(uint *Q_DECL_RESTRICT dest,-
2004 const uint *Q_DECL_RESTRICT src,-
2005 int length,-
2006 uint const_alpha)-
2007{-
2008 Q_UNUSED(const_alpha);-
2009 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
2010 *dest = (*src | ~(*dest)) | 0xff000000;-
2011 ++dest; ++src;-
2012 }
never executed: end of block
0
2013}
never executed: end of block
0
2014-
2015void QT_FASTCALL rasterop_solid_SourceOrNotDestination(uint *Q_DECL_RESTRICT dest,-
2016 int length,-
2017 uint color,-
2018 uint const_alpha)-
2019{-
2020 Q_UNUSED(const_alpha);-
2021 while (length--) {
length--Description
TRUEnever evaluated
FALSEnever evaluated
0
2022 *dest = (color | ~(*dest)) | 0xff000000;-
2023 ++dest;-
2024 }
never executed: end of block
0
2025}
never executed: end of block
0
2026-
2027void QT_FASTCALL rasterop_ClearDestination(uint *Q_DECL_RESTRICT dest,-
2028 const uint *Q_DECL_RESTRICT src,-
2029 int length,-
2030 uint const_alpha)-
2031{-
2032 Q_UNUSED(src);-
2033 comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);-
2034}
never executed: end of block
0
2035-
2036void QT_FASTCALL rasterop_solid_ClearDestination(uint *Q_DECL_RESTRICT dest,-
2037 int length,-
2038 uint color,-
2039 uint const_alpha)-
2040{-
2041 Q_UNUSED(color);-
2042 comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);-
2043}
never executed: end of block
0
2044-
2045void QT_FASTCALL rasterop_SetDestination(uint *Q_DECL_RESTRICT dest,-
2046 const uint *Q_DECL_RESTRICT src,-
2047 int length,-
2048 uint const_alpha)-
2049{-
2050 Q_UNUSED(src);-
2051 comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);-
2052}
never executed: end of block
0
2053-
2054void QT_FASTCALL rasterop_solid_SetDestination(uint *Q_DECL_RESTRICT dest,-
2055 int length,-
2056 uint color,-
2057 uint const_alpha)-
2058{-
2059 Q_UNUSED(color);-
2060 comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);-
2061}
never executed: end of block
0
2062-
2063void QT_FASTCALL rasterop_NotDestination(uint *Q_DECL_RESTRICT dest,-
2064 const uint *Q_DECL_RESTRICT src,-
2065 int length,-
2066 uint const_alpha)-
2067{-
2068 Q_UNUSED(src);-
2069 rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);-
2070}
never executed: end of block
0
2071-
2072void QT_FASTCALL rasterop_solid_NotDestination(uint *Q_DECL_RESTRICT dest,-
2073 int length,-
2074 uint color,-
2075 uint const_alpha)-
2076{-
2077 Q_UNUSED(color);-
2078 rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);-
2079}
never executed: end of block
0
2080-
2081CompositionFunctionSolid qt_functionForModeSolid_C[] = {-
2082 comp_func_solid_SourceOver,-
2083 comp_func_solid_DestinationOver,-
2084 comp_func_solid_Clear,-
2085 comp_func_solid_Source,-
2086 comp_func_solid_Destination,-
2087 comp_func_solid_SourceIn,-
2088 comp_func_solid_DestinationIn,-
2089 comp_func_solid_SourceOut,-
2090 comp_func_solid_DestinationOut,-
2091 comp_func_solid_SourceAtop,-
2092 comp_func_solid_DestinationAtop,-
2093 comp_func_solid_XOR,-
2094 comp_func_solid_Plus,-
2095 comp_func_solid_Multiply,-
2096 comp_func_solid_Screen,-
2097 comp_func_solid_Overlay,-
2098 comp_func_solid_Darken,-
2099 comp_func_solid_Lighten,-
2100 comp_func_solid_ColorDodge,-
2101 comp_func_solid_ColorBurn,-
2102 comp_func_solid_HardLight,-
2103 comp_func_solid_SoftLight,-
2104 comp_func_solid_Difference,-
2105 comp_func_solid_Exclusion,-
2106 rasterop_solid_SourceOrDestination,-
2107 rasterop_solid_SourceAndDestination,-
2108 rasterop_solid_SourceXorDestination,-
2109 rasterop_solid_NotSourceAndNotDestination,-
2110 rasterop_solid_NotSourceOrNotDestination,-
2111 rasterop_solid_NotSourceXorDestination,-
2112 rasterop_solid_NotSource,-
2113 rasterop_solid_NotSourceAndDestination,-
2114 rasterop_solid_SourceAndNotDestination,-
2115 rasterop_solid_NotSourceOrDestination,-
2116 rasterop_solid_SourceOrNotDestination,-
2117 rasterop_solid_ClearDestination,-
2118 rasterop_solid_SetDestination,-
2119 rasterop_solid_NotDestination-
2120};-
2121-
2122CompositionFunctionSolid64 qt_functionForModeSolid64_C[] = {-
2123 comp_func_solid_SourceOver_rgb64,-
2124 comp_func_solid_DestinationOver_rgb64,-
2125 comp_func_solid_Clear_rgb64,-
2126 comp_func_solid_Source_rgb64,-
2127 comp_func_solid_Destination_rgb64,-
2128 comp_func_solid_SourceIn_rgb64,-
2129 comp_func_solid_DestinationIn_rgb64,-
2130 comp_func_solid_SourceOut_rgb64,-
2131 comp_func_solid_DestinationOut_rgb64,-
2132 comp_func_solid_SourceAtop_rgb64,-
2133 comp_func_solid_DestinationAtop_rgb64,-
2134 comp_func_solid_XOR_rgb64,-
2135 comp_func_solid_Plus_rgb64,-
2136 0, 0, 0, 0, 0,-
2137 0, 0, 0, 0, 0, 0,-
2138 0, 0, 0, 0, 0, 0,-
2139 0, 0, 0, 0, 0, 0, 0, 0-
2140};-
2141-
2142CompositionFunction qt_functionForMode_C[] = {-
2143 comp_func_SourceOver,-
2144 comp_func_DestinationOver,-
2145 comp_func_Clear,-
2146 comp_func_Source,-
2147 comp_func_Destination,-
2148 comp_func_SourceIn,-
2149 comp_func_DestinationIn,-
2150 comp_func_SourceOut,-
2151 comp_func_DestinationOut,-
2152 comp_func_SourceAtop,-
2153 comp_func_DestinationAtop,-
2154 comp_func_XOR,-
2155 comp_func_Plus,-
2156 comp_func_Multiply,-
2157 comp_func_Screen,-
2158 comp_func_Overlay,-
2159 comp_func_Darken,-
2160 comp_func_Lighten,-
2161 comp_func_ColorDodge,-
2162 comp_func_ColorBurn,-
2163 comp_func_HardLight,-
2164 comp_func_SoftLight,-
2165 comp_func_Difference,-
2166 comp_func_Exclusion,-
2167 rasterop_SourceOrDestination,-
2168 rasterop_SourceAndDestination,-
2169 rasterop_SourceXorDestination,-
2170 rasterop_NotSourceAndNotDestination,-
2171 rasterop_NotSourceOrNotDestination,-
2172 rasterop_NotSourceXorDestination,-
2173 rasterop_NotSource,-
2174 rasterop_NotSourceAndDestination,-
2175 rasterop_SourceAndNotDestination,-
2176 rasterop_NotSourceOrDestination,-
2177 rasterop_SourceOrNotDestination,-
2178 rasterop_ClearDestination,-
2179 rasterop_SetDestination,-
2180 rasterop_NotDestination-
2181};-
2182-
2183CompositionFunction64 qt_functionForMode64_C[] = {-
2184 comp_func_SourceOver_rgb64,-
2185 comp_func_DestinationOver_rgb64,-
2186 comp_func_Clear_rgb64,-
2187 comp_func_Source_rgb64,-
2188 comp_func_Destination_rgb64,-
2189 comp_func_SourceIn_rgb64,-
2190 comp_func_DestinationIn_rgb64,-
2191 comp_func_SourceOut_rgb64,-
2192 comp_func_DestinationOut_rgb64,-
2193 comp_func_SourceAtop_rgb64,-
2194 comp_func_DestinationAtop_rgb64,-
2195 comp_func_XOR_rgb64,-
2196 comp_func_Plus_rgb64,-
2197 0, 0, 0, 0, 0,-
2198 0, 0, 0, 0, 0, 0,-
2199 0, 0, 0, 0, 0, 0,-
2200 0, 0, 0, 0, 0, 0, 0, 0-
2201};-
2202-
2203QT_END_NAMESPACE-
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9