57 m_alpha255 = (m_alpha256 * 255) >> 8;
61 uint t = (((x & 0x07e0)*m_alpha255) >> 8) & 0x07e0;
62 t |= (((x & 0xf81f)*(m_alpha255>>2)) >> 6) & 0xf81f;
97 m_alpha = (alpha * 255) >> 8;
98 m_ialpha = 255 - m_alpha;
127 m_alpha = (alpha * 255) >> 8;
162 m_alpha = (alpha * 255) >> 8;
182 const uchar *srcPixels,
int sbpl,
int sh,
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(),
195 if (const_alpha == 256) {
197 qt_scale_image_16bit<quint16>(destPixels, dbpl, srcPixels, sbpl, sh,
198 targetRect, sourceRect, clip, noAlpha);
201 qt_scale_image_16bit<quint16>(destPixels, dbpl, srcPixels, sbpl, sh,
202 targetRect, sourceRect, clip, constAlpha);
207 const uchar *srcPixels,
int sbpl,
int sh,
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(),
220 if (const_alpha == 256) {
222 qt_scale_image_16bit<qargb8565>(destPixels, dbpl, srcPixels, sbpl, sh,
223 targetRect, sourceRect, clip, noAlpha);
226 qt_scale_image_16bit<qargb8565>(destPixels, dbpl, srcPixels, sbpl, sh,
227 targetRect, sourceRect, clip, constAlpha);
233 const uchar *srcPixels,
int sbpl,
int sh,
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(),
246 if (const_alpha == 256) {
248 qt_scale_image_16bit<quint32>(destPixels, dbpl, srcPixels, sbpl, sh,
249 targetRect, sourceRect, clip, noAlpha);
252 qt_scale_image_16bit<quint32>(destPixels, dbpl, srcPixels, sbpl, sh,
253 targetRect, sourceRect, clip, constAlpha);
258 const uchar *src,
int sbpl,
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);
267 if (const_alpha == 256) {
277 memcpy(dst, src, length);
282 }
else if (const_alpha != 0) {
286 quint8 a = (255 * const_alpha) >> 8;
289 for (
int x=0; x<w; ++x) {
300 const uchar *srcPixels,
int sbpl,
301 int w,
int h,
const T &alphaFunc)
304 int dstJPL = dbpl / 2;
306 int dstExtraStride = dstJPL - w;
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_ARMV5) || 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)) || (defined(QT_ARCH_INTEGRITY) && !defined(_X86_)) 323 }
else if (alpha != 0) {
327 quint16 dr = (dpix & 0x0000f800);
328 quint16 dg = (dpix & 0x000007e0);
329 quint16 db = (dpix & 0x0000001f);
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;
339 *dst = alphaFunc.bytemul(spix) + rr + rg + rb;
345 dst += dstExtraStride;
351 const uchar *srcPixels,
int sbpl,
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);
360 if (const_alpha != 256) {
373 const uchar *srcPixels,
int sbpl,
380 const_alpha = (const_alpha * 255) >> 8;
381 for (
int y=0; y<h; ++y) {
382 for (
int i = 0; i < w; ++i) {
396 const uchar *srcPixels,
int sbpl,
400 if (const_alpha != 256) {
408 for (
int y=0; y<h; ++y) {
409 for (
int x=0; x<w; ++x) {
416 }
else if (alpha != 0) {
421 quint32 sr = (spix >> 8) & 0xf800;
422 quint32 sg = (spix >> 5) & 0x07e0;
423 quint32 sb = (spix >> 3) & 0x001f;
425 quint32 dr = (dpix & 0x0000f800);
426 quint32 dg = (dpix & 0x000007e0);
427 quint32 db = (dpix & 0x0000001f);
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);
437 dst[x] = (rr & 0xf800)
449 const uchar *srcPixels,
int sbpl,
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);
458 if (const_alpha != 256) {
464 int srcExtraStride = (sbpl >> 2) - w;
466 int dstJPL = dbpl / 2;
469 quint16 *dstEnd = dst + dstJPL * h;
471 int dstExtraStride = dstJPL - w;
473 while (dst < dstEnd) {
474 const quint32 *srcEnd = src + w;
475 while (src < srcEnd) {
480 dst += dstExtraStride;
481 src += srcExtraStride;
492 const uchar *srcPixels,
int sbpl,
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);
502 const uint *src = (
const uint *) srcPixels;
504 if (const_alpha == 256) {
505 for (
int y=0; y<h; ++y) {
506 for (
int x=0; x<w; ++x) {
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) {
531 const uchar *srcPixels,
int sbpl,
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);
541 if (const_alpha != 256) {
546 const uint *src = (
const uint *) srcPixels;
549 for (
int y=0; y<h; ++y) {
556 for (
int y=0; y<h; ++y) {
557 memcpy(dst, src, len);
574 m_alpha = (alpha * 255) >> 8;
575 m_ialpha = 255 - m_alpha;
598 m_alpha = (alpha * 255) >> 8;
599 m_ialpha = 255 - m_alpha;
614 const uchar *srcPixels,
int sbpl,
int sh,
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(),
627 if (const_alpha == 256) {
630 targetRect, sourceRect, clip, noAlpha);
634 targetRect, sourceRect, clip, constAlpha);
639 const uchar *srcPixels,
int sbpl,
int sh,
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(),
652 if (const_alpha == 256) {
655 targetRect, sourceRect, clip, sourceAlpha);
659 targetRect, sourceRect, clip, constAlpha);
664 const uchar *srcPixels,
int sbpl,
671 if (const_alpha == 256) {
674 reinterpret_cast<const quint16 *>(srcPixels), sbpl,
675 targetRect, sourceRect, clip, targetRectTransform, noAlpha);
679 reinterpret_cast<const quint16 *>(srcPixels), sbpl,
680 targetRect, sourceRect, clip, targetRectTransform, constAlpha);
685 const uchar *srcPixels,
int sbpl,
692 if (const_alpha == 256) {
695 reinterpret_cast<const qargb8565 *>(srcPixels), sbpl,
696 targetRect, sourceRect, clip, targetRectTransform, noAlpha);
700 reinterpret_cast<const qargb8565 *>(srcPixels), sbpl,
701 targetRect, sourceRect, clip, targetRectTransform, constAlpha);
707 const uchar *srcPixels,
int sbpl,
714 if (const_alpha == 256) {
717 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
718 targetRect, sourceRect, clip, targetRectTransform, noAlpha);
722 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
723 targetRect, sourceRect, clip, targetRectTransform, constAlpha);
729 const uchar *srcPixels,
int sbpl,
736 if (const_alpha == 256) {
739 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
740 targetRect, sourceRect, clip, targetRectTransform, noAlpha);
744 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
745 targetRect, sourceRect, clip, targetRectTransform, constAlpha);
750 const uchar *srcPixels,
int sbpl,
757 if (const_alpha == 256) {
760 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
761 targetRect, sourceRect, clip, targetRectTransform, sourceAlpha);
765 reinterpret_cast<const quint32 *>(srcPixels), sbpl,
766 targetRect, sourceRect, clip, targetRectTransform, constAlpha);
void write(quint32 *dst, quint32 src)
Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16(uint x, uint a)
qreal y() const
Returns the y-coordinate of the rectangle's top edge.
void qt_scale_image_rgb16_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int sh, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, int const_alpha)
void(* SrcOverScaleFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, int srch, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clipRect, int const_alpha)
void qt_blend_rgb32_on_rgb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
#define QT_END_NAMESPACE
This macro expands to.
void write(quint32 *dst, quint32 src)
void qt_blend_rgb16_on_rgb16(uchar *dst, int dbpl, const uchar *src, int sbpl, int w, int h, int const_alpha)
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
void qt_scale_image_argb32_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int sh, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, int const_alpha)
SourceAndConstAlpha(int a)
void qt_scale_image_rgb32_on_rgb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int sh, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, int const_alpha)
uchar alpha(uchar src) const
void qt_transform_image_argb32_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
long ASN1_INTEGER_get ASN1_INTEGER * a
SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]
void qt_scale_image_32bit(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int sh, const QRectF &targetRect, const QRectF &srcRect, const QRect &clip, T blender)
void write(quint16 *dst, quint16 src)
Blend_ARGB32_on_ARGB32_SourceAndConstAlpha(quint32 alpha)
Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a)
#define QT_BEGIN_NAMESPACE
This macro expands to.
void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, const T &alphaFunc)
SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]
void qt_transform_image(DestT *destPixels, int dbpl, const SrcT *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, Blender blender)
The QRectF class defines a rectangle in the plane using floating point precision. ...
void write(quint16 *dst, quint32 src)
void write(quint32 *dst, quint32 src)
qreal height() const
Returns the height of the rectangle.
void write(quint32 *dst, quint32 src)
void qt_scale_image_argb24_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int sh, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, int const_alpha)
void qt_transform_image_argb32_on_argb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
qreal width() const
Returns the width of the rectangle.
void(* SrcOverBlendFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, int w, int h, int const_alpha)
void write(quint16 *dst, qargb8565 src)
void qt_transform_image_argb24_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
quint16 bytemul(quint16 spix) const
quint16 bytemul(quint16 x) const
void qt_transform_image_rgb16_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
static void qt_blend_rgb32_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
void write(quint16 *dst, quint32 src)
void qt_memconvert(DST *dest, const SRC *src, int count)
qreal x() const
Returns the x-coordinate of the rectangle's left edge.
void write(quint16 *dst, const qargb8565 &src)
void qt_scale_image_argb32_on_argb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int sh, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, int const_alpha)
static void qt_blend_argb32_on_argb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
The QRect class defines a rectangle in the plane using integer precision.
void write(quint16 *dst, quint16 src)
Blend_ARGB32_on_RGB16_SourceAndConstAlpha(quint32 alpha)
void(* SrcOverTransformFunc)(uchar *destPixels, int dbpl, const uchar *src, int spbl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clipRect, const QTransform &targetRectTransform, int const_alpha)
qargb8565 byte_mul(quint8 a) const
Blend_RGB32_on_RGB32_ConstAlpha(quint32 alpha)
Blend_RGB16_on_RGB16_ConstAlpha(quint32 alpha)
#define QT_MEMCPY_USHORT(dest, src, length)
Blend_ARGB24_on_RGB16_SourceAndConstAlpha(quint32 alpha)
static quint16 convert_argb32_to_rgb16(quint32 spix)
quint16 rawValue16() const
static void qt_blend_argb32_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]
void qt_transform_image_rgb32_on_rgb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
uchar alpha(uchar src) const