Qt 4.8
Classes | Functions | Variables
qblendfunctions.cpp File Reference
#include <qmath.h>
#include "qblendfunctions_p.h"

Go to the source code of this file.

Classes

struct  Blend_ARGB24_on_RGB16_SourceAlpha
 
struct  Blend_ARGB24_on_RGB16_SourceAndConstAlpha
 
struct  Blend_ARGB32_on_ARGB32_SourceAlpha
 
struct  Blend_ARGB32_on_ARGB32_SourceAndConstAlpha
 
struct  Blend_ARGB32_on_RGB16_SourceAlpha
 
struct  Blend_ARGB32_on_RGB16_SourceAndConstAlpha
 
struct  Blend_RGB16_on_RGB16_ConstAlpha
 
struct  Blend_RGB16_on_RGB16_NoAlpha
 
struct  Blend_RGB32_on_RGB32_ConstAlpha
 
struct  Blend_RGB32_on_RGB32_NoAlpha
 
struct  SourceAndConstAlpha
 
struct  SourceOnlyAlpha
 

Functions

static quint16 convert_argb32_to_rgb16 (quint32 spix)
 
template<typename T >
void qt_blend_argb24_on_rgb16 (uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, const T &alphaFunc)
 
static void qt_blend_argb24_on_rgb16 (uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, 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)
 
static void qt_blend_argb32_on_rgb16 (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)
 
void qt_blend_rgb16_on_rgb16 (uchar *dst, int dbpl, const uchar *src, int sbpl, int w, int h, int const_alpha)
 
static void qt_blend_rgb32_on_rgb16 (uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
 
void qt_blend_rgb32_on_rgb32 (uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
 
void qt_scale_image_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_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)
 
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)
 
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 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)
 
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)
 
void qt_transform_image_argb32_on_argb32 (uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
 
void qt_transform_image_argb32_on_rgb16 (uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
 
void qt_transform_image_rgb16_on_rgb16 (uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, const QRectF &targetRect, const QRectF &sourceRect, const QRect &clip, const QTransform &targetRectTransform, int const_alpha)
 
void qt_transform_image_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)
 

Variables

SrcOverBlendFunc qBlendFunctions [QImage::NImageFormats][QImage::NImageFormats]
 
SrcOverScaleFunc qScaleFunctions [QImage::NImageFormats][QImage::NImageFormats]
 
SrcOverTransformFunc qTransformFunctions [QImage::NImageFormats][QImage::NImageFormats]
 

Function Documentation

◆ convert_argb32_to_rgb16()

static quint16 convert_argb32_to_rgb16 ( quint32  spix)
inlinestatic

Definition at line 74 of file qblendfunctions.cpp.

Referenced by qt_blend_argb32_on_rgb16(), qt_blend_argb32_on_rgb16_const_alpha(), qt_blend_rgb32_on_rgb16(), Blend_ARGB32_on_RGB16_SourceAlpha::write(), and Blend_ARGB32_on_RGB16_SourceAndConstAlpha::write().

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 }
unsigned int quint32
Definition: qglobal.h:938

◆ qt_blend_argb24_on_rgb16() [1/2]

template<typename T >
void qt_blend_argb24_on_rgb16 ( uchar destPixels,
int  dbpl,
const uchar srcPixels,
int  sbpl,
int  w,
int  h,
const T &  alphaFunc 
)

Definition at line 299 of file qblendfunctions.cpp.

Referenced by qt_blend_argb24_on_rgb16().

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_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_))
313  // non-16-bit aligned memory access is not possible on PowerPC,
314  // ARM <v6 (QT_ARCH_ARMV5) & 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 }
unsigned char uchar
Definition: qglobal.h:994
unsigned short quint16
Definition: qglobal.h:936
unsigned int quint32
Definition: qglobal.h:938

◆ qt_blend_argb24_on_rgb16() [2/2]

static void qt_blend_argb24_on_rgb16 ( uchar destPixels,
int  dbpl,
const uchar srcPixels,
int  sbpl,
int  w,
int  h,
int  const_alpha 
)
static

Definition at line 350 of file qblendfunctions.cpp.

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 }
void qt_blend_argb24_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, const T &alphaFunc)

◆ qt_blend_argb32_on_argb32()

static void qt_blend_argb32_on_argb32 ( uchar destPixels,
int  dbpl,
const uchar srcPixels,
int  sbpl,
int  w,
int  h,
int  const_alpha 
)
static

Definition at line 491 of file qblendfunctions.cpp.

Referenced by qt_blend_rgb32_on_rgb32().

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 }
int qAlpha(QRgb rgba)
Returns the alpha component of the ARGB quadruplet rgba.
Definition: qrgb.h:66
unsigned char uchar
Definition: qglobal.h:994
Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a)
unsigned int uint
Definition: qglobal.h:996
unsigned int quint32
Definition: qglobal.h:938

◆ qt_blend_argb32_on_rgb16()

static void qt_blend_argb32_on_rgb16 ( uchar destPixels,
int  dbpl,
const uchar srcPixels,
int  sbpl,
int  w,
int  h,
int  const_alpha 
)
static

Definition at line 395 of file qblendfunctions.cpp.

Referenced by qt_blend_rgb32_on_rgb16().

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 }
unsigned char uchar
Definition: qglobal.h:994
unsigned short quint16
Definition: qglobal.h:936
unsigned int quint32
Definition: qglobal.h:938
void qt_blend_argb32_on_rgb16_const_alpha(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)
static quint16 convert_argb32_to_rgb16(quint32 spix)

◆ qt_blend_argb32_on_rgb16_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 
)

Definition at line 372 of file qblendfunctions.cpp.

Referenced by qt_blend_argb32_on_rgb16().

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);
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 }
Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16(uint x, uint a)
int qAlpha(QRgb rgba)
Returns the alpha component of the ARGB quadruplet rgba.
Definition: qrgb.h:66
unsigned char uchar
Definition: qglobal.h:994
Q_STATIC_INLINE_FUNCTION uint BYTE_MUL(uint x, uint a)
unsigned short quint16
Definition: qglobal.h:936
unsigned int uint
Definition: qglobal.h:996
unsigned int quint32
Definition: qglobal.h:938
static quint16 convert_argb32_to_rgb16(quint32 spix)

◆ qt_blend_rgb16_on_rgb16()

void qt_blend_rgb16_on_rgb16 ( uchar dst,
int  dbpl,
const uchar src,
int  sbpl,
int  w,
int  h,
int  const_alpha 
)

Definition at line 257 of file qblendfunctions.cpp.

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 }
double d
Definition: qnumeric_p.h:62
Q_STATIC_INLINE_FUNCTION uint BYTE_MUL_RGB16(uint x, uint a)
long ASN1_INTEGER_get ASN1_INTEGER * a
unsigned char quint8
Definition: qglobal.h:934
unsigned char uchar
Definition: qglobal.h:994
unsigned short quint16
Definition: qglobal.h:936
#define QT_MEMCPY_USHORT(dest, src, length)

◆ qt_blend_rgb32_on_rgb16()

static void qt_blend_rgb32_on_rgb16 ( uchar destPixels,
int  dbpl,
const uchar srcPixels,
int  sbpl,
int  w,
int  h,
int  const_alpha 
)
static

Definition at line 448 of file qblendfunctions.cpp.

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 }
unsigned short quint16
Definition: qglobal.h:936
unsigned int quint32
Definition: qglobal.h:938
static quint16 convert_argb32_to_rgb16(quint32 spix)
static void qt_blend_argb32_on_rgb16(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)

◆ qt_blend_rgb32_on_rgb32()

void qt_blend_rgb32_on_rgb32 ( uchar destPixels,
int  dbpl,
const uchar srcPixels,
int  sbpl,
int  w,
int  h,
int  const_alpha 
)

Definition at line 530 of file qblendfunctions.cpp.

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 }
unsigned char uchar
Definition: qglobal.h:994
unsigned int uint
Definition: qglobal.h:996
void qt_memconvert(DST *dest, const SRC *src, int count)
unsigned int quint32
Definition: qglobal.h:938
static void qt_blend_argb32_on_argb32(uchar *destPixels, int dbpl, const uchar *srcPixels, int sbpl, int w, int h, int const_alpha)

◆ qt_scale_image_argb24_on_rgb16()

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 
)

Definition at line 206 of file qblendfunctions.cpp.

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) {
222  qt_scale_image_16bit<qargb8565>(destPixels, dbpl, srcPixels, sbpl, sh,
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, sh,
227  targetRect, sourceRect, clip, constAlpha);
228  }
229 }
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664

◆ qt_scale_image_argb32_on_argb32()

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 
)

Definition at line 638 of file qblendfunctions.cpp.

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) {
654  qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, sh,
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, sh,
659  targetRect, sourceRect, clip, constAlpha);
660  }
661 }
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
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)
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664

◆ qt_scale_image_argb32_on_rgb16()

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 
)

Definition at line 232 of file qblendfunctions.cpp.

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) {
248  qt_scale_image_16bit<quint32>(destPixels, dbpl, srcPixels, sbpl, sh,
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, sh,
253  targetRect, sourceRect, clip, constAlpha);
254  }
255 }
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664

◆ qt_scale_image_rgb16_on_rgb16()

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 
)

Definition at line 181 of file qblendfunctions.cpp.

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) {
197  qt_scale_image_16bit<quint16>(destPixels, dbpl, srcPixels, sbpl, sh,
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, sh,
202  targetRect, sourceRect, clip, constAlpha);
203  }
204 }
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664

◆ qt_scale_image_rgb32_on_rgb32()

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 
)

Definition at line 613 of file qblendfunctions.cpp.

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) {
629  qt_scale_image_32bit(destPixels, dbpl, srcPixels, sbpl, sh,
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, sh,
634  targetRect, sourceRect, clip, constAlpha);
635  }
636 }
qreal y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:667
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)
qreal height() const
Returns the height of the rectangle.
Definition: qrect.h:710
qreal width() const
Returns the width of the rectangle.
Definition: qrect.h:707
qreal x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:664

◆ qt_transform_image_argb24_on_rgb16()

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 
)

Definition at line 684 of file qblendfunctions.cpp.

691 {
692  if (const_alpha == 256) {
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 }
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)

◆ qt_transform_image_argb32_on_argb32()

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 
)

Definition at line 749 of file qblendfunctions.cpp.

756 {
757  if (const_alpha == 256) {
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 }
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)

◆ qt_transform_image_argb32_on_rgb16()

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 
)

Definition at line 706 of file qblendfunctions.cpp.

713 {
714  if (const_alpha == 256) {
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 }
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)

◆ qt_transform_image_rgb16_on_rgb16()

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 
)

Definition at line 663 of file qblendfunctions.cpp.

670 {
671  if (const_alpha == 256) {
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 }
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)

◆ qt_transform_image_rgb32_on_rgb32()

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 
)

Definition at line 728 of file qblendfunctions.cpp.

735 {
736  if (const_alpha == 256) {
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 }
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)

Variable Documentation

◆ qBlendFunctions

SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]

Definition at line 1062 of file qblendfunctions.cpp.

Referenced by QRasterPaintEngine::drawImage(), and qInitDrawhelperAsm().

◆ qScaleFunctions

SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]

Definition at line 770 of file qblendfunctions.cpp.

Referenced by QRasterPaintEngine::drawImage(), and qInitDrawhelperAsm().

◆ qTransformFunctions

SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]

Definition at line 1353 of file qblendfunctions.cpp.

Referenced by QRasterPaintEngine::drawImage(), and qInitDrawhelperAsm().