13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
42 {
return qAlpha(val) == 255; }
44 {
return qAlpha(val) == 0; }
48 { qt_memfill32(ptr, value, len); }
50 { ::memcpy(dest, src, len *
sizeof(Type)); }
63 {
return comp_func_Plus_one_pixel(a, b); }
65 {
return qAlpha(val); }
73 {
return BYTE_MUL(val, a); }
75 {
return INTERPOLATE_PIXEL_255(x, a1, y, a2); }
77 {
return BYTE_MUL(val, a); }
81 {
return INTERPOLATE_PIXEL_255(x, a1, y, a2); }
96 {
return val.isOpaque(); }
98 {
return val.isTransparent(); }
103 { qt_memfill64((quint64*)ptr, value, len); }
105 { ::memcpy(dest, src, len *
sizeof(Type)); }
108#if QT_CONFIG(raster_64bit)
109const Rgba64OperationsBase::Type Rgba64OperationsBase::clear = QRgba64::fromRgba64(0);
111struct Rgba64OperationsC :
public Rgba64OperationsBase
113 typedef QRgba64 OptimalType;
114 typedef quint16 OptimalScalar;
116 static OptimalType load(
const Type *ptr)
118 static OptimalType convert(
const Type &val)
120 static void store(Type *ptr, OptimalType value)
122 static OptimalType add(OptimalType a, OptimalType b)
123 {
return QRgba64::fromRgba64((quint64)a + (quint64)b); }
124 static OptimalScalar add(OptimalScalar a, OptimalScalar b)
126 static OptimalType plus(OptimalType a, OptimalType b)
127 {
return addWithSaturation(a, b); }
128 static OptimalScalar alpha(OptimalType val)
129 {
return val.alpha(); }
130 static OptimalScalar invAlpha(Scalar c)
131 {
return 65535 - c; }
132 static OptimalScalar invAlpha(OptimalType val)
133 {
return 65535 - alpha(val); }
134 static OptimalScalar scalar(Scalar v)
136 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
137 {
return multiplyAlpha255(val, a); }
138 static OptimalScalar multiplyAlpha8bit(OptimalScalar val, uint8_t a)
139 {
return qt_div_255(val * a); }
140 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
141 {
return interpolate255(x, a1, y, a2); }
142 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
143 {
return multiplyAlpha65535(val, a); }
144 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2)
145 {
return interpolate65535(x, a1, y, a2); }
149struct Rgba64OperationsSSE2 :
public Rgba64OperationsBase
151 typedef __m128i OptimalType;
152 typedef __m128i OptimalScalar;
154 static OptimalType load(
const Type *ptr)
156 return _mm_loadl_epi64(
reinterpret_cast<
const __m128i *>(ptr));
158 static OptimalType convert(
const Type &value)
160#ifdef Q_PROCESSOR_X86_64
161 return _mm_cvtsi64_si128(value);
166 static void store(Type *ptr, OptimalType value)
168 _mm_storel_epi64(
reinterpret_cast<__m128i *>(ptr), value);
170 static OptimalType add(OptimalType a, OptimalType b)
172 return _mm_add_epi16(a, b);
176 static OptimalType plus(OptimalType a, OptimalType b)
178 return _mm_adds_epu16(a, b);
180 static OptimalScalar alpha(OptimalType c)
182 return _mm_shufflelo_epi16(c, _MM_SHUFFLE(3, 3, 3, 3));
184 static OptimalScalar invAlpha(Scalar c)
186 return scalar(65535 - c);
188 static OptimalScalar invAlpha(OptimalType c)
190 return _mm_xor_si128(_mm_set1_epi16(-1), alpha(c));
192 static OptimalScalar scalar(Scalar n)
194 return _mm_shufflelo_epi16(_mm_cvtsi32_si128(n), _MM_SHUFFLE(0, 0, 0, 0));
196 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
198 return multiplyAlpha255(val, a);
202 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
204 return interpolate255(x, a1, y, a2);
206 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
208 return multiplyAlpha65535(val, a);
211 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y,
const OptimalScalar &a2)
213 return interpolate65535(x, a1, y, a2);
218#if defined(__ARM_NEON__)
219struct Rgba64OperationsNEON :
public Rgba64OperationsBase
221 typedef uint16x4_t OptimalType;
222 typedef uint16x4_t OptimalScalar;
224 static OptimalType load(
const Type *ptr)
226 return vreinterpret_u16_u64(vld1_u64(
reinterpret_cast<
const uint64_t *>(ptr)));
228 static OptimalType convert(
const Type &val)
230 return vreinterpret_u16_u64(vmov_n_u64(val));
232 static void store(Type *ptr, OptimalType value)
234 vst1_u64(
reinterpret_cast<uint64_t *>(ptr), vreinterpret_u64_u16(value));
236 static OptimalType add(OptimalType a, OptimalType b)
238 return vadd_u16(a, b);
242 static OptimalType plus(OptimalType a, OptimalType b)
244 return vqadd_u16(a, b);
246 static OptimalScalar alpha(OptimalType c)
248 return vdup_lane_u16(c, 3);
250 static OptimalScalar invAlpha(Scalar c)
252 return scalar(65535 - c);
254 static OptimalScalar invAlpha(OptimalType c)
256 return vmvn_u16(alpha(c));
258 static OptimalScalar scalar(Scalar n)
260 return vdup_n_u16(n);
262 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
264 return multiplyAlpha255(val, a);
268 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
270 return interpolate255(x, a1, y, a2);
272 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
274 return multiplyAlpha65535(val, a);
276 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2)
278 return interpolate65535(x, a1, y, a2);
283#if defined(__loongarch_sx)
284struct Rgba64OperationsLSX :
public Rgba64OperationsBase
286 typedef __m128i OptimalType;
287 typedef __m128i OptimalScalar;
288 static OptimalType load(
const Type *ptr)
290 return __lsx_vilvl_d(__lsx_vldi(0), __lsx_vldrepl_d(
reinterpret_cast<
const __m128i *>(ptr), 0));
292 static OptimalType convert(
const Type &value)
294 return __lsx_vinsgr2vr_d(__lsx_vldi(0), value, 0);
296 static void store(Type *ptr, OptimalType value)
298 __lsx_vstelm_d(value,
reinterpret_cast<
const __m128i *>(ptr), 0, 0);
300 static OptimalType add(OptimalType a, OptimalType b)
302 return __lsx_vadd_h(a, b);
306 static OptimalType plus(OptimalType a, OptimalType b)
308 return __lsx_vsadd_hu(a, b);
310 static OptimalScalar alpha(OptimalType c)
312 const __m128i shuffleMask = (__m128i)(v8i16){3, 3, 3, 3, 4, 5, 6, 7};
313 return __lsx_vshuf_h(shuffleMask, __lsx_vldi(0), c);
315 static OptimalScalar invAlpha(Scalar c)
317 return scalar(65535 - c);
319 static OptimalScalar invAlpha(OptimalType c)
321 return __lsx_vxor_v(__lsx_vreplgr2vr_h(-1), alpha(c));
323 static OptimalScalar scalar(Scalar n)
325 const __m128i shuffleMask = (__m128i)(v8i16){0, 0, 0, 0, 4, 5, 6, 7};
326 return __lsx_vshuf_h(shuffleMask, __lsx_vldi(0), __lsx_vinsgr2vr_w(__lsx_vldi(0), n, 0));
328 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
330 return multiplyAlpha255(val, a);
334 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
336 return interpolate255(x, a1, y, a2);
338 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
340 return multiplyAlpha65535(val, a);
342 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y,
const OptimalScalar &a2)
344 return interpolate65535(x, a1, y, a2);
350typedef Rgba64OperationsSSE2 Rgba64Operations;
351#elif defined(__ARM_NEON__)
352typedef Rgba64OperationsNEON Rgba64Operations;
353#elif defined(__loongarch_sx)
354typedef Rgba64OperationsLSX Rgba64Operations;
356typedef Rgba64OperationsC Rgba64Operations;
361#if QT_CONFIG(raster_fp)
363static inline QRgbaFloat32 qRgbaFloat32(
float r,
float g,
float b,
float a)
365 return QRgbaFloat32{r, g, b, a};
368struct RgbaFPOperationsBase
370 typedef QRgbaFloat32 Type;
371 typedef float Scalar;
373 static inline constexpr Type clear = { 0, 0, 0, 0 };
375 static bool isOpaque(Type val)
376 {
return val.a >= 1.0f; }
377 static bool isTransparent(Type val)
378 {
return val.a <= 0.0f; }
379 static Scalar scalarFrom8bit(uint8_t a)
380 {
return a * (1.0f / 255.0f); }
382 static void memfill(Type *ptr, Type value, qsizetype len)
384 for (qsizetype i = 0; i < len; ++i)
387 static void memcpy(Type *Q_DECL_RESTRICT dest,
const Type *Q_DECL_RESTRICT src, qsizetype len)
388 { ::memcpy(dest, src, len *
sizeof(Type)); }
391struct RgbaFPOperationsC : RgbaFPOperationsBase
393 typedef QRgbaFloat32 OptimalType;
394 typedef float OptimalScalar;
396 static OptimalType load(
const Type *ptr)
398 return QRgbaFloat32 { ptr->r, ptr->g, ptr->b, ptr->a };
400 static OptimalType convert(
const Type &val)
402 return QRgbaFloat32 { val.r, val.g, val.b, val.a };
404 static void store(Type *ptr, OptimalType value)
411 static OptimalType add(OptimalType a, OptimalType b)
419 static OptimalScalar add(OptimalScalar a, OptimalScalar b)
421 static OptimalType plus(OptimalType a, OptimalType b)
424 if (a.a < 0.0f) a.a = 0.0f;
425 else if (a.a > 1.0f) a.a = 1.0f;
428 static OptimalScalar alpha(OptimalType val)
430 static OptimalScalar invAlpha(OptimalScalar c)
432 static OptimalScalar invAlpha(OptimalType val)
433 {
return 1.0f - val.a; }
434 static OptimalScalar scalar(Scalar v)
436 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
444 static OptimalScalar multiplyAlpha8bit(OptimalScalar val, uint8_t a)
446 return val * a * (1.0f / 255.0f);
448 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2)
450 return add(multiplyAlpha(x, a1), multiplyAlpha(y, a2));
452 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
454 return multiplyAlpha(val, a * (1.0f / 255.0f));
456 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
458 return add(multiplyAlpha8bit(x, a1), multiplyAlpha8bit(y, a2));
463struct RgbaFPOperationsSSE2 :
public RgbaFPOperationsBase
465 typedef __m128 OptimalType;
466 typedef __m128 OptimalScalar;
468 static OptimalType Q_DECL_VECTORCALL load(
const Type *ptr)
470 return _mm_loadu_ps(
reinterpret_cast<
const float *>(ptr));
472 static OptimalType Q_DECL_VECTORCALL convert(
const Type &value)
476 static void Q_DECL_VECTORCALL store(Type *ptr, OptimalType value)
478 _mm_storeu_ps(
reinterpret_cast<
float *>(ptr), value);
480 static OptimalType Q_DECL_VECTORCALL add(OptimalType a, OptimalType b)
482 return _mm_add_ps(a, b);
486 static OptimalType Q_DECL_VECTORCALL plus(OptimalType a, OptimalType b)
488 a = _mm_add_ps(a, b);
489 __m128 aa = _mm_min_ps(a, _mm_set1_ps(1.0f));
490 aa = _mm_max_ps(aa, _mm_set1_ps(0.0f));
492 aa = _mm_shuffle_ps(aa, a, _MM_SHUFFLE(2, 2, 3, 3));
493 a = _mm_shuffle_ps(a, aa, _MM_SHUFFLE(0, 2, 1, 0));
496 static OptimalScalar Q_DECL_VECTORCALL alpha(OptimalType c)
498 return _mm_shuffle_ps(c, c, _MM_SHUFFLE(3, 3, 3, 3));
500 static OptimalScalar Q_DECL_VECTORCALL invAlpha(Scalar c)
502 return _mm_set1_ps(1.0f -
float(c));
504 static OptimalScalar Q_DECL_VECTORCALL invAlpha(OptimalType c)
506 return _mm_sub_ps(_mm_set1_ps(1.0f), alpha(c));
508 static OptimalScalar Q_DECL_VECTORCALL scalar(Scalar n)
510 return _mm_set1_ps(
float(n));
512 static OptimalType Q_DECL_VECTORCALL multiplyAlpha(OptimalType val, OptimalScalar a)
514 return _mm_mul_ps(val, a);
516 static OptimalType Q_DECL_VECTORCALL interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2)
518 return add(multiplyAlpha(x, a1), multiplyAlpha(y, a2));
520 static OptimalType Q_DECL_VECTORCALL multiplyAlpha8bit(OptimalType val, uint8_t a)
522 return multiplyAlpha(val, _mm_set1_ps(a * (1.0f / 255.0f)));
526 static OptimalType Q_DECL_VECTORCALL interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
528 return add(multiplyAlpha8bit(x, a1), multiplyAlpha8bit(y, a2));
534typedef RgbaFPOperationsSSE2 RgbaFPOperations;
536typedef RgbaFPOperationsC RgbaFPOperations;
542
543
544
548 if (const_alpha == 255)
549 Ops::memfill(dest, Ops::clear, length);
551 uint ialpha = 255 - const_alpha;
552 for (
int i = 0; i < length; ++i) {
553 Ops::store(&dest[i], Ops::multiplyAlpha8bit(Ops::load(&dest[i]), ialpha));
558void QT_FASTCALL comp_func_solid_Clear(uint *dest,
int length, uint, uint const_alpha)
560 comp_func_Clear_template<Argb32Operations>(dest, length, const_alpha);
563void QT_FASTCALL comp_func_Clear(uint *dest,
const uint *,
int length, uint const_alpha)
565 comp_func_Clear_template<Argb32Operations>(dest, length, const_alpha);
568#if QT_CONFIG(raster_64bit)
569void QT_FASTCALL comp_func_solid_Clear_rgb64(QRgba64 *dest,
int length, QRgba64, uint const_alpha)
571 comp_func_Clear_template<Rgba64Operations>(dest, length, const_alpha);
574void QT_FASTCALL comp_func_Clear_rgb64(QRgba64 *dest,
const QRgba64 *,
int length, uint const_alpha)
576 comp_func_Clear_template<Rgba64Operations>(dest, length, const_alpha);
580#if QT_CONFIG(raster_fp)
581void QT_FASTCALL comp_func_solid_Clear_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32, uint const_alpha)
583 comp_func_Clear_template<RgbaFPOperations>(dest, length, const_alpha);
586void QT_FASTCALL comp_func_Clear_rgbafp(QRgbaFloat32 *dest,
const QRgbaFloat32 *,
int length, uint const_alpha)
588 comp_func_Clear_template<RgbaFPOperations>(dest, length, const_alpha);
593
594
595
599 if (const_alpha == 255)
600 Ops::memfill(dest, color, length);
602 const uint ialpha = 255 - const_alpha;
603 auto s = Ops::multiplyAlpha8bit(Ops::convert(color), const_alpha);
604 for (
int i = 0; i < length; ++i) {
605 auto d = Ops::multiplyAlpha8bit(Ops::load(&dest[i]), ialpha);
606 Ops::store(&dest[i], Ops::add(s, d));
614 int length, uint const_alpha)
616 if (const_alpha == 255)
617 Ops::memcpy(dest, src, length);
619 const uint ialpha = 255 - const_alpha;
620 for (
int i = 0; i < length; ++i) {
621 auto s = Ops::load(src + i);
622 auto d = Ops::load(dest + i);
623 Ops::store(&dest[i], Ops::interpolate8bit(s, const_alpha, d, ialpha));
628void QT_FASTCALL comp_func_solid_Source(uint *dest,
int length, uint color, uint const_alpha)
630 comp_func_solid_Source_template<Argb32Operations>(dest, length, color, const_alpha);
635 comp_func_Source_template<Argb32Operations>(dest, src, length, const_alpha);
638#if QT_CONFIG(raster_64bit)
639void QT_FASTCALL comp_func_solid_Source_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
641 comp_func_solid_Source_template<Rgba64Operations>(dest, length, color, const_alpha);
644void QT_FASTCALL comp_func_Source_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
646 comp_func_Source_template<Rgba64Operations>(dest, src, length, const_alpha);
650#if QT_CONFIG(raster_fp)
651void QT_FASTCALL comp_func_solid_Source_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
653 comp_func_solid_Source_template<RgbaFPOperations>(dest, length, color, const_alpha);
656void QT_FASTCALL comp_func_Source_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
658 comp_func_Source_template<RgbaFPOperations>(dest, src, length, const_alpha);
662void QT_FASTCALL comp_func_solid_Destination(uint *,
int, uint, uint)
666void QT_FASTCALL comp_func_Destination(uint *,
const uint *,
int, uint)
670#if QT_CONFIG(raster_64bit)
671void QT_FASTCALL comp_func_solid_Destination_rgb64(QRgba64 *,
int, QRgba64, uint)
675void QT_FASTCALL comp_func_Destination_rgb64(QRgba64 *,
const QRgba64 *,
int, uint)
680#if QT_CONFIG(raster_fp)
681void QT_FASTCALL comp_func_solid_Destination_rgbafp(QRgbaFloat32 *,
int, QRgbaFloat32, uint)
685void QT_FASTCALL comp_func_Destination_rgbafp(QRgbaFloat32 *,
const QRgbaFloat32 *,
int, uint)
691
692
693
694
695
699 if (const_alpha == 255 && Ops::isOpaque(color))
700 Ops::memfill(dest, color, length);
702 auto c = Ops::convert(color);
703 if (const_alpha != 255)
704 c = Ops::multiplyAlpha8bit(c, const_alpha);
705 auto cAlpha = Ops::invAlpha(c);
706 for (
int i = 0; i < length; ++i) {
707 auto d = Ops::multiplyAlpha(Ops::load(&dest[i]), cAlpha);
708 Ops::store(&dest[i], Ops::add(c, d));
716 int length, uint const_alpha)
718 if (const_alpha == 255) {
719 for (
int i = 0; i < length; ++i) {
721 if (Ops::isOpaque(c))
722 Ops::store(&dest[i], Ops::convert(c));
723 else if (!Ops::isTransparent(c)) {
724 auto s = Ops::convert(c);
725 auto d = Ops::multiplyAlpha(Ops::load(&dest[i]), Ops::invAlpha(s));
726 Ops::store(&dest[i], Ops::add(s, d));
730 for (
int i = 0; i < length; ++i) {
731 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
732 auto d = Ops::multiplyAlpha(Ops::load(&dest[i]), Ops::invAlpha(s));
733 Ops::store(&dest[i], Ops::add(s, d));
738void QT_FASTCALL comp_func_solid_SourceOver(uint *dest,
int length, uint color, uint const_alpha)
740 comp_func_solid_SourceOver_template<Argb32Operations>(dest, length, color, const_alpha);
745 comp_func_SourceOver_template<Argb32Operations>(dest, src, length, const_alpha);
748#if QT_CONFIG(raster_64bit)
749void QT_FASTCALL comp_func_solid_SourceOver_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
751 comp_func_solid_SourceOver_template<Rgba64Operations>(dest, length, color, const_alpha);
754void QT_FASTCALL comp_func_SourceOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
756 comp_func_SourceOver_template<Rgba64Operations>(dest, src, length, const_alpha);
760#if QT_CONFIG(raster_fp)
761void QT_FASTCALL comp_func_solid_SourceOver_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
763 comp_func_solid_SourceOver_template<RgbaFPOperations>(dest, length, color, const_alpha);
767void QT_FASTCALL comp_func_SourceOver_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
769 comp_func_SourceOver_template<RgbaFPOperations>(dest, src, length, const_alpha);
774
775
776
777
781 auto c = Ops::convert(color);
782 if (const_alpha != 255)
783 c = Ops::multiplyAlpha8bit(c, const_alpha);
784 for (
int i = 0; i < length; ++i) {
785 auto d = Ops::load(&dest[i]);
786 auto s = Ops::multiplyAlpha(c, Ops::invAlpha(d));
787 Ops::store(&dest[i], Ops::add(s, d));
794 int length, uint const_alpha)
796 if (const_alpha == 255) {
797 for (
int i = 0; i < length; ++i) {
798 auto d = Ops::load(&dest[i]);
799 auto s = Ops::multiplyAlpha(Ops::load(&src[i]), Ops::invAlpha(d));
800 Ops::store(&dest[i], Ops::add(s, d));
803 for (
int i = 0; i < length; ++i) {
804 auto d = Ops::load(&dest[i]);
805 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
806 s = Ops::multiplyAlpha(s, Ops::invAlpha(d));
807 Ops::store(&dest[i], Ops::add(s, d));
812void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest,
int length, uint color, uint const_alpha)
814 comp_func_solid_DestinationOver_template<Argb32Operations>(dest, length, color, const_alpha);
819 comp_func_DestinationOver_template<Argb32Operations>(dest, src, length, const_alpha);
822#if QT_CONFIG(raster_64bit)
823void QT_FASTCALL comp_func_solid_DestinationOver_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
825 comp_func_solid_DestinationOver_template<Rgba64Operations>(dest, length, color, const_alpha);
828void QT_FASTCALL comp_func_DestinationOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
830 comp_func_DestinationOver_template<Rgba64Operations>(dest, src, length, const_alpha);
834#if QT_CONFIG(raster_fp)
835void QT_FASTCALL comp_func_solid_DestinationOver_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
837 comp_func_solid_DestinationOver_template<RgbaFPOperations>(dest, length, color, const_alpha);
840void QT_FASTCALL comp_func_DestinationOver_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
842 comp_func_DestinationOver_template<RgbaFPOperations>(dest, src, length, const_alpha);
847
848
849
853 if (const_alpha == 255) {
854 auto c = Ops::convert(color);
855 for (
int i = 0; i < length; ++i) {
856 Ops::store(&dest[i], Ops::multiplyAlpha(c, Ops::alpha(Ops::load(&dest[i]))));
859 auto c = Ops::multiplyAlpha8bit(Ops::convert(color), const_alpha);
860 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
861 for (
int i = 0; i < length; ++i) {
862 auto d = Ops::load(&dest[i]);
863 Ops::store(&dest[i], Ops::interpolate(c, Ops::alpha(d), d, cia));
871 int length, uint const_alpha)
873 if (const_alpha == 255) {
874 for (
int i = 0; i < length; ++i) {
875 auto s = Ops::load(&src[i]);
876 Ops::store(&dest[i], Ops::multiplyAlpha(s, Ops::alpha(Ops::load(&dest[i]))));
879 auto ca = Ops::scalarFrom8bit(const_alpha);
880 auto cia = Ops::invAlpha(ca);
881 auto cav = Ops::scalar(ca);
882 for (
int i = 0; i < length; ++i) {
883 auto d = Ops::load(&dest[i]);
884 auto s = Ops::multiplyAlpha(Ops::load(&src[i]), cav);
885 Ops::store(&dest[i], Ops::interpolate(s, Ops::alpha(d), d, cia));
890void QT_FASTCALL comp_func_solid_SourceIn(uint *dest,
int length, uint color, uint const_alpha)
892 comp_func_solid_SourceIn_template<Argb32Operations>(dest, length, color, const_alpha);
897 comp_func_SourceIn_template<Argb32Operations>(dest, src, length, const_alpha);
900#if QT_CONFIG(raster_64bit)
901void QT_FASTCALL comp_func_solid_SourceIn_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
903 comp_func_solid_SourceIn_template<Rgba64Operations>(dest, length, color, const_alpha);
906void QT_FASTCALL comp_func_SourceIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
908 comp_func_SourceIn_template<Rgba64Operations>(dest, src, length, const_alpha);
912#if QT_CONFIG(raster_fp)
913void QT_FASTCALL comp_func_solid_SourceIn_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
915 comp_func_solid_SourceIn_template<RgbaFPOperations>(dest, length, color, const_alpha);
918void QT_FASTCALL comp_func_SourceIn_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
920 comp_func_SourceIn_template<RgbaFPOperations>(dest, src, length, const_alpha);
925
926
927
928
932 auto sa = Ops::alpha(Ops::convert(color));
933 if (const_alpha != 255) {
934 sa = Ops::multiplyAlpha8bit(sa, const_alpha);
935 sa = Ops::add(sa, Ops::invAlpha(Ops::scalarFrom8bit(const_alpha)));
938 for (
int i = 0; i < length; ++i) {
939 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sa));
946 int length, uint const_alpha)
948 if (const_alpha == 255) {
949 for (
int i = 0; i < length; ++i) {
950 auto a = Ops::alpha(Ops::load(&src[i]));
951 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), a));
954 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
955 for (
int i = 0; i < length; ++i) {
956 auto sa = Ops::multiplyAlpha8bit(Ops::alpha(Ops::load(&src[i])), const_alpha);
957 sa = Ops::add(sa, cia);
958 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sa));
963void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest,
int length, uint color, uint const_alpha)
965 comp_func_solid_DestinationIn_template<Argb32Operations>(dest, length, color, const_alpha);
970 comp_func_DestinationIn_template<Argb32Operations>(dest, src, length, const_alpha);
973#if QT_CONFIG(raster_64bit)
974void QT_FASTCALL comp_func_solid_DestinationIn_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
976 comp_func_solid_DestinationIn_template<Rgba64Operations>(dest, length, color, const_alpha);
979void QT_FASTCALL comp_func_DestinationIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
981 comp_func_DestinationIn_template<Rgba64Operations>(dest, src, length, const_alpha);
985#if QT_CONFIG(raster_fp)
986void QT_FASTCALL comp_func_solid_DestinationIn_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
988 comp_func_solid_DestinationIn_template<RgbaFPOperations>(dest, length, color, const_alpha);
991void QT_FASTCALL comp_func_DestinationIn_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
993 comp_func_DestinationIn_template<RgbaFPOperations>(dest, src, length, const_alpha);
998
999
1000
1004 auto c = Ops::convert(color);
1005 if (const_alpha == 255) {
1006 for (
int i = 0; i < length; ++i)
1007 Ops::store(&dest[i], Ops::multiplyAlpha(c, Ops::invAlpha(Ops::load(&dest[i]))));
1009 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1010 c = Ops::multiplyAlpha8bit(c, const_alpha);
1011 for (
int i = 0; i < length; ++i) {
1012 auto d = Ops::load(&dest[i]);
1013 Ops::store(&dest[i], Ops::interpolate(c, Ops::invAlpha(d), d, cia));
1021 int length, uint const_alpha)
1023 if (const_alpha == 255) {
1024 for (
int i = 0; i < length; ++i) {
1025 auto s = Ops::load(&src[i]);
1026 auto d = Ops::load(&dest[i]);
1027 Ops::store(&dest[i], Ops::multiplyAlpha(s, Ops::invAlpha(d)));
1030 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1031 for (
int i = 0; i < length; ++i) {
1032 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
1033 auto d = Ops::load(&dest[i]);
1034 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, cia));
1039void QT_FASTCALL comp_func_solid_SourceOut(uint *dest,
int length, uint color, uint const_alpha)
1041 comp_func_solid_SourceOut_template<Argb32Operations>(dest, length, color, const_alpha);
1046 comp_func_SourceOut_template<Argb32Operations>(dest, src, length, const_alpha);
1049#if QT_CONFIG(raster_64bit)
1050void QT_FASTCALL comp_func_solid_SourceOut_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1052 comp_func_solid_SourceOut_template<Rgba64Operations>(dest, length, color, const_alpha);
1055void QT_FASTCALL comp_func_SourceOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1057 comp_func_SourceOut_template<Rgba64Operations>(dest, src, length, const_alpha);
1061#if QT_CONFIG(raster_fp)
1062void QT_FASTCALL comp_func_solid_SourceOut_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1064 comp_func_solid_SourceOut_template<RgbaFPOperations>(dest, length, color, const_alpha);
1067void QT_FASTCALL comp_func_SourceOut_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1069 comp_func_SourceOut_template<RgbaFPOperations>(dest, src, length, const_alpha);
1074
1075
1076
1077
1081 auto sai = Ops::invAlpha(Ops::convert(color));
1082 if (const_alpha != 255) {
1083 sai = Ops::multiplyAlpha8bit(sai, const_alpha);
1084 sai = Ops::add(sai, Ops::invAlpha(Ops::scalarFrom8bit(const_alpha)));
1087 for (
int i = 0; i < length; ++i) {
1088 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sai));
1095 int length, uint const_alpha)
1097 if (const_alpha == 255) {
1098 for (
int i = 0; i < length; ++i) {
1099 auto sia = Ops::invAlpha(Ops::load(&src[i]));
1100 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sia));
1103 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1104 for (
int i = 0; i < length; ++i) {
1105 auto sia = Ops::multiplyAlpha8bit(Ops::invAlpha(Ops::load(&src[i])), const_alpha);
1106 sia = Ops::add(sia, cia);
1107 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sia));
1112void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest,
int length, uint color, uint const_alpha)
1114 comp_func_solid_DestinationOut_template<Argb32Operations>(dest, length, color, const_alpha);
1119 comp_func_DestinationOut_template<Argb32Operations>(dest, src, length, const_alpha);
1122#if QT_CONFIG(raster_64bit)
1123void QT_FASTCALL comp_func_solid_DestinationOut_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1125 comp_func_solid_DestinationOut_template<Rgba64Operations>(dest, length, color, const_alpha);
1128void QT_FASTCALL comp_func_DestinationOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1130 comp_func_DestinationOut_template<Rgba64Operations>(dest, src, length, const_alpha);
1134#if QT_CONFIG(raster_fp)
1135void QT_FASTCALL comp_func_solid_DestinationOut_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1137 comp_func_solid_DestinationOut_template<RgbaFPOperations>(dest, length, color, const_alpha);
1140void QT_FASTCALL comp_func_DestinationOut_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1142 comp_func_DestinationOut_template<RgbaFPOperations>(dest, src, length, const_alpha);
1147
1148
1149
1150
1151
1155 auto c = Ops::convert(color);
1156 if (const_alpha != 255)
1157 c = Ops::multiplyAlpha8bit(c, const_alpha);
1158 auto sia = Ops::invAlpha(c);
1159 for (
int i = 0; i < length; ++i) {
1160 auto d = Ops::load(&dest[i]);
1161 Ops::store(&dest[i], Ops::interpolate(c, Ops::alpha(d), d, sia));
1168 int length, uint const_alpha)
1170 if (const_alpha == 255) {
1171 for (
int i = 0; i < length; ++i) {
1172 auto s = Ops::load(&src[i]);
1173 auto d = Ops::load(&dest[i]);
1174 Ops::store(&dest[i], Ops::interpolate(s, Ops::alpha(d), d, Ops::invAlpha(s)));
1177 for (
int i = 0; i < length; ++i) {
1178 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
1179 auto d = Ops::load(&dest[i]);
1180 Ops::store(&dest[i], Ops::interpolate(s, Ops::alpha(d), d, Ops::invAlpha(s)));
1185void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest,
int length, uint color, uint const_alpha)
1187 comp_func_solid_SourceAtop_template<Argb32Operations>(dest, length, color, const_alpha);
1192 comp_func_SourceAtop_template<Argb32Operations>(dest, src, length, const_alpha);
1195#if QT_CONFIG(raster_64bit)
1196void QT_FASTCALL comp_func_solid_SourceAtop_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1198 comp_func_solid_SourceAtop_template<Rgba64Operations>(dest, length, color, const_alpha);
1201void QT_FASTCALL comp_func_SourceAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1203 comp_func_SourceAtop_template<Rgba64Operations>(dest, src, length, const_alpha);
1207#if QT_CONFIG(raster_fp)
1208void QT_FASTCALL comp_func_solid_SourceAtop_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1210 comp_func_solid_SourceAtop_template<RgbaFPOperations>(dest, length, color, const_alpha);
1213void QT_FASTCALL comp_func_SourceAtop_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1215 comp_func_SourceAtop_template<RgbaFPOperations>(dest, src, length, const_alpha);
1220
1221
1222
1223
1227 auto c = Ops::convert(color);
1228 auto sa = Ops::alpha(c);
1229 if (const_alpha != 255) {
1230 c = Ops::multiplyAlpha8bit(c, const_alpha);
1231 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1232 sa = Ops::add(Ops::alpha(c), cia);
1235 for (
int i = 0; i < length; ++i) {
1236 auto d = Ops::load(&dest[i]);
1237 Ops::store(&dest[i], Ops::interpolate(c, Ops::invAlpha(d), d, sa));
1244 int length, uint const_alpha)
1246 if (const_alpha == 255) {
1247 for (
int i = 0; i < length; ++i) {
1248 auto s = Ops::load(&src[i]);
1249 auto d = Ops::load(&dest[i]);
1250 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, Ops::alpha(s)));
1253 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1254 for (
int i = 0; i < length; ++i) {
1255 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
1256 auto d = Ops::load(&dest[i]);
1257 auto sa = Ops::add(Ops::alpha(s), cia);
1258 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, sa));
1263void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest,
int length, uint color, uint const_alpha)
1265 comp_func_solid_DestinationAtop_template<Argb32Operations>(dest, length, color, const_alpha);
1270 comp_func_DestinationAtop_template<Argb32Operations>(dest, src, length, const_alpha);
1273#if QT_CONFIG(raster_64bit)
1274void QT_FASTCALL comp_func_solid_DestinationAtop_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1276 comp_func_solid_DestinationAtop_template<Rgba64Operations>(dest, length, color, const_alpha);
1279void QT_FASTCALL comp_func_DestinationAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1281 comp_func_DestinationAtop_template<Rgba64Operations>(dest, src, length, const_alpha);
1285#if QT_CONFIG(raster_fp)
1286void QT_FASTCALL comp_func_solid_DestinationAtop_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1288 comp_func_solid_DestinationAtop_template<RgbaFPOperations>(dest, length, color, const_alpha);
1291void QT_FASTCALL comp_func_DestinationAtop_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1293 comp_func_DestinationAtop_template<RgbaFPOperations>(dest, src, length, const_alpha);
1298
1299
1300
1301
1302
1306 auto c = Ops::convert(color);
1307 if (const_alpha != 255)
1308 c = Ops::multiplyAlpha8bit(c, const_alpha);
1310 auto sia = Ops::invAlpha(c);
1311 for (
int i = 0; i < length; ++i) {
1312 auto d = Ops::load(&dest[i]);
1313 Ops::store(&dest[i], Ops::interpolate(c, Ops::invAlpha(d), d, sia));
1320 int length, uint const_alpha)
1322 if (const_alpha == 255) {
1323 for (
int i = 0; i < length; ++i) {
1324 auto d = Ops::load(&dest[i]);
1325 auto s = Ops::load(&src[i]);
1326 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, Ops::invAlpha(s)));
1329 for (
int i = 0; i < length; ++i) {
1330 auto d = Ops::load(&dest[i]);
1331 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
1332 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, Ops::invAlpha(s)));
1337void QT_FASTCALL comp_func_solid_XOR(uint *dest,
int length, uint color, uint const_alpha)
1339 comp_func_solid_XOR_template<Argb32Operations>(dest, length, color, const_alpha);
1344 comp_func_XOR_template<Argb32Operations>(dest, src, length, const_alpha);
1347#if QT_CONFIG(raster_64bit)
1348void QT_FASTCALL comp_func_solid_XOR_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1350 comp_func_solid_XOR_template<Rgba64Operations>(dest, length, color, const_alpha);
1353void QT_FASTCALL comp_func_XOR_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1355 comp_func_XOR_template<Rgba64Operations>(dest, src, length, const_alpha);
1359#if QT_CONFIG(raster_fp)
1360void QT_FASTCALL comp_func_solid_XOR_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1362 comp_func_solid_XOR_template<RgbaFPOperations>(dest, length, color, const_alpha);
1365void QT_FASTCALL comp_func_XOR_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1367 comp_func_XOR_template<RgbaFPOperations>(dest, src, length, const_alpha);
1372 inline void store(uint *dest,
const uint src)
const
1376#if QT_CONFIG(raster_64bit)
1382#if QT_CONFIG(raster_fp)
1393 , ica(255 - const_alpha)
1397 template<
typename Op>
1398 inline void store_template(
typename Op::Type *dest,
const typename Op::Type src)
const
1400 Op::store(dest, Op::interpolate8bit(Op::convert(src), ca, Op::load(dest), ica));
1402 inline void store(uint *dest,
const uint src)
const
1406#if QT_CONFIG(raster_64bit)
1412#if QT_CONFIG(raster_fp)
1429#if QT_CONFIG(raster_64bit)
1430static inline uint mix_alpha_rgb64(uint da, uint sa)
1432 return 65535U - qt_div_65535((65535U - sa) * (65535U - da));
1436#if QT_CONFIG(raster_fp)
1437static inline float mix_alpha_rgbafp(
float da,
float sa)
1439 return 1.0f - (1.0f - sa) * (1.0f - da);
1444
1445
1446
1450 auto c = Ops::convert(color);
1451 if (const_alpha == 255) {
1452 for (
int i = 0; i < length; ++i) {
1453 auto d = Ops::load(&dest[i]);
1454 d = Ops::plus(d, c);
1455 Ops::store(&dest[i], d);
1458 uint ia = 255 - const_alpha;
1459 for (
int i = 0; i < length; ++i) {
1460 auto d = Ops::load(&dest[i]);
1461 d = Ops::interpolate8bit(Ops::plus(d, c), const_alpha, d, ia);
1462 Ops::store(&dest[i], d);
1470 int length, uint const_alpha)
1472 if (const_alpha == 255) {
1473 for (
int i = 0; i < length; ++i) {
1474 auto d = Ops::load(&dest[i]);
1475 auto s = Ops::load(&src[i]);
1476 d = Ops::plus(d, s);
1477 Ops::store(&dest[i], d);
1480 uint ia = 255 - const_alpha;
1481 for (
int i = 0; i < length; ++i) {
1482 auto d = Ops::load(&dest[i]);
1483 auto s = Ops::load(&src[i]);
1484 d = Ops::interpolate8bit(Ops::plus(d, s), const_alpha, d, ia);
1485 Ops::store(&dest[i], d);
1490void QT_FASTCALL comp_func_solid_Plus(uint *dest,
int length, uint color, uint const_alpha)
1492 comp_func_solid_Plus_template<Argb32Operations>(dest, length, color, const_alpha);
1497 comp_func_Plus_template<Argb32Operations>(dest, src, length, const_alpha);
1500#if QT_CONFIG(raster_64bit)
1501void QT_FASTCALL comp_func_solid_Plus_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1503 comp_func_solid_Plus_template<Rgba64Operations>(dest, length, color, const_alpha);
1506void QT_FASTCALL comp_func_Plus_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1508 comp_func_Plus_template<Rgba64Operations>(dest, src, length, const_alpha);
1512#if QT_CONFIG(raster_fp)
1513void QT_FASTCALL comp_func_solid_Plus_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1515 comp_func_solid_Plus_template<RgbaFPOperations>(dest, length, color, const_alpha);
1518void QT_FASTCALL comp_func_Plus_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1520 comp_func_Plus_template<RgbaFPOperations>(dest, src, length, const_alpha);
1525
1526
1529 return qt_div_255(src * dst + src * (255 - da) + dst * (255 - sa)
);
1532template <
typename T>
1535 int sa = qAlpha(color);
1536 int sr = qRed(color);
1537 int sg = qGreen(color);
1538 int sb = qBlue(color);
1540 for (
int i = 0; i < length; ++i) {
1544#define OP(a, b) multiply_op(a, b, da, sa)
1545 int r =
OP( qRed(d), sr);
1546 int b =
OP( qBlue(d), sb);
1547 int g =
OP(qGreen(d), sg);
1551 coverage.store(&dest[i], qRgba(r, g, b, a));
1555void QT_FASTCALL comp_func_solid_Multiply(uint *dest,
int length, uint color, uint const_alpha)
1557 if (const_alpha == 255)
1558 comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
1560 comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
1563#if QT_CONFIG(raster_64bit)
1564static inline uint multiply_op_rgb64(uint dst, uint src, uint da, uint sa)
1566 return qt_div_65535(src * dst + src * (65535U - da) + dst * (65535U - sa));
1569template <
typename T>
1570static inline void comp_func_solid_Multiply_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
1572 uint sa = color.alpha();
1573 uint sr = color.red();
1574 uint sg = color.green();
1575 uint sb = color.blue();
1577 for (
int i = 0; i < length; ++i) {
1578 QRgba64 d = dest[i];
1579 uint da = d.alpha();
1581#define OP(a, b) multiply_op_rgb64(a, b, da, sa)
1582 uint r = OP( d.red(), sr);
1583 uint b = OP( d.blue(), sb);
1584 uint g = OP(d.green(), sg);
1585 uint a = mix_alpha_rgb64(da, sa);
1588 coverage.store(&dest[i], qRgba64(r, g, b, a));
1592void QT_FASTCALL comp_func_solid_Multiply_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1594 if (const_alpha == 255)
1595 comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
1597 comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
1601#if QT_CONFIG(raster_fp)
1602static inline float multiply_op_rgbafp(
float dst,
float src,
float da,
float sa)
1604 return src * dst + src * (1.0f - da) + dst * (1.0f - sa);
1607template <
typename T>
1608static inline void comp_func_solid_Multiply_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
1610 float sa = color.alpha();
1611 float sr = color.red();
1612 float sg = color.green();
1613 float sb = color.blue();
1615 for (
int i = 0; i < length; ++i) {
1616 QRgbaFloat32 d = dest[i];
1617 float da = d.alpha();
1619#define OP(a, b) multiply_op_rgbafp(a, b, da, sa)
1620 float r = OP( d.red(), sr);
1621 float b = OP( d.blue(), sb);
1622 float g = OP(d.green(), sg);
1623 float a = mix_alpha_rgbafp(da, sa);
1626 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
1630void QT_FASTCALL comp_func_solid_Multiply_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1632 if (const_alpha == 255)
1633 comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
1635 comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
1640template <
typename T>
1643 for (
int i = 0; i < length; ++i) {
1650#define OP(a, b) multiply_op(a, b, da, sa)
1651 int r =
OP( qRed(d), qRed(s));
1652 int b =
OP( qBlue(d), qBlue(s));
1653 int g =
OP(qGreen(d), qGreen(s));
1657 coverage.store(&dest[i], qRgba(r, g, b, a));
1663 if (const_alpha == 255)
1664 comp_func_Multiply_impl(dest, src, length, QFullCoverage());
1666 comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
1669#if QT_CONFIG(raster_64bit)
1670template <
typename T>
1671static inline void comp_func_Multiply_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
1673 for (
int i = 0; i < length; ++i) {
1674 QRgba64 d = dest[i];
1677 uint da = d.alpha();
1678 uint sa = s.alpha();
1680#define OP(a, b) multiply_op_rgb64(a, b, da, sa)
1681 uint r = OP( d.red(), s.red());
1682 uint b = OP( d.blue(), s.blue());
1683 uint g = OP(d.green(), s.green());
1684 uint a = mix_alpha_rgb64(da, sa);
1687 coverage.store(&dest[i], qRgba64(r, g, b, a));
1691void QT_FASTCALL comp_func_Multiply_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1693 if (const_alpha == 255)
1694 comp_func_Multiply_impl(dest, src, length, QFullCoverage());
1696 comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
1700#if QT_CONFIG(raster_fp)
1701template <
typename T>
1702static inline void comp_func_Multiply_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
1704 for (
int i = 0; i < length; ++i) {
1705 QRgbaFloat32 d = dest[i];
1706 QRgbaFloat32 s = src[i];
1708 float da = d.alpha();
1709 float sa = s.alpha();
1711#define OP(a, b) multiply_op_rgbafp(a, b, da, sa)
1712 float r = OP( d.red(), s.red());
1713 float b = OP( d.blue(), s.blue());
1714 float g = OP(d.green(), s.green());
1715 float a = mix_alpha_rgbafp(da, sa);
1718 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
1722void QT_FASTCALL comp_func_Multiply_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1724 if (const_alpha == 255)
1725 comp_func_Multiply_impl(dest, src, length, QFullCoverage());
1727 comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
1732
1733
1734
1735template <
typename T>
1738 int sa = qAlpha(color);
1739 int sr = qRed(color);
1740 int sg = qGreen(color);
1741 int sb = qBlue(color);
1743 for (
int i = 0; i < length; ++i) {
1747#define OP(a, b) 255
- qt_div_255((255
-a) * (255
-b))
1748 int r =
OP( qRed(d), sr);
1749 int b =
OP( qBlue(d), sb);
1750 int g =
OP(qGreen(d), sg);
1754 coverage.store(&dest[i], qRgba(r, g, b, a));
1758void QT_FASTCALL comp_func_solid_Screen(uint *dest,
int length, uint color, uint const_alpha)
1760 if (const_alpha == 255)
1761 comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
1763 comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
1766#if QT_CONFIG(raster_64bit)
1767template <
typename T>
1768static inline void comp_func_solid_Screen_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
1770 uint sa = color.alpha();
1771 uint sr = color.red();
1772 uint sg = color.green();
1773 uint sb = color.blue();
1775 for (
int i = 0; i < length; ++i) {
1776 QRgba64 d = dest[i];
1777 uint da = d.alpha();
1779#define OP(a, b) 65535
- qt_div_65535((65535U
-a) * (65535U
-b))
1780 uint r = OP( d.red(), sr);
1781 uint b = OP( d.blue(), sb);
1782 uint g = OP(d.green(), sg);
1783 uint a = mix_alpha_rgb64(da, sa);
1786 coverage.store(&dest[i], qRgba64(r, g, b, a));
1790void QT_FASTCALL comp_func_solid_Screen_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1792 if (const_alpha == 255)
1793 comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
1795 comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
1799#if QT_CONFIG(raster_fp)
1800template <
typename T>
1801static inline void comp_func_solid_Screen_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
1803 float sa = color.alpha();
1804 float sr = color.red();
1805 float sg = color.green();
1806 float sb = color.blue();
1808 for (
int i = 0; i < length; ++i) {
1809 QRgbaFloat32 d = dest[i];
1810 float da = d.alpha();
1812#define OP(a, b) (1.0f
- ((1.0f
- a) * (1.0f
- b)))
1813 float r = OP( d.red(), sr);
1814 float b = OP( d.blue(), sb);
1815 float g = OP(d.green(), sg);
1816 float a = mix_alpha_rgbafp(da, sa);
1819 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
1823void QT_FASTCALL comp_func_solid_Screen_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1825 if (const_alpha == 255)
1826 comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
1828 comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
1832template <
typename T>
1835 for (
int i = 0; i < length; ++i) {
1842#define OP(a, b) 255
- qt_div_255((255
-a) * (255
-b))
1843 int r =
OP( qRed(d), qRed(s));
1844 int b =
OP( qBlue(d), qBlue(s));
1845 int g =
OP(qGreen(d), qGreen(s));
1849 coverage.store(&dest[i], qRgba(r, g, b, a));
1853void QT_FASTCALL comp_func_Screen(uint *dest,
const uint *src,
int length, uint const_alpha)
1855 if (const_alpha == 255)
1856 comp_func_Screen_impl(dest, src, length, QFullCoverage());
1858 comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
1861#if QT_CONFIG(raster_64bit)
1862template <
typename T>
1863static inline void comp_func_Screen_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
1865 for (
int i = 0; i < length; ++i) {
1866 QRgba64 d = dest[i];
1869 uint da = d.alpha();
1870 uint sa = s.alpha();
1872#define OP(a, b) 65535U
- qt_div_65535((65535U
-a) * (65535U
-b))
1873 uint r = OP( d.red(), s.red());
1874 uint b = OP( d.blue(), s.blue());
1875 uint g = OP(d.green(), s.green());
1876 uint a = mix_alpha_rgb64(da, sa);
1879 coverage.store(&dest[i], qRgba64(r, g, b, a));
1883void QT_FASTCALL comp_func_Screen_rgb64(QRgba64 *dest,
const QRgba64 *src,
int length, uint const_alpha)
1885 if (const_alpha == 255)
1886 comp_func_Screen_impl(dest, src, length, QFullCoverage());
1888 comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
1892#if QT_CONFIG(raster_fp)
1893template <
typename T>
1894static inline void comp_func_Screen_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
1896 for (
int i = 0; i < length; ++i) {
1897 QRgbaFloat32 d = dest[i];
1898 QRgbaFloat32 s = src[i];
1900 float da = d.alpha();
1901 float sa = s.alpha();
1903#define OP(a, b) (1.0f
- ((1.0f
- a) * (1.0f
- b)))
1904 float r = OP( d.red(), s.red());
1905 float b = OP( d.blue(), s.blue());
1906 float g = OP(d.green(), s.green());
1907 float a = mix_alpha_rgbafp(da, sa);
1910 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
1914void QT_FASTCALL comp_func_Screen_rgbafp(QRgbaFloat32 *dest,
const QRgbaFloat32 *src,
int length, uint const_alpha)
1916 if (const_alpha == 255)
1917 comp_func_Screen_impl(dest, src, length, QFullCoverage());
1919 comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
1924
1925
1926
1927
1928
1931 const int temp = src * (255 - da) + dst * (255 - sa);
1935 return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp
);
1938template <
typename T>
1941 int sa = qAlpha(color);
1942 int sr = qRed(color);
1943 int sg = qGreen(color);
1944 int sb = qBlue(color);
1946 for (
int i = 0; i < length; ++i) {
1950#define OP(a, b) overlay_op(a, b, da, sa)
1951 int r =
OP( qRed(d), sr);
1952 int b =
OP( qBlue(d), sb);
1953 int g =
OP(qGreen(d), sg);
1957 coverage.store(&dest[i], qRgba(r, g, b, a));
1961void QT_FASTCALL comp_func_solid_Overlay(uint *dest,
int length, uint color, uint const_alpha)
1963 if (const_alpha == 255)
1964 comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
1966 comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
1969#if QT_CONFIG(raster_64bit)
1970static inline uint overlay_op_rgb64(uint dst, uint src, uint da, uint sa)
1972 const uint temp = src * (65535U - da) + dst * (65535U - sa);
1974 return qt_div_65535(2 * src * dst + temp);
1976 return qt_div_65535(sa * da - 2 * (da - dst) * (sa - src) + temp);
1979template <
typename T>
1980static inline void comp_func_solid_Overlay_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
1982 uint sa = color.alpha();
1983 uint sr = color.red();
1984 uint sg = color.green();
1985 uint sb = color.blue();
1987 for (
int i = 0; i < length; ++i) {
1988 QRgba64 d = dest[i];
1989 uint da = d.alpha();
1991#define OP(a, b) overlay_op_rgb64(a, b, da, sa)
1992 uint r = OP( d.red(), sr);
1993 uint b = OP( d.blue(), sb);
1994 uint g = OP(d.green(), sg);
1995 uint a = mix_alpha_rgb64(da, sa);
1998 coverage.store(&dest[i], qRgba64(r, g, b, a));
2002void QT_FASTCALL comp_func_solid_Overlay_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2004 if (const_alpha == 255)
2005 comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
2007 comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
2011#if QT_CONFIG(raster_fp)
2012static inline float overlay_op_rgbafp(
float dst,
float src,
float da,
float sa)
2014 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
2016 return 2 * src * dst + temp;
2018 return sa * da - 2 * (da - dst) * (sa - src) + temp;
2021template <
typename T>
2022static inline void comp_func_solid_Overlay_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2024 float sa = color.alpha();
2025 float sr = color.red();
2026 float sg = color.green();
2027 float sb = color.blue();
2029 for (
int i = 0; i < length; ++i) {
2030 QRgbaFloat32 d = dest[i];
2031 float da = d.alpha();
2033#define OP(a, b) overlay_op_rgbafp(a, b, da, sa)
2034 float r = OP( d.red(), sr);
2035 float b = OP( d.blue(), sb);
2036 float g = OP(d.green(), sg);
2037 float a = mix_alpha_rgbafp(da, sa);
2040 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2044void QT_FASTCALL comp_func_solid_Overlay_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2046 if (const_alpha == 255)
2047 comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
2049 comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
2053template <
typename T>
2056 for (
int i = 0; i < length; ++i) {
2063#define OP(a, b) overlay_op(a, b, da, sa)
2064 int r =
OP( qRed(d), qRed(s));
2065 int b =
OP( qBlue(d), qBlue(s));
2066 int g =
OP(qGreen(d), qGreen(s));
2070 coverage.store(&dest[i], qRgba(r, g, b, a));
2076 if (const_alpha == 255)
2077 comp_func_Overlay_impl(dest, src, length, QFullCoverage());
2079 comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
2082#if QT_CONFIG(raster_64bit)
2083template <
typename T>
2084static inline void comp_func_Overlay_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2086 for (
int i = 0; i < length; ++i) {
2087 QRgba64 d = dest[i];
2090 uint da = d.alpha();
2091 uint sa = s.alpha();
2093#define OP(a, b) overlay_op_rgb64(a, b, da, sa)
2094 uint r = OP( d.red(), s.red());
2095 uint b = OP( d.blue(), s.blue());
2096 uint g = OP(d.green(), s.green());
2097 uint a = mix_alpha_rgb64(da, sa);
2100 coverage.store(&dest[i], qRgba64(r, g, b, a));
2104void QT_FASTCALL comp_func_Overlay_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2106 if (const_alpha == 255)
2107 comp_func_Overlay_impl(dest, src, length, QFullCoverage());
2109 comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
2113#if QT_CONFIG(raster_fp)
2114template <
typename T>
2115static inline void comp_func_Overlay_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2117 for (
int i = 0; i < length; ++i) {
2118 QRgbaFloat32 d = dest[i];
2119 QRgbaFloat32 s = src[i];
2121 float da = d.alpha();
2122 float sa = s.alpha();
2124#define OP(a, b) overlay_op_rgbafp(a, b, da, sa)
2125 float r = OP( d.red(), s.red());
2126 float b = OP( d.blue(), s.blue());
2127 float g = OP(d.green(), s.green());
2128 float a = mix_alpha_rgbafp(da, sa);
2131 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2135void QT_FASTCALL comp_func_Overlay_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2137 if (const_alpha == 255)
2138 comp_func_Overlay_impl(dest, src, length, QFullCoverage());
2140 comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
2145
2146
2147
2148static inline int darken_op(
int dst,
int src,
int da,
int sa)
2150 return qt_div_255(qMin(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
2153template <
typename T>
2156 int sa = qAlpha(color);
2157 int sr = qRed(color);
2158 int sg = qGreen(color);
2159 int sb = qBlue(color);
2161 for (
int i = 0; i < length; ++i) {
2165#define OP(a, b) darken_op(a, b, da, sa)
2166 int r =
OP( qRed(d), sr);
2167 int b =
OP( qBlue(d), sb);
2168 int g =
OP(qGreen(d), sg);
2172 coverage.store(&dest[i], qRgba(r, g, b, a));
2176void QT_FASTCALL comp_func_solid_Darken(uint *dest,
int length, uint color, uint const_alpha)
2178 if (const_alpha == 255)
2179 comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
2181 comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
2184#if QT_CONFIG(raster_64bit)
2185static inline uint darken_op_rgb64(uint dst, uint src, uint da, uint sa)
2187 return qt_div_65535(qMin(src * da, dst * sa) + src * (65535U - da) + dst * (65535U - sa));
2190template <
typename T>
2191static inline void comp_func_solid_Darken_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
2193 uint sa = color.alpha();
2194 uint sr = color.red();
2195 uint sg = color.green();
2196 uint sb = color.blue();
2198 for (
int i = 0; i < length; ++i) {
2199 QRgba64 d = dest[i];
2200 uint da = d.alpha();
2202#define OP(a, b) darken_op_rgb64(a, b, da, sa)
2203 uint r = OP( d.red(), sr);
2204 uint b = OP( d.blue(), sb);
2205 uint g = OP(d.green(), sg);
2206 uint a = mix_alpha_rgb64(da, sa);
2209 coverage.store(&dest[i], qRgba64(r, g, b, a));
2213void QT_FASTCALL comp_func_solid_Darken_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2215 if (const_alpha == 255)
2216 comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
2218 comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
2222#if QT_CONFIG(raster_fp)
2223static inline float darken_op_rgbafp(
float dst,
float src,
float da,
float sa)
2225 return qMin(src * da, dst * sa) + src * (1.0f - da) + dst * (1.0f - sa);
2228template <
typename T>
2229static inline void comp_func_solid_Darken_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2231 float sa = color.alpha();
2232 float sr = color.red();
2233 float sg = color.green();
2234 float sb = color.blue();
2236 for (
int i = 0; i < length; ++i) {
2237 QRgbaFloat32 d = dest[i];
2238 float da = d.alpha();
2240#define OP(a, b) darken_op_rgbafp(a, b, da, sa)
2241 float r = OP( d.red(), sr);
2242 float b = OP( d.blue(), sb);
2243 float g = OP(d.green(), sg);
2244 float a = mix_alpha_rgbafp(da, sa);
2247 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2251void QT_FASTCALL comp_func_solid_Darken_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2253 if (const_alpha == 255)
2254 comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
2256 comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
2260template <
typename T>
2263 for (
int i = 0; i < length; ++i) {
2270#define OP(a, b) darken_op(a, b, da, sa)
2271 int r =
OP( qRed(d), qRed(s));
2272 int b =
OP( qBlue(d), qBlue(s));
2273 int g =
OP(qGreen(d), qGreen(s));
2277 coverage.store(&dest[i], qRgba(r, g, b, a));
2283 if (const_alpha == 255)
2284 comp_func_Darken_impl(dest, src, length, QFullCoverage());
2286 comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
2289#if QT_CONFIG(raster_64bit)
2290template <
typename T>
2291static inline void comp_func_Darken_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2293 for (
int i = 0; i < length; ++i) {
2294 QRgba64 d = dest[i];
2297 uint da = d.alpha();
2298 uint sa = s.alpha();
2300#define OP(a, b) darken_op_rgb64(a, b, da, sa)
2301 uint r = OP( d.red(), s.red());
2302 uint b = OP( d.blue(), s.blue());
2303 uint g = OP(d.green(), s.green());
2304 uint a = mix_alpha_rgb64(da, sa);
2307 coverage.store(&dest[i], qRgba64(r, g, b, a));
2311void QT_FASTCALL comp_func_Darken_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2313 if (const_alpha == 255)
2314 comp_func_Darken_impl(dest, src, length, QFullCoverage());
2316 comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
2320#if QT_CONFIG(raster_fp)
2321template <
typename T>
2322static inline void comp_func_Darken_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2324 for (
int i = 0; i < length; ++i) {
2325 QRgbaFloat32 d = dest[i];
2326 QRgbaFloat32 s = src[i];
2328 float da = d.alpha();
2329 float sa = s.alpha();
2331#define OP(a, b) darken_op_rgbafp(a, b, da, sa)
2332 float r = OP( d.red(), s.red());
2333 float b = OP( d.blue(), s.blue());
2334 float g = OP(d.green(), s.green());
2335 float a = mix_alpha_rgbafp(da, sa);
2338 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2342void QT_FASTCALL comp_func_Darken_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2344 if (const_alpha == 255)
2345 comp_func_Darken_impl(dest, src, length, QFullCoverage());
2347 comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
2352
2353
2354
2357 return qt_div_255(qMax(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
2360template <
typename T>
2363 int sa = qAlpha(color);
2364 int sr = qRed(color);
2365 int sg = qGreen(color);
2366 int sb = qBlue(color);
2368 for (
int i = 0; i < length; ++i) {
2372#define OP(a, b) lighten_op(a, b, da, sa)
2373 int r =
OP( qRed(d), sr);
2374 int b =
OP( qBlue(d), sb);
2375 int g =
OP(qGreen(d), sg);
2379 coverage.store(&dest[i], qRgba(r, g, b, a));
2383void QT_FASTCALL comp_func_solid_Lighten(uint *dest,
int length, uint color, uint const_alpha)
2385 if (const_alpha == 255)
2386 comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
2388 comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
2392#if QT_CONFIG(raster_64bit)
2393static inline uint lighten_op_rgb64(uint dst, uint src, uint da, uint sa)
2395 return qt_div_65535(qMax(src * da, dst * sa) + src * (65535U - da) + dst * (65535U - sa));
2398template <
typename T>
2399static inline void comp_func_solid_Lighten_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
2401 uint sa = color.alpha();
2402 uint sr = color.red();
2403 uint sg = color.green();
2404 uint sb = color.blue();
2406 for (
int i = 0; i < length; ++i) {
2407 QRgba64 d = dest[i];
2408 uint da = d.alpha();
2410#define OP(a, b) lighten_op_rgb64(a, b, da, sa)
2411 uint r = OP( d.red(), sr);
2412 uint b = OP( d.blue(), sb);
2413 uint g = OP(d.green(), sg);
2414 uint a = mix_alpha_rgb64(da, sa);
2417 coverage.store(&dest[i], qRgba64(r, g, b, a));
2421void QT_FASTCALL comp_func_solid_Lighten_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2423 if (const_alpha == 255)
2424 comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
2426 comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
2430#if QT_CONFIG(raster_fp)
2431static inline float lighten_op_rgbafp(
float dst,
float src,
float da,
float sa)
2433 return qMax(src * da, dst * sa) + src * (1.0f - da) + dst * (1.0f - sa);
2436template <
typename T>
2437static inline void comp_func_solid_Lighten_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2439 float sa = color.alpha();
2440 float sr = color.red();
2441 float sg = color.green();
2442 float sb = color.blue();
2444 for (
int i = 0; i < length; ++i) {
2445 QRgbaFloat32 d = dest[i];
2446 float da = d.alpha();
2448#define OP(a, b) lighten_op_rgbafp(a, b, da, sa)
2449 float r = OP( d.red(), sr);
2450 float b = OP( d.blue(), sb);
2451 float g = OP(d.green(), sg);
2452 float a = mix_alpha_rgbafp(da, sa);
2455 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2459void QT_FASTCALL comp_func_solid_Lighten_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2461 if (const_alpha == 255)
2462 comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
2464 comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
2468template <
typename T>
2471 for (
int i = 0; i < length; ++i) {
2478#define OP(a, b) lighten_op(a, b, da, sa)
2479 int r =
OP( qRed(d), qRed(s));
2480 int b =
OP( qBlue(d), qBlue(s));
2481 int g =
OP(qGreen(d), qGreen(s));
2485 coverage.store(&dest[i], qRgba(r, g, b, a));
2491 if (const_alpha == 255)
2492 comp_func_Lighten_impl(dest, src, length, QFullCoverage());
2494 comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
2497#if QT_CONFIG(raster_64bit)
2498template <
typename T>
2499static inline void comp_func_Lighten_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2501 for (
int i = 0; i < length; ++i) {
2502 QRgba64 d = dest[i];
2505 uint da = d.alpha();
2506 uint sa = s.alpha();
2508#define OP(a, b) lighten_op_rgb64(a, b, da, sa)
2509 uint r = OP( d.red(), s.red());
2510 uint b = OP( d.blue(), s.blue());
2511 uint g = OP(d.green(), s.green());
2512 uint a = mix_alpha_rgb64(da, sa);
2515 coverage.store(&dest[i], qRgba64(r, g, b, a));
2519void QT_FASTCALL comp_func_Lighten_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2521 if (const_alpha == 255)
2522 comp_func_Lighten_impl(dest, src, length, QFullCoverage());
2524 comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
2528#if QT_CONFIG(raster_fp)
2529template <
typename T>
2530static inline void comp_func_Lighten_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2532 for (
int i = 0; i < length; ++i) {
2533 QRgbaFloat32 d = dest[i];
2534 QRgbaFloat32 s = src[i];
2536 float da = d.alpha();
2537 float sa = s.alpha();
2539#define OP(a, b) lighten_op_rgbafp(a, b, da, sa)
2540 float r = OP( d.red(), s.red());
2541 float b = OP( d.blue(), s.blue());
2542 float g = OP(d.green(), s.green());
2543 float a = mix_alpha_rgbafp(da, sa);
2546 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2550void QT_FASTCALL comp_func_Lighten_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2552 if (const_alpha == 255)
2553 comp_func_Lighten_impl(dest, src, length, QFullCoverage());
2555 comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
2560
2561
2562
2563
2564
2565
2566
2569 const int sa_da = sa * da;
2570 const int dst_sa = dst * sa;
2571 const int src_da = src * da;
2573 const int temp = src * (255 - da) + dst * (255 - sa);
2574 if (src_da + dst_sa > sa_da)
2576 else if (src == sa || sa == 0)
2579 return qt_div_255(255 * dst_sa / (255 - 255 * src / sa) + temp
);
2582template <
typename T>
2585 int sa = qAlpha(color);
2586 int sr = qRed(color);
2587 int sg = qGreen(color);
2588 int sb = qBlue(color);
2590 for (
int i = 0; i < length; ++i) {
2594#define OP(a,b) color_dodge_op(a, b, da, sa)
2595 int r =
OP( qRed(d), sr);
2596 int b =
OP( qBlue(d), sb);
2597 int g =
OP(qGreen(d), sg);
2601 coverage.store(&dest[i], qRgba(r, g, b, a));
2605void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest,
int length, uint color, uint const_alpha)
2607 if (const_alpha == 255)
2608 comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
2610 comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
2613#if QT_CONFIG(raster_64bit)
2614static inline uint color_dodge_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
2616 const qint64 sa_da = sa * da;
2617 const qint64 dst_sa = dst * sa;
2618 const qint64 src_da = src * da;
2620 const qint64 temp = src * (65535U - da) + dst * (65535U - sa);
2621 if (src_da + dst_sa > sa_da)
2622 return qt_div_65535(sa_da + temp);
2623 else if (src == sa || sa == 0)
2624 return qt_div_65535(temp);
2626 return qt_div_65535(65535U * dst_sa / (65535U - 65535U * src / sa) + temp);
2629template <
typename T>
2630static inline void comp_func_solid_ColorDodge_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
2632 uint sa = color.alpha();
2633 uint sr = color.red();
2634 uint sg = color.green();
2635 uint sb = color.blue();
2637 for (
int i = 0; i < length; ++i) {
2638 QRgba64 d = dest[i];
2639 uint da = d.alpha();
2641#define OP(a,b) color_dodge_op_rgb64(a, b, da, sa)
2642 uint r = OP( d.red(), sr);
2643 uint b = OP( d.blue(), sb);
2644 uint g = OP(d.green(), sg);
2645 uint a = mix_alpha_rgb64(da, sa);
2648 coverage.store(&dest[i], qRgba64(r, g, b, a));
2652void QT_FASTCALL comp_func_solid_ColorDodge_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2654 if (const_alpha == 255)
2655 comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
2657 comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
2661#if QT_CONFIG(raster_fp)
2662static inline float color_dodge_op_rgbafp(
float dst,
float src,
float da,
float sa)
2664 const float sa_da = sa * da;
2665 const float dst_sa = dst * sa;
2666 const float src_da = src * da;
2668 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
2669 if (src_da + dst_sa > sa_da)
2670 return sa_da + temp;
2671 else if (src == sa || sa == 0.0f)
2674 return dst_sa / (1.0f - src / sa) + temp;
2677template <
typename T>
2678static inline void comp_func_solid_ColorDodge_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2680 float sa = color.alpha();
2681 float sr = color.red();
2682 float sg = color.green();
2683 float sb = color.blue();
2685 for (
int i = 0; i < length; ++i) {
2686 QRgbaFloat32 d = dest[i];
2687 float da = d.alpha();
2689#define OP(a,b) color_dodge_op_rgbafp(a, b, da, sa)
2690 float r = OP( d.red(), sr);
2691 float b = OP( d.blue(), sb);
2692 float g = OP(d.green(), sg);
2693 float a = mix_alpha_rgbafp(da, sa);
2696 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2700void QT_FASTCALL comp_func_solid_ColorDodge_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2702 if (const_alpha == 255)
2703 comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
2705 comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
2709template <
typename T>
2712 for (
int i = 0; i < length; ++i) {
2719#define OP(a, b) color_dodge_op(a, b, da, sa)
2720 int r =
OP( qRed(d), qRed(s));
2721 int b =
OP( qBlue(d), qBlue(s));
2722 int g =
OP(qGreen(d), qGreen(s));
2726 coverage.store(&dest[i], qRgba(r, g, b, a));
2732 if (const_alpha == 255)
2733 comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
2735 comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
2738#if QT_CONFIG(raster_64bit)
2739template <
typename T>
2740static inline void comp_func_ColorDodge_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2742 for (
int i = 0; i < length; ++i) {
2743 QRgba64 d = dest[i];
2746 uint da = d.alpha();
2747 uint sa = s.alpha();
2749#define OP(a, b) color_dodge_op_rgb64(a, b, da, sa)
2750 uint r = OP( d.red(), s.red());
2751 uint b = OP( d.blue(), s.blue());
2752 uint g = OP(d.green(), s.green());
2753 uint a = mix_alpha_rgb64(da, sa);
2756 coverage.store(&dest[i], qRgba64(r, g, b, a));
2760void QT_FASTCALL comp_func_ColorDodge_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2762 if (const_alpha == 255)
2763 comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
2765 comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
2769#if QT_CONFIG(raster_fp)
2770template <
typename T>
2771static inline void comp_func_ColorDodge_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2773 for (
int i = 0; i < length; ++i) {
2774 QRgbaFloat32 d = dest[i];
2775 QRgbaFloat32 s = src[i];
2777 float da = d.alpha();
2778 float sa = s.alpha();
2780#define OP(a, b) color_dodge_op_rgbafp(a, b, da, sa)
2781 float r = OP( d.red(), s.red());
2782 float b = OP( d.blue(), s.blue());
2783 float g = OP(d.green(), s.green());
2784 float a = mix_alpha_rgbafp(da, sa);
2787 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2791void QT_FASTCALL comp_func_ColorDodge_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2793 if (const_alpha == 255)
2794 comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
2796 comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
2801
2802
2803
2804
2805
2806
2807
2810 const int src_da = src * da;
2811 const int dst_sa = dst * sa;
2812 const int sa_da = sa * da;
2814 const int temp = src * (255 - da) + dst * (255 - sa);
2816 if (src_da + dst_sa < sa_da)
2820 return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp
);
2823template <
typename T>
2826 int sa = qAlpha(color);
2827 int sr = qRed(color);
2828 int sg = qGreen(color);
2829 int sb = qBlue(color);
2831 for (
int i = 0; i < length; ++i) {
2835#define OP(a, b) color_burn_op(a, b, da, sa)
2836 int r =
OP( qRed(d), sr);
2837 int b =
OP( qBlue(d), sb);
2838 int g =
OP(qGreen(d), sg);
2842 coverage.store(&dest[i], qRgba(r, g, b, a));
2846void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest,
int length, uint color, uint const_alpha)
2848 if (const_alpha == 255)
2849 comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
2851 comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
2854#if QT_CONFIG(raster_64bit)
2855static inline uint color_burn_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
2857 const qint64 src_da = src * da;
2858 const qint64 dst_sa = dst * sa;
2859 const qint64 sa_da = sa * da;
2861 const qint64 temp = src * (65535U - da) + dst * (65535U - sa);
2863 if (src_da + dst_sa < sa_da)
2864 return qt_div_65535(temp);
2866 return qt_div_65535(dst_sa + temp);
2867 return qt_div_65535(sa * (src_da + dst_sa - sa_da) / src + temp);
2870template <
typename T>
2871static inline void comp_func_solid_ColorBurn_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
2873 uint sa = color.alpha();
2874 uint sr = color.red();
2875 uint sg = color.green();
2876 uint sb = color.blue();
2878 for (
int i = 0; i < length; ++i) {
2879 QRgba64 d = dest[i];
2880 uint da = d.alpha();
2882#define OP(a, b) color_burn_op_rgb64(a, b, da, sa)
2883 uint r = OP( d.red(), sr);
2884 uint b = OP( d.blue(), sb);
2885 uint g = OP(d.green(), sg);
2886 uint a = mix_alpha_rgb64(da, sa);
2889 coverage.store(&dest[i], qRgba64(r, g, b, a));
2893void QT_FASTCALL comp_func_solid_ColorBurn_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2895 if (const_alpha == 255)
2896 comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
2898 comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
2902#if QT_CONFIG(raster_fp)
2903static inline float color_burn_op_rgbafp(
float dst,
float src,
float da,
float sa)
2905 const float src_da = src * da;
2906 const float dst_sa = dst * sa;
2907 const float sa_da = sa * da;
2909 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
2911 if (src_da + dst_sa < sa_da)
2914 return dst_sa + temp;
2915 return sa * (src_da + dst_sa - sa_da) / src + temp;
2918template <
typename T>
2919static inline void comp_func_solid_ColorBurn_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2921 float sa = color.alpha();
2922 float sr = color.red();
2923 float sg = color.green();
2924 float sb = color.blue();
2926 for (
int i = 0; i < length; ++i) {
2927 QRgbaFloat32 d = dest[i];
2928 float da = d.alpha();
2930#define OP(a, b) color_burn_op_rgbafp(a, b, da, sa)
2931 float r = OP( d.red(), sr);
2932 float b = OP( d.blue(), sb);
2933 float g = OP(d.green(), sg);
2934 float a = mix_alpha_rgbafp(da, sa);
2937 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2941void QT_FASTCALL comp_func_solid_ColorBurn_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2943 if (const_alpha == 255)
2944 comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
2946 comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
2950template <
typename T>
2953 for (
int i = 0; i < length; ++i) {
2960#define OP(a, b) color_burn_op(a, b, da, sa)
2961 int r =
OP( qRed(d), qRed(s));
2962 int b =
OP( qBlue(d), qBlue(s));
2963 int g =
OP(qGreen(d), qGreen(s));
2967 coverage.store(&dest[i], qRgba(r, g, b, a));
2973 if (const_alpha == 255)
2974 comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
2976 comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
2979#if QT_CONFIG(raster_64bit)
2980template <
typename T>
2981static inline void comp_func_ColorBurn_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2983 for (
int i = 0; i < length; ++i) {
2984 QRgba64 d = dest[i];
2987 uint da = d.alpha();
2988 uint sa = s.alpha();
2990#define OP(a, b) color_burn_op_rgb64(a, b, da, sa)
2991 uint r = OP( d.red(), s.red());
2992 uint b = OP( d.blue(), s.blue());
2993 uint g = OP(d.green(), s.green());
2994 uint a = mix_alpha_rgb64(da, sa);
2997 coverage.store(&dest[i], qRgba64(r, g, b, a));
3001void QT_FASTCALL comp_func_ColorBurn_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3003 if (const_alpha == 255)
3004 comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
3006 comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
3010#if QT_CONFIG(raster_fp)
3011template <
typename T>
3012static inline void comp_func_ColorBurn_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3014 for (
int i = 0; i < length; ++i) {
3015 QRgbaFloat32 d = dest[i];
3016 QRgbaFloat32 s = src[i];
3018 float da = d.alpha();
3019 float sa = s.alpha();
3021#define OP(a, b) color_burn_op_rgbafp(a, b, da, sa)
3022 float r = OP( d.red(), s.red());
3023 float b = OP( d.blue(), s.blue());
3024 float g = OP(d.green(), s.green());
3025 float a = mix_alpha_rgbafp(da, sa);
3028 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3032void QT_FASTCALL comp_func_ColorBurn_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3034 if (const_alpha == 255)
3035 comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
3037 comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
3042
3043
3044
3045
3046
3049 const uint temp = src * (255 - da) + dst * (255 - sa);
3054 return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp
);
3057template <
typename T>
3060 int sa = qAlpha(color);
3061 int sr = qRed(color);
3062 int sg = qGreen(color);
3063 int sb = qBlue(color);
3065 for (
int i = 0; i < length; ++i) {
3069#define OP(a, b) hardlight_op(a, b, da, sa)
3070 int r =
OP( qRed(d), sr);
3071 int b =
OP( qBlue(d), sb);
3072 int g =
OP(qGreen(d), sg);
3076 coverage.store(&dest[i], qRgba(r, g, b, a));
3080void QT_FASTCALL comp_func_solid_HardLight(uint *dest,
int length, uint color, uint const_alpha)
3082 if (const_alpha == 255)
3083 comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
3085 comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3088#if QT_CONFIG(raster_64bit)
3089static inline uint hardlight_op_rgb64(uint dst, uint src, uint da, uint sa)
3091 const uint temp = src * (65535U - da) + dst * (65535U - sa);
3094 return qt_div_65535(2 * src * dst + temp);
3096 return qt_div_65535(sa * da - 2 * (da - dst) * (sa - src) + temp);
3099template <
typename T>
3100static inline void comp_func_solid_HardLight_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
3102 uint sa = color.alpha();
3103 uint sr = color.red();
3104 uint sg = color.green();
3105 uint sb = color.blue();
3107 for (
int i = 0; i < length; ++i) {
3108 QRgba64 d = dest[i];
3109 uint da = d.alpha();
3111#define OP(a, b) hardlight_op_rgb64(a, b, da, sa)
3112 uint r = OP( d.red(), sr);
3113 uint b = OP( d.blue(), sb);
3114 uint g = OP(d.green(), sg);
3115 uint a = mix_alpha_rgb64(da, sa);
3118 coverage.store(&dest[i], qRgba64(r, g, b, a));
3122void QT_FASTCALL comp_func_solid_HardLight_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
3124 if (const_alpha == 255)
3125 comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
3127 comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3131#if QT_CONFIG(raster_fp)
3132static inline float hardlight_op_rgbafp(
float dst,
float src,
float da,
float sa)
3134 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
3137 return 2 * src * dst + temp;
3139 return sa * da - 2 * (da - dst) * (sa - src) + temp;
3142template <
typename T>
3143static inline void comp_func_solid_HardLight_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
3145 float sa = color.alpha();
3146 float sr = color.red();
3147 float sg = color.green();
3148 float sb = color.blue();
3150 for (
int i = 0; i < length; ++i) {
3151 QRgbaFloat32 d = dest[i];
3152 float da = d.alpha();
3154#define OP(a, b) hardlight_op_rgbafp(a, b, da, sa)
3155 float r = OP( d.red(), sr);
3156 float b = OP( d.blue(), sb);
3157 float g = OP(d.green(), sg);
3158 float a = mix_alpha_rgbafp(da, sa);
3161 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3165void QT_FASTCALL comp_func_solid_HardLight_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
3167 if (const_alpha == 255)
3168 comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
3170 comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3174template <
typename T>
3177 for (
int i = 0; i < length; ++i) {
3184#define OP(a, b) hardlight_op(a, b, da, sa)
3185 int r =
OP( qRed(d), qRed(s));
3186 int b =
OP( qBlue(d), qBlue(s));
3187 int g =
OP(qGreen(d), qGreen(s));
3191 coverage.store(&dest[i], qRgba(r, g, b, a));
3197 if (const_alpha == 255)
3198 comp_func_HardLight_impl(dest, src, length, QFullCoverage());
3200 comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3203#if QT_CONFIG(raster_64bit)
3204template <
typename T>
3205static inline void comp_func_HardLight_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3207 for (
int i = 0; i < length; ++i) {
3208 QRgba64 d = dest[i];
3211 uint da = d.alpha();
3212 uint sa = s.alpha();
3214#define OP(a, b) hardlight_op_rgb64(a, b, da, sa)
3215 uint r = OP( d.red(), s.red());
3216 uint b = OP( d.blue(), s.blue());
3217 uint g = OP(d.green(), s.green());
3218 uint a = mix_alpha_rgb64(da, sa);
3221 coverage.store(&dest[i], qRgba64(r, g, b, a));
3225void QT_FASTCALL comp_func_HardLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3227 if (const_alpha == 255)
3228 comp_func_HardLight_impl(dest, src, length, QFullCoverage());
3230 comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3234#if QT_CONFIG(raster_fp)
3235template <
typename T>
3236static inline void comp_func_HardLight_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3238 for (
int i = 0; i < length; ++i) {
3239 QRgbaFloat32 d = dest[i];
3240 QRgbaFloat32 s = src[i];
3242 float da = d.alpha();
3243 float sa = s.alpha();
3245#define OP(a, b) hardlight_op_rgbafp(a, b, da, sa)
3246 float r = OP( d.red(), s.red());
3247 float b = OP( d.blue(), s.blue());
3248 float g = OP(d.green(), s.green());
3249 float a = mix_alpha_rgbafp(da, sa);
3252 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3256void QT_FASTCALL comp_func_HardLight_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3258 if (const_alpha == 255)
3259 comp_func_HardLight_impl(dest, src, length, QFullCoverage());
3261 comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3266
3267
3268
3269
3270
3271
3272
3275 const int src2 = src << 1;
3276 const int dst_np = da != 0 ? (255 * dst) / da : 0;
3277 const int temp = (src * (255 - da) + dst * (255 - sa)) * 255;
3280 return (dst * (sa * 255 + (src2 - sa) * (255 - dst_np)) + temp) / 65025;
3281 else if (4 * dst <= da)
3282 return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025;
3284 return (dst * sa * 255 + da * (src2 - sa) * (
int(qSqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025;
3288template <
typename T>
3291 int sa = qAlpha(color);
3292 int sr = qRed(color);
3293 int sg = qGreen(color);
3294 int sb = qBlue(color);
3296 for (
int i = 0; i < length; ++i) {
3300#define OP(a, b) soft_light_op(a, b, da, sa)
3301 int r =
OP( qRed(d), sr);
3302 int b =
OP( qBlue(d), sb);
3303 int g =
OP(qGreen(d), sg);
3307 coverage.store(&dest[i], qRgba(r, g, b, a));
3311void QT_FASTCALL comp_func_solid_SoftLight(uint *dest,
int length, uint color, uint const_alpha)
3313 if (const_alpha == 255)
3314 comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
3316 comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3319#if QT_CONFIG(raster_64bit)
3320static inline uint soft_light_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
3322 const qint64 src2 = src << 1;
3323 const qint64 dst_np = da != 0 ? (65535U * dst) / da : 0;
3324 const qint64 temp = (src * (65535U - da) + dst * (65535U - sa)) * 65535U;
3325 const qint64 factor = Q_UINT64_C(65535) * 65535U;
3328 return (dst * (sa * 65535U + (src2 - sa) * (65535U - dst_np)) + temp) / factor;
3329 else if (4 * dst <= da)
3330 return (dst * sa * 65535U + da * (src2 - sa) * ((((16 * dst_np - 12 * 65535U) * dst_np + 3 * factor) * dst_np) / factor) + temp) / factor;
3332 return (dst * sa * 65535U + da * (src2 - sa) * (
int(qSqrt(qreal(dst_np * 65535U))) - dst_np) + temp) / factor;
3336template <
typename T>
3337static inline void comp_func_solid_SoftLight_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
3339 uint sa = color.alpha();
3340 uint sr = color.red();
3341 uint sg = color.green();
3342 uint sb = color.blue();
3344 for (
int i = 0; i < length; ++i) {
3345 QRgba64 d = dest[i];
3346 uint da = d.alpha();
3348#define OP(a, b) soft_light_op_rgb64(a, b, da, sa)
3349 uint r = OP( d.red(), sr);
3350 uint b = OP( d.blue(), sb);
3351 uint g = OP(d.green(), sg);
3352 uint a = mix_alpha_rgb64(da, sa);
3355 coverage.store(&dest[i], qRgba64(r, g, b, a));
3359void QT_FASTCALL comp_func_solid_SoftLight_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
3361 if (const_alpha == 255)
3362 comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
3364 comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3369#if QT_CONFIG(raster_fp)
3370static inline float soft_light_op_rgbafp(
float dst,
float src,
float da,
float sa)
3372 const float src2 = src * 2;
3373 const float dst_np = da != 0.0f ? (dst / da) : 0.0f;
3374 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
3377 return dst * (sa + (src2 - sa) * (1.0f - dst_np)) + temp;
3378 else if (4 * dst <= da)
3379 return dst * sa + da * (src2 - sa) * (((16 * dst_np - 12) * dst_np + 3) * dst_np) + temp;
3381 return dst * sa + da * (src2 - sa) * (qSqrt(qreal(dst_np)) - dst_np) + temp;
3385template <
typename T>
3386static inline void comp_func_solid_SoftLight_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
3388 float sa = color.alpha();
3389 float sr = color.red();
3390 float sg = color.green();
3391 float sb = color.blue();
3393 for (
int i = 0; i < length; ++i) {
3394 QRgbaFloat32 d = dest[i];
3395 float da = d.alpha();
3397#define OP(a, b) soft_light_op_rgbafp(a, b, da, sa)
3398 float r = OP( d.red(), sr);
3399 float b = OP( d.blue(), sb);
3400 float g = OP(d.green(), sg);
3401 float a = mix_alpha_rgbafp(da, sa);
3404 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3408void QT_FASTCALL comp_func_solid_SoftLight_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
3410 if (const_alpha == 255)
3411 comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
3413 comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3417template <
typename T>
3420 for (
int i = 0; i < length; ++i) {
3427#define OP(a, b) soft_light_op(a, b, da, sa)
3428 int r =
OP( qRed(d), qRed(s));
3429 int b =
OP( qBlue(d), qBlue(s));
3430 int g =
OP(qGreen(d), qGreen(s));
3434 coverage.store(&dest[i], qRgba(r, g, b, a));
3440 if (const_alpha == 255)
3441 comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
3443 comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3446#if QT_CONFIG(raster_64bit)
3447template <
typename T>
3448static inline void comp_func_SoftLight_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3450 for (
int i = 0; i < length; ++i) {
3451 QRgba64 d = dest[i];
3454 uint da = d.alpha();
3455 uint sa = s.alpha();
3457#define OP(a, b) soft_light_op_rgb64(a, b, da, sa)
3458 uint r = OP( d.red(), s.red());
3459 uint b = OP( d.blue(), s.blue());
3460 uint g = OP(d.green(), s.green());
3461 uint a = mix_alpha_rgb64(da, sa);
3464 coverage.store(&dest[i], qRgba64(r, g, b, a));
3468void QT_FASTCALL comp_func_SoftLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3470 if (const_alpha == 255)
3471 comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
3473 comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3477#if QT_CONFIG(raster_fp)
3478template <
typename T>
3479static inline void comp_func_SoftLight_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3481 for (
int i = 0; i < length; ++i) {
3482 QRgbaFloat32 d = dest[i];
3483 QRgbaFloat32 s = src[i];
3485 float da = d.alpha();
3486 float sa = s.alpha();
3488#define OP(a, b) soft_light_op_rgbafp(a, b, da, sa)
3489 float r = OP( d.red(), s.red());
3490 float b = OP( d.blue(), s.blue());
3491 float g = OP(d.green(), s.green());
3492 float a = mix_alpha_rgbafp(da, sa);
3495 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3499void QT_FASTCALL comp_func_SoftLight_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3501 if (const_alpha == 255)
3502 comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
3504 comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3509
3510
3511
3514 return src + dst - qt_div_255(2 * qMin(src * da, dst * sa));
3517template <
typename T>
3520 int sa = qAlpha(color);
3521 int sr = qRed(color);
3522 int sg = qGreen(color);
3523 int sb = qBlue(color);
3525 for (
int i = 0; i < length; ++i) {
3529#define OP(a, b) difference_op(a, b, da, sa)
3530 int r =
OP( qRed(d), sr);
3531 int b =
OP( qBlue(d), sb);
3532 int g =
OP(qGreen(d), sg);
3536 coverage.store(&dest[i], qRgba(r, g, b, a));
3540void QT_FASTCALL comp_func_solid_Difference(uint *dest,
int length, uint color, uint const_alpha)
3542 if (const_alpha == 255)
3543 comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
3545 comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
3548#if QT_CONFIG(raster_64bit)
3549static inline uint difference_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
3551 return src + dst - qt_div_65535(2 * qMin(src * da, dst * sa));
3554template <
typename T>
3555static inline void comp_func_solid_Difference_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
3557 uint sa = color.alpha();
3558 uint sr = color.red();
3559 uint sg = color.green();
3560 uint sb = color.blue();
3562 for (
int i = 0; i < length; ++i) {
3563 QRgba64 d = dest[i];
3564 uint da = d.alpha();
3566#define OP(a, b) difference_op_rgb64(a, b, da, sa)
3567 uint r = OP( d.red(), sr);
3568 uint b = OP( d.blue(), sb);
3569 uint g = OP(d.green(), sg);
3570 uint a = mix_alpha_rgb64(da, sa);
3573 coverage.store(&dest[i], qRgba64(r, g, b, a));
3577void QT_FASTCALL comp_func_solid_Difference_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
3579 if (const_alpha == 255)
3580 comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
3582 comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
3586#if QT_CONFIG(raster_fp)
3587static inline float difference_op_rgbafp(
float dst,
float src,
float da,
float sa)
3589 return src + dst - (2 * qMin(src * da, dst * sa));
3592template <
typename T>
3593static inline void comp_func_solid_Difference_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
3595 float sa = color.alpha();
3596 float sr = color.red();
3597 float sg = color.green();
3598 float sb = color.blue();
3600 for (
int i = 0; i < length; ++i) {
3601 QRgbaFloat32 d = dest[i];
3602 float da = d.alpha();
3604#define OP(a, b) difference_op_rgbafp(a, b, da, sa)
3605 float r = OP( d.red(), sr);
3606 float b = OP( d.blue(), sb);
3607 float g = OP(d.green(), sg);
3608 float a = mix_alpha_rgbafp(da, sa);
3611 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3615void QT_FASTCALL comp_func_solid_Difference_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
3617 if (const_alpha == 255)
3618 comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
3620 comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
3624template <
typename T>
3627 for (
int i = 0; i < length; ++i) {
3634#define OP(a, b) difference_op(a, b, da, sa)
3635 int r =
OP( qRed(d), qRed(s));
3636 int b =
OP( qBlue(d), qBlue(s));
3637 int g =
OP(qGreen(d), qGreen(s));
3641 coverage.store(&dest[i], qRgba(r, g, b, a));
3647 if (const_alpha == 255)
3648 comp_func_Difference_impl(dest, src, length, QFullCoverage());
3650 comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
3653#if QT_CONFIG(raster_64bit)
3654template <
typename T>
3655static inline void comp_func_Difference_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3657 for (
int i = 0; i < length; ++i) {
3658 QRgba64 d = dest[i];
3661 uint da = d.alpha();
3662 uint sa = s.alpha();
3664#define OP(a, b) difference_op_rgb64(a, b, da, sa)
3665 uint r = OP( d.red(), s.red());
3666 uint b = OP( d.blue(), s.blue());
3667 uint g = OP(d.green(), s.green());
3668 uint a = mix_alpha_rgb64(da, sa);
3671 coverage.store(&dest[i], qRgba64(r, g, b, a));
3675void QT_FASTCALL comp_func_Difference_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3677 if (const_alpha == 255)
3678 comp_func_Difference_impl(dest, src, length, QFullCoverage());
3680 comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
3684#if QT_CONFIG(raster_fp)
3685template <
typename T>
3686static inline void comp_func_Difference_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3688 for (
int i = 0; i < length; ++i) {
3689 QRgbaFloat32 d = dest[i];
3690 QRgbaFloat32 s = src[i];
3692 float da = d.alpha();
3693 float sa = s.alpha();
3695#define OP(a, b) difference_op_rgbafp(a, b, da, sa)
3696 float r = OP( d.red(), s.red());
3697 float b = OP( d.blue(), s.blue());
3698 float g = OP(d.green(), s.green());
3699 float a = mix_alpha_rgbafp(da, sa);
3702 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3706void QT_FASTCALL comp_func_Difference_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3708 if (const_alpha == 255)
3709 comp_func_Difference_impl(dest, src, length, QFullCoverage());
3711 comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
3716
3717
3718template <
typename T>
3719static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(uint *dest,
int length, uint color,
const T &coverage)
3721 int sa = qAlpha(color);
3722 int sr = qRed(color);
3723 int sg = qGreen(color);
3724 int sb = qBlue(color);
3726 for (
int i = 0; i < length; ++i) {
3730#define OP(a, b) (a + b - qt_div_255(2
*(a*b)))
3731 int r =
OP( qRed(d), sr);
3732 int b =
OP( qBlue(d), sb);
3733 int g =
OP(qGreen(d), sg);
3734 int a = mix_alpha(da, sa);
3737 coverage.store(&dest[i], qRgba(r, g, b, a));
3741void QT_FASTCALL comp_func_solid_Exclusion(uint *dest,
int length, uint color, uint const_alpha)
3743 if (const_alpha == 255)
3744 comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
3746 comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
3749#if QT_CONFIG(raster_64bit)
3750template <
typename T>
3751static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
3753 uint sa = color.alpha();
3754 uint sr = color.red();
3755 uint sg = color.green();
3756 uint sb = color.blue();
3758 for (
int i = 0; i < length; ++i) {
3759 QRgba64 d = dest[i];
3760 uint da = d.alpha();
3762#define OP(a, b) (a + b - qt_div_65535(2
*(qint64(a)*b)))
3763 uint r = OP( d.red(), sr);
3764 uint b = OP( d.blue(), sb);
3765 uint g = OP(d.green(), sg);
3766 uint a = mix_alpha_rgb64(da, sa);
3769 coverage.store(&dest[i], qRgba64(r, g, b, a));
3773void QT_FASTCALL comp_func_solid_Exclusion_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
3775 if (const_alpha == 255)
3776 comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
3778 comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
3782#if QT_CONFIG(raster_fp)
3783template <
typename T>
3784static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
3786 float sa = color.alpha();
3787 float sr = color.red();
3788 float sg = color.green();
3789 float sb = color.blue();
3791 for (
int i = 0; i < length; ++i) {
3792 QRgbaFloat32 d = dest[i];
3793 float da = d.alpha();
3795#define OP(a, b) (a + b - (2.0f
* a * b))
3796 float r = OP( d.red(), sr);
3797 float b = OP( d.blue(), sb);
3798 float g = OP(d.green(), sg);
3799 float a = mix_alpha_rgbafp(da, sa);
3802 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3806void QT_FASTCALL comp_func_solid_Exclusion_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
3808 if (const_alpha == 255)
3809 comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
3811 comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
3815template <
typename T>
3818 for (
int i = 0; i < length; ++i) {
3825#define OP(a, b) (a + b - ((a*b) >> 7
))
3826 int r =
OP( qRed(d), qRed(s));
3827 int b =
OP( qBlue(d), qBlue(s));
3828 int g =
OP(qGreen(d), qGreen(s));
3832 coverage.store(&dest[i], qRgba(r, g, b, a));
3838 if (const_alpha == 255)
3839 comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
3841 comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
3844#if QT_CONFIG(raster_64bit)
3845template <
typename T>
3846static inline void comp_func_Exclusion_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3848 for (
int i = 0; i < length; ++i) {
3849 QRgba64 d = dest[i];
3852 uint da = d.alpha();
3853 uint sa = s.alpha();
3855#define OP(a, b) (a + b - ((qint64(a)*b) >> 15
))
3856 uint r = OP( d.red(), s.red());
3857 uint b = OP( d.blue(), s.blue());
3858 uint g = OP(d.green(), s.green());
3859 uint a = mix_alpha_rgb64(da, sa);
3862 coverage.store(&dest[i], qRgba64(r, g, b, a));
3866void QT_FASTCALL comp_func_Exclusion_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3868 if (const_alpha == 255)
3869 comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
3871 comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
3875#if QT_CONFIG(raster_fp)
3876template <
typename T>
3877static inline void comp_func_Exclusion_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3879 for (
int i = 0; i < length; ++i) {
3880 QRgbaFloat32 d = dest[i];
3881 QRgbaFloat32 s = src[i];
3883 float da = d.alpha();
3884 float sa = s.alpha();
3886#define OP(a, b) (a + b - (2.0f
* a * b))
3887 float r = OP( d.red(), s.red());
3888 float b = OP( d.blue(), s.blue());
3889 float g = OP(d.green(), s.green());
3890 float a = mix_alpha_rgbafp(da, sa);
3893 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3897void QT_FASTCALL comp_func_Exclusion_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3899 if (const_alpha == 255)
3900 comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
3902 comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
3911 Q_UNUSED(const_alpha);
3921 Q_UNUSED(const_alpha);
3931 Q_UNUSED(const_alpha);
3932 color |= 0xff000000;
3942 Q_UNUSED(const_alpha);
3944 *dest = (*src & *dest) | 0xff000000;
3954 Q_UNUSED(const_alpha);
3955 color &= 0x00ffffff;
3965 Q_UNUSED(const_alpha);
3967 *dest = (*src ^ *dest) | 0xff000000;
3977 Q_UNUSED(const_alpha);
3980 *dest = (color & ~(*dest)) | 0xff000000;
3990 Q_UNUSED(const_alpha);
3992 *dest = (~(*src) & ~(*dest)) | 0xff000000;
4002 Q_UNUSED(const_alpha);
4003 color = ~color | 0xff000000;
4005 *dest = color | ~(*dest);
4015 Q_UNUSED(const_alpha);
4017 *dest = ~(*src) | ~(*dest) | 0xff000000;
4027 Q_UNUSED(const_alpha);
4028 color = ~color & 0x00ffffff;
4030 *dest = color ^ (*dest);
4040 Q_UNUSED(const_alpha);
4042 *dest = ((~(*src)) ^ (*dest)) | 0xff000000;
4048 uint color, uint const_alpha)
4050 Q_UNUSED(const_alpha);
4051 qt_memfill(dest, ~color | 0xff000000, length);
4055 int length, uint const_alpha)
4057 Q_UNUSED(const_alpha);
4059 *dest++ = ~(*src++) | 0xff000000;
4067 Q_UNUSED(const_alpha);
4068 color = ~color | 0xff000000;
4070 *dest = color & *dest;
4080 Q_UNUSED(const_alpha);
4082 *dest = (~(*src) & *dest) | 0xff000000;
4092 Q_UNUSED(const_alpha);
4094 *dest = (color & ~(*dest)) | 0xff000000;
4104 Q_UNUSED(const_alpha);
4106 *dest = (*src & ~(*dest)) | 0xff000000;
4116 Q_UNUSED(const_alpha);
4118 *dest = (~(*src) | *dest) | 0xff000000;
4128 Q_UNUSED(const_alpha);
4129 color = ~color | 0xff000000;
4139 Q_UNUSED(const_alpha);
4141 *dest = (*src | ~(*dest)) | 0xff000000;
4151 Q_UNUSED(const_alpha);
4153 *dest = (color | ~(*dest)) | 0xff000000;
4164 comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);
4173 comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);
4182 comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);
4191 comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);
4200 rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);
4209 rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);
4213 comp_func_solid_SourceOver,
4214 comp_func_solid_DestinationOver,
4215 comp_func_solid_Clear,
4216 comp_func_solid_Source,
4217 comp_func_solid_Destination,
4218 comp_func_solid_SourceIn,
4219 comp_func_solid_DestinationIn,
4220 comp_func_solid_SourceOut,
4221 comp_func_solid_DestinationOut,
4222 comp_func_solid_SourceAtop,
4223 comp_func_solid_DestinationAtop,
4224 comp_func_solid_XOR,
4225 comp_func_solid_Plus,
4226 comp_func_solid_Multiply,
4227 comp_func_solid_Screen,
4228 comp_func_solid_Overlay,
4229 comp_func_solid_Darken,
4230 comp_func_solid_Lighten,
4231 comp_func_solid_ColorDodge,
4232 comp_func_solid_ColorBurn,
4233 comp_func_solid_HardLight,
4234 comp_func_solid_SoftLight,
4235 comp_func_solid_Difference,
4236 comp_func_solid_Exclusion,
4237 rasterop_solid_SourceOrDestination,
4238 rasterop_solid_SourceAndDestination,
4239 rasterop_solid_SourceXorDestination,
4240 rasterop_solid_NotSourceAndNotDestination,
4241 rasterop_solid_NotSourceOrNotDestination,
4242 rasterop_solid_NotSourceXorDestination,
4243 rasterop_solid_NotSource,
4244 rasterop_solid_NotSourceAndDestination,
4245 rasterop_solid_SourceAndNotDestination,
4246 rasterop_solid_NotSourceOrDestination,
4247 rasterop_solid_SourceOrNotDestination,
4248 rasterop_solid_ClearDestination,
4249 rasterop_solid_SetDestination,
4250 rasterop_solid_NotDestination
4253static_assert(std::size(qt_functionForModeSolid_C) == QPainter::NCompositionModes);
4256#if QT_CONFIG(raster_64bit)
4257 comp_func_solid_SourceOver_rgb64,
4258 comp_func_solid_DestinationOver_rgb64,
4259 comp_func_solid_Clear_rgb64,
4260 comp_func_solid_Source_rgb64,
4261 comp_func_solid_Destination_rgb64,
4262 comp_func_solid_SourceIn_rgb64,
4263 comp_func_solid_DestinationIn_rgb64,
4264 comp_func_solid_SourceOut_rgb64,
4265 comp_func_solid_DestinationOut_rgb64,
4266 comp_func_solid_SourceAtop_rgb64,
4267 comp_func_solid_DestinationAtop_rgb64,
4268 comp_func_solid_XOR_rgb64,
4269 comp_func_solid_Plus_rgb64,
4270 comp_func_solid_Multiply_rgb64,
4271 comp_func_solid_Screen_rgb64,
4272 comp_func_solid_Overlay_rgb64,
4273 comp_func_solid_Darken_rgb64,
4274 comp_func_solid_Lighten_rgb64,
4275 comp_func_solid_ColorDodge_rgb64,
4276 comp_func_solid_ColorBurn_rgb64,
4277 comp_func_solid_HardLight_rgb64,
4278 comp_func_solid_SoftLight_rgb64,
4279 comp_func_solid_Difference_rgb64,
4280 comp_func_solid_Exclusion_rgb64,
4282 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4283 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4284 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4286 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4287 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
4290static_assert(std::size(qt_functionForModeSolid64_C) == QPainter::NCompositionModes);
4293#if QT_CONFIG(raster_fp)
4294 comp_func_solid_SourceOver_rgbafp,
4295 comp_func_solid_DestinationOver_rgbafp,
4296 comp_func_solid_Clear_rgbafp,
4297 comp_func_solid_Source_rgbafp,
4298 comp_func_solid_Destination_rgbafp,
4299 comp_func_solid_SourceIn_rgbafp,
4300 comp_func_solid_DestinationIn_rgbafp,
4301 comp_func_solid_SourceOut_rgbafp,
4302 comp_func_solid_DestinationOut_rgbafp,
4303 comp_func_solid_SourceAtop_rgbafp,
4304 comp_func_solid_DestinationAtop_rgbafp,
4305 comp_func_solid_XOR_rgbafp,
4306 comp_func_solid_Plus_rgbafp,
4307 comp_func_solid_Multiply_rgbafp,
4308 comp_func_solid_Screen_rgbafp,
4309 comp_func_solid_Overlay_rgbafp,
4310 comp_func_solid_Darken_rgbafp,
4311 comp_func_solid_Lighten_rgbafp,
4312 comp_func_solid_ColorDodge_rgbafp,
4313 comp_func_solid_ColorBurn_rgbafp,
4314 comp_func_solid_HardLight_rgbafp,
4315 comp_func_solid_SoftLight_rgbafp,
4316 comp_func_solid_Difference_rgbafp,
4317 comp_func_solid_Exclusion_rgbafp,
4319 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4320 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4322 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4323 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
4326static_assert(std::size(qt_functionForModeSolidFP_C) == QPainter::NCompositionModes);
4329 comp_func_SourceOver,
4330 comp_func_DestinationOver,
4333 comp_func_Destination,
4335 comp_func_DestinationIn,
4336 comp_func_SourceOut,
4337 comp_func_DestinationOut,
4338 comp_func_SourceAtop,
4339 comp_func_DestinationAtop,
4347 comp_func_ColorDodge,
4348 comp_func_ColorBurn,
4349 comp_func_HardLight,
4350 comp_func_SoftLight,
4351 comp_func_Difference,
4352 comp_func_Exclusion,
4353 rasterop_SourceOrDestination,
4354 rasterop_SourceAndDestination,
4355 rasterop_SourceXorDestination,
4356 rasterop_NotSourceAndNotDestination,
4357 rasterop_NotSourceOrNotDestination,
4358 rasterop_NotSourceXorDestination,
4360 rasterop_NotSourceAndDestination,
4361 rasterop_SourceAndNotDestination,
4362 rasterop_NotSourceOrDestination,
4363 rasterop_SourceOrNotDestination,
4364 rasterop_ClearDestination,
4365 rasterop_SetDestination,
4366 rasterop_NotDestination
4369static_assert(std::size(qt_functionForMode_C) == QPainter::NCompositionModes);
4372#if QT_CONFIG(raster_64bit)
4373 comp_func_SourceOver_rgb64,
4374 comp_func_DestinationOver_rgb64,
4375 comp_func_Clear_rgb64,
4376 comp_func_Source_rgb64,
4377 comp_func_Destination_rgb64,
4378 comp_func_SourceIn_rgb64,
4379 comp_func_DestinationIn_rgb64,
4380 comp_func_SourceOut_rgb64,
4381 comp_func_DestinationOut_rgb64,
4382 comp_func_SourceAtop_rgb64,
4383 comp_func_DestinationAtop_rgb64,
4384 comp_func_XOR_rgb64,
4385 comp_func_Plus_rgb64,
4386 comp_func_Multiply_rgb64,
4387 comp_func_Screen_rgb64,
4388 comp_func_Overlay_rgb64,
4389 comp_func_Darken_rgb64,
4390 comp_func_Lighten_rgb64,
4391 comp_func_ColorDodge_rgb64,
4392 comp_func_ColorBurn_rgb64,
4393 comp_func_HardLight_rgb64,
4394 comp_func_SoftLight_rgb64,
4395 comp_func_Difference_rgb64,
4396 comp_func_Exclusion_rgb64,
4398 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4399 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4400 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4402 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4403 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
4406static_assert(std::size(qt_functionForMode64_C) == QPainter::NCompositionModes);
4409#if QT_CONFIG(raster_fp)
4410 comp_func_SourceOver_rgbafp,
4411 comp_func_DestinationOver_rgbafp,
4412 comp_func_Clear_rgbafp,
4413 comp_func_Source_rgbafp,
4414 comp_func_Destination_rgbafp,
4415 comp_func_SourceIn_rgbafp,
4416 comp_func_DestinationIn_rgbafp,
4417 comp_func_SourceOut_rgbafp,
4418 comp_func_DestinationOut_rgbafp,
4419 comp_func_SourceAtop_rgbafp,
4420 comp_func_DestinationAtop_rgbafp,
4421 comp_func_XOR_rgbafp,
4422 comp_func_Plus_rgbafp,
4423 comp_func_Multiply_rgbafp,
4424 comp_func_Screen_rgbafp,
4425 comp_func_Overlay_rgbafp,
4426 comp_func_Darken_rgbafp,
4427 comp_func_Lighten_rgbafp,
4428 comp_func_ColorDodge_rgbafp,
4429 comp_func_ColorBurn_rgbafp,
4430 comp_func_HardLight_rgbafp,
4431 comp_func_SoftLight_rgbafp,
4432 comp_func_Difference_rgbafp,
4433 comp_func_Exclusion_rgbafp,
4435 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4436 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4438 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4439 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
4442static_assert(std::size(qt_functionForModeFP_C) == QPainter::NCompositionModes);
static void comp_func_solid_ColorBurn_impl(uint *dest, int length, uint color, const T &coverage)
static void comp_func_solid_ColorDodge_impl(uint *dest, int length, uint color, const T &coverage)
CompositionFunctionFP qt_functionForModeFP_C[]
static void comp_func_solid_Darken_impl(uint *dest, int length, uint color, const T &coverage)
CompositionFunction qt_functionForMode_C[]
static void comp_func_solid_SourceOut_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
static void comp_func_solid_Screen_impl(uint *dest, int length, uint color, const T &coverage)
static void comp_func_solid_SoftLight_impl(uint *dest, int length, uint color, const T &coverage)
static void comp_func_Difference_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static void comp_func_Plus_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
static uint hardlight_op(int dst, int src, int da, int sa)
static void comp_func_solid_XOR_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
static void comp_func_Clear_template(typename Ops::Type *dest, int length, uint const_alpha)
static void comp_func_SourceAtop_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
static void comp_func_Multiply_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static void comp_func_DestinationIn_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
static void comp_func_solid_Source_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
static int color_dodge_op(int dst, int src, int da, int sa)
static void comp_func_solid_HardLight_impl(uint *dest, int length, uint color, const T &coverage)
static void comp_func_solid_Overlay_impl(uint *dest, int length, uint color, const T &coverage)
static int overlay_op(int dst, int src, int da, int sa)
static void comp_func_DestinationOver_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
static void comp_func_solid_SourceIn_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
static void comp_func_solid_Plus_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
static void comp_func_solid_SourceOver_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
Argb32OperationsC Argb32Operations
static void comp_func_solid_Difference_impl(uint *dest, int length, uint color, const T &coverage)
static int multiply_op(int dst, int src, int da, int sa)
static void comp_func_DestinationAtop_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
static int soft_light_op(int dst, int src, int da, int sa)
static void comp_func_ColorBurn_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static void comp_func_solid_DestinationOver_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
static void comp_func_Source_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
static void comp_func_HardLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static int mix_alpha(int da, int sa)
static void comp_func_solid_DestinationOut_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
static void comp_func_SourceOver_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
static int difference_op(int dst, int src, int da, int sa)
static void comp_func_solid_SourceAtop_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
static int color_burn_op(int dst, int src, int da, int sa)
static void comp_func_SourceOut_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
CompositionFunctionSolidFP qt_functionForModeSolidFP_C[]
static void comp_func_Overlay_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static void comp_func_Lighten_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static void comp_func_solid_DestinationIn_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
static void comp_func_Darken_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static int lighten_op(int dst, int src, int da, int sa)
static void comp_func_Screen_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static void comp_func_solid_DestinationAtop_template(typename Ops::Type *dest, int length, typename Ops::Type color, uint const_alpha)
CompositionFunction64 qt_functionForMode64_C[]
CompositionFunctionSolid qt_functionForModeSolid_C[]
static void comp_func_ColorDodge_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static void comp_func_solid_Multiply_impl(uint *dest, int length, uint color, const T &coverage)
static void comp_func_DestinationOut_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
static void comp_func_Exclusion_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static void comp_func_SoftLight_impl(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, const T &coverage)
static void comp_func_XOR_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
static void comp_func_solid_Lighten_impl(uint *dest, int length, uint color, const T &coverage)
static int darken_op(int dst, int src, int da, int sa)
CompositionFunctionSolid64 qt_functionForModeSolid64_C[]
static void comp_func_SourceIn_template(typename Ops::Type *Q_DECL_RESTRICT dest, const typename Ops::Type *Q_DECL_RESTRICT src, int length, uint const_alpha)
uint QT_FASTCALL fetch1Pixel< QPixelLayout::BPP1LSB >(const uchar *src, int index)
static constexpr int qt_div_255(int x)
static OptimalType add(OptimalType a, OptimalType b)
static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2)
static Scalar scalarFrom8bit(uint8_t a)
static bool isTransparent(Type val)
static void memfill(Type *ptr, Type value, qsizetype len)
static void store(Type *ptr, OptimalType value)
static void memcpy(Type *Q_DECL_RESTRICT dest, const Type *Q_DECL_RESTRICT src, qsizetype len)
static OptimalScalar invAlpha(OptimalScalar c)
static OptimalType convert(const Type &val)
static OptimalType plus(OptimalType a, OptimalType b)
static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
static OptimalScalar scalar(Scalar v)
static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
static OptimalType load(const Type *ptr)
static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
static OptimalScalar alpha(OptimalType val)
static bool isOpaque(Type val)
void store(uint *dest, const uint src) const
void store_template(typename Op::Type *dest, const typename Op::Type src) const
void store(uint *dest, const uint src) const
QPartialCoverage(uint const_alpha)
static bool isOpaque(Type val)
static void memcpy(Type *Q_DECL_RESTRICT dest, const Type *Q_DECL_RESTRICT src, qsizetype len)
static void memfill(Type *ptr, Type value, qsizetype len)
static Scalar scalarFrom8bit(uint8_t a)
static bool isTransparent(Type val)