author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Tue, 06 Jul 2010 15:10:48 +0300 | |
changeset 30 | 5dc02b23752f |
parent 18 | 2f34d5167611 |
child 37 | 758a864f9613 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
18
2f34d5167611
Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtGui module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#include <qmath.h> |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
43 |
#include "qblendfunctions_p.h" |
0 | 44 |
|
45 |
QT_BEGIN_NAMESPACE |
|
46 |
||
47 |
struct SourceOnlyAlpha |
|
48 |
{ |
|
49 |
inline uchar alpha(uchar src) const { return src; } |
|
50 |
inline quint16 bytemul(quint16 spix) const { return spix; } |
|
51 |
}; |
|
52 |
||
53 |
||
54 |
struct SourceAndConstAlpha |
|
55 |
{ |
|
56 |
SourceAndConstAlpha(int a) : m_alpha256(a) { |
|
57 |
m_alpha255 = (m_alpha256 * 255) >> 8; |
|
58 |
}; |
|
59 |
inline uchar alpha(uchar src) const { return (src * m_alpha256) >> 8; } |
|
60 |
inline quint16 bytemul(quint16 x) const { |
|
61 |
uint t = (((x & 0x07e0)*m_alpha255) >> 8) & 0x07e0; |
|
62 |
t |= (((x & 0xf81f)*(m_alpha255>>2)) >> 6) & 0xf81f; |
|
63 |
return t; |
|
64 |
} |
|
65 |
int m_alpha255; |
|
66 |
int m_alpha256; |
|
67 |
}; |
|
68 |
||
69 |
||
70 |
/************************************************************************ |
|
71 |
RGB16 (565) format target format |
|
72 |
************************************************************************/ |
|
73 |
||
74 |
static inline quint16 convert_argb32_to_rgb16(quint32 spix) |
|
75 |
{ |
|
76 |
quint32 b = spix; |
|
77 |
quint32 g = spix; |
|
78 |
b >>= 8; |
|
79 |
g >>= 5; |
|
80 |
b &= 0x0000f800; |
|
81 |
g &= 0x000007e0; |
|
82 |
spix >>= 3; |
|
83 |
b |= g; |
|
84 |
spix &= 0x0000001f; |
|
85 |
b |= spix; |
|
86 |
return b; |
|
87 |
} |
|
88 |
||
89 |
struct Blend_RGB16_on_RGB16_NoAlpha { |
|
90 |
inline void write(quint16 *dst, quint16 src) { *dst = src; } |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
91 |
|
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
92 |
inline void flush(void *) {} |
0 | 93 |
}; |
94 |
||
95 |
struct Blend_RGB16_on_RGB16_ConstAlpha { |
|
96 |
inline Blend_RGB16_on_RGB16_ConstAlpha(quint32 alpha) { |
|
97 |
m_alpha = (alpha * 255) >> 8; |
|
98 |
m_ialpha = 255 - m_alpha; |
|
99 |
} |
|
100 |
||
101 |
inline void write(quint16 *dst, quint16 src) { |
|
102 |
*dst = BYTE_MUL_RGB16(src, m_alpha) + BYTE_MUL_RGB16(*dst, m_ialpha); |
|
103 |
} |
|
104 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
105 |
inline void flush(void *) {} |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
106 |
|
0 | 107 |
quint32 m_alpha; |
108 |
quint32 m_ialpha; |
|
109 |
}; |
|
110 |
||
111 |
struct Blend_ARGB24_on_RGB16_SourceAlpha { |
|
112 |
inline void write(quint16 *dst, const qargb8565 &src) { |
|
113 |
const uint alpha = src.alpha(); |
|
114 |
if (alpha) { |
|
115 |
quint16 s = src.rawValue16(); |
|
116 |
if (alpha < 255) |
|
117 |
s += BYTE_MUL_RGB16(*dst, 255 - alpha); |
|
118 |
*dst = s; |
|
119 |
} |
|
120 |
} |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
121 |
|
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
122 |
inline void flush(void *) {} |
0 | 123 |
}; |
124 |
||
125 |
struct Blend_ARGB24_on_RGB16_SourceAndConstAlpha { |
|
126 |
inline Blend_ARGB24_on_RGB16_SourceAndConstAlpha(quint32 alpha) { |
|
127 |
m_alpha = (alpha * 255) >> 8; |
|
128 |
} |
|
129 |
||
130 |
inline void write(quint16 *dst, qargb8565 src) { |
|
131 |
src = src.byte_mul(src.alpha(m_alpha)); |
|
132 |
const uint alpha = src.alpha(); |
|
133 |
if (alpha) { |
|
134 |
quint16 s = src.rawValue16(); |
|
135 |
if (alpha < 255) |
|
136 |
s += BYTE_MUL_RGB16(*dst, 255 - alpha); |
|
137 |
*dst = s; |
|
138 |
} |
|
139 |
} |
|
140 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
141 |
inline void flush(void *) {} |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
142 |
|
0 | 143 |
quint32 m_alpha; |
144 |
}; |
|
145 |
||
146 |
struct Blend_ARGB32_on_RGB16_SourceAlpha { |
|
147 |
inline void write(quint16 *dst, quint32 src) { |
|
148 |
const quint8 alpha = qAlpha(src); |
|
149 |
if(alpha) { |
|
150 |
quint16 s = convert_argb32_to_rgb16(src); |
|
151 |
if(alpha < 255) |
|
152 |
s += BYTE_MUL_RGB16(*dst, 255 - alpha); |
|
153 |
*dst = s; |
|
154 |
} |
|
155 |
} |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
156 |
|
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
157 |
inline void flush(void *) {} |
0 | 158 |
}; |
159 |
||
160 |
struct Blend_ARGB32_on_RGB16_SourceAndConstAlpha { |
|
161 |
inline Blend_ARGB32_on_RGB16_SourceAndConstAlpha(quint32 alpha) { |
|
162 |
m_alpha = (alpha * 255) >> 8; |
|
163 |
} |
|
164 |
||
165 |
inline void write(quint16 *dst, quint32 src) { |
|
166 |
src = BYTE_MUL(src, m_alpha); |
|
167 |
const quint8 alpha = qAlpha(src); |
|
168 |
if(alpha) { |
|
169 |
quint16 s = convert_argb32_to_rgb16(src); |
|
170 |
if(alpha < 255) |
|
171 |
s += BYTE_MUL_RGB16(*dst, 255 - alpha); |
|
172 |
*dst = s; |
|
173 |
} |
|
174 |
} |
|
175 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
176 |
inline void flush(void *) {} |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
177 |
|
0 | 178 |
quint32 m_alpha; |
179 |
}; |
|
180 |
||
181 |
void qt_scale_image_rgb16_on_rgb16(uchar *destPixels, int dbpl, |
|
182 |
const uchar *srcPixels, int sbpl, |
|
183 |
const QRectF &targetRect, |
|
184 |
const QRectF &sourceRect, |
|
185 |
const QRect &clip, |
|
186 |
int const_alpha) |
|
187 |
{ |
|
188 |
#ifdef QT_DEBUG_DRAW |
|
189 |
printf("qt_scale_rgb16_on_rgb16: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n", |
|
190 |
destPixels, dbpl, srcPixels, sbpl, |
|
191 |
targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), |
|
192 |
sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(), |
|
193 |
const_alpha); |
|
194 |
#endif |
|
195 |
if (const_alpha == 256) { |
|
196 |
Blend_RGB16_on_RGB16_NoAlpha noAlpha; |
|
197 |
qt_scale_image_16bit<quint16>(destPixels, dbpl, srcPixels, sbpl, |
|
198 |
targetRect, sourceRect, clip, noAlpha); |
|
199 |
} else { |
|
200 |
Blend_RGB16_on_RGB16_ConstAlpha constAlpha(const_alpha); |
|
201 |
qt_scale_image_16bit<quint16>(destPixels, dbpl, srcPixels, sbpl, |
|
202 |
targetRect, sourceRect, clip, constAlpha); |
|
203 |
} |
|
204 |
} |
|
205 |
||
206 |
void qt_scale_image_argb24_on_rgb16(uchar *destPixels, int dbpl, |
|
207 |
const uchar *srcPixels, int sbpl, |
|
208 |
const QRectF &targetRect, |
|
209 |
const QRectF &sourceRect, |
|
210 |
const QRect &clip, |
|
211 |
int const_alpha) |
|
212 |
{ |
|
213 |
#ifdef QT_DEBUG_DRAW |
|
214 |
printf("qt_scale_argb24_on_rgb16: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n", |
|
215 |
destPixels, dbpl, srcPixels, sbpl, |
|
216 |
targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), |
|
217 |
sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(), |
|
218 |
const_alpha); |
|
219 |
#endif |
|
220 |
if (const_alpha == 256) { |
|
221 |
Blend_ARGB24_on_RGB16_SourceAlpha noAlpha; |
|
222 |
qt_scale_image_16bit<qargb8565>(destPixels, dbpl, srcPixels, sbpl, |
|
223 |
targetRect, sourceRect, clip, noAlpha); |
|
224 |
} else { |
|
225 |
Blend_ARGB24_on_RGB16_SourceAndConstAlpha constAlpha(const_alpha); |
|
226 |
qt_scale_image_16bit<qargb8565>(destPixels, dbpl, srcPixels, sbpl, |
|
227 |
targetRect, sourceRect, clip, constAlpha); |
|
228 |
} |
|
229 |
} |
|
230 |
||
231 |
||
232 |
void qt_scale_image_argb32_on_rgb16(uchar *destPixels, int dbpl, |
|
233 |
const uchar *srcPixels, int sbpl, |
|
234 |
const QRectF &targetRect, |
|
235 |
const QRectF &sourceRect, |
|
236 |
const QRect &clip, |
|
237 |
int const_alpha) |
|
238 |
{ |
|
239 |
#ifdef QT_DEBUG_DRAW |
|
240 |
printf("qt_scale_argb32_on_rgb16: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n", |
|
241 |
destPixels, dbpl, srcPixels, sbpl, |
|
242 |
targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), |
|
243 |
sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(), |
|
244 |
const_alpha); |
|
245 |
#endif |
|
246 |
if (const_alpha == 256) { |
|
247 |
Blend_ARGB32_on_RGB16_SourceAlpha noAlpha; |
|
248 |
qt_scale_image_16bit<quint32>(destPixels, dbpl, srcPixels, sbpl, |
|
249 |
targetRect, sourceRect, clip, noAlpha); |
|
250 |
} else { |
|
251 |
Blend_ARGB32_on_RGB16_SourceAndConstAlpha constAlpha(const_alpha); |
|
252 |
qt_scale_image_16bit<quint32>(destPixels, dbpl, srcPixels, sbpl, |
|
253 |
targetRect, sourceRect, clip, constAlpha); |
|
254 |
} |
|
255 |
} |
|
256 |
||
257 |
static void qt_blend_rgb16_on_rgb16(uchar *dst, int dbpl, |
|
258 |
const uchar *src, int sbpl, |
|
259 |
int w, int h, |
|
260 |
int const_alpha) |
|
261 |
{ |
|
262 |
#ifdef QT_DEBUG_DRAW |
|
263 |
printf("qt_blend_rgb16_on_rgb16: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", |
|
264 |
dst, dbpl, src, sbpl, w, h, const_alpha); |
|
265 |
#endif |
|
266 |
||
267 |
if (const_alpha == 256) { |
|
268 |
if (w <= 64) { |
|
269 |
while (h--) { |
|
270 |
QT_MEMCPY_USHORT(dst, src, w); |
|
271 |
dst += dbpl; |
|
272 |
src += sbpl; |
|
273 |
} |
|
274 |
} else { |
|
275 |
int length = w << 1; |
|
276 |
while (h--) { |
|
277 |
memcpy(dst, src, length); |
|
278 |
dst += dbpl; |
|
279 |
src += sbpl; |
|
280 |
} |
|
281 |
} |
|
282 |
} else if (const_alpha != 0) { |
|
283 |
SourceAndConstAlpha alpha(const_alpha); // expects the 0-256 range |
|
284 |
quint16 *d = (quint16 *) dst; |
|
285 |
const quint16 *s = (const quint16 *) src; |
|
286 |
quint8 a = (255 * const_alpha) >> 8; |
|
287 |
quint8 ia = 255 - a; |
|
288 |
while (h--) { |
|
289 |
for (int x=0; x<w; ++x) { |
|
290 |
d[x] = BYTE_MUL_RGB16(s[x], a) + BYTE_MUL_RGB16(d[x], ia); |
|
291 |
} |
|
292 |
d = (quint16 *)(((uchar *) d) + dbpl); |
|
293 |
s = (const quint16 *)(((const uchar *) s) + sbpl); |
|
294 |
} |
|
295 |
} |
|
296 |
} |
|
297 |
||
298 |
||
299 |
template <typename T> void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl, |
|
300 |
const uchar *srcPixels, int sbpl, |
|
301 |
int w, int h, const T &alphaFunc) |
|
302 |
{ |
|
303 |
int srcOffset = w*3; |
|
304 |
int dstJPL = dbpl / 2; |
|
305 |
quint16 *dst = (quint16 *) destPixels; |
|
306 |
int dstExtraStride = dstJPL - w; |
|
307 |
||
308 |
for (int y=0; y<h; ++y) { |
|
309 |
const uchar *src = srcPixels + y * sbpl; |
|
310 |
const uchar *srcEnd = src + srcOffset; |
|
311 |
while (src < srcEnd) { |
|
312 |
#if defined(QT_ARCH_ARM) || defined(QT_ARCH_POWERPC) || defined(QT_ARCH_SH) || defined(QT_ARCH_AVR32) || (defined(QT_ARCH_WINDOWSCE) && !defined(_X86_)) || (defined(QT_ARCH_SPARC) && defined(Q_CC_GNU)) |
|
313 |
// non-16-bit aligned memory access is not possible on PowerPC, |
|
314 |
// ARM <v6 (QT_ARCH_ARMV6) & SH & AVR32 & SPARC w/GCC |
|
315 |
quint16 spix = (quint16(src[2])<<8) + src[1]; |
|
316 |
#else |
|
317 |
quint16 spix = *(quint16 *) (src + 1); |
|
318 |
#endif |
|
319 |
uchar alpha = alphaFunc.alpha(*src); |
|
320 |
||
321 |
if (alpha == 255) { |
|
322 |
*dst = spix; |
|
323 |
} else if (alpha != 0) { |
|
324 |
quint16 dpix = *dst; |
|
325 |
quint32 sia = 255 - alpha; |
|
326 |
||
327 |
quint16 dr = (dpix & 0x0000f800); |
|
328 |
quint16 dg = (dpix & 0x000007e0); |
|
329 |
quint16 db = (dpix & 0x0000001f); |
|
330 |
||
331 |
quint32 siar = dr * sia; |
|
332 |
quint32 siag = dg * sia; |
|
333 |
quint32 siab = db * sia; |
|
334 |
||
335 |
quint32 rr = ((siar + (siar>>8) + (0x80 << 8)) >> 8) & 0xf800; |
|
336 |
quint32 rg = ((siag + (siag>>8) + (0x80 << 3)) >> 8) & 0x07e0; |
|
337 |
quint32 rb = ((siab + (siab>>8) + (0x80 >> 3)) >> 8) & 0x001f; |
|
338 |
||
339 |
*dst = alphaFunc.bytemul(spix) + rr + rg + rb; |
|
340 |
} |
|
341 |
||
342 |
++dst; |
|
343 |
src += 3; |
|
344 |
} |
|
345 |
dst += dstExtraStride; |
|
346 |
} |
|
347 |
||
348 |
} |
|
349 |
||
350 |
static void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl, |
|
351 |
const uchar *srcPixels, int sbpl, |
|
352 |
int w, int h, |
|
353 |
int const_alpha) |
|
354 |
{ |
|
355 |
#ifdef QT_DEBUG_DRAW |
|
356 |
printf("qt_blend_argb24_on_rgb16: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", |
|
357 |
destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); |
|
358 |
#endif |
|
359 |
||
360 |
if (const_alpha != 256) { |
|
361 |
SourceAndConstAlpha alphaFunc(const_alpha); |
|
362 |
qt_blend_argb24_on_rgb16(destPixels, dbpl, srcPixels, sbpl, w, h, alphaFunc); |
|
363 |
} else { |
|
364 |
SourceOnlyAlpha alphaFunc; |
|
365 |
qt_blend_argb24_on_rgb16(destPixels, dbpl, srcPixels, sbpl, w, h, alphaFunc); |
|
366 |
} |
|
367 |
} |
|
368 |
||
369 |
||
370 |
||
371 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
372 |
void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
373 |
const uchar *srcPixels, int sbpl, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
374 |
int w, int h, |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
375 |
int const_alpha) |
0 | 376 |
{ |
377 |
quint16 *dst = (quint16 *) destPixels; |
|
378 |
const quint32 *src = (const quint32 *) srcPixels; |
|
379 |
||
380 |
const_alpha = (const_alpha * 255) >> 8; |
|
381 |
for (int y=0; y<h; ++y) { |
|
382 |
for (int i = 0; i < w; ++i) { |
|
383 |
uint s = src[i]; |
|
384 |
s = BYTE_MUL(s, const_alpha); |
|
385 |
int alpha = qAlpha(s); |
|
386 |
s = convert_argb32_to_rgb16(s); |
|
387 |
s += BYTE_MUL_RGB16(dst[i], 255 - alpha); |
|
388 |
dst[i] = s; |
|
389 |
} |
|
390 |
dst = (quint16 *)(((uchar *) dst) + dbpl); |
|
391 |
src = (const quint32 *)(((const uchar *) src) + sbpl); |
|
392 |
} |
|
393 |
} |
|
394 |
||
395 |
static void qt_blend_argb32_on_rgb16(uchar *destPixels, int dbpl, |
|
396 |
const uchar *srcPixels, int sbpl, |
|
397 |
int w, int h, |
|
398 |
int const_alpha) |
|
399 |
{ |
|
400 |
if (const_alpha != 256) { |
|
401 |
qt_blend_argb32_on_rgb16_const_alpha(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); |
|
402 |
return; |
|
403 |
} |
|
404 |
||
405 |
quint16 *dst = (quint16 *) destPixels; |
|
406 |
quint32 *src = (quint32 *) srcPixels; |
|
407 |
||
408 |
for (int y=0; y<h; ++y) { |
|
409 |
for (int x=0; x<w; ++x) { |
|
410 |
||
411 |
quint32 spix = src[x]; |
|
412 |
quint32 alpha = spix >> 24; |
|
413 |
||
414 |
if (alpha == 255) { |
|
415 |
dst[x] = convert_argb32_to_rgb16(spix); |
|
416 |
} else if (alpha != 0) { |
|
417 |
quint32 dpix = dst[x]; |
|
418 |
||
419 |
quint32 sia = 255 - alpha; |
|
420 |
||
421 |
quint32 sr = (spix >> 8) & 0xf800; |
|
422 |
quint32 sg = (spix >> 5) & 0x07e0; |
|
423 |
quint32 sb = (spix >> 3) & 0x001f; |
|
424 |
||
425 |
quint32 dr = (dpix & 0x0000f800); |
|
426 |
quint32 dg = (dpix & 0x000007e0); |
|
427 |
quint32 db = (dpix & 0x0000001f); |
|
428 |
||
429 |
quint32 siar = dr * sia; |
|
430 |
quint32 siag = dg * sia; |
|
431 |
quint32 siab = db * sia; |
|
432 |
||
433 |
quint32 rr = sr + ((siar + (siar>>8) + (0x80 << 8)) >> 8); |
|
434 |
quint32 rg = sg + ((siag + (siag>>8) + (0x80 << 3)) >> 8); |
|
435 |
quint32 rb = sb + ((siab + (siab>>8) + (0x80 >> 3)) >> 8); |
|
436 |
||
437 |
dst[x] = (rr & 0xf800) |
|
438 |
| (rg & 0x07e0) |
|
439 |
| (rb); |
|
440 |
} |
|
441 |
} |
|
442 |
dst = (quint16 *) (((uchar *) dst) + dbpl); |
|
443 |
src = (quint32 *) (((uchar *) src) + sbpl); |
|
444 |
} |
|
445 |
} |
|
446 |
||
447 |
||
448 |
static void qt_blend_rgb32_on_rgb16(uchar *destPixels, int dbpl, |
|
449 |
const uchar *srcPixels, int sbpl, |
|
450 |
int w, int h, |
|
451 |
int const_alpha) |
|
452 |
{ |
|
453 |
#ifdef QT_DEBUG_DRAW |
|
454 |
printf("qt_blend_rgb32_on_rgb16: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", |
|
455 |
destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); |
|
456 |
#endif |
|
457 |
||
458 |
if (const_alpha != 256) { |
|
459 |
qt_blend_argb32_on_rgb16(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); |
|
460 |
return; |
|
461 |
} |
|
462 |
||
463 |
const quint32 *src = (const quint32 *) srcPixels; |
|
464 |
int srcExtraStride = (sbpl >> 2) - w; |
|
465 |
||
466 |
int dstJPL = dbpl / 2; |
|
467 |
||
468 |
quint16 *dst = (quint16 *) destPixels; |
|
469 |
quint16 *dstEnd = dst + dstJPL * h; |
|
470 |
||
471 |
int dstExtraStride = dstJPL - w; |
|
472 |
||
473 |
while (dst < dstEnd) { |
|
474 |
const quint32 *srcEnd = src + w; |
|
475 |
while (src < srcEnd) { |
|
476 |
*dst = convert_argb32_to_rgb16(*src); |
|
477 |
++dst; |
|
478 |
++src; |
|
479 |
} |
|
480 |
dst += dstExtraStride; |
|
481 |
src += srcExtraStride; |
|
482 |
} |
|
483 |
} |
|
484 |
||
485 |
||
486 |
||
487 |
/************************************************************************ |
|
488 |
RGB32 (-888) format target format |
|
489 |
************************************************************************/ |
|
490 |
||
491 |
static void qt_blend_argb32_on_argb32(uchar *destPixels, int dbpl, |
|
492 |
const uchar *srcPixels, int sbpl, |
|
493 |
int w, int h, |
|
494 |
int const_alpha) |
|
495 |
{ |
|
496 |
#ifdef QT_DEBUG_DRAW |
|
497 |
fprintf(stdout, "qt_blend_argb32_on_argb32: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", |
|
498 |
destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); |
|
499 |
fflush(stdout); |
|
500 |
#endif |
|
501 |
||
502 |
const uint *src = (const uint *) srcPixels; |
|
503 |
uint *dst = (uint *) destPixels; |
|
504 |
if (const_alpha == 256) { |
|
505 |
for (int y=0; y<h; ++y) { |
|
506 |
for (int x=0; x<w; ++x) { |
|
507 |
uint s = src[x]; |
|
508 |
if (s >= 0xff000000) |
|
509 |
dst[x] = s; |
|
510 |
else if (s != 0) |
|
511 |
dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); |
|
512 |
} |
|
513 |
dst = (quint32 *)(((uchar *) dst) + dbpl); |
|
514 |
src = (const quint32 *)(((const uchar *) src) + sbpl); |
|
515 |
} |
|
516 |
} else if (const_alpha != 0) { |
|
517 |
const_alpha = (const_alpha * 255) >> 8; |
|
518 |
for (int y=0; y<h; ++y) { |
|
519 |
for (int x=0; x<w; ++x) { |
|
520 |
uint s = BYTE_MUL(src[x], const_alpha); |
|
521 |
dst[x] = s + BYTE_MUL(dst[x], qAlpha(~s)); |
|
522 |
} |
|
523 |
dst = (quint32 *)(((uchar *) dst) + dbpl); |
|
524 |
src = (const quint32 *)(((const uchar *) src) + sbpl); |
|
525 |
} |
|
526 |
} |
|
527 |
} |
|
528 |
||
529 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
530 |
void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl, |
0 | 531 |
const uchar *srcPixels, int sbpl, |
532 |
int w, int h, |
|
533 |
int const_alpha) |
|
534 |
{ |
|
535 |
#ifdef QT_DEBUG_DRAW |
|
536 |
fprintf(stdout, "qt_blend_rgb32_on_rgb32: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", |
|
537 |
destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); |
|
538 |
fflush(stdout); |
|
539 |
#endif |
|
540 |
||
541 |
if (const_alpha != 256) { |
|
542 |
qt_blend_argb32_on_argb32(destPixels, dbpl, srcPixels, sbpl, w, h, const_alpha); |
|
543 |
return; |
|
544 |
} |
|
545 |
||
546 |
const uint *src = (const uint *) srcPixels; |
|
547 |
uint *dst = (uint *) destPixels; |
|
548 |
if (w <= 64) { |
|
549 |
for (int y=0; y<h; ++y) { |
|
550 |
qt_memconvert(dst, src, w); |
|
551 |
dst = (quint32 *)(((uchar *) dst) + dbpl); |
|
552 |
src = (const quint32 *)(((const uchar *) src) + sbpl); |
|
553 |
} |
|
554 |
} else { |
|
555 |
int len = w * 4; |
|
556 |
for (int y=0; y<h; ++y) { |
|
557 |
memcpy(dst, src, len); |
|
558 |
dst = (quint32 *)(((uchar *) dst) + dbpl); |
|
559 |
src = (const quint32 *)(((const uchar *) src) + sbpl); |
|
560 |
} |
|
561 |
} |
|
562 |
} |
|
563 |
||
564 |
||
565 |
||
566 |
struct Blend_RGB32_on_RGB32_NoAlpha { |
|
567 |
inline void write(quint32 *dst, quint32 src) { *dst = src; } |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
568 |
|
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
569 |
inline void flush(void *) {} |
0 | 570 |
}; |
571 |
||
572 |
struct Blend_RGB32_on_RGB32_ConstAlpha { |
|
573 |
inline Blend_RGB32_on_RGB32_ConstAlpha(quint32 alpha) { |
|
574 |
m_alpha = (alpha * 255) >> 8; |
|
575 |
m_ialpha = 255 - m_alpha; |
|
576 |
} |
|
577 |
||
578 |
inline void write(quint32 *dst, quint32 src) { |
|
579 |
*dst = BYTE_MUL(src, m_alpha) + BYTE_MUL(*dst, m_ialpha); |
|
580 |
} |
|
581 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
582 |
inline void flush(void *) {} |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
583 |
|
0 | 584 |
quint32 m_alpha; |
585 |
quint32 m_ialpha; |
|
586 |
}; |
|
587 |
||
588 |
struct Blend_ARGB32_on_ARGB32_SourceAlpha { |
|
589 |
inline void write(quint32 *dst, quint32 src) { |
|
590 |
*dst = src + BYTE_MUL(*dst, qAlpha(~src)); |
|
591 |
} |
|
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
592 |
|
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
593 |
inline void flush(void *) {} |
0 | 594 |
}; |
595 |
||
596 |
struct Blend_ARGB32_on_ARGB32_SourceAndConstAlpha { |
|
597 |
inline Blend_ARGB32_on_ARGB32_SourceAndConstAlpha(quint32 alpha) { |
|
598 |
m_alpha = (alpha * 255) >> 8; |
|
599 |
m_ialpha = 255 - m_alpha; |
|
600 |
} |
|
601 |
||
602 |
inline void write(quint32 *dst, quint32 src) { |
|
603 |
src = BYTE_MUL(src, m_alpha); |
|
604 |
*dst = src + BYTE_MUL(*dst, qAlpha(~src)); |
|
605 |
} |
|
606 |
||
30
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
607 |
inline void flush(void *) {} |
5dc02b23752f
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
18
diff
changeset
|
608 |
|
0 | 609 |
quint32 m_alpha; |
610 |
quint32 m_ialpha; |
|
611 |
}; |
|
612 |
||
613 |
void qt_scale_image_rgb32_on_rgb32(uchar *destPixels, int dbpl, |
|
614 |
const uchar *srcPixels, int sbpl, |
|
615 |
const QRectF &targetRect, |
|
616 |
const QRectF &sourceRect, |
|
617 |
const QRect &clip, |
|
618 |
int const_alpha) |
|
619 |
{ |
|
620 |
#ifdef QT_DEBUG_DRAW |
|
621 |
printf("qt_scale_rgb32_on_rgb32: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n", |
|
622 |
destPixels, dbpl, srcPixels, sbpl, |
|
623 |
targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), |
|
624 |
sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(), |
|
625 |
const_alpha); |
|
626 |
#endif |
|
627 |
if (const_alpha == 256) { |
|
628 |
Blend_RGB32_on_RGB32_NoAlpha noAlpha; |
|
629 |
qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, |
|
630 |
targetRect, sourceRect, clip, noAlpha); |
|
631 |
} else { |
|
632 |
Blend_RGB32_on_RGB32_ConstAlpha constAlpha(const_alpha); |
|
633 |
qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, |
|
634 |
targetRect, sourceRect, clip, constAlpha); |
|
635 |
} |
|
636 |
} |
|
637 |
||
638 |
void qt_scale_image_argb32_on_argb32(uchar *destPixels, int dbpl, |
|
639 |
const uchar *srcPixels, int sbpl, |
|
640 |
const QRectF &targetRect, |
|
641 |
const QRectF &sourceRect, |
|
642 |
const QRect &clip, |
|
643 |
int const_alpha) |
|
644 |
{ |
|
645 |
#ifdef QT_DEBUG_DRAW |
|
646 |
printf("qt_scale_argb32_on_argb32: dst=(%p, %d), src=(%p, %d), target=(%d, %d), [%d x %d], src=(%d, %d) [%d x %d] alpha=%d\n", |
|
647 |
destPixels, dbpl, srcPixels, sbpl, |
|
648 |
targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), |
|
649 |
sourceRect.x(), sourceRect.y(), sourceRect.width(), sourceRect.height(), |
|
650 |
const_alpha); |
|
651 |
#endif |
|
652 |
if (const_alpha == 256) { |
|
653 |
Blend_ARGB32_on_ARGB32_SourceAlpha sourceAlpha; |
|
654 |
qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, |
|
655 |
targetRect, sourceRect, clip, sourceAlpha); |
|
656 |
} else { |
|
657 |
Blend_ARGB32_on_ARGB32_SourceAndConstAlpha constAlpha(const_alpha); |
|
658 |
qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, |
|
659 |
targetRect, sourceRect, clip, constAlpha); |
|
660 |
} |
|
661 |
} |
|
662 |
||
663 |
void qt_transform_image_rgb16_on_rgb16(uchar *destPixels, int dbpl, |
|
664 |
const uchar *srcPixels, int sbpl, |
|
665 |
const QRectF &targetRect, |
|
666 |
const QRectF &sourceRect, |
|
667 |
const QRect &clip, |
|
668 |
const QTransform &targetRectTransform, |
|
669 |
int const_alpha) |
|
670 |
{ |
|
671 |
if (const_alpha == 256) { |
|
672 |
Blend_RGB16_on_RGB16_NoAlpha noAlpha; |
|
673 |
qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl, |
|
674 |
reinterpret_cast<const quint16 *>(srcPixels), sbpl, |
|
675 |
targetRect, sourceRect, clip, targetRectTransform, noAlpha); |
|
676 |
} else { |
|
677 |
Blend_RGB16_on_RGB16_ConstAlpha constAlpha(const_alpha); |
|
678 |
qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl, |
|
679 |
reinterpret_cast<const quint16 *>(srcPixels), sbpl, |
|
680 |
targetRect, sourceRect, clip, targetRectTransform, constAlpha); |
|
681 |
} |
|
682 |
} |
|
683 |
||
684 |
void qt_transform_image_argb24_on_rgb16(uchar *destPixels, int dbpl, |
|
685 |
const uchar *srcPixels, int sbpl, |
|
686 |
const QRectF &targetRect, |
|
687 |
const QRectF &sourceRect, |
|
688 |
const QRect &clip, |
|
689 |
const QTransform &targetRectTransform, |
|
690 |
int const_alpha) |
|
691 |
{ |
|
692 |
if (const_alpha == 256) { |
|
693 |
Blend_ARGB24_on_RGB16_SourceAlpha noAlpha; |
|
694 |
qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl, |
|
695 |
reinterpret_cast<const qargb8565 *>(srcPixels), sbpl, |
|
696 |
targetRect, sourceRect, clip, targetRectTransform, noAlpha); |
|
697 |
} else { |
|
698 |
Blend_ARGB24_on_RGB16_SourceAndConstAlpha constAlpha(const_alpha); |
|
699 |
qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl, |
|
700 |
reinterpret_cast<const qargb8565 *>(srcPixels), sbpl, |
|
701 |
targetRect, sourceRect, clip, targetRectTransform, constAlpha); |
|
702 |
} |
|
703 |
} |
|
704 |
||
705 |
||
706 |
void qt_transform_image_argb32_on_rgb16(uchar *destPixels, int dbpl, |
|
707 |
const uchar *srcPixels, int sbpl, |
|
708 |
const QRectF &targetRect, |
|
709 |
const QRectF &sourceRect, |
|
710 |
const QRect &clip, |
|
711 |
const QTransform &targetRectTransform, |
|
712 |
int const_alpha) |
|
713 |
{ |
|
714 |
if (const_alpha == 256) { |
|
715 |
Blend_ARGB32_on_RGB16_SourceAlpha noAlpha; |
|
716 |
qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl, |
|
717 |
reinterpret_cast<const quint32 *>(srcPixels), sbpl, |
|
718 |
targetRect, sourceRect, clip, targetRectTransform, noAlpha); |
|
719 |
} else { |
|
720 |
Blend_ARGB32_on_RGB16_SourceAndConstAlpha constAlpha(const_alpha); |
|
721 |
qt_transform_image(reinterpret_cast<quint16 *>(destPixels), dbpl, |
|
722 |
reinterpret_cast<const quint32 *>(srcPixels), sbpl, |
|
723 |
targetRect, sourceRect, clip, targetRectTransform, constAlpha); |
|
724 |
} |
|
725 |
} |
|
726 |
||
727 |
||
728 |
void qt_transform_image_rgb32_on_rgb32(uchar *destPixels, int dbpl, |
|
729 |
const uchar *srcPixels, int sbpl, |
|
730 |
const QRectF &targetRect, |
|
731 |
const QRectF &sourceRect, |
|
732 |
const QRect &clip, |
|
733 |
const QTransform &targetRectTransform, |
|
734 |
int const_alpha) |
|
735 |
{ |
|
736 |
if (const_alpha == 256) { |
|
737 |
Blend_RGB32_on_RGB32_NoAlpha noAlpha; |
|
738 |
qt_transform_image(reinterpret_cast<quint32 *>(destPixels), dbpl, |
|
739 |
reinterpret_cast<const quint32 *>(srcPixels), sbpl, |
|
740 |
targetRect, sourceRect, clip, targetRectTransform, noAlpha); |
|
741 |
} else { |
|
742 |
Blend_RGB32_on_RGB32_ConstAlpha constAlpha(const_alpha); |
|
743 |
qt_transform_image(reinterpret_cast<quint32 *>(destPixels), dbpl, |
|
744 |
reinterpret_cast<const quint32 *>(srcPixels), sbpl, |
|
745 |
targetRect, sourceRect, clip, targetRectTransform, constAlpha); |
|
746 |
} |
|
747 |
} |
|
748 |
||
749 |
void qt_transform_image_argb32_on_argb32(uchar *destPixels, int dbpl, |
|
750 |
const uchar *srcPixels, int sbpl, |
|
751 |
const QRectF &targetRect, |
|
752 |
const QRectF &sourceRect, |
|
753 |
const QRect &clip, |
|
754 |
const QTransform &targetRectTransform, |
|
755 |
int const_alpha) |
|
756 |
{ |
|
757 |
if (const_alpha == 256) { |
|
758 |
Blend_ARGB32_on_ARGB32_SourceAlpha sourceAlpha; |
|
759 |
qt_transform_image(reinterpret_cast<quint32 *>(destPixels), dbpl, |
|
760 |
reinterpret_cast<const quint32 *>(srcPixels), sbpl, |
|
761 |
targetRect, sourceRect, clip, targetRectTransform, sourceAlpha); |
|
762 |
} else { |
|
763 |
Blend_ARGB32_on_ARGB32_SourceAndConstAlpha constAlpha(const_alpha); |
|
764 |
qt_transform_image(reinterpret_cast<quint32 *>(destPixels), dbpl, |
|
765 |
reinterpret_cast<const quint32 *>(srcPixels), sbpl, |
|
766 |
targetRect, sourceRect, clip, targetRectTransform, constAlpha); |
|
767 |
} |
|
768 |
} |
|
769 |
||
770 |
SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = { |
|
771 |
{ // Format_Invalid |
|
772 |
0, // Format_Invalid, |
|
773 |
0, // Format_Mono, |
|
774 |
0, // Format_MonoLSB, |
|
775 |
0, // Format_Indexed8, |
|
776 |
0, // Format_RGB32, |
|
777 |
0, // Format_ARGB32, |
|
778 |
0, // Format_ARGB32_Premultiplied, |
|
779 |
0, // Format_RGB16, |
|
780 |
0, // Format_ARGB8565_Premultiplied, |
|
781 |
0, // Format_RGB666, |
|
782 |
0, // Format_ARGB6666_Premultiplied, |
|
783 |
0, // Format_RGB555, |
|
784 |
0, // Format_ARGB8555_Premultiplied, |
|
785 |
0, // Format_RGB888, |
|
786 |
0, // Format_RGB444, |
|
787 |
0 // Format_ARGB4444_Premultiplied, |
|
788 |
}, |
|
789 |
{ // Format_Mono |
|
790 |
0, // Format_Invalid, |
|
791 |
0, // Format_Mono, |
|
792 |
0, // Format_MonoLSB, |
|
793 |
0, // Format_Indexed8, |
|
794 |
0, // Format_RGB32, |
|
795 |
0, // Format_ARGB32, |
|
796 |
0, // Format_ARGB32_Premultiplied, |
|
797 |
0, // Format_RGB16, |
|
798 |
0, // Format_ARGB8565_Premultiplied, |
|
799 |
0, // Format_RGB666, |
|
800 |
0, // Format_ARGB6666_Premultiplied, |
|
801 |
0, // Format_RGB555, |
|
802 |
0, // Format_ARGB8555_Premultiplied, |
|
803 |
0, // Format_RGB888, |
|
804 |
0, // Format_RGB444, |
|
805 |
0 // Format_ARGB4444_Premultiplied, |
|
806 |
}, |
|
807 |
{ // Format_MonoLSB |
|
808 |
0, // Format_Invalid, |
|
809 |
0, // Format_Mono, |
|
810 |
0, // Format_MonoLSB, |
|
811 |
0, // Format_Indexed8, |
|
812 |
0, // Format_RGB32, |
|
813 |
0, // Format_ARGB32, |
|
814 |
0, // Format_ARGB32_Premultiplied, |
|
815 |
0, // Format_RGB16, |
|
816 |
0, // Format_ARGB8565_Premultiplied, |
|
817 |
0, // Format_RGB666, |
|
818 |
0, // Format_ARGB6666_Premultiplied, |
|
819 |
0, // Format_RGB555, |
|
820 |
0, // Format_ARGB8555_Premultiplied, |
|
821 |
0, // Format_RGB888, |
|
822 |
0, // Format_RGB444, |
|
823 |
0 // Format_ARGB4444_Premultiplied, |
|
824 |
}, |
|
825 |
{ // Format_Indexed8 |
|
826 |
0, // Format_Invalid, |
|
827 |
0, // Format_Mono, |
|
828 |
0, // Format_MonoLSB, |
|
829 |
0, // Format_Indexed8, |
|
830 |
0, // Format_RGB32, |
|
831 |
0, // Format_ARGB32, |
|
832 |
0, // Format_ARGB32_Premultiplied, |
|
833 |
0, // Format_RGB16, |
|
834 |
0, // Format_ARGB8565_Premultiplied, |
|
835 |
0, // Format_RGB666, |
|
836 |
0, // Format_ARGB6666_Premultiplied, |
|
837 |
0, // Format_RGB555, |
|
838 |
0, // Format_ARGB8555_Premultiplied, |
|
839 |
0, // Format_RGB888, |
|
840 |
0, // Format_RGB444, |
|
841 |
0 // Format_ARGB4444_Premultiplied, |
|
842 |
}, |
|
843 |
{ // Format_RGB32 |
|
844 |
0, // Format_Invalid, |
|
845 |
0, // Format_Mono, |
|
846 |
0, // Format_MonoLSB, |
|
847 |
0, // Format_Indexed8, |
|
848 |
qt_scale_image_rgb32_on_rgb32, // Format_RGB32, |
|
849 |
0, // Format_ARGB32, |
|
850 |
qt_scale_image_argb32_on_argb32, // Format_ARGB32_Premultiplied, |
|
851 |
0, // Format_RGB16, |
|
852 |
0, // Format_ARGB8565_Premultiplied, |
|
853 |
0, // Format_RGB666, |
|
854 |
0, // Format_ARGB6666_Premultiplied, |
|
855 |
0, // Format_RGB555, |
|
856 |
0, // Format_ARGB8555_Premultiplied, |
|
857 |
0, // Format_RGB888, |
|
858 |
0, // Format_RGB444, |
|
859 |
0 // Format_ARGB4444_Premultiplied, |
|
860 |
}, |
|
861 |
{ // Format_ARGB32 |
|
862 |
0, // Format_Invalid, |
|
863 |
0, // Format_Mono, |
|
864 |
0, // Format_MonoLSB, |
|
865 |
0, // Format_Indexed8, |
|
866 |
0, // Format_RGB32, |
|
867 |
0, // Format_ARGB32, |
|
868 |
0, // Format_ARGB32_Premultiplied, |
|
869 |
0, // Format_RGB16, |
|
870 |
0, // Format_ARGB8565_Premultiplied, |
|
871 |
0, // Format_RGB666, |
|
872 |
0, // Format_ARGB6666_Premultiplied, |
|
873 |
0, // Format_RGB555, |
|
874 |
0, // Format_ARGB8555_Premultiplied, |
|
875 |
0, // Format_RGB888, |
|
876 |
0, // Format_RGB444, |
|
877 |
0 // Format_ARGB4444_Premultiplied, |
|
878 |
}, |
|
879 |
{ // Format_ARGB32_Premultiplied |
|
880 |
0, // Format_Invalid, |
|
881 |
0, // Format_Mono, |
|
882 |
0, // Format_MonoLSB, |
|
883 |
0, // Format_Indexed8, |
|
884 |
qt_scale_image_rgb32_on_rgb32, // Format_RGB32, |
|
885 |
0, // Format_ARGB32, |
|
886 |
qt_scale_image_argb32_on_argb32, // Format_ARGB32_Premultiplied, |
|
887 |
0, // Format_RGB16, |
|
888 |
0, // Format_ARGB8565_Premultiplied, |
|
889 |
0, // Format_RGB666, |
|
890 |
0, // Format_ARGB6666_Premultiplied, |
|
891 |
0, // Format_RGB555, |
|
892 |
0, // Format_ARGB8555_Premultiplied, |
|
893 |
0, // Format_RGB888, |
|
894 |
0, // Format_RGB444, |
|
895 |
0 // Format_ARGB4444_Premultiplied, |
|
896 |
}, |
|
897 |
{ // Format_RGB16 |
|
898 |
0, // Format_Invalid, |
|
899 |
0, // Format_Mono, |
|
900 |
0, // Format_MonoLSB, |
|
901 |
0, // Format_Indexed8, |
|
902 |
0, // Format_RGB32, |
|
903 |
0, // Format_ARGB32, |
|
904 |
qt_scale_image_argb32_on_rgb16, // Format_ARGB32_Premultiplied, |
|
905 |
qt_scale_image_rgb16_on_rgb16, // Format_RGB16, |
|
906 |
qt_scale_image_argb24_on_rgb16, // Format_ARGB8565_Premultiplied, |
|
907 |
0, // Format_RGB666, |
|
908 |
0, // Format_ARGB6666_Premultiplied, |
|
909 |
0, // Format_RGB555, |
|
910 |
0, // Format_ARGB8555_Premultiplied, |
|
911 |
0, // Format_RGB888, |
|
912 |
0, // Format_RGB444, |
|
913 |
0 // Format_ARGB4444_Premultiplied, |
|
914 |
}, |
|
915 |
{ // Format_ARGB8565_Premultiplied |
|
916 |
0, // Format_Invalid, |
|
917 |
0, // Format_Mono, |
|
918 |
0, // Format_MonoLSB, |
|
919 |
0, // Format_Indexed8, |
|
920 |
0, // Format_RGB32, |
|
921 |
0, // Format_ARGB32, |
|
922 |
0, // Format_ARGB32_Premultiplied, |
|
923 |
0, // Format_RGB16, |
|
924 |
0, // Format_ARGB8565_Premultiplied, |
|
925 |
0, // Format_RGB666, |
|
926 |
0, // Format_ARGB6666_Premultiplied, |
|
927 |
0, // Format_RGB555, |
|
928 |
0, // Format_ARGB8555_Premultiplied, |
|
929 |
0, // Format_RGB888, |
|
930 |
0, // Format_RGB444, |
|
931 |
0 // Format_ARGB4444_Premultiplied, |
|
932 |
}, |
|
933 |
{ // Format_RGB666 |
|
934 |
0, // Format_Invalid, |
|
935 |
0, // Format_Mono, |
|
936 |
0, // Format_MonoLSB, |
|
937 |
0, // Format_Indexed8, |
|
938 |
0, // Format_RGB32, |
|
939 |
0, // Format_ARGB32, |
|
940 |
0, // Format_ARGB32_Premultiplied, |
|
941 |
0, // Format_RGB16, |
|
942 |
0, // Format_ARGB8565_Premultiplied, |
|
943 |
0, // Format_RGB666, |
|
944 |
0, // Format_ARGB6666_Premultiplied, |
|
945 |
0, // Format_RGB555, |
|
946 |
0, // Format_ARGB8555_Premultiplied, |
|
947 |
0, // Format_RGB888, |
|
948 |
0, // Format_RGB444, |
|
949 |
0 // Format_ARGB4444_Premultiplied, |
|
950 |
}, |
|
951 |
{ // Format_ARGB6666_Premultiplied |
|
952 |
0, // Format_Invalid, |
|
953 |
0, // Format_Mono, |
|
954 |
0, // Format_MonoLSB, |
|
955 |
0, // Format_Indexed8, |
|
956 |
0, // Format_RGB32, |
|
957 |
0, // Format_ARGB32, |
|
958 |
0, // Format_ARGB32_Premultiplied, |
|
959 |
0, // Format_RGB16, |
|
960 |
0, // Format_ARGB8565_Premultiplied, |
|
961 |
0, // Format_RGB666, |
|
962 |
0, // Format_ARGB6666_Premultiplied, |
|
963 |
0, // Format_RGB555, |
|
964 |
0, // Format_ARGB8555_Premultiplied, |
|
965 |
0, // Format_RGB888, |
|
966 |
0, // Format_RGB444, |
|
967 |
0 // Format_ARGB4444_Premultiplied, |
|
968 |
}, |
|
969 |
{ // Format_RGB555 |
|
970 |
0, // Format_Invalid, |
|
971 |
0, // Format_Mono, |
|
972 |
0, // Format_MonoLSB, |
|
973 |
0, // Format_Indexed8, |
|
974 |
0, // Format_RGB32, |
|
975 |
0, // Format_ARGB32, |
|
976 |
0, // Format_ARGB32_Premultiplied, |
|
977 |
0, // Format_RGB16, |
|
978 |
0, // Format_ARGB8565_Premultiplied, |
|
979 |
0, // Format_RGB666, |
|
980 |
0, // Format_ARGB6666_Premultiplied, |
|
981 |
0, // Format_RGB555, |
|
982 |
0, // Format_ARGB8555_Premultiplied, |
|
983 |
0, // Format_RGB888, |
|
984 |
0, // Format_RGB444, |
|
985 |
0 // Format_ARGB4444_Premultiplied, |
|
986 |
}, |
|
987 |
{ // Format_ARGB8555_Premultiplied |
|
988 |
0, // Format_Invalid, |
|
989 |
0, // Format_Mono, |
|
990 |
0, // Format_MonoLSB, |
|
991 |
0, // Format_Indexed8, |
|
992 |
0, // Format_RGB32, |
|
993 |
0, // Format_ARGB32, |
|
994 |
0, // Format_ARGB32_Premultiplied, |
|
995 |
0, // Format_RGB16, |
|
996 |
0, // Format_ARGB8565_Premultiplied, |
|
997 |
0, // Format_RGB666, |
|
998 |
0, // Format_ARGB6666_Premultiplied, |
|
999 |
0, // Format_RGB555, |
|
1000 |
0, // Format_ARGB8555_Premultiplied, |
|
1001 |
0, // Format_RGB888, |
|
1002 |
0, // Format_RGB444, |
|
1003 |
0 // Format_ARGB4444_Premultiplied, |
|
1004 |
}, |
|
1005 |
{ // Format_RGB888 |
|
1006 |
0, // Format_Invalid, |
|
1007 |
0, // Format_Mono, |
|
1008 |
0, // Format_MonoLSB, |
|
1009 |
0, // Format_Indexed8, |
|
1010 |
0, // Format_RGB32, |
|
1011 |
0, // Format_ARGB32, |
|
1012 |
0, // Format_ARGB32_Premultiplied, |
|
1013 |
0, // Format_RGB16, |
|
1014 |
0, // Format_ARGB8565_Premultiplied, |
|
1015 |
0, // Format_RGB666, |
|
1016 |
0, // Format_ARGB6666_Premultiplied, |
|
1017 |
0, // Format_RGB555, |
|
1018 |
0, // Format_ARGB8555_Premultiplied, |
|
1019 |
0, // Format_RGB888, |
|
1020 |
0, // Format_RGB444, |
|
1021 |
0 // Format_ARGB4444_Premultiplied, |
|
1022 |
}, |
|
1023 |
{ // Format_RGB444 |
|
1024 |
0, // Format_Invalid, |
|
1025 |
0, // Format_Mono, |
|
1026 |
0, // Format_MonoLSB, |
|
1027 |
0, // Format_Indexed8, |
|
1028 |
0, // Format_RGB32, |
|
1029 |
0, // Format_ARGB32, |
|
1030 |
0, // Format_ARGB32_Premultiplied, |
|
1031 |
0, // Format_RGB16, |
|
1032 |
0, // Format_ARGB8565_Premultiplied, |
|
1033 |
0, // Format_RGB666, |
|
1034 |
0, // Format_ARGB6666_Premultiplied, |
|
1035 |
0, // Format_RGB555, |
|
1036 |
0, // Format_ARGB8555_Premultiplied, |
|
1037 |
0, // Format_RGB888, |
|
1038 |
0, // Format_RGB444, |
|
1039 |
0 // Format_ARGB4444_Premultiplied, |
|
1040 |
}, |
|
1041 |
{ // Format_ARGB4444_Premultiplied |
|
1042 |
0, // Format_Invalid, |
|
1043 |
0, // Format_Mono, |
|
1044 |
0, // Format_MonoLSB, |
|
1045 |
0, // Format_Indexed8, |
|
1046 |
0, // Format_RGB32, |
|
1047 |
0, // Format_ARGB32, |
|
1048 |
0, // Format_ARGB32_Premultiplied, |
|
1049 |
0, // Format_RGB16, |
|
1050 |
0, // Format_ARGB8565_Premultiplied, |
|
1051 |
0, // Format_RGB666, |
|
1052 |
0, // Format_ARGB6666_Premultiplied, |
|
1053 |
0, // Format_RGB555, |
|
1054 |
0, // Format_ARGB8555_Premultiplied, |
|
1055 |
0, // Format_RGB888, |
|
1056 |
0, // Format_RGB444, |
|
1057 |
0 // Format_ARGB4444_Premultiplied, |
|
1058 |
} |
|
1059 |
}; |
|
1060 |
||
1061 |
||
1062 |
SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = { |
|
1063 |
{ // Format_Invalid |
|
1064 |
0, // Format_Invalid, |
|
1065 |
0, // Format_Mono, |
|
1066 |
0, // Format_MonoLSB, |
|
1067 |
0, // Format_Indexed8, |
|
1068 |
0, // Format_RGB32, |
|
1069 |
0, // Format_ARGB32, |
|
1070 |
0, // Format_ARGB32_Premultiplied, |
|
1071 |
0, // Format_RGB16, |
|
1072 |
0, // Format_ARGB8565_Premultiplied, |
|
1073 |
0, // Format_RGB666, |
|
1074 |
0, // Format_ARGB6666_Premultiplied, |
|
1075 |
0, // Format_RGB555, |
|
1076 |
0, // Format_ARGB8555_Premultiplied, |
|
1077 |
0, // Format_RGB888, |
|
1078 |
0, // Format_RGB444, |
|
1079 |
0 // Format_ARGB4444_Premultiplied, |
|
1080 |
}, |
|
1081 |
{ // Format_Mono |
|
1082 |
0, // Format_Invalid, |
|
1083 |
0, // Format_Mono, |
|
1084 |
0, // Format_MonoLSB, |
|
1085 |
0, // Format_Indexed8, |
|
1086 |
0, // Format_RGB32, |
|
1087 |
0, // Format_ARGB32, |
|
1088 |
0, // Format_ARGB32_Premultiplied, |
|
1089 |
0, // Format_RGB16, |
|
1090 |
0, // Format_ARGB8565_Premultiplied, |
|
1091 |
0, // Format_RGB666, |
|
1092 |
0, // Format_ARGB6666_Premultiplied, |
|
1093 |
0, // Format_RGB555, |
|
1094 |
0, // Format_ARGB8555_Premultiplied, |
|
1095 |
0, // Format_RGB888, |
|
1096 |
0, // Format_RGB444, |
|
1097 |
0 // Format_ARGB4444_Premultiplied, |
|
1098 |
}, |
|
1099 |
{ // Format_MonoLSB |
|
1100 |
0, // Format_Invalid, |
|
1101 |
0, // Format_Mono, |
|
1102 |
0, // Format_MonoLSB, |
|
1103 |
0, // Format_Indexed8, |
|
1104 |
0, // Format_RGB32, |
|
1105 |
0, // Format_ARGB32, |
|
1106 |
0, // Format_ARGB32_Premultiplied, |
|
1107 |
0, // Format_RGB16, |
|
1108 |
0, // Format_ARGB8565_Premultiplied, |
|
1109 |
0, // Format_RGB666, |
|
1110 |
0, // Format_ARGB6666_Premultiplied, |
|
1111 |
0, // Format_RGB555, |
|
1112 |
0, // Format_ARGB8555_Premultiplied, |
|
1113 |
0, // Format_RGB888, |
|
1114 |
0, // Format_RGB444, |
|
1115 |
0 // Format_ARGB4444_Premultiplied, |
|
1116 |
}, |
|
1117 |
{ // Format_Indexed8 |
|
1118 |
0, // Format_Invalid, |
|
1119 |
0, // Format_Mono, |
|
1120 |
0, // Format_MonoLSB, |
|
1121 |
0, // Format_Indexed8, |
|
1122 |
0, // Format_RGB32, |
|
1123 |
0, // Format_ARGB32, |
|
1124 |
0, // Format_ARGB32_Premultiplied, |
|
1125 |
0, // Format_RGB16, |
|
1126 |
0, // Format_ARGB8565_Premultiplied, |
|
1127 |
0, // Format_RGB666, |
|
1128 |
0, // Format_ARGB6666_Premultiplied, |
|
1129 |
0, // Format_RGB555, |
|
1130 |
0, // Format_ARGB8555_Premultiplied, |
|
1131 |
0, // Format_RGB888, |
|
1132 |
0, // Format_RGB444, |
|
1133 |
0 // Format_ARGB4444_Premultiplied, |
|
1134 |
}, |
|
1135 |
{ // Format_RGB32 |
|
1136 |
0, // Format_Invalid, |
|
1137 |
0, // Format_Mono, |
|
1138 |
0, // Format_MonoLSB, |
|
1139 |
0, // Format_Indexed8, |
|
1140 |
qt_blend_rgb32_on_rgb32, // Format_RGB32, |
|
1141 |
0, // Format_ARGB32, |
|
1142 |
qt_blend_argb32_on_argb32, // Format_ARGB32_Premultiplied, |
|
1143 |
0, // Format_RGB16, |
|
1144 |
0, // Format_ARGB8565_Premultiplied, |
|
1145 |
0, // Format_RGB666, |
|
1146 |
0, // Format_ARGB6666_Premultiplied, |
|
1147 |
0, // Format_RGB555, |
|
1148 |
0, // Format_ARGB8555_Premultiplied, |
|
1149 |
0, // Format_RGB888, |
|
1150 |
0, // Format_RGB444, |
|
1151 |
0 // Format_ARGB4444_Premultiplied, |
|
1152 |
}, |
|
1153 |
{ // Format_ARGB32 |
|
1154 |
0, // Format_Invalid, |
|
1155 |
0, // Format_Mono, |
|
1156 |
0, // Format_MonoLSB, |
|
1157 |
0, // Format_Indexed8, |
|
1158 |
0, // Format_RGB32, |
|
1159 |
0, // Format_ARGB32, |
|
1160 |
0, // Format_ARGB32_Premultiplied, |
|
1161 |
0, // Format_RGB16, |
|
1162 |
0, // Format_ARGB8565_Premultiplied, |
|
1163 |
0, // Format_RGB666, |
|
1164 |
0, // Format_ARGB6666_Premultiplied, |
|
1165 |
0, // Format_RGB555, |
|
1166 |
0, // Format_ARGB8555_Premultiplied, |
|
1167 |
0, // Format_RGB888, |
|
1168 |
0, // Format_RGB444, |
|
1169 |
0 // Format_ARGB4444_Premultiplied, |
|
1170 |
}, |
|
1171 |
{ // Format_ARGB32_Premultiplied |
|
1172 |
0, // Format_Invalid, |
|
1173 |
0, // Format_Mono, |
|
1174 |
0, // Format_MonoLSB, |
|
1175 |
0, // Format_Indexed8, |
|
1176 |
qt_blend_rgb32_on_rgb32, // Format_RGB32, |
|
1177 |
0, // Format_ARGB32, |
|
1178 |
qt_blend_argb32_on_argb32, // Format_ARGB32_Premultiplied, |
|
1179 |
0, // Format_RGB16, |
|
1180 |
0, // Format_ARGB8565_Premultiplied, |
|
1181 |
0, // Format_RGB666, |
|
1182 |
0, // Format_ARGB6666_Premultiplied, |
|
1183 |
0, // Format_RGB555, |
|
1184 |
0, // Format_ARGB8555_Premultiplied, |
|
1185 |
0, // Format_RGB888, |
|
1186 |
0, // Format_RGB444, |
|
1187 |
0 // Format_ARGB4444_Premultiplied, |
|
1188 |
}, |
|
1189 |
{ // Format_RGB16 |
|
1190 |
0, // Format_Invalid, |
|
1191 |
0, // Format_Mono, |
|
1192 |
0, // Format_MonoLSB, |
|
1193 |
0, // Format_Indexed8, |
|
1194 |
qt_blend_rgb32_on_rgb16, // Format_RGB32, |
|
1195 |
0, // Format_ARGB32, |
|
1196 |
qt_blend_argb32_on_rgb16, // Format_ARGB32_Premultiplied, |
|
1197 |
qt_blend_rgb16_on_rgb16, // Format_RGB16, |
|
1198 |
qt_blend_argb24_on_rgb16, // Format_ARGB8565_Premultiplied, |
|
1199 |
0, // Format_RGB666, |
|
1200 |
0, // Format_ARGB6666_Premultiplied, |
|
1201 |
0, // Format_RGB555, |
|
1202 |
0, // Format_ARGB8555_Premultiplied, |
|
1203 |
0, // Format_RGB888, |
|
1204 |
0, // Format_RGB444, |
|
1205 |
0 // Format_ARGB4444_Premultiplied, |
|
1206 |
}, |
|
1207 |
{ // Format_ARGB8565_Premultiplied |
|
1208 |
0, // Format_Invalid, |
|
1209 |
0, // Format_Mono, |
|
1210 |
0, // Format_MonoLSB, |
|
1211 |
0, // Format_Indexed8, |
|
1212 |
0, // Format_RGB32, |
|
1213 |
0, // Format_ARGB32, |
|
1214 |
0, // Format_ARGB32_Premultiplied, |
|
1215 |
0, // Format_RGB16, |
|
1216 |
0, // Format_ARGB8565_Premultiplied, |
|
1217 |
0, // Format_RGB666, |
|
1218 |
0, // Format_ARGB6666_Premultiplied, |
|
1219 |
0, // Format_RGB555, |
|
1220 |
0, // Format_ARGB8555_Premultiplied, |
|
1221 |
0, // Format_RGB888, |
|
1222 |
0, // Format_RGB444, |
|
1223 |
0 // Format_ARGB4444_Premultiplied, |
|
1224 |
}, |
|
1225 |
{ // Format_RGB666 |
|
1226 |
0, // Format_Invalid, |
|
1227 |
0, // Format_Mono, |
|
1228 |
0, // Format_MonoLSB, |
|
1229 |
0, // Format_Indexed8, |
|
1230 |
0, // Format_RGB32, |
|
1231 |
0, // Format_ARGB32, |
|
1232 |
0, // Format_ARGB32_Premultiplied, |
|
1233 |
0, // Format_RGB16, |
|
1234 |
0, // Format_ARGB8565_Premultiplied, |
|
1235 |
0, // Format_RGB666, |
|
1236 |
0, // Format_ARGB6666_Premultiplied, |
|
1237 |
0, // Format_RGB555, |
|
1238 |
0, // Format_ARGB8555_Premultiplied, |
|
1239 |
0, // Format_RGB888, |
|
1240 |
0, // Format_RGB444, |
|
1241 |
0 // Format_ARGB4444_Premultiplied, |
|
1242 |
}, |
|
1243 |
{ // Format_ARGB6666_Premultiplied |
|
1244 |
0, // Format_Invalid, |
|
1245 |
0, // Format_Mono, |
|
1246 |
0, // Format_MonoLSB, |
|
1247 |
0, // Format_Indexed8, |
|
1248 |
0, // Format_RGB32, |
|
1249 |
0, // Format_ARGB32, |
|
1250 |
0, // Format_ARGB32_Premultiplied, |
|
1251 |
0, // Format_RGB16, |
|
1252 |
0, // Format_ARGB8565_Premultiplied, |
|
1253 |
0, // Format_RGB666, |
|
1254 |
0, // Format_ARGB6666_Premultiplied, |
|
1255 |
0, // Format_RGB555, |
|
1256 |
0, // Format_ARGB8555_Premultiplied, |
|
1257 |
0, // Format_RGB888, |
|
1258 |
0, // Format_RGB444, |
|
1259 |
0 // Format_ARGB4444_Premultiplied, |
|
1260 |
}, |
|
1261 |
{ // Format_RGB555 |
|
1262 |
0, // Format_Invalid, |
|
1263 |
0, // Format_Mono, |
|
1264 |
0, // Format_MonoLSB, |
|
1265 |
0, // Format_Indexed8, |
|
1266 |
0, // Format_RGB32, |
|
1267 |
0, // Format_ARGB32, |
|
1268 |
0, // Format_ARGB32_Premultiplied, |
|
1269 |
0, // Format_RGB16, |
|
1270 |
0, // Format_ARGB8565_Premultiplied, |
|
1271 |
0, // Format_RGB666, |
|
1272 |
0, // Format_ARGB6666_Premultiplied, |
|
1273 |
0, // Format_RGB555, |
|
1274 |
0, // Format_ARGB8555_Premultiplied, |
|
1275 |
0, // Format_RGB888, |
|
1276 |
0, // Format_RGB444, |
|
1277 |
0 // Format_ARGB4444_Premultiplied, |
|
1278 |
}, |
|
1279 |
{ // Format_ARGB8555_Premultiplied |
|
1280 |
0, // Format_Invalid, |
|
1281 |
0, // Format_Mono, |
|
1282 |
0, // Format_MonoLSB, |
|
1283 |
0, // Format_Indexed8, |
|
1284 |
0, // Format_RGB32, |
|
1285 |
0, // Format_ARGB32, |
|
1286 |
0, // Format_ARGB32_Premultiplied, |
|
1287 |
0, // Format_RGB16, |
|
1288 |
0, // Format_ARGB8565_Premultiplied, |
|
1289 |
0, // Format_RGB666, |
|
1290 |
0, // Format_ARGB6666_Premultiplied, |
|
1291 |
0, // Format_RGB555, |
|
1292 |
0, // Format_ARGB8555_Premultiplied, |
|
1293 |
0, // Format_RGB888, |
|
1294 |
0, // Format_RGB444, |
|
1295 |
0 // Format_ARGB4444_Premultiplied, |
|
1296 |
}, |
|
1297 |
{ // Format_RGB888 |
|
1298 |
0, // Format_Invalid, |
|
1299 |
0, // Format_Mono, |
|
1300 |
0, // Format_MonoLSB, |
|
1301 |
0, // Format_Indexed8, |
|
1302 |
0, // Format_RGB32, |
|
1303 |
0, // Format_ARGB32, |
|
1304 |
0, // Format_ARGB32_Premultiplied, |
|
1305 |
0, // Format_RGB16, |
|
1306 |
0, // Format_ARGB8565_Premultiplied, |
|
1307 |
0, // Format_RGB666, |
|
1308 |
0, // Format_ARGB6666_Premultiplied, |
|
1309 |
0, // Format_RGB555, |
|
1310 |
0, // Format_ARGB8555_Premultiplied, |
|
1311 |
0, // Format_RGB888, |
|
1312 |
0, // Format_RGB444, |
|
1313 |
0 // Format_ARGB4444_Premultiplied, |
|
1314 |
}, |
|
1315 |
{ // Format_RGB444 |
|
1316 |
0, // Format_Invalid, |
|
1317 |
0, // Format_Mono, |
|
1318 |
0, // Format_MonoLSB, |
|
1319 |
0, // Format_Indexed8, |
|
1320 |
0, // Format_RGB32, |
|
1321 |
0, // Format_ARGB32, |
|
1322 |
0, // Format_ARGB32_Premultiplied, |
|
1323 |
0, // Format_RGB16, |
|
1324 |
0, // Format_ARGB8565_Premultiplied, |
|
1325 |
0, // Format_RGB666, |
|
1326 |
0, // Format_ARGB6666_Premultiplied, |
|
1327 |
0, // Format_RGB555, |
|
1328 |
0, // Format_ARGB8555_Premultiplied, |
|
1329 |
0, // Format_RGB888, |
|
1330 |
0, // Format_RGB444, |
|
1331 |
0 // Format_ARGB4444_Premultiplied, |
|
1332 |
}, |
|
1333 |
{ // Format_ARGB4444_Premultiplied |
|
1334 |
0, // Format_Invalid, |
|
1335 |
0, // Format_Mono, |
|
1336 |
0, // Format_MonoLSB, |
|
1337 |
0, // Format_Indexed8, |
|
1338 |
0, // Format_RGB32, |
|
1339 |
0, // Format_ARGB32, |
|
1340 |
0, // Format_ARGB32_Premultiplied, |
|
1341 |
0, // Format_RGB16, |
|
1342 |
0, // Format_ARGB8565_Premultiplied, |
|
1343 |
0, // Format_RGB666, |
|
1344 |
0, // Format_ARGB6666_Premultiplied, |
|
1345 |
0, // Format_RGB555, |
|
1346 |
0, // Format_ARGB8555_Premultiplied, |
|
1347 |
0, // Format_RGB888, |
|
1348 |
0, // Format_RGB444, |
|
1349 |
0 // Format_ARGB4444_Premultiplied, |
|
1350 |
} |
|
1351 |
}; |
|
1352 |
||
1353 |
SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats] = { |
|
1354 |
{ // Format_Invalid |
|
1355 |
0, // Format_Invalid, |
|
1356 |
0, // Format_Mono, |
|
1357 |
0, // Format_MonoLSB, |
|
1358 |
0, // Format_Indexed8, |
|
1359 |
0, // Format_RGB32, |
|
1360 |
0, // Format_ARGB32, |
|
1361 |
0, // Format_ARGB32_Premultiplied, |
|
1362 |
0, // Format_RGB16, |
|
1363 |
0, // Format_ARGB8565_Premultiplied, |
|
1364 |
0, // Format_RGB666, |
|
1365 |
0, // Format_ARGB6666_Premultiplied, |
|
1366 |
0, // Format_RGB555, |
|
1367 |
0, // Format_ARGB8555_Premultiplied, |
|
1368 |
0, // Format_RGB888, |
|
1369 |
0, // Format_RGB444, |
|
1370 |
0 // Format_ARGB4444_Premultiplied, |
|
1371 |
}, |
|
1372 |
{ // Format_Mono |
|
1373 |
0, // Format_Invalid, |
|
1374 |
0, // Format_Mono, |
|
1375 |
0, // Format_MonoLSB, |
|
1376 |
0, // Format_Indexed8, |
|
1377 |
0, // Format_RGB32, |
|
1378 |
0, // Format_ARGB32, |
|
1379 |
0, // Format_ARGB32_Premultiplied, |
|
1380 |
0, // Format_RGB16, |
|
1381 |
0, // Format_ARGB8565_Premultiplied, |
|
1382 |
0, // Format_RGB666, |
|
1383 |
0, // Format_ARGB6666_Premultiplied, |
|
1384 |
0, // Format_RGB555, |
|
1385 |
0, // Format_ARGB8555_Premultiplied, |
|
1386 |
0, // Format_RGB888, |
|
1387 |
0, // Format_RGB444, |
|
1388 |
0 // Format_ARGB4444_Premultiplied, |
|
1389 |
}, |
|
1390 |
{ // Format_MonoLSB |
|
1391 |
0, // Format_Invalid, |
|
1392 |
0, // Format_Mono, |
|
1393 |
0, // Format_MonoLSB, |
|
1394 |
0, // Format_Indexed8, |
|
1395 |
0, // Format_RGB32, |
|
1396 |
0, // Format_ARGB32, |
|
1397 |
0, // Format_ARGB32_Premultiplied, |
|
1398 |
0, // Format_RGB16, |
|
1399 |
0, // Format_ARGB8565_Premultiplied, |
|
1400 |
0, // Format_RGB666, |
|
1401 |
0, // Format_ARGB6666_Premultiplied, |
|
1402 |
0, // Format_RGB555, |
|
1403 |
0, // Format_ARGB8555_Premultiplied, |
|
1404 |
0, // Format_RGB888, |
|
1405 |
0, // Format_RGB444, |
|
1406 |
0 // Format_ARGB4444_Premultiplied, |
|
1407 |
}, |
|
1408 |
{ // Format_Indexed8 |
|
1409 |
0, // Format_Invalid, |
|
1410 |
0, // Format_Mono, |
|
1411 |
0, // Format_MonoLSB, |
|
1412 |
0, // Format_Indexed8, |
|
1413 |
0, // Format_RGB32, |
|
1414 |
0, // Format_ARGB32, |
|
1415 |
0, // Format_ARGB32_Premultiplied, |
|
1416 |
0, // Format_RGB16, |
|
1417 |
0, // Format_ARGB8565_Premultiplied, |
|
1418 |
0, // Format_RGB666, |
|
1419 |
0, // Format_ARGB6666_Premultiplied, |
|
1420 |
0, // Format_RGB555, |
|
1421 |
0, // Format_ARGB8555_Premultiplied, |
|
1422 |
0, // Format_RGB888, |
|
1423 |
0, // Format_RGB444, |
|
1424 |
0 // Format_ARGB4444_Premultiplied, |
|
1425 |
}, |
|
1426 |
{ // Format_RGB32 |
|
1427 |
0, // Format_Invalid, |
|
1428 |
0, // Format_Mono, |
|
1429 |
0, // Format_MonoLSB, |
|
1430 |
0, // Format_Indexed8, |
|
1431 |
qt_transform_image_rgb32_on_rgb32, // Format_RGB32, |
|
1432 |
0, // Format_ARGB32, |
|
1433 |
qt_transform_image_argb32_on_argb32, // Format_ARGB32_Premultiplied, |
|
1434 |
0, // Format_RGB16, |
|
1435 |
0, // Format_ARGB8565_Premultiplied, |
|
1436 |
0, // Format_RGB666, |
|
1437 |
0, // Format_ARGB6666_Premultiplied, |
|
1438 |
0, // Format_RGB555, |
|
1439 |
0, // Format_ARGB8555_Premultiplied, |
|
1440 |
0, // Format_RGB888, |
|
1441 |
0, // Format_RGB444, |
|
1442 |
0 // Format_ARGB4444_Premultiplied, |
|
1443 |
}, |
|
1444 |
{ // Format_ARGB32 |
|
1445 |
0, // Format_Invalid, |
|
1446 |
0, // Format_Mono, |
|
1447 |
0, // Format_MonoLSB, |
|
1448 |
0, // Format_Indexed8, |
|
1449 |
0, // Format_RGB32, |
|
1450 |
0, // Format_ARGB32, |
|
1451 |
0, // Format_ARGB32_Premultiplied, |
|
1452 |
0, // Format_RGB16, |
|
1453 |
0, // Format_ARGB8565_Premultiplied, |
|
1454 |
0, // Format_RGB666, |
|
1455 |
0, // Format_ARGB6666_Premultiplied, |
|
1456 |
0, // Format_RGB555, |
|
1457 |
0, // Format_ARGB8555_Premultiplied, |
|
1458 |
0, // Format_RGB888, |
|
1459 |
0, // Format_RGB444, |
|
1460 |
0 // Format_ARGB4444_Premultiplied, |
|
1461 |
}, |
|
1462 |
{ // Format_ARGB32_Premultiplied |
|
1463 |
0, // Format_Invalid, |
|
1464 |
0, // Format_Mono, |
|
1465 |
0, // Format_MonoLSB, |
|
1466 |
0, // Format_Indexed8, |
|
1467 |
qt_transform_image_rgb32_on_rgb32, // Format_RGB32, |
|
1468 |
0, // Format_ARGB32, |
|
1469 |
qt_transform_image_argb32_on_argb32, // Format_ARGB32_Premultiplied, |
|
1470 |
0, // Format_RGB16, |
|
1471 |
0, // Format_ARGB8565_Premultiplied, |
|
1472 |
0, // Format_RGB666, |
|
1473 |
0, // Format_ARGB6666_Premultiplied, |
|
1474 |
0, // Format_RGB555, |
|
1475 |
0, // Format_ARGB8555_Premultiplied, |
|
1476 |
0, // Format_RGB888, |
|
1477 |
0, // Format_RGB444, |
|
1478 |
0 // Format_ARGB4444_Premultiplied, |
|
1479 |
}, |
|
1480 |
{ // Format_RGB16 |
|
1481 |
0, // Format_Invalid, |
|
1482 |
0, // Format_Mono, |
|
1483 |
0, // Format_MonoLSB, |
|
1484 |
0, // Format_Indexed8, |
|
1485 |
0, // Format_RGB32, |
|
1486 |
0, // Format_ARGB32, |
|
1487 |
qt_transform_image_argb32_on_rgb16, // Format_ARGB32_Premultiplied, |
|
1488 |
qt_transform_image_rgb16_on_rgb16, // Format_RGB16, |
|
1489 |
qt_transform_image_argb24_on_rgb16, // Format_ARGB8565_Premultiplied, |
|
1490 |
0, // Format_RGB666, |
|
1491 |
0, // Format_ARGB6666_Premultiplied, |
|
1492 |
0, // Format_RGB555, |
|
1493 |
0, // Format_ARGB8555_Premultiplied, |
|
1494 |
0, // Format_RGB888, |
|
1495 |
0, // Format_RGB444, |
|
1496 |
0 // Format_ARGB4444_Premultiplied, |
|
1497 |
}, |
|
1498 |
{ // Format_ARGB8565_Premultiplied |
|
1499 |
0, // Format_Invalid, |
|
1500 |
0, // Format_Mono, |
|
1501 |
0, // Format_MonoLSB, |
|
1502 |
0, // Format_Indexed8, |
|
1503 |
0, // Format_RGB32, |
|
1504 |
0, // Format_ARGB32, |
|
1505 |
0, // Format_ARGB32_Premultiplied, |
|
1506 |
0, // Format_RGB16, |
|
1507 |
0, // Format_ARGB8565_Premultiplied, |
|
1508 |
0, // Format_RGB666, |
|
1509 |
0, // Format_ARGB6666_Premultiplied, |
|
1510 |
0, // Format_RGB555, |
|
1511 |
0, // Format_ARGB8555_Premultiplied, |
|
1512 |
0, // Format_RGB888, |
|
1513 |
0, // Format_RGB444, |
|
1514 |
0 // Format_ARGB4444_Premultiplied, |
|
1515 |
}, |
|
1516 |
{ // Format_RGB666 |
|
1517 |
0, // Format_Invalid, |
|
1518 |
0, // Format_Mono, |
|
1519 |
0, // Format_MonoLSB, |
|
1520 |
0, // Format_Indexed8, |
|
1521 |
0, // Format_RGB32, |
|
1522 |
0, // Format_ARGB32, |
|
1523 |
0, // Format_ARGB32_Premultiplied, |
|
1524 |
0, // Format_RGB16, |
|
1525 |
0, // Format_ARGB8565_Premultiplied, |
|
1526 |
0, // Format_RGB666, |
|
1527 |
0, // Format_ARGB6666_Premultiplied, |
|
1528 |
0, // Format_RGB555, |
|
1529 |
0, // Format_ARGB8555_Premultiplied, |
|
1530 |
0, // Format_RGB888, |
|
1531 |
0, // Format_RGB444, |
|
1532 |
0 // Format_ARGB4444_Premultiplied, |
|
1533 |
}, |
|
1534 |
{ // Format_ARGB6666_Premultiplied |
|
1535 |
0, // Format_Invalid, |
|
1536 |
0, // Format_Mono, |
|
1537 |
0, // Format_MonoLSB, |
|
1538 |
0, // Format_Indexed8, |
|
1539 |
0, // Format_RGB32, |
|
1540 |
0, // Format_ARGB32, |
|
1541 |
0, // Format_ARGB32_Premultiplied, |
|
1542 |
0, // Format_RGB16, |
|
1543 |
0, // Format_ARGB8565_Premultiplied, |
|
1544 |
0, // Format_RGB666, |
|
1545 |
0, // Format_ARGB6666_Premultiplied, |
|
1546 |
0, // Format_RGB555, |
|
1547 |
0, // Format_ARGB8555_Premultiplied, |
|
1548 |
0, // Format_RGB888, |
|
1549 |
0, // Format_RGB444, |
|
1550 |
0 // Format_ARGB4444_Premultiplied, |
|
1551 |
}, |
|
1552 |
{ // Format_RGB555 |
|
1553 |
0, // Format_Invalid, |
|
1554 |
0, // Format_Mono, |
|
1555 |
0, // Format_MonoLSB, |
|
1556 |
0, // Format_Indexed8, |
|
1557 |
0, // Format_RGB32, |
|
1558 |
0, // Format_ARGB32, |
|
1559 |
0, // Format_ARGB32_Premultiplied, |
|
1560 |
0, // Format_RGB16, |
|
1561 |
0, // Format_ARGB8565_Premultiplied, |
|
1562 |
0, // Format_RGB666, |
|
1563 |
0, // Format_ARGB6666_Premultiplied, |
|
1564 |
0, // Format_RGB555, |
|
1565 |
0, // Format_ARGB8555_Premultiplied, |
|
1566 |
0, // Format_RGB888, |
|
1567 |
0, // Format_RGB444, |
|
1568 |
0 // Format_ARGB4444_Premultiplied, |
|
1569 |
}, |
|
1570 |
{ // Format_ARGB8555_Premultiplied |
|
1571 |
0, // Format_Invalid, |
|
1572 |
0, // Format_Mono, |
|
1573 |
0, // Format_MonoLSB, |
|
1574 |
0, // Format_Indexed8, |
|
1575 |
0, // Format_RGB32, |
|
1576 |
0, // Format_ARGB32, |
|
1577 |
0, // Format_ARGB32_Premultiplied, |
|
1578 |
0, // Format_RGB16, |
|
1579 |
0, // Format_ARGB8565_Premultiplied, |
|
1580 |
0, // Format_RGB666, |
|
1581 |
0, // Format_ARGB6666_Premultiplied, |
|
1582 |
0, // Format_RGB555, |
|
1583 |
0, // Format_ARGB8555_Premultiplied, |
|
1584 |
0, // Format_RGB888, |
|
1585 |
0, // Format_RGB444, |
|
1586 |
0 // Format_ARGB4444_Premultiplied, |
|
1587 |
}, |
|
1588 |
{ // Format_RGB888 |
|
1589 |
0, // Format_Invalid, |
|
1590 |
0, // Format_Mono, |
|
1591 |
0, // Format_MonoLSB, |
|
1592 |
0, // Format_Indexed8, |
|
1593 |
0, // Format_RGB32, |
|
1594 |
0, // Format_ARGB32, |
|
1595 |
0, // Format_ARGB32_Premultiplied, |
|
1596 |
0, // Format_RGB16, |
|
1597 |
0, // Format_ARGB8565_Premultiplied, |
|
1598 |
0, // Format_RGB666, |
|
1599 |
0, // Format_ARGB6666_Premultiplied, |
|
1600 |
0, // Format_RGB555, |
|
1601 |
0, // Format_ARGB8555_Premultiplied, |
|
1602 |
0, // Format_RGB888, |
|
1603 |
0, // Format_RGB444, |
|
1604 |
0 // Format_ARGB4444_Premultiplied, |
|
1605 |
}, |
|
1606 |
{ // Format_RGB444 |
|
1607 |
0, // Format_Invalid, |
|
1608 |
0, // Format_Mono, |
|
1609 |
0, // Format_MonoLSB, |
|
1610 |
0, // Format_Indexed8, |
|
1611 |
0, // Format_RGB32, |
|
1612 |
0, // Format_ARGB32, |
|
1613 |
0, // Format_ARGB32_Premultiplied, |
|
1614 |
0, // Format_RGB16, |
|
1615 |
0, // Format_ARGB8565_Premultiplied, |
|
1616 |
0, // Format_RGB666, |
|
1617 |
0, // Format_ARGB6666_Premultiplied, |
|
1618 |
0, // Format_RGB555, |
|
1619 |
0, // Format_ARGB8555_Premultiplied, |
|
1620 |
0, // Format_RGB888, |
|
1621 |
0, // Format_RGB444, |
|
1622 |
0 // Format_ARGB4444_Premultiplied, |
|
1623 |
}, |
|
1624 |
{ // Format_ARGB4444_Premultiplied |
|
1625 |
0, // Format_Invalid, |
|
1626 |
0, // Format_Mono, |
|
1627 |
0, // Format_MonoLSB, |
|
1628 |
0, // Format_Indexed8, |
|
1629 |
0, // Format_RGB32, |
|
1630 |
0, // Format_ARGB32, |
|
1631 |
0, // Format_ARGB32_Premultiplied, |
|
1632 |
0, // Format_RGB16, |
|
1633 |
0, // Format_ARGB8565_Premultiplied, |
|
1634 |
0, // Format_RGB666, |
|
1635 |
0, // Format_ARGB6666_Premultiplied, |
|
1636 |
0, // Format_RGB555, |
|
1637 |
0, // Format_ARGB8555_Premultiplied, |
|
1638 |
0, // Format_RGB888, |
|
1639 |
0, // Format_RGB444, |
|
1640 |
0 // Format_ARGB4444_Premultiplied, |
|
1641 |
} |
|
1642 |
}; |
|
1643 |
||
1644 |
QT_END_NAMESPACE |