14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
43 {
return qAlpha(val) == 255; }
45 {
return qAlpha(val) == 0; }
49 { qt_memfill32(ptr, value, len); }
51 { ::memcpy(dest, src, len *
sizeof(Type)); }
64 {
return comp_func_Plus_one_pixel(a, b); }
66 {
return qAlpha(val); }
74 {
return BYTE_MUL(val, a); }
76 {
return INTERPOLATE_PIXEL_255(x, a1, y, a2); }
78 {
return BYTE_MUL(val, a); }
82 {
return INTERPOLATE_PIXEL_255(x, a1, y, a2); }
97 {
return val.isOpaque(); }
99 {
return val.isTransparent(); }
104 { qt_memfill64((quint64*)ptr, value, len); }
106 { ::memcpy(dest, src, len *
sizeof(Type)); }
109#if QT_CONFIG(raster_64bit)
110const Rgba64OperationsBase::Type Rgba64OperationsBase::clear = QRgba64::fromRgba64(0);
112struct Rgba64OperationsC :
public Rgba64OperationsBase
114 typedef QRgba64 OptimalType;
115 typedef quint16 OptimalScalar;
117 static OptimalType load(
const Type *ptr)
119 static OptimalType convert(
const Type &val)
121 static void store(Type *ptr, OptimalType value)
123 static OptimalType add(OptimalType a, OptimalType b)
124 {
return QRgba64::fromRgba64((quint64)a + (quint64)b); }
125 static OptimalScalar add(OptimalScalar a, OptimalScalar b)
127 static OptimalType plus(OptimalType a, OptimalType b)
128 {
return addWithSaturation(a, b); }
129 static OptimalScalar alpha(OptimalType val)
130 {
return val.alpha(); }
131 static OptimalScalar invAlpha(Scalar c)
132 {
return 65535 - c; }
133 static OptimalScalar invAlpha(OptimalType val)
134 {
return 65535 - alpha(val); }
135 static OptimalScalar scalar(Scalar v)
137 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
138 {
return multiplyAlpha255(val, a); }
139 static OptimalScalar multiplyAlpha8bit(OptimalScalar val, uint8_t a)
140 {
return qt_div_255(val * a); }
141 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
142 {
return interpolate255(x, a1, y, a2); }
143 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
144 {
return multiplyAlpha65535(val, a); }
145 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2)
146 {
return interpolate65535(x, a1, y, a2); }
150struct Rgba64OperationsSSE2 :
public Rgba64OperationsBase
152 typedef __m128i OptimalType;
153 typedef __m128i OptimalScalar;
155 static OptimalType load(
const Type *ptr)
157 return _mm_loadl_epi64(
reinterpret_cast<
const __m128i *>(ptr));
159 static OptimalType convert(
const Type &value)
161#ifdef Q_PROCESSOR_X86_64
162 return _mm_cvtsi64_si128(value);
167 static void store(Type *ptr, OptimalType value)
169 _mm_storel_epi64(
reinterpret_cast<__m128i *>(ptr), value);
171 static OptimalType add(OptimalType a, OptimalType b)
173 return _mm_add_epi16(a, b);
177 static OptimalType plus(OptimalType a, OptimalType b)
179 return _mm_adds_epu16(a, b);
181 static OptimalScalar alpha(OptimalType c)
183 return _mm_shufflelo_epi16(c, _MM_SHUFFLE(3, 3, 3, 3));
185 static OptimalScalar invAlpha(Scalar c)
187 return scalar(65535 - c);
189 static OptimalScalar invAlpha(OptimalType c)
191 return _mm_xor_si128(_mm_set1_epi16(-1), alpha(c));
193 static OptimalScalar scalar(Scalar n)
195 return _mm_shufflelo_epi16(_mm_cvtsi32_si128(n), _MM_SHUFFLE(0, 0, 0, 0));
197 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
199 return multiplyAlpha255(val, a);
203 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
205 return interpolate255(x, a1, y, a2);
207 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
209 return multiplyAlpha65535(val, a);
212 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y,
const OptimalScalar &a2)
214 return interpolate65535(x, a1, y, a2);
219#if defined(__ARM_NEON__)
220struct Rgba64OperationsNEON :
public Rgba64OperationsBase
222 typedef uint16x4_t OptimalType;
223 typedef uint16x4_t OptimalScalar;
225 static OptimalType load(
const Type *ptr)
227 return vreinterpret_u16_u64(vld1_u64(
reinterpret_cast<
const uint64_t *>(ptr)));
229 static OptimalType convert(
const Type &val)
231 return vreinterpret_u16_u64(vmov_n_u64(val));
233 static void store(Type *ptr, OptimalType value)
235 vst1_u64(
reinterpret_cast<uint64_t *>(ptr), vreinterpret_u64_u16(value));
237 static OptimalType add(OptimalType a, OptimalType b)
239 return vadd_u16(a, b);
243 static OptimalType plus(OptimalType a, OptimalType b)
245 return vqadd_u16(a, b);
247 static OptimalScalar alpha(OptimalType c)
249 return vdup_lane_u16(c, 3);
251 static OptimalScalar invAlpha(Scalar c)
253 return scalar(65535 - c);
255 static OptimalScalar invAlpha(OptimalType c)
257 return vmvn_u16(alpha(c));
259 static OptimalScalar scalar(Scalar n)
261 return vdup_n_u16(n);
263 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
265 return multiplyAlpha255(val, a);
269 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
271 return interpolate255(x, a1, y, a2);
273 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
275 return multiplyAlpha65535(val, a);
277 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2)
279 return interpolate65535(x, a1, y, a2);
284#if defined(__loongarch_sx)
285struct Rgba64OperationsLSX :
public Rgba64OperationsBase
287 typedef __m128i OptimalType;
288 typedef __m128i OptimalScalar;
289 static OptimalType load(
const Type *ptr)
291 return __lsx_vilvl_d(__lsx_vldi(0), __lsx_vldrepl_d(
reinterpret_cast<
const __m128i *>(ptr), 0));
293 static OptimalType convert(
const Type &value)
295 return __lsx_vinsgr2vr_d(__lsx_vldi(0), value, 0);
297 static void store(Type *ptr, OptimalType value)
299 __lsx_vstelm_d(value,
reinterpret_cast<
const __m128i *>(ptr), 0, 0);
301 static OptimalType add(OptimalType a, OptimalType b)
303 return __lsx_vadd_h(a, b);
307 static OptimalType plus(OptimalType a, OptimalType b)
309 return __lsx_vsadd_hu(a, b);
311 static OptimalScalar alpha(OptimalType c)
313 const __m128i shuffleMask = (__m128i)(v8i16){3, 3, 3, 3, 4, 5, 6, 7};
314 return __lsx_vshuf_h(shuffleMask, __lsx_vldi(0), c);
316 static OptimalScalar invAlpha(Scalar c)
318 return scalar(65535 - c);
320 static OptimalScalar invAlpha(OptimalType c)
322 return __lsx_vxor_v(__lsx_vreplgr2vr_h(-1), alpha(c));
324 static OptimalScalar scalar(Scalar n)
326 const __m128i shuffleMask = (__m128i)(v8i16){0, 0, 0, 0, 4, 5, 6, 7};
327 return __lsx_vshuf_h(shuffleMask, __lsx_vldi(0), __lsx_vinsgr2vr_w(__lsx_vldi(0), n, 0));
329 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
331 return multiplyAlpha255(val, a);
335 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
337 return interpolate255(x, a1, y, a2);
339 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
341 return multiplyAlpha65535(val, a);
343 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y,
const OptimalScalar &a2)
345 return interpolate65535(x, a1, y, a2);
351typedef Rgba64OperationsSSE2 Rgba64Operations;
352#elif defined(__ARM_NEON__)
353typedef Rgba64OperationsNEON Rgba64Operations;
354#elif defined(__loongarch_sx)
355typedef Rgba64OperationsLSX Rgba64Operations;
357typedef Rgba64OperationsC Rgba64Operations;
362#if QT_CONFIG(raster_fp)
364static inline QRgbaFloat32 qRgbaFloat32(
float r,
float g,
float b,
float a)
366 return QRgbaFloat32{r, g, b, a};
369struct RgbaFPOperationsBase
371 typedef QRgbaFloat32 Type;
372 typedef float Scalar;
374 static inline constexpr Type clear = { 0, 0, 0, 0 };
376 static bool isOpaque(Type val)
377 {
return val.a >= 1.0f; }
378 static bool isTransparent(Type val)
379 {
return val.a <= 0.0f; }
380 static Scalar scalarFrom8bit(uint8_t a)
381 {
return a * (1.0f / 255.0f); }
383 static void memfill(Type *ptr, Type value, qsizetype len)
385 for (qsizetype i = 0; i < len; ++i)
388 static void memcpy(Type *Q_DECL_RESTRICT dest,
const Type *Q_DECL_RESTRICT src, qsizetype len)
389 { ::memcpy(dest, src, len *
sizeof(Type)); }
392struct RgbaFPOperationsC : RgbaFPOperationsBase
394 typedef QRgbaFloat32 OptimalType;
395 typedef float OptimalScalar;
397 static OptimalType load(
const Type *ptr)
399 return QRgbaFloat32 { ptr->r, ptr->g, ptr->b, ptr->a };
401 static OptimalType convert(
const Type &val)
403 return QRgbaFloat32 { val.r, val.g, val.b, val.a };
405 static void store(Type *ptr, OptimalType value)
412 static OptimalType add(OptimalType a, OptimalType b)
420 static OptimalScalar add(OptimalScalar a, OptimalScalar b)
422 static OptimalType plus(OptimalType a, OptimalType b)
425 if (a.a < 0.0f) a.a = 0.0f;
426 else if (a.a > 1.0f) a.a = 1.0f;
429 static OptimalScalar alpha(OptimalType val)
431 static OptimalScalar invAlpha(OptimalScalar c)
433 static OptimalScalar invAlpha(OptimalType val)
434 {
return 1.0f - val.a; }
435 static OptimalScalar scalar(Scalar v)
437 static OptimalType multiplyAlpha(OptimalType val, OptimalScalar a)
445 static OptimalScalar multiplyAlpha8bit(OptimalScalar val, uint8_t a)
447 return val * a * (1.0f / 255.0f);
449 static OptimalType interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2)
451 return add(multiplyAlpha(x, a1), multiplyAlpha(y, a2));
453 static OptimalType multiplyAlpha8bit(OptimalType val, uint8_t a)
455 return multiplyAlpha(val, a * (1.0f / 255.0f));
457 static OptimalType interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
459 return add(multiplyAlpha8bit(x, a1), multiplyAlpha8bit(y, a2));
464struct RgbaFPOperationsSSE2 :
public RgbaFPOperationsBase
466 typedef __m128 OptimalType;
467 typedef __m128 OptimalScalar;
469 static OptimalType Q_DECL_VECTORCALL load(
const Type *ptr)
471 return _mm_loadu_ps(
reinterpret_cast<
const float *>(ptr));
473 static OptimalType Q_DECL_VECTORCALL convert(
const Type &value)
477 static void Q_DECL_VECTORCALL store(Type *ptr, OptimalType value)
479 _mm_storeu_ps(
reinterpret_cast<
float *>(ptr), value);
481 static OptimalType Q_DECL_VECTORCALL add(OptimalType a, OptimalType b)
483 return _mm_add_ps(a, b);
487 static OptimalType Q_DECL_VECTORCALL plus(OptimalType a, OptimalType b)
489 a = _mm_add_ps(a, b);
490 __m128 aa = _mm_min_ps(a, _mm_set1_ps(1.0f));
491 aa = _mm_max_ps(aa, _mm_set1_ps(0.0f));
493 aa = _mm_shuffle_ps(aa, a, _MM_SHUFFLE(2, 2, 3, 3));
494 a = _mm_shuffle_ps(a, aa, _MM_SHUFFLE(0, 2, 1, 0));
497 static OptimalScalar Q_DECL_VECTORCALL alpha(OptimalType c)
499 return _mm_shuffle_ps(c, c, _MM_SHUFFLE(3, 3, 3, 3));
501 static OptimalScalar Q_DECL_VECTORCALL invAlpha(Scalar c)
503 return _mm_set1_ps(1.0f -
float(c));
505 static OptimalScalar Q_DECL_VECTORCALL invAlpha(OptimalType c)
507 return _mm_sub_ps(_mm_set1_ps(1.0f), alpha(c));
509 static OptimalScalar Q_DECL_VECTORCALL scalar(Scalar n)
511 return _mm_set1_ps(
float(n));
513 static OptimalType Q_DECL_VECTORCALL multiplyAlpha(OptimalType val, OptimalScalar a)
515 return _mm_mul_ps(val, a);
517 static OptimalType Q_DECL_VECTORCALL interpolate(OptimalType x, OptimalScalar a1, OptimalType y, OptimalScalar a2)
519 return add(multiplyAlpha(x, a1), multiplyAlpha(y, a2));
521 static OptimalType Q_DECL_VECTORCALL multiplyAlpha8bit(OptimalType val, uint8_t a)
523 return multiplyAlpha(val, _mm_set1_ps(a * (1.0f / 255.0f)));
527 static OptimalType Q_DECL_VECTORCALL interpolate8bit(OptimalType x, uint8_t a1, OptimalType y, uint8_t a2)
529 return add(multiplyAlpha8bit(x, a1), multiplyAlpha8bit(y, a2));
535typedef RgbaFPOperationsSSE2 RgbaFPOperations;
537typedef RgbaFPOperationsC RgbaFPOperations;
543
544
545
549 if (const_alpha == 255)
550 Ops::memfill(dest, Ops::clear, length);
552 uint ialpha = 255 - const_alpha;
553 for (
int i = 0; i < length; ++i) {
554 Ops::store(&dest[i], Ops::multiplyAlpha8bit(Ops::load(&dest[i]), ialpha));
559void QT_FASTCALL comp_func_solid_Clear(uint *dest,
int length, uint, uint const_alpha)
561 comp_func_Clear_template<Argb32Operations>(dest, length, const_alpha);
564void QT_FASTCALL comp_func_Clear(uint *dest,
const uint *,
int length, uint const_alpha)
566 comp_func_Clear_template<Argb32Operations>(dest, length, const_alpha);
569#if QT_CONFIG(raster_64bit)
570void QT_FASTCALL comp_func_solid_Clear_rgb64(QRgba64 *dest,
int length, QRgba64, uint const_alpha)
572 comp_func_Clear_template<Rgba64Operations>(dest, length, const_alpha);
575void QT_FASTCALL comp_func_Clear_rgb64(QRgba64 *dest,
const QRgba64 *,
int length, uint const_alpha)
577 comp_func_Clear_template<Rgba64Operations>(dest, length, const_alpha);
581#if QT_CONFIG(raster_fp)
582void QT_FASTCALL comp_func_solid_Clear_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32, uint const_alpha)
584 comp_func_Clear_template<RgbaFPOperations>(dest, length, const_alpha);
587void QT_FASTCALL comp_func_Clear_rgbafp(QRgbaFloat32 *dest,
const QRgbaFloat32 *,
int length, uint const_alpha)
589 comp_func_Clear_template<RgbaFPOperations>(dest, length, const_alpha);
594
595
596
600 if (const_alpha == 255)
601 Ops::memfill(dest, color, length);
603 const uint ialpha = 255 - const_alpha;
604 auto s = Ops::multiplyAlpha8bit(Ops::convert(color), const_alpha);
605 for (
int i = 0; i < length; ++i) {
606 auto d = Ops::multiplyAlpha8bit(Ops::load(&dest[i]), ialpha);
607 Ops::store(&dest[i], Ops::add(s, d));
615 int length, uint const_alpha)
617 if (const_alpha == 255)
618 Ops::memcpy(dest, src, length);
620 const uint ialpha = 255 - const_alpha;
621 for (
int i = 0; i < length; ++i) {
622 auto s = Ops::load(src + i);
623 auto d = Ops::load(dest + i);
624 Ops::store(&dest[i], Ops::interpolate8bit(s, const_alpha, d, ialpha));
629void QT_FASTCALL comp_func_solid_Source(uint *dest,
int length, uint color, uint const_alpha)
631 comp_func_solid_Source_template<Argb32Operations>(dest, length, color, const_alpha);
636 comp_func_Source_template<Argb32Operations>(dest, src, length, const_alpha);
639#if QT_CONFIG(raster_64bit)
640void QT_FASTCALL comp_func_solid_Source_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
642 comp_func_solid_Source_template<Rgba64Operations>(dest, length, color, const_alpha);
645void QT_FASTCALL comp_func_Source_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
647 comp_func_Source_template<Rgba64Operations>(dest, src, length, const_alpha);
651#if QT_CONFIG(raster_fp)
652void QT_FASTCALL comp_func_solid_Source_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
654 comp_func_solid_Source_template<RgbaFPOperations>(dest, length, color, const_alpha);
657void QT_FASTCALL comp_func_Source_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
659 comp_func_Source_template<RgbaFPOperations>(dest, src, length, const_alpha);
663void QT_FASTCALL comp_func_solid_Destination(uint *,
int, uint, uint)
667void QT_FASTCALL comp_func_Destination(uint *,
const uint *,
int, uint)
671#if QT_CONFIG(raster_64bit)
672void QT_FASTCALL comp_func_solid_Destination_rgb64(QRgba64 *,
int, QRgba64, uint)
676void QT_FASTCALL comp_func_Destination_rgb64(QRgba64 *,
const QRgba64 *,
int, uint)
681#if QT_CONFIG(raster_fp)
682void QT_FASTCALL comp_func_solid_Destination_rgbafp(QRgbaFloat32 *,
int, QRgbaFloat32, uint)
686void QT_FASTCALL comp_func_Destination_rgbafp(QRgbaFloat32 *,
const QRgbaFloat32 *,
int, uint)
692
693
694
695
696
700 if (const_alpha == 255 && Ops::isOpaque(color))
701 Ops::memfill(dest, color, length);
703 auto c = Ops::convert(color);
704 if (const_alpha != 255)
705 c = Ops::multiplyAlpha8bit(c, const_alpha);
706 auto cAlpha = Ops::invAlpha(c);
707 for (
int i = 0; i < length; ++i) {
708 auto d = Ops::multiplyAlpha(Ops::load(&dest[i]), cAlpha);
709 Ops::store(&dest[i], Ops::add(c, d));
717 int length, uint const_alpha)
719 if (const_alpha == 255) {
720 for (
int i = 0; i < length; ++i) {
722 if (Ops::isOpaque(c))
723 Ops::store(&dest[i], Ops::convert(c));
724 else if (!Ops::isTransparent(c)) {
725 auto s = Ops::convert(c);
726 auto d = Ops::multiplyAlpha(Ops::load(&dest[i]), Ops::invAlpha(s));
727 Ops::store(&dest[i], Ops::add(s, d));
731 for (
int i = 0; i < length; ++i) {
732 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
733 auto d = Ops::multiplyAlpha(Ops::load(&dest[i]), Ops::invAlpha(s));
734 Ops::store(&dest[i], Ops::add(s, d));
739void QT_FASTCALL comp_func_solid_SourceOver(uint *dest,
int length, uint color, uint const_alpha)
741 comp_func_solid_SourceOver_template<Argb32Operations>(dest, length, color, const_alpha);
746 comp_func_SourceOver_template<Argb32Operations>(dest, src, length, const_alpha);
749#if QT_CONFIG(raster_64bit)
750void QT_FASTCALL comp_func_solid_SourceOver_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
752 comp_func_solid_SourceOver_template<Rgba64Operations>(dest, length, color, const_alpha);
755void QT_FASTCALL comp_func_SourceOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
757 comp_func_SourceOver_template<Rgba64Operations>(dest, src, length, const_alpha);
761#if QT_CONFIG(raster_fp)
762void QT_FASTCALL comp_func_solid_SourceOver_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
764 comp_func_solid_SourceOver_template<RgbaFPOperations>(dest, length, color, const_alpha);
768void QT_FASTCALL comp_func_SourceOver_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
770 comp_func_SourceOver_template<RgbaFPOperations>(dest, src, length, const_alpha);
775
776
777
778
782 auto c = Ops::convert(color);
783 if (const_alpha != 255)
784 c = Ops::multiplyAlpha8bit(c, const_alpha);
785 for (
int i = 0; i < length; ++i) {
786 auto d = Ops::load(&dest[i]);
787 auto s = Ops::multiplyAlpha(c, Ops::invAlpha(d));
788 Ops::store(&dest[i], Ops::add(s, d));
795 int length, uint const_alpha)
797 if (const_alpha == 255) {
798 for (
int i = 0; i < length; ++i) {
799 auto d = Ops::load(&dest[i]);
800 auto s = Ops::multiplyAlpha(Ops::load(&src[i]), Ops::invAlpha(d));
801 Ops::store(&dest[i], Ops::add(s, d));
804 for (
int i = 0; i < length; ++i) {
805 auto d = Ops::load(&dest[i]);
806 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
807 s = Ops::multiplyAlpha(s, Ops::invAlpha(d));
808 Ops::store(&dest[i], Ops::add(s, d));
813void QT_FASTCALL comp_func_solid_DestinationOver(uint *dest,
int length, uint color, uint const_alpha)
815 comp_func_solid_DestinationOver_template<Argb32Operations>(dest, length, color, const_alpha);
820 comp_func_DestinationOver_template<Argb32Operations>(dest, src, length, const_alpha);
823#if QT_CONFIG(raster_64bit)
824void QT_FASTCALL comp_func_solid_DestinationOver_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
826 comp_func_solid_DestinationOver_template<Rgba64Operations>(dest, length, color, const_alpha);
829void QT_FASTCALL comp_func_DestinationOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
831 comp_func_DestinationOver_template<Rgba64Operations>(dest, src, length, const_alpha);
835#if QT_CONFIG(raster_fp)
836void QT_FASTCALL comp_func_solid_DestinationOver_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
838 comp_func_solid_DestinationOver_template<RgbaFPOperations>(dest, length, color, const_alpha);
841void QT_FASTCALL comp_func_DestinationOver_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
843 comp_func_DestinationOver_template<RgbaFPOperations>(dest, src, length, const_alpha);
848
849
850
854 if (const_alpha == 255) {
855 auto c = Ops::convert(color);
856 for (
int i = 0; i < length; ++i) {
857 Ops::store(&dest[i], Ops::multiplyAlpha(c, Ops::alpha(Ops::load(&dest[i]))));
860 auto c = Ops::multiplyAlpha8bit(Ops::convert(color), const_alpha);
861 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
862 for (
int i = 0; i < length; ++i) {
863 auto d = Ops::load(&dest[i]);
864 Ops::store(&dest[i], Ops::interpolate(c, Ops::alpha(d), d, cia));
872 int length, uint const_alpha)
874 if (const_alpha == 255) {
875 for (
int i = 0; i < length; ++i) {
876 auto s = Ops::load(&src[i]);
877 Ops::store(&dest[i], Ops::multiplyAlpha(s, Ops::alpha(Ops::load(&dest[i]))));
880 auto ca = Ops::scalarFrom8bit(const_alpha);
881 auto cia = Ops::invAlpha(ca);
882 auto cav = Ops::scalar(ca);
883 for (
int i = 0; i < length; ++i) {
884 auto d = Ops::load(&dest[i]);
885 auto s = Ops::multiplyAlpha(Ops::load(&src[i]), cav);
886 Ops::store(&dest[i], Ops::interpolate(s, Ops::alpha(d), d, cia));
891void QT_FASTCALL comp_func_solid_SourceIn(uint *dest,
int length, uint color, uint const_alpha)
893 comp_func_solid_SourceIn_template<Argb32Operations>(dest, length, color, const_alpha);
898 comp_func_SourceIn_template<Argb32Operations>(dest, src, length, const_alpha);
901#if QT_CONFIG(raster_64bit)
902void QT_FASTCALL comp_func_solid_SourceIn_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
904 comp_func_solid_SourceIn_template<Rgba64Operations>(dest, length, color, const_alpha);
907void QT_FASTCALL comp_func_SourceIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
909 comp_func_SourceIn_template<Rgba64Operations>(dest, src, length, const_alpha);
913#if QT_CONFIG(raster_fp)
914void QT_FASTCALL comp_func_solid_SourceIn_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
916 comp_func_solid_SourceIn_template<RgbaFPOperations>(dest, length, color, const_alpha);
919void QT_FASTCALL comp_func_SourceIn_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
921 comp_func_SourceIn_template<RgbaFPOperations>(dest, src, length, const_alpha);
926
927
928
929
933 auto sa = Ops::alpha(Ops::convert(color));
934 if (const_alpha != 255) {
935 sa = Ops::multiplyAlpha8bit(sa, const_alpha);
936 sa = Ops::add(sa, Ops::invAlpha(Ops::scalarFrom8bit(const_alpha)));
939 for (
int i = 0; i < length; ++i) {
940 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sa));
947 int length, uint const_alpha)
949 if (const_alpha == 255) {
950 for (
int i = 0; i < length; ++i) {
951 auto a = Ops::alpha(Ops::load(&src[i]));
952 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), a));
955 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
956 for (
int i = 0; i < length; ++i) {
957 auto sa = Ops::multiplyAlpha8bit(Ops::alpha(Ops::load(&src[i])), const_alpha);
958 sa = Ops::add(sa, cia);
959 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sa));
964void QT_FASTCALL comp_func_solid_DestinationIn(uint *dest,
int length, uint color, uint const_alpha)
966 comp_func_solid_DestinationIn_template<Argb32Operations>(dest, length, color, const_alpha);
971 comp_func_DestinationIn_template<Argb32Operations>(dest, src, length, const_alpha);
974#if QT_CONFIG(raster_64bit)
975void QT_FASTCALL comp_func_solid_DestinationIn_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
977 comp_func_solid_DestinationIn_template<Rgba64Operations>(dest, length, color, const_alpha);
980void QT_FASTCALL comp_func_DestinationIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
982 comp_func_DestinationIn_template<Rgba64Operations>(dest, src, length, const_alpha);
986#if QT_CONFIG(raster_fp)
987void QT_FASTCALL comp_func_solid_DestinationIn_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
989 comp_func_solid_DestinationIn_template<RgbaFPOperations>(dest, length, color, const_alpha);
992void QT_FASTCALL comp_func_DestinationIn_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
994 comp_func_DestinationIn_template<RgbaFPOperations>(dest, src, length, const_alpha);
999
1000
1001
1005 auto c = Ops::convert(color);
1006 if (const_alpha == 255) {
1007 for (
int i = 0; i < length; ++i)
1008 Ops::store(&dest[i], Ops::multiplyAlpha(c, Ops::invAlpha(Ops::load(&dest[i]))));
1010 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1011 c = Ops::multiplyAlpha8bit(c, const_alpha);
1012 for (
int i = 0; i < length; ++i) {
1013 auto d = Ops::load(&dest[i]);
1014 Ops::store(&dest[i], Ops::interpolate(c, Ops::invAlpha(d), d, cia));
1022 int length, uint const_alpha)
1024 if (const_alpha == 255) {
1025 for (
int i = 0; i < length; ++i) {
1026 auto s = Ops::load(&src[i]);
1027 auto d = Ops::load(&dest[i]);
1028 Ops::store(&dest[i], Ops::multiplyAlpha(s, Ops::invAlpha(d)));
1031 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1032 for (
int i = 0; i < length; ++i) {
1033 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
1034 auto d = Ops::load(&dest[i]);
1035 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, cia));
1040void QT_FASTCALL comp_func_solid_SourceOut(uint *dest,
int length, uint color, uint const_alpha)
1042 comp_func_solid_SourceOut_template<Argb32Operations>(dest, length, color, const_alpha);
1047 comp_func_SourceOut_template<Argb32Operations>(dest, src, length, const_alpha);
1050#if QT_CONFIG(raster_64bit)
1051void QT_FASTCALL comp_func_solid_SourceOut_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1053 comp_func_solid_SourceOut_template<Rgba64Operations>(dest, length, color, const_alpha);
1056void QT_FASTCALL comp_func_SourceOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1058 comp_func_SourceOut_template<Rgba64Operations>(dest, src, length, const_alpha);
1062#if QT_CONFIG(raster_fp)
1063void QT_FASTCALL comp_func_solid_SourceOut_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1065 comp_func_solid_SourceOut_template<RgbaFPOperations>(dest, length, color, const_alpha);
1068void QT_FASTCALL comp_func_SourceOut_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1070 comp_func_SourceOut_template<RgbaFPOperations>(dest, src, length, const_alpha);
1075
1076
1077
1078
1082 auto sai = Ops::invAlpha(Ops::convert(color));
1083 if (const_alpha != 255) {
1084 sai = Ops::multiplyAlpha8bit(sai, const_alpha);
1085 sai = Ops::add(sai, Ops::invAlpha(Ops::scalarFrom8bit(const_alpha)));
1088 for (
int i = 0; i < length; ++i) {
1089 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sai));
1096 int length, uint const_alpha)
1098 if (const_alpha == 255) {
1099 for (
int i = 0; i < length; ++i) {
1100 auto sia = Ops::invAlpha(Ops::load(&src[i]));
1101 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sia));
1104 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1105 for (
int i = 0; i < length; ++i) {
1106 auto sia = Ops::multiplyAlpha8bit(Ops::invAlpha(Ops::load(&src[i])), const_alpha);
1107 sia = Ops::add(sia, cia);
1108 Ops::store(&dest[i], Ops::multiplyAlpha(Ops::load(&dest[i]), sia));
1113void QT_FASTCALL comp_func_solid_DestinationOut(uint *dest,
int length, uint color, uint const_alpha)
1115 comp_func_solid_DestinationOut_template<Argb32Operations>(dest, length, color, const_alpha);
1120 comp_func_DestinationOut_template<Argb32Operations>(dest, src, length, const_alpha);
1123#if QT_CONFIG(raster_64bit)
1124void QT_FASTCALL comp_func_solid_DestinationOut_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1126 comp_func_solid_DestinationOut_template<Rgba64Operations>(dest, length, color, const_alpha);
1129void QT_FASTCALL comp_func_DestinationOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1131 comp_func_DestinationOut_template<Rgba64Operations>(dest, src, length, const_alpha);
1135#if QT_CONFIG(raster_fp)
1136void QT_FASTCALL comp_func_solid_DestinationOut_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1138 comp_func_solid_DestinationOut_template<RgbaFPOperations>(dest, length, color, const_alpha);
1141void QT_FASTCALL comp_func_DestinationOut_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1143 comp_func_DestinationOut_template<RgbaFPOperations>(dest, src, length, const_alpha);
1148
1149
1150
1151
1152
1156 auto c = Ops::convert(color);
1157 if (const_alpha != 255)
1158 c = Ops::multiplyAlpha8bit(c, const_alpha);
1159 auto sia = Ops::invAlpha(c);
1160 for (
int i = 0; i < length; ++i) {
1161 auto d = Ops::load(&dest[i]);
1162 Ops::store(&dest[i], Ops::interpolate(c, Ops::alpha(d), d, sia));
1169 int length, uint const_alpha)
1171 if (const_alpha == 255) {
1172 for (
int i = 0; i < length; ++i) {
1173 auto s = Ops::load(&src[i]);
1174 auto d = Ops::load(&dest[i]);
1175 Ops::store(&dest[i], Ops::interpolate(s, Ops::alpha(d), d, Ops::invAlpha(s)));
1178 for (
int i = 0; i < length; ++i) {
1179 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
1180 auto d = Ops::load(&dest[i]);
1181 Ops::store(&dest[i], Ops::interpolate(s, Ops::alpha(d), d, Ops::invAlpha(s)));
1186void QT_FASTCALL comp_func_solid_SourceAtop(uint *dest,
int length, uint color, uint const_alpha)
1188 comp_func_solid_SourceAtop_template<Argb32Operations>(dest, length, color, const_alpha);
1193 comp_func_SourceAtop_template<Argb32Operations>(dest, src, length, const_alpha);
1196#if QT_CONFIG(raster_64bit)
1197void QT_FASTCALL comp_func_solid_SourceAtop_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1199 comp_func_solid_SourceAtop_template<Rgba64Operations>(dest, length, color, const_alpha);
1202void QT_FASTCALL comp_func_SourceAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1204 comp_func_SourceAtop_template<Rgba64Operations>(dest, src, length, const_alpha);
1208#if QT_CONFIG(raster_fp)
1209void QT_FASTCALL comp_func_solid_SourceAtop_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1211 comp_func_solid_SourceAtop_template<RgbaFPOperations>(dest, length, color, const_alpha);
1214void QT_FASTCALL comp_func_SourceAtop_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1216 comp_func_SourceAtop_template<RgbaFPOperations>(dest, src, length, const_alpha);
1221
1222
1223
1224
1228 auto c = Ops::convert(color);
1229 auto sa = Ops::alpha(c);
1230 if (const_alpha != 255) {
1231 c = Ops::multiplyAlpha8bit(c, const_alpha);
1232 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1233 sa = Ops::add(Ops::alpha(c), cia);
1236 for (
int i = 0; i < length; ++i) {
1237 auto d = Ops::load(&dest[i]);
1238 Ops::store(&dest[i], Ops::interpolate(c, Ops::invAlpha(d), d, sa));
1245 int length, uint const_alpha)
1247 if (const_alpha == 255) {
1248 for (
int i = 0; i < length; ++i) {
1249 auto s = Ops::load(&src[i]);
1250 auto d = Ops::load(&dest[i]);
1251 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, Ops::alpha(s)));
1254 auto cia = Ops::invAlpha(Ops::scalarFrom8bit(const_alpha));
1255 for (
int i = 0; i < length; ++i) {
1256 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
1257 auto d = Ops::load(&dest[i]);
1258 auto sa = Ops::add(Ops::alpha(s), cia);
1259 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, sa));
1264void QT_FASTCALL comp_func_solid_DestinationAtop(uint *dest,
int length, uint color, uint const_alpha)
1266 comp_func_solid_DestinationAtop_template<Argb32Operations>(dest, length, color, const_alpha);
1271 comp_func_DestinationAtop_template<Argb32Operations>(dest, src, length, const_alpha);
1274#if QT_CONFIG(raster_64bit)
1275void QT_FASTCALL comp_func_solid_DestinationAtop_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1277 comp_func_solid_DestinationAtop_template<Rgba64Operations>(dest, length, color, const_alpha);
1280void QT_FASTCALL comp_func_DestinationAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1282 comp_func_DestinationAtop_template<Rgba64Operations>(dest, src, length, const_alpha);
1286#if QT_CONFIG(raster_fp)
1287void QT_FASTCALL comp_func_solid_DestinationAtop_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1289 comp_func_solid_DestinationAtop_template<RgbaFPOperations>(dest, length, color, const_alpha);
1292void QT_FASTCALL comp_func_DestinationAtop_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1294 comp_func_DestinationAtop_template<RgbaFPOperations>(dest, src, length, const_alpha);
1299
1300
1301
1302
1303
1307 auto c = Ops::convert(color);
1308 if (const_alpha != 255)
1309 c = Ops::multiplyAlpha8bit(c, const_alpha);
1311 auto sia = Ops::invAlpha(c);
1312 for (
int i = 0; i < length; ++i) {
1313 auto d = Ops::load(&dest[i]);
1314 Ops::store(&dest[i], Ops::interpolate(c, Ops::invAlpha(d), d, sia));
1321 int length, uint const_alpha)
1323 if (const_alpha == 255) {
1324 for (
int i = 0; i < length; ++i) {
1325 auto d = Ops::load(&dest[i]);
1326 auto s = Ops::load(&src[i]);
1327 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, Ops::invAlpha(s)));
1330 for (
int i = 0; i < length; ++i) {
1331 auto d = Ops::load(&dest[i]);
1332 auto s = Ops::multiplyAlpha8bit(Ops::load(&src[i]), const_alpha);
1333 Ops::store(&dest[i], Ops::interpolate(s, Ops::invAlpha(d), d, Ops::invAlpha(s)));
1338void QT_FASTCALL comp_func_solid_XOR(uint *dest,
int length, uint color, uint const_alpha)
1340 comp_func_solid_XOR_template<Argb32Operations>(dest, length, color, const_alpha);
1345 comp_func_XOR_template<Argb32Operations>(dest, src, length, const_alpha);
1348#if QT_CONFIG(raster_64bit)
1349void QT_FASTCALL comp_func_solid_XOR_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1351 comp_func_solid_XOR_template<Rgba64Operations>(dest, length, color, const_alpha);
1354void QT_FASTCALL comp_func_XOR_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1356 comp_func_XOR_template<Rgba64Operations>(dest, src, length, const_alpha);
1360#if QT_CONFIG(raster_fp)
1361void QT_FASTCALL comp_func_solid_XOR_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1363 comp_func_solid_XOR_template<RgbaFPOperations>(dest, length, color, const_alpha);
1366void QT_FASTCALL comp_func_XOR_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1368 comp_func_XOR_template<RgbaFPOperations>(dest, src, length, const_alpha);
1373 inline void store(uint *dest,
const uint src)
const
1377#if QT_CONFIG(raster_64bit)
1383#if QT_CONFIG(raster_fp)
1394 , ica(255 - const_alpha)
1398 template<
typename Op>
1399 inline void store_template(
typename Op::Type *dest,
const typename Op::Type src)
const
1401 Op::store(dest, Op::interpolate8bit(Op::convert(src), ca, Op::load(dest), ica));
1403 inline void store(uint *dest,
const uint src)
const
1407#if QT_CONFIG(raster_64bit)
1413#if QT_CONFIG(raster_fp)
1430#if QT_CONFIG(raster_64bit)
1431static inline uint mix_alpha_rgb64(uint da, uint sa)
1433 return 65535U - qt_div_65535((65535U - sa) * (65535U - da));
1437#if QT_CONFIG(raster_fp)
1438static inline float mix_alpha_rgbafp(
float da,
float sa)
1440 return 1.0f - (1.0f - sa) * (1.0f - da);
1445
1446
1447
1451 auto c = Ops::convert(color);
1452 if (const_alpha == 255) {
1453 for (
int i = 0; i < length; ++i) {
1454 auto d = Ops::load(&dest[i]);
1455 d = Ops::plus(d, c);
1456 Ops::store(&dest[i], d);
1459 uint ia = 255 - const_alpha;
1460 for (
int i = 0; i < length; ++i) {
1461 auto d = Ops::load(&dest[i]);
1462 d = Ops::interpolate8bit(Ops::plus(d, c), const_alpha, d, ia);
1463 Ops::store(&dest[i], d);
1471 int length, uint const_alpha)
1473 if (const_alpha == 255) {
1474 for (
int i = 0; i < length; ++i) {
1475 auto d = Ops::load(&dest[i]);
1476 auto s = Ops::load(&src[i]);
1477 d = Ops::plus(d, s);
1478 Ops::store(&dest[i], d);
1481 uint ia = 255 - const_alpha;
1482 for (
int i = 0; i < length; ++i) {
1483 auto d = Ops::load(&dest[i]);
1484 auto s = Ops::load(&src[i]);
1485 d = Ops::interpolate8bit(Ops::plus(d, s), const_alpha, d, ia);
1486 Ops::store(&dest[i], d);
1491void QT_FASTCALL comp_func_solid_Plus(uint *dest,
int length, uint color, uint const_alpha)
1493 comp_func_solid_Plus_template<Argb32Operations>(dest, length, color, const_alpha);
1498 comp_func_Plus_template<Argb32Operations>(dest, src, length, const_alpha);
1501#if QT_CONFIG(raster_64bit)
1502void QT_FASTCALL comp_func_solid_Plus_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1504 comp_func_solid_Plus_template<Rgba64Operations>(dest, length, color, const_alpha);
1507void QT_FASTCALL comp_func_Plus_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1509 comp_func_Plus_template<Rgba64Operations>(dest, src, length, const_alpha);
1513#if QT_CONFIG(raster_fp)
1514void QT_FASTCALL comp_func_solid_Plus_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1516 comp_func_solid_Plus_template<RgbaFPOperations>(dest, length, color, const_alpha);
1519void QT_FASTCALL comp_func_Plus_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1521 comp_func_Plus_template<RgbaFPOperations>(dest, src, length, const_alpha);
1526
1527
1530 return qt_div_255(src * dst + src * (255 - da) + dst * (255 - sa)
);
1533template <
typename T>
1536 int sa = qAlpha(color);
1537 int sr = qRed(color);
1538 int sg = qGreen(color);
1539 int sb = qBlue(color);
1541 for (
int i = 0; i < length; ++i) {
1545#define OP(a, b) multiply_op(a, b, da, sa)
1546 int r =
OP( qRed(d), sr);
1547 int b =
OP( qBlue(d), sb);
1548 int g =
OP(qGreen(d), sg);
1552 coverage.store(&dest[i], qRgba(r, g, b, a));
1556void QT_FASTCALL comp_func_solid_Multiply(uint *dest,
int length, uint color, uint const_alpha)
1558 if (const_alpha == 255)
1559 comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
1561 comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
1564#if QT_CONFIG(raster_64bit)
1565static inline uint multiply_op_rgb64(uint dst, uint src, uint da, uint sa)
1567 return qt_div_65535(src * dst + src * (65535U - da) + dst * (65535U - sa));
1570template <
typename T>
1571static inline void comp_func_solid_Multiply_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
1573 uint sa = color.alpha();
1574 uint sr = color.red();
1575 uint sg = color.green();
1576 uint sb = color.blue();
1578 for (
int i = 0; i < length; ++i) {
1579 QRgba64 d = dest[i];
1580 uint da = d.alpha();
1582#define OP(a, b) multiply_op_rgb64(a, b, da, sa)
1583 uint r = OP( d.red(), sr);
1584 uint b = OP( d.blue(), sb);
1585 uint g = OP(d.green(), sg);
1586 uint a = mix_alpha_rgb64(da, sa);
1589 coverage.store(&dest[i], qRgba64(r, g, b, a));
1593void QT_FASTCALL comp_func_solid_Multiply_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1595 if (const_alpha == 255)
1596 comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
1598 comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
1602#if QT_CONFIG(raster_fp)
1603static inline float multiply_op_rgbafp(
float dst,
float src,
float da,
float sa)
1605 return src * dst + src * (1.0f - da) + dst * (1.0f - sa);
1608template <
typename T>
1609static inline void comp_func_solid_Multiply_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
1611 float sa = color.alpha();
1612 float sr = color.red();
1613 float sg = color.green();
1614 float sb = color.blue();
1616 for (
int i = 0; i < length; ++i) {
1617 QRgbaFloat32 d = dest[i];
1618 float da = d.alpha();
1620#define OP(a, b) multiply_op_rgbafp(a, b, da, sa)
1621 float r = OP( d.red(), sr);
1622 float b = OP( d.blue(), sb);
1623 float g = OP(d.green(), sg);
1624 float a = mix_alpha_rgbafp(da, sa);
1627 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
1631void QT_FASTCALL comp_func_solid_Multiply_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1633 if (const_alpha == 255)
1634 comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
1636 comp_func_solid_Multiply_impl(dest, length, color, QPartialCoverage(const_alpha));
1641template <
typename T>
1644 for (
int i = 0; i < length; ++i) {
1651#define OP(a, b) multiply_op(a, b, da, sa)
1652 int r =
OP( qRed(d), qRed(s));
1653 int b =
OP( qBlue(d), qBlue(s));
1654 int g =
OP(qGreen(d), qGreen(s));
1658 coverage.store(&dest[i], qRgba(r, g, b, a));
1664 if (const_alpha == 255)
1665 comp_func_Multiply_impl(dest, src, length, QFullCoverage());
1667 comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
1670#if QT_CONFIG(raster_64bit)
1671template <
typename T>
1672static inline void comp_func_Multiply_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
1674 for (
int i = 0; i < length; ++i) {
1675 QRgba64 d = dest[i];
1678 uint da = d.alpha();
1679 uint sa = s.alpha();
1681#define OP(a, b) multiply_op_rgb64(a, b, da, sa)
1682 uint r = OP( d.red(), s.red());
1683 uint b = OP( d.blue(), s.blue());
1684 uint g = OP(d.green(), s.green());
1685 uint a = mix_alpha_rgb64(da, sa);
1688 coverage.store(&dest[i], qRgba64(r, g, b, a));
1692void QT_FASTCALL comp_func_Multiply_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1694 if (const_alpha == 255)
1695 comp_func_Multiply_impl(dest, src, length, QFullCoverage());
1697 comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
1701#if QT_CONFIG(raster_fp)
1702template <
typename T>
1703static inline void comp_func_Multiply_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
1705 for (
int i = 0; i < length; ++i) {
1706 QRgbaFloat32 d = dest[i];
1707 QRgbaFloat32 s = src[i];
1709 float da = d.alpha();
1710 float sa = s.alpha();
1712#define OP(a, b) multiply_op_rgbafp(a, b, da, sa)
1713 float r = OP( d.red(), s.red());
1714 float b = OP( d.blue(), s.blue());
1715 float g = OP(d.green(), s.green());
1716 float a = mix_alpha_rgbafp(da, sa);
1719 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
1723void QT_FASTCALL comp_func_Multiply_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
1725 if (const_alpha == 255)
1726 comp_func_Multiply_impl(dest, src, length, QFullCoverage());
1728 comp_func_Multiply_impl(dest, src, length, QPartialCoverage(const_alpha));
1733
1734
1735
1736template <
typename T>
1739 int sa = qAlpha(color);
1740 int sr = qRed(color);
1741 int sg = qGreen(color);
1742 int sb = qBlue(color);
1744 for (
int i = 0; i < length; ++i) {
1748#define OP(a, b) 255
- qt_div_255((255
-a) * (255
-b))
1749 int r =
OP( qRed(d), sr);
1750 int b =
OP( qBlue(d), sb);
1751 int g =
OP(qGreen(d), sg);
1755 coverage.store(&dest[i], qRgba(r, g, b, a));
1759void QT_FASTCALL comp_func_solid_Screen(uint *dest,
int length, uint color, uint const_alpha)
1761 if (const_alpha == 255)
1762 comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
1764 comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
1767#if QT_CONFIG(raster_64bit)
1768template <
typename T>
1769static inline void comp_func_solid_Screen_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
1771 uint sa = color.alpha();
1772 uint sr = color.red();
1773 uint sg = color.green();
1774 uint sb = color.blue();
1776 for (
int i = 0; i < length; ++i) {
1777 QRgba64 d = dest[i];
1778 uint da = d.alpha();
1780#define OP(a, b) 65535
- qt_div_65535((65535U
-a) * (65535U
-b))
1781 uint r = OP( d.red(), sr);
1782 uint b = OP( d.blue(), sb);
1783 uint g = OP(d.green(), sg);
1784 uint a = mix_alpha_rgb64(da, sa);
1787 coverage.store(&dest[i], qRgba64(r, g, b, a));
1791void QT_FASTCALL comp_func_solid_Screen_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
1793 if (const_alpha == 255)
1794 comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
1796 comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
1800#if QT_CONFIG(raster_fp)
1801template <
typename T>
1802static inline void comp_func_solid_Screen_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
1804 float sa = color.alpha();
1805 float sr = color.red();
1806 float sg = color.green();
1807 float sb = color.blue();
1809 for (
int i = 0; i < length; ++i) {
1810 QRgbaFloat32 d = dest[i];
1811 float da = d.alpha();
1813#define OP(a, b) (1.0f
- ((1.0f
- a) * (1.0f
- b)))
1814 float r = OP( d.red(), sr);
1815 float b = OP( d.blue(), sb);
1816 float g = OP(d.green(), sg);
1817 float a = mix_alpha_rgbafp(da, sa);
1820 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
1824void QT_FASTCALL comp_func_solid_Screen_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
1826 if (const_alpha == 255)
1827 comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
1829 comp_func_solid_Screen_impl(dest, length, color, QPartialCoverage(const_alpha));
1833template <
typename T>
1836 for (
int i = 0; i < length; ++i) {
1843#define OP(a, b) 255
- qt_div_255((255
-a) * (255
-b))
1844 int r =
OP( qRed(d), qRed(s));
1845 int b =
OP( qBlue(d), qBlue(s));
1846 int g =
OP(qGreen(d), qGreen(s));
1850 coverage.store(&dest[i], qRgba(r, g, b, a));
1854void QT_FASTCALL comp_func_Screen(uint *dest,
const uint *src,
int length, uint const_alpha)
1856 if (const_alpha == 255)
1857 comp_func_Screen_impl(dest, src, length, QFullCoverage());
1859 comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
1862#if QT_CONFIG(raster_64bit)
1863template <
typename T>
1864static inline void comp_func_Screen_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
1866 for (
int i = 0; i < length; ++i) {
1867 QRgba64 d = dest[i];
1870 uint da = d.alpha();
1871 uint sa = s.alpha();
1873#define OP(a, b) 65535U
- qt_div_65535((65535U
-a) * (65535U
-b))
1874 uint r = OP( d.red(), s.red());
1875 uint b = OP( d.blue(), s.blue());
1876 uint g = OP(d.green(), s.green());
1877 uint a = mix_alpha_rgb64(da, sa);
1880 coverage.store(&dest[i], qRgba64(r, g, b, a));
1884void QT_FASTCALL comp_func_Screen_rgb64(QRgba64 *dest,
const QRgba64 *src,
int length, uint const_alpha)
1886 if (const_alpha == 255)
1887 comp_func_Screen_impl(dest, src, length, QFullCoverage());
1889 comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
1893#if QT_CONFIG(raster_fp)
1894template <
typename T>
1895static inline void comp_func_Screen_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
1897 for (
int i = 0; i < length; ++i) {
1898 QRgbaFloat32 d = dest[i];
1899 QRgbaFloat32 s = src[i];
1901 float da = d.alpha();
1902 float sa = s.alpha();
1904#define OP(a, b) (1.0f
- ((1.0f
- a) * (1.0f
- b)))
1905 float r = OP( d.red(), s.red());
1906 float b = OP( d.blue(), s.blue());
1907 float g = OP(d.green(), s.green());
1908 float a = mix_alpha_rgbafp(da, sa);
1911 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
1915void QT_FASTCALL comp_func_Screen_rgbafp(QRgbaFloat32 *dest,
const QRgbaFloat32 *src,
int length, uint const_alpha)
1917 if (const_alpha == 255)
1918 comp_func_Screen_impl(dest, src, length, QFullCoverage());
1920 comp_func_Screen_impl(dest, src, length, QPartialCoverage(const_alpha));
1925
1926
1927
1928
1929
1932 const int temp = src * (255 - da) + dst * (255 - sa);
1936 return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp
);
1939template <
typename T>
1942 int sa = qAlpha(color);
1943 int sr = qRed(color);
1944 int sg = qGreen(color);
1945 int sb = qBlue(color);
1947 for (
int i = 0; i < length; ++i) {
1951#define OP(a, b) overlay_op(a, b, da, sa)
1952 int r =
OP( qRed(d), sr);
1953 int b =
OP( qBlue(d), sb);
1954 int g =
OP(qGreen(d), sg);
1958 coverage.store(&dest[i], qRgba(r, g, b, a));
1962void QT_FASTCALL comp_func_solid_Overlay(uint *dest,
int length, uint color, uint const_alpha)
1964 if (const_alpha == 255)
1965 comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
1967 comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
1970#if QT_CONFIG(raster_64bit)
1971static inline uint overlay_op_rgb64(uint dst, uint src, uint da, uint sa)
1973 const uint temp = src * (65535U - da) + dst * (65535U - sa);
1975 return qt_div_65535(2 * src * dst + temp);
1977 return qt_div_65535(sa * da - 2 * (da - dst) * (sa - src) + temp);
1980template <
typename T>
1981static inline void comp_func_solid_Overlay_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
1983 uint sa = color.alpha();
1984 uint sr = color.red();
1985 uint sg = color.green();
1986 uint sb = color.blue();
1988 for (
int i = 0; i < length; ++i) {
1989 QRgba64 d = dest[i];
1990 uint da = d.alpha();
1992#define OP(a, b) overlay_op_rgb64(a, b, da, sa)
1993 uint r = OP( d.red(), sr);
1994 uint b = OP( d.blue(), sb);
1995 uint g = OP(d.green(), sg);
1996 uint a = mix_alpha_rgb64(da, sa);
1999 coverage.store(&dest[i], qRgba64(r, g, b, a));
2003void QT_FASTCALL comp_func_solid_Overlay_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2005 if (const_alpha == 255)
2006 comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
2008 comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
2012#if QT_CONFIG(raster_fp)
2013static inline float overlay_op_rgbafp(
float dst,
float src,
float da,
float sa)
2015 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
2017 return 2 * src * dst + temp;
2019 return sa * da - 2 * (da - dst) * (sa - src) + temp;
2022template <
typename T>
2023static inline void comp_func_solid_Overlay_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2025 float sa = color.alpha();
2026 float sr = color.red();
2027 float sg = color.green();
2028 float sb = color.blue();
2030 for (
int i = 0; i < length; ++i) {
2031 QRgbaFloat32 d = dest[i];
2032 float da = d.alpha();
2034#define OP(a, b) overlay_op_rgbafp(a, b, da, sa)
2035 float r = OP( d.red(), sr);
2036 float b = OP( d.blue(), sb);
2037 float g = OP(d.green(), sg);
2038 float a = mix_alpha_rgbafp(da, sa);
2041 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2045void QT_FASTCALL comp_func_solid_Overlay_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2047 if (const_alpha == 255)
2048 comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
2050 comp_func_solid_Overlay_impl(dest, length, color, QPartialCoverage(const_alpha));
2054template <
typename T>
2057 for (
int i = 0; i < length; ++i) {
2064#define OP(a, b) overlay_op(a, b, da, sa)
2065 int r =
OP( qRed(d), qRed(s));
2066 int b =
OP( qBlue(d), qBlue(s));
2067 int g =
OP(qGreen(d), qGreen(s));
2071 coverage.store(&dest[i], qRgba(r, g, b, a));
2077 if (const_alpha == 255)
2078 comp_func_Overlay_impl(dest, src, length, QFullCoverage());
2080 comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
2083#if QT_CONFIG(raster_64bit)
2084template <
typename T>
2085static inline void comp_func_Overlay_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2087 for (
int i = 0; i < length; ++i) {
2088 QRgba64 d = dest[i];
2091 uint da = d.alpha();
2092 uint sa = s.alpha();
2094#define OP(a, b) overlay_op_rgb64(a, b, da, sa)
2095 uint r = OP( d.red(), s.red());
2096 uint b = OP( d.blue(), s.blue());
2097 uint g = OP(d.green(), s.green());
2098 uint a = mix_alpha_rgb64(da, sa);
2101 coverage.store(&dest[i], qRgba64(r, g, b, a));
2105void QT_FASTCALL comp_func_Overlay_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2107 if (const_alpha == 255)
2108 comp_func_Overlay_impl(dest, src, length, QFullCoverage());
2110 comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
2114#if QT_CONFIG(raster_fp)
2115template <
typename T>
2116static inline void comp_func_Overlay_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2118 for (
int i = 0; i < length; ++i) {
2119 QRgbaFloat32 d = dest[i];
2120 QRgbaFloat32 s = src[i];
2122 float da = d.alpha();
2123 float sa = s.alpha();
2125#define OP(a, b) overlay_op_rgbafp(a, b, da, sa)
2126 float r = OP( d.red(), s.red());
2127 float b = OP( d.blue(), s.blue());
2128 float g = OP(d.green(), s.green());
2129 float a = mix_alpha_rgbafp(da, sa);
2132 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2136void QT_FASTCALL comp_func_Overlay_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2138 if (const_alpha == 255)
2139 comp_func_Overlay_impl(dest, src, length, QFullCoverage());
2141 comp_func_Overlay_impl(dest, src, length, QPartialCoverage(const_alpha));
2146
2147
2148
2149static inline int darken_op(
int dst,
int src,
int da,
int sa)
2151 return qt_div_255(qMin(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
2154template <
typename T>
2157 int sa = qAlpha(color);
2158 int sr = qRed(color);
2159 int sg = qGreen(color);
2160 int sb = qBlue(color);
2162 for (
int i = 0; i < length; ++i) {
2166#define OP(a, b) darken_op(a, b, da, sa)
2167 int r =
OP( qRed(d), sr);
2168 int b =
OP( qBlue(d), sb);
2169 int g =
OP(qGreen(d), sg);
2173 coverage.store(&dest[i], qRgba(r, g, b, a));
2177void QT_FASTCALL comp_func_solid_Darken(uint *dest,
int length, uint color, uint const_alpha)
2179 if (const_alpha == 255)
2180 comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
2182 comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
2185#if QT_CONFIG(raster_64bit)
2186static inline uint darken_op_rgb64(uint dst, uint src, uint da, uint sa)
2188 return qt_div_65535(qMin(src * da, dst * sa) + src * (65535U - da) + dst * (65535U - sa));
2191template <
typename T>
2192static inline void comp_func_solid_Darken_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
2194 uint sa = color.alpha();
2195 uint sr = color.red();
2196 uint sg = color.green();
2197 uint sb = color.blue();
2199 for (
int i = 0; i < length; ++i) {
2200 QRgba64 d = dest[i];
2201 uint da = d.alpha();
2203#define OP(a, b) darken_op_rgb64(a, b, da, sa)
2204 uint r = OP( d.red(), sr);
2205 uint b = OP( d.blue(), sb);
2206 uint g = OP(d.green(), sg);
2207 uint a = mix_alpha_rgb64(da, sa);
2210 coverage.store(&dest[i], qRgba64(r, g, b, a));
2214void QT_FASTCALL comp_func_solid_Darken_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2216 if (const_alpha == 255)
2217 comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
2219 comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
2223#if QT_CONFIG(raster_fp)
2224static inline float darken_op_rgbafp(
float dst,
float src,
float da,
float sa)
2226 return qMin(src * da, dst * sa) + src * (1.0f - da) + dst * (1.0f - sa);
2229template <
typename T>
2230static inline void comp_func_solid_Darken_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2232 float sa = color.alpha();
2233 float sr = color.red();
2234 float sg = color.green();
2235 float sb = color.blue();
2237 for (
int i = 0; i < length; ++i) {
2238 QRgbaFloat32 d = dest[i];
2239 float da = d.alpha();
2241#define OP(a, b) darken_op_rgbafp(a, b, da, sa)
2242 float r = OP( d.red(), sr);
2243 float b = OP( d.blue(), sb);
2244 float g = OP(d.green(), sg);
2245 float a = mix_alpha_rgbafp(da, sa);
2248 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2252void QT_FASTCALL comp_func_solid_Darken_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2254 if (const_alpha == 255)
2255 comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
2257 comp_func_solid_Darken_impl(dest, length, color, QPartialCoverage(const_alpha));
2261template <
typename T>
2264 for (
int i = 0; i < length; ++i) {
2271#define OP(a, b) darken_op(a, b, da, sa)
2272 int r =
OP( qRed(d), qRed(s));
2273 int b =
OP( qBlue(d), qBlue(s));
2274 int g =
OP(qGreen(d), qGreen(s));
2278 coverage.store(&dest[i], qRgba(r, g, b, a));
2284 if (const_alpha == 255)
2285 comp_func_Darken_impl(dest, src, length, QFullCoverage());
2287 comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
2290#if QT_CONFIG(raster_64bit)
2291template <
typename T>
2292static inline void comp_func_Darken_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2294 for (
int i = 0; i < length; ++i) {
2295 QRgba64 d = dest[i];
2298 uint da = d.alpha();
2299 uint sa = s.alpha();
2301#define OP(a, b) darken_op_rgb64(a, b, da, sa)
2302 uint r = OP( d.red(), s.red());
2303 uint b = OP( d.blue(), s.blue());
2304 uint g = OP(d.green(), s.green());
2305 uint a = mix_alpha_rgb64(da, sa);
2308 coverage.store(&dest[i], qRgba64(r, g, b, a));
2312void QT_FASTCALL comp_func_Darken_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2314 if (const_alpha == 255)
2315 comp_func_Darken_impl(dest, src, length, QFullCoverage());
2317 comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
2321#if QT_CONFIG(raster_fp)
2322template <
typename T>
2323static inline void comp_func_Darken_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2325 for (
int i = 0; i < length; ++i) {
2326 QRgbaFloat32 d = dest[i];
2327 QRgbaFloat32 s = src[i];
2329 float da = d.alpha();
2330 float sa = s.alpha();
2332#define OP(a, b) darken_op_rgbafp(a, b, da, sa)
2333 float r = OP( d.red(), s.red());
2334 float b = OP( d.blue(), s.blue());
2335 float g = OP(d.green(), s.green());
2336 float a = mix_alpha_rgbafp(da, sa);
2339 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2343void QT_FASTCALL comp_func_Darken_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2345 if (const_alpha == 255)
2346 comp_func_Darken_impl(dest, src, length, QFullCoverage());
2348 comp_func_Darken_impl(dest, src, length, QPartialCoverage(const_alpha));
2353
2354
2355
2358 return qt_div_255(qMax(src * da, dst * sa) + src * (255 - da) + dst * (255 - sa));
2361template <
typename T>
2364 int sa = qAlpha(color);
2365 int sr = qRed(color);
2366 int sg = qGreen(color);
2367 int sb = qBlue(color);
2369 for (
int i = 0; i < length; ++i) {
2373#define OP(a, b) lighten_op(a, b, da, sa)
2374 int r =
OP( qRed(d), sr);
2375 int b =
OP( qBlue(d), sb);
2376 int g =
OP(qGreen(d), sg);
2380 coverage.store(&dest[i], qRgba(r, g, b, a));
2384void QT_FASTCALL comp_func_solid_Lighten(uint *dest,
int length, uint color, uint const_alpha)
2386 if (const_alpha == 255)
2387 comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
2389 comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
2393#if QT_CONFIG(raster_64bit)
2394static inline uint lighten_op_rgb64(uint dst, uint src, uint da, uint sa)
2396 return qt_div_65535(qMax(src * da, dst * sa) + src * (65535U - da) + dst * (65535U - sa));
2399template <
typename T>
2400static inline void comp_func_solid_Lighten_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
2402 uint sa = color.alpha();
2403 uint sr = color.red();
2404 uint sg = color.green();
2405 uint sb = color.blue();
2407 for (
int i = 0; i < length; ++i) {
2408 QRgba64 d = dest[i];
2409 uint da = d.alpha();
2411#define OP(a, b) lighten_op_rgb64(a, b, da, sa)
2412 uint r = OP( d.red(), sr);
2413 uint b = OP( d.blue(), sb);
2414 uint g = OP(d.green(), sg);
2415 uint a = mix_alpha_rgb64(da, sa);
2418 coverage.store(&dest[i], qRgba64(r, g, b, a));
2422void QT_FASTCALL comp_func_solid_Lighten_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2424 if (const_alpha == 255)
2425 comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
2427 comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
2431#if QT_CONFIG(raster_fp)
2432static inline float lighten_op_rgbafp(
float dst,
float src,
float da,
float sa)
2434 return qMax(src * da, dst * sa) + src * (1.0f - da) + dst * (1.0f - sa);
2437template <
typename T>
2438static inline void comp_func_solid_Lighten_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2440 float sa = color.alpha();
2441 float sr = color.red();
2442 float sg = color.green();
2443 float sb = color.blue();
2445 for (
int i = 0; i < length; ++i) {
2446 QRgbaFloat32 d = dest[i];
2447 float da = d.alpha();
2449#define OP(a, b) lighten_op_rgbafp(a, b, da, sa)
2450 float r = OP( d.red(), sr);
2451 float b = OP( d.blue(), sb);
2452 float g = OP(d.green(), sg);
2453 float a = mix_alpha_rgbafp(da, sa);
2456 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2460void QT_FASTCALL comp_func_solid_Lighten_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2462 if (const_alpha == 255)
2463 comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
2465 comp_func_solid_Lighten_impl(dest, length, color, QPartialCoverage(const_alpha));
2469template <
typename T>
2472 for (
int i = 0; i < length; ++i) {
2479#define OP(a, b) lighten_op(a, b, da, sa)
2480 int r =
OP( qRed(d), qRed(s));
2481 int b =
OP( qBlue(d), qBlue(s));
2482 int g =
OP(qGreen(d), qGreen(s));
2486 coverage.store(&dest[i], qRgba(r, g, b, a));
2492 if (const_alpha == 255)
2493 comp_func_Lighten_impl(dest, src, length, QFullCoverage());
2495 comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
2498#if QT_CONFIG(raster_64bit)
2499template <
typename T>
2500static inline void comp_func_Lighten_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2502 for (
int i = 0; i < length; ++i) {
2503 QRgba64 d = dest[i];
2506 uint da = d.alpha();
2507 uint sa = s.alpha();
2509#define OP(a, b) lighten_op_rgb64(a, b, da, sa)
2510 uint r = OP( d.red(), s.red());
2511 uint b = OP( d.blue(), s.blue());
2512 uint g = OP(d.green(), s.green());
2513 uint a = mix_alpha_rgb64(da, sa);
2516 coverage.store(&dest[i], qRgba64(r, g, b, a));
2520void QT_FASTCALL comp_func_Lighten_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2522 if (const_alpha == 255)
2523 comp_func_Lighten_impl(dest, src, length, QFullCoverage());
2525 comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
2529#if QT_CONFIG(raster_fp)
2530template <
typename T>
2531static inline void comp_func_Lighten_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2533 for (
int i = 0; i < length; ++i) {
2534 QRgbaFloat32 d = dest[i];
2535 QRgbaFloat32 s = src[i];
2537 float da = d.alpha();
2538 float sa = s.alpha();
2540#define OP(a, b) lighten_op_rgbafp(a, b, da, sa)
2541 float r = OP( d.red(), s.red());
2542 float b = OP( d.blue(), s.blue());
2543 float g = OP(d.green(), s.green());
2544 float a = mix_alpha_rgbafp(da, sa);
2547 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2551void QT_FASTCALL comp_func_Lighten_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2553 if (const_alpha == 255)
2554 comp_func_Lighten_impl(dest, src, length, QFullCoverage());
2556 comp_func_Lighten_impl(dest, src, length, QPartialCoverage(const_alpha));
2561
2562
2563
2564
2565
2566
2567
2570 const int sa_da = sa * da;
2571 const int dst_sa = dst * sa;
2572 const int src_da = src * da;
2574 const int temp = src * (255 - da) + dst * (255 - sa);
2575 if (src_da + dst_sa > sa_da)
2577 else if (src == sa || sa == 0)
2580 return qt_div_255(255 * dst_sa / (255 - 255 * src / sa) + temp
);
2583template <
typename T>
2586 int sa = qAlpha(color);
2587 int sr = qRed(color);
2588 int sg = qGreen(color);
2589 int sb = qBlue(color);
2591 for (
int i = 0; i < length; ++i) {
2595#define OP(a,b) color_dodge_op(a, b, da, sa)
2596 int r =
OP( qRed(d), sr);
2597 int b =
OP( qBlue(d), sb);
2598 int g =
OP(qGreen(d), sg);
2602 coverage.store(&dest[i], qRgba(r, g, b, a));
2606void QT_FASTCALL comp_func_solid_ColorDodge(uint *dest,
int length, uint color, uint const_alpha)
2608 if (const_alpha == 255)
2609 comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
2611 comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
2614#if QT_CONFIG(raster_64bit)
2615static inline uint color_dodge_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
2617 const qint64 sa_da = sa * da;
2618 const qint64 dst_sa = dst * sa;
2619 const qint64 src_da = src * da;
2621 const qint64 temp = src * (65535U - da) + dst * (65535U - sa);
2622 if (src_da + dst_sa > sa_da)
2623 return qt_div_65535(sa_da + temp);
2624 else if (src == sa || sa == 0)
2625 return qt_div_65535(temp);
2627 return qt_div_65535(65535U * dst_sa / (65535U - 65535U * src / sa) + temp);
2630template <
typename T>
2631static inline void comp_func_solid_ColorDodge_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
2633 uint sa = color.alpha();
2634 uint sr = color.red();
2635 uint sg = color.green();
2636 uint sb = color.blue();
2638 for (
int i = 0; i < length; ++i) {
2639 QRgba64 d = dest[i];
2640 uint da = d.alpha();
2642#define OP(a,b) color_dodge_op_rgb64(a, b, da, sa)
2643 uint r = OP( d.red(), sr);
2644 uint b = OP( d.blue(), sb);
2645 uint g = OP(d.green(), sg);
2646 uint a = mix_alpha_rgb64(da, sa);
2649 coverage.store(&dest[i], qRgba64(r, g, b, a));
2653void QT_FASTCALL comp_func_solid_ColorDodge_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2655 if (const_alpha == 255)
2656 comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
2658 comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
2662#if QT_CONFIG(raster_fp)
2663static inline float color_dodge_op_rgbafp(
float dst,
float src,
float da,
float sa)
2665 const float sa_da = sa * da;
2666 const float dst_sa = dst * sa;
2667 const float src_da = src * da;
2669 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
2670 if (src_da + dst_sa > sa_da)
2671 return sa_da + temp;
2672 else if (src == sa || sa == 0.0f)
2675 return dst_sa / (1.0f - src / sa) + temp;
2678template <
typename T>
2679static inline void comp_func_solid_ColorDodge_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2681 float sa = color.alpha();
2682 float sr = color.red();
2683 float sg = color.green();
2684 float sb = color.blue();
2686 for (
int i = 0; i < length; ++i) {
2687 QRgbaFloat32 d = dest[i];
2688 float da = d.alpha();
2690#define OP(a,b) color_dodge_op_rgbafp(a, b, da, sa)
2691 float r = OP( d.red(), sr);
2692 float b = OP( d.blue(), sb);
2693 float g = OP(d.green(), sg);
2694 float a = mix_alpha_rgbafp(da, sa);
2697 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2701void QT_FASTCALL comp_func_solid_ColorDodge_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2703 if (const_alpha == 255)
2704 comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
2706 comp_func_solid_ColorDodge_impl(dest, length, color, QPartialCoverage(const_alpha));
2710template <
typename T>
2713 for (
int i = 0; i < length; ++i) {
2720#define OP(a, b) color_dodge_op(a, b, da, sa)
2721 int r =
OP( qRed(d), qRed(s));
2722 int b =
OP( qBlue(d), qBlue(s));
2723 int g =
OP(qGreen(d), qGreen(s));
2727 coverage.store(&dest[i], qRgba(r, g, b, a));
2733 if (const_alpha == 255)
2734 comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
2736 comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
2739#if QT_CONFIG(raster_64bit)
2740template <
typename T>
2741static inline void comp_func_ColorDodge_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2743 for (
int i = 0; i < length; ++i) {
2744 QRgba64 d = dest[i];
2747 uint da = d.alpha();
2748 uint sa = s.alpha();
2750#define OP(a, b) color_dodge_op_rgb64(a, b, da, sa)
2751 uint r = OP( d.red(), s.red());
2752 uint b = OP( d.blue(), s.blue());
2753 uint g = OP(d.green(), s.green());
2754 uint a = mix_alpha_rgb64(da, sa);
2757 coverage.store(&dest[i], qRgba64(r, g, b, a));
2761void QT_FASTCALL comp_func_ColorDodge_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2763 if (const_alpha == 255)
2764 comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
2766 comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
2770#if QT_CONFIG(raster_fp)
2771template <
typename T>
2772static inline void comp_func_ColorDodge_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2774 for (
int i = 0; i < length; ++i) {
2775 QRgbaFloat32 d = dest[i];
2776 QRgbaFloat32 s = src[i];
2778 float da = d.alpha();
2779 float sa = s.alpha();
2781#define OP(a, b) color_dodge_op_rgbafp(a, b, da, sa)
2782 float r = OP( d.red(), s.red());
2783 float b = OP( d.blue(), s.blue());
2784 float g = OP(d.green(), s.green());
2785 float a = mix_alpha_rgbafp(da, sa);
2788 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2792void QT_FASTCALL comp_func_ColorDodge_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
2794 if (const_alpha == 255)
2795 comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
2797 comp_func_ColorDodge_impl(dest, src, length, QPartialCoverage(const_alpha));
2802
2803
2804
2805
2806
2807
2808
2811 const int src_da = src * da;
2812 const int dst_sa = dst * sa;
2813 const int sa_da = sa * da;
2815 const int temp = src * (255 - da) + dst * (255 - sa);
2817 if (src_da + dst_sa < sa_da)
2821 return qt_div_255(sa * (src_da + dst_sa - sa_da) / src + temp
);
2824template <
typename T>
2827 int sa = qAlpha(color);
2828 int sr = qRed(color);
2829 int sg = qGreen(color);
2830 int sb = qBlue(color);
2832 for (
int i = 0; i < length; ++i) {
2836#define OP(a, b) color_burn_op(a, b, da, sa)
2837 int r =
OP( qRed(d), sr);
2838 int b =
OP( qBlue(d), sb);
2839 int g =
OP(qGreen(d), sg);
2843 coverage.store(&dest[i], qRgba(r, g, b, a));
2847void QT_FASTCALL comp_func_solid_ColorBurn(uint *dest,
int length, uint color, uint const_alpha)
2849 if (const_alpha == 255)
2850 comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
2852 comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
2855#if QT_CONFIG(raster_64bit)
2856static inline uint color_burn_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
2858 const qint64 src_da = src * da;
2859 const qint64 dst_sa = dst * sa;
2860 const qint64 sa_da = sa * da;
2862 const qint64 temp = src * (65535U - da) + dst * (65535U - sa);
2864 if (src_da + dst_sa < sa_da)
2865 return qt_div_65535(temp);
2867 return qt_div_65535(dst_sa + temp);
2868 return qt_div_65535(sa * (src_da + dst_sa - sa_da) / src + temp);
2871template <
typename T>
2872static inline void comp_func_solid_ColorBurn_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
2874 uint sa = color.alpha();
2875 uint sr = color.red();
2876 uint sg = color.green();
2877 uint sb = color.blue();
2879 for (
int i = 0; i < length; ++i) {
2880 QRgba64 d = dest[i];
2881 uint da = d.alpha();
2883#define OP(a, b) color_burn_op_rgb64(a, b, da, sa)
2884 uint r = OP( d.red(), sr);
2885 uint b = OP( d.blue(), sb);
2886 uint g = OP(d.green(), sg);
2887 uint a = mix_alpha_rgb64(da, sa);
2890 coverage.store(&dest[i], qRgba64(r, g, b, a));
2894void QT_FASTCALL comp_func_solid_ColorBurn_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
2896 if (const_alpha == 255)
2897 comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
2899 comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
2903#if QT_CONFIG(raster_fp)
2904static inline float color_burn_op_rgbafp(
float dst,
float src,
float da,
float sa)
2906 const float src_da = src * da;
2907 const float dst_sa = dst * sa;
2908 const float sa_da = sa * da;
2910 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
2912 if (src_da + dst_sa < sa_da)
2915 return dst_sa + temp;
2916 return sa * (src_da + dst_sa - sa_da) / src + temp;
2919template <
typename T>
2920static inline void comp_func_solid_ColorBurn_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
2922 float sa = color.alpha();
2923 float sr = color.red();
2924 float sg = color.green();
2925 float sb = color.blue();
2927 for (
int i = 0; i < length; ++i) {
2928 QRgbaFloat32 d = dest[i];
2929 float da = d.alpha();
2931#define OP(a, b) color_burn_op_rgbafp(a, b, da, sa)
2932 float r = OP( d.red(), sr);
2933 float b = OP( d.blue(), sb);
2934 float g = OP(d.green(), sg);
2935 float a = mix_alpha_rgbafp(da, sa);
2938 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
2942void QT_FASTCALL comp_func_solid_ColorBurn_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
2944 if (const_alpha == 255)
2945 comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
2947 comp_func_solid_ColorBurn_impl(dest, length, color, QPartialCoverage(const_alpha));
2951template <
typename T>
2954 for (
int i = 0; i < length; ++i) {
2961#define OP(a, b) color_burn_op(a, b, da, sa)
2962 int r =
OP( qRed(d), qRed(s));
2963 int b =
OP( qBlue(d), qBlue(s));
2964 int g =
OP(qGreen(d), qGreen(s));
2968 coverage.store(&dest[i], qRgba(r, g, b, a));
2974 if (const_alpha == 255)
2975 comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
2977 comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
2980#if QT_CONFIG(raster_64bit)
2981template <
typename T>
2982static inline void comp_func_ColorBurn_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
2984 for (
int i = 0; i < length; ++i) {
2985 QRgba64 d = dest[i];
2988 uint da = d.alpha();
2989 uint sa = s.alpha();
2991#define OP(a, b) color_burn_op_rgb64(a, b, da, sa)
2992 uint r = OP( d.red(), s.red());
2993 uint b = OP( d.blue(), s.blue());
2994 uint g = OP(d.green(), s.green());
2995 uint a = mix_alpha_rgb64(da, sa);
2998 coverage.store(&dest[i], qRgba64(r, g, b, a));
3002void QT_FASTCALL comp_func_ColorBurn_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3004 if (const_alpha == 255)
3005 comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
3007 comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
3011#if QT_CONFIG(raster_fp)
3012template <
typename T>
3013static inline void comp_func_ColorBurn_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3015 for (
int i = 0; i < length; ++i) {
3016 QRgbaFloat32 d = dest[i];
3017 QRgbaFloat32 s = src[i];
3019 float da = d.alpha();
3020 float sa = s.alpha();
3022#define OP(a, b) color_burn_op_rgbafp(a, b, da, sa)
3023 float r = OP( d.red(), s.red());
3024 float b = OP( d.blue(), s.blue());
3025 float g = OP(d.green(), s.green());
3026 float a = mix_alpha_rgbafp(da, sa);
3029 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3033void QT_FASTCALL comp_func_ColorBurn_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3035 if (const_alpha == 255)
3036 comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
3038 comp_func_ColorBurn_impl(dest, src, length, QPartialCoverage(const_alpha));
3043
3044
3045
3046
3047
3050 const uint temp = src * (255 - da) + dst * (255 - sa);
3055 return qt_div_255(sa * da - 2 * (da - dst) * (sa - src) + temp
);
3058template <
typename T>
3061 int sa = qAlpha(color);
3062 int sr = qRed(color);
3063 int sg = qGreen(color);
3064 int sb = qBlue(color);
3066 for (
int i = 0; i < length; ++i) {
3070#define OP(a, b) hardlight_op(a, b, da, sa)
3071 int r =
OP( qRed(d), sr);
3072 int b =
OP( qBlue(d), sb);
3073 int g =
OP(qGreen(d), sg);
3077 coverage.store(&dest[i], qRgba(r, g, b, a));
3081void QT_FASTCALL comp_func_solid_HardLight(uint *dest,
int length, uint color, uint const_alpha)
3083 if (const_alpha == 255)
3084 comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
3086 comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3089#if QT_CONFIG(raster_64bit)
3090static inline uint hardlight_op_rgb64(uint dst, uint src, uint da, uint sa)
3092 const uint temp = src * (65535U - da) + dst * (65535U - sa);
3095 return qt_div_65535(2 * src * dst + temp);
3097 return qt_div_65535(sa * da - 2 * (da - dst) * (sa - src) + temp);
3100template <
typename T>
3101static inline void comp_func_solid_HardLight_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
3103 uint sa = color.alpha();
3104 uint sr = color.red();
3105 uint sg = color.green();
3106 uint sb = color.blue();
3108 for (
int i = 0; i < length; ++i) {
3109 QRgba64 d = dest[i];
3110 uint da = d.alpha();
3112#define OP(a, b) hardlight_op_rgb64(a, b, da, sa)
3113 uint r = OP( d.red(), sr);
3114 uint b = OP( d.blue(), sb);
3115 uint g = OP(d.green(), sg);
3116 uint a = mix_alpha_rgb64(da, sa);
3119 coverage.store(&dest[i], qRgba64(r, g, b, a));
3123void QT_FASTCALL comp_func_solid_HardLight_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
3125 if (const_alpha == 255)
3126 comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
3128 comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3132#if QT_CONFIG(raster_fp)
3133static inline float hardlight_op_rgbafp(
float dst,
float src,
float da,
float sa)
3135 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
3138 return 2 * src * dst + temp;
3140 return sa * da - 2 * (da - dst) * (sa - src) + temp;
3143template <
typename T>
3144static inline void comp_func_solid_HardLight_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
3146 float sa = color.alpha();
3147 float sr = color.red();
3148 float sg = color.green();
3149 float sb = color.blue();
3151 for (
int i = 0; i < length; ++i) {
3152 QRgbaFloat32 d = dest[i];
3153 float da = d.alpha();
3155#define OP(a, b) hardlight_op_rgbafp(a, b, da, sa)
3156 float r = OP( d.red(), sr);
3157 float b = OP( d.blue(), sb);
3158 float g = OP(d.green(), sg);
3159 float a = mix_alpha_rgbafp(da, sa);
3162 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3166void QT_FASTCALL comp_func_solid_HardLight_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
3168 if (const_alpha == 255)
3169 comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
3171 comp_func_solid_HardLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3175template <
typename T>
3178 for (
int i = 0; i < length; ++i) {
3185#define OP(a, b) hardlight_op(a, b, da, sa)
3186 int r =
OP( qRed(d), qRed(s));
3187 int b =
OP( qBlue(d), qBlue(s));
3188 int g =
OP(qGreen(d), qGreen(s));
3192 coverage.store(&dest[i], qRgba(r, g, b, a));
3198 if (const_alpha == 255)
3199 comp_func_HardLight_impl(dest, src, length, QFullCoverage());
3201 comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3204#if QT_CONFIG(raster_64bit)
3205template <
typename T>
3206static inline void comp_func_HardLight_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3208 for (
int i = 0; i < length; ++i) {
3209 QRgba64 d = dest[i];
3212 uint da = d.alpha();
3213 uint sa = s.alpha();
3215#define OP(a, b) hardlight_op_rgb64(a, b, da, sa)
3216 uint r = OP( d.red(), s.red());
3217 uint b = OP( d.blue(), s.blue());
3218 uint g = OP(d.green(), s.green());
3219 uint a = mix_alpha_rgb64(da, sa);
3222 coverage.store(&dest[i], qRgba64(r, g, b, a));
3226void QT_FASTCALL comp_func_HardLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3228 if (const_alpha == 255)
3229 comp_func_HardLight_impl(dest, src, length, QFullCoverage());
3231 comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3235#if QT_CONFIG(raster_fp)
3236template <
typename T>
3237static inline void comp_func_HardLight_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3239 for (
int i = 0; i < length; ++i) {
3240 QRgbaFloat32 d = dest[i];
3241 QRgbaFloat32 s = src[i];
3243 float da = d.alpha();
3244 float sa = s.alpha();
3246#define OP(a, b) hardlight_op_rgbafp(a, b, da, sa)
3247 float r = OP( d.red(), s.red());
3248 float b = OP( d.blue(), s.blue());
3249 float g = OP(d.green(), s.green());
3250 float a = mix_alpha_rgbafp(da, sa);
3253 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3257void QT_FASTCALL comp_func_HardLight_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3259 if (const_alpha == 255)
3260 comp_func_HardLight_impl(dest, src, length, QFullCoverage());
3262 comp_func_HardLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3267
3268
3269
3270
3271
3272
3273
3276 const int src2 = src << 1;
3277 const int dst_np = da != 0 ? (255 * dst) / da : 0;
3278 const int temp = (src * (255 - da) + dst * (255 - sa)) * 255;
3281 return (dst * (sa * 255 + (src2 - sa) * (255 - dst_np)) + temp) / 65025;
3282 else if (4 * dst <= da)
3283 return (dst * sa * 255 + da * (src2 - sa) * ((((16 * dst_np - 12 * 255) * dst_np + 3 * 65025) * dst_np) / 65025) + temp) / 65025;
3285 return (dst * sa * 255 + da * (src2 - sa) * (
int(qSqrt(qreal(dst_np * 255))) - dst_np) + temp) / 65025;
3289template <
typename T>
3292 int sa = qAlpha(color);
3293 int sr = qRed(color);
3294 int sg = qGreen(color);
3295 int sb = qBlue(color);
3297 for (
int i = 0; i < length; ++i) {
3301#define OP(a, b) soft_light_op(a, b, da, sa)
3302 int r =
OP( qRed(d), sr);
3303 int b =
OP( qBlue(d), sb);
3304 int g =
OP(qGreen(d), sg);
3308 coverage.store(&dest[i], qRgba(r, g, b, a));
3312void QT_FASTCALL comp_func_solid_SoftLight(uint *dest,
int length, uint color, uint const_alpha)
3314 if (const_alpha == 255)
3315 comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
3317 comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3320#if QT_CONFIG(raster_64bit)
3321static inline uint soft_light_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
3323 const qint64 src2 = src << 1;
3324 const qint64 dst_np = da != 0 ? (65535U * dst) / da : 0;
3325 const qint64 temp = (src * (65535U - da) + dst * (65535U - sa)) * 65535U;
3326 const qint64 factor = Q_UINT64_C(65535) * 65535U;
3329 return (dst * (sa * 65535U + (src2 - sa) * (65535U - dst_np)) + temp) / factor;
3330 else if (4 * dst <= da)
3331 return (dst * sa * 65535U + da * (src2 - sa) * ((((16 * dst_np - 12 * 65535U) * dst_np + 3 * factor) * dst_np) / factor) + temp) / factor;
3333 return (dst * sa * 65535U + da * (src2 - sa) * (
int(qSqrt(qreal(dst_np * 65535U))) - dst_np) + temp) / factor;
3337template <
typename T>
3338static inline void comp_func_solid_SoftLight_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
3340 uint sa = color.alpha();
3341 uint sr = color.red();
3342 uint sg = color.green();
3343 uint sb = color.blue();
3345 for (
int i = 0; i < length; ++i) {
3346 QRgba64 d = dest[i];
3347 uint da = d.alpha();
3349#define OP(a, b) soft_light_op_rgb64(a, b, da, sa)
3350 uint r = OP( d.red(), sr);
3351 uint b = OP( d.blue(), sb);
3352 uint g = OP(d.green(), sg);
3353 uint a = mix_alpha_rgb64(da, sa);
3356 coverage.store(&dest[i], qRgba64(r, g, b, a));
3360void QT_FASTCALL comp_func_solid_SoftLight_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
3362 if (const_alpha == 255)
3363 comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
3365 comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3370#if QT_CONFIG(raster_fp)
3371static inline float soft_light_op_rgbafp(
float dst,
float src,
float da,
float sa)
3373 const float src2 = src * 2;
3374 const float dst_np = da != 0.0f ? (dst / da) : 0.0f;
3375 const float temp = src * (1.0f - da) + dst * (1.0f - sa);
3378 return dst * (sa + (src2 - sa) * (1.0f - dst_np)) + temp;
3379 else if (4 * dst <= da)
3380 return dst * sa + da * (src2 - sa) * (((16 * dst_np - 12) * dst_np + 3) * dst_np) + temp;
3382 return dst * sa + da * (src2 - sa) * (qSqrt(qreal(dst_np)) - dst_np) + temp;
3386template <
typename T>
3387static inline void comp_func_solid_SoftLight_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
3389 float sa = color.alpha();
3390 float sr = color.red();
3391 float sg = color.green();
3392 float sb = color.blue();
3394 for (
int i = 0; i < length; ++i) {
3395 QRgbaFloat32 d = dest[i];
3396 float da = d.alpha();
3398#define OP(a, b) soft_light_op_rgbafp(a, b, da, sa)
3399 float r = OP( d.red(), sr);
3400 float b = OP( d.blue(), sb);
3401 float g = OP(d.green(), sg);
3402 float a = mix_alpha_rgbafp(da, sa);
3405 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3409void QT_FASTCALL comp_func_solid_SoftLight_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
3411 if (const_alpha == 255)
3412 comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
3414 comp_func_solid_SoftLight_impl(dest, length, color, QPartialCoverage(const_alpha));
3418template <
typename T>
3421 for (
int i = 0; i < length; ++i) {
3428#define OP(a, b) soft_light_op(a, b, da, sa)
3429 int r =
OP( qRed(d), qRed(s));
3430 int b =
OP( qBlue(d), qBlue(s));
3431 int g =
OP(qGreen(d), qGreen(s));
3435 coverage.store(&dest[i], qRgba(r, g, b, a));
3441 if (const_alpha == 255)
3442 comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
3444 comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3447#if QT_CONFIG(raster_64bit)
3448template <
typename T>
3449static inline void comp_func_SoftLight_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3451 for (
int i = 0; i < length; ++i) {
3452 QRgba64 d = dest[i];
3455 uint da = d.alpha();
3456 uint sa = s.alpha();
3458#define OP(a, b) soft_light_op_rgb64(a, b, da, sa)
3459 uint r = OP( d.red(), s.red());
3460 uint b = OP( d.blue(), s.blue());
3461 uint g = OP(d.green(), s.green());
3462 uint a = mix_alpha_rgb64(da, sa);
3465 coverage.store(&dest[i], qRgba64(r, g, b, a));
3469void QT_FASTCALL comp_func_SoftLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3471 if (const_alpha == 255)
3472 comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
3474 comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3478#if QT_CONFIG(raster_fp)
3479template <
typename T>
3480static inline void comp_func_SoftLight_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3482 for (
int i = 0; i < length; ++i) {
3483 QRgbaFloat32 d = dest[i];
3484 QRgbaFloat32 s = src[i];
3486 float da = d.alpha();
3487 float sa = s.alpha();
3489#define OP(a, b) soft_light_op_rgbafp(a, b, da, sa)
3490 float r = OP( d.red(), s.red());
3491 float b = OP( d.blue(), s.blue());
3492 float g = OP(d.green(), s.green());
3493 float a = mix_alpha_rgbafp(da, sa);
3496 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3500void QT_FASTCALL comp_func_SoftLight_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3502 if (const_alpha == 255)
3503 comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
3505 comp_func_SoftLight_impl(dest, src, length, QPartialCoverage(const_alpha));
3510
3511
3512
3515 return src + dst - qt_div_255(2 * qMin(src * da, dst * sa));
3518template <
typename T>
3521 int sa = qAlpha(color);
3522 int sr = qRed(color);
3523 int sg = qGreen(color);
3524 int sb = qBlue(color);
3526 for (
int i = 0; i < length; ++i) {
3530#define OP(a, b) difference_op(a, b, da, sa)
3531 int r =
OP( qRed(d), sr);
3532 int b =
OP( qBlue(d), sb);
3533 int g =
OP(qGreen(d), sg);
3537 coverage.store(&dest[i], qRgba(r, g, b, a));
3541void QT_FASTCALL comp_func_solid_Difference(uint *dest,
int length, uint color, uint const_alpha)
3543 if (const_alpha == 255)
3544 comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
3546 comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
3549#if QT_CONFIG(raster_64bit)
3550static inline uint difference_op_rgb64(qint64 dst, qint64 src, qint64 da, qint64 sa)
3552 return src + dst - qt_div_65535(2 * qMin(src * da, dst * sa));
3555template <
typename T>
3556static inline void comp_func_solid_Difference_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
3558 uint sa = color.alpha();
3559 uint sr = color.red();
3560 uint sg = color.green();
3561 uint sb = color.blue();
3563 for (
int i = 0; i < length; ++i) {
3564 QRgba64 d = dest[i];
3565 uint da = d.alpha();
3567#define OP(a, b) difference_op_rgb64(a, b, da, sa)
3568 uint r = OP( d.red(), sr);
3569 uint b = OP( d.blue(), sb);
3570 uint g = OP(d.green(), sg);
3571 uint a = mix_alpha_rgb64(da, sa);
3574 coverage.store(&dest[i], qRgba64(r, g, b, a));
3578void QT_FASTCALL comp_func_solid_Difference_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
3580 if (const_alpha == 255)
3581 comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
3583 comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
3587#if QT_CONFIG(raster_fp)
3588static inline float difference_op_rgbafp(
float dst,
float src,
float da,
float sa)
3590 return src + dst - (2 * qMin(src * da, dst * sa));
3593template <
typename T>
3594static inline void comp_func_solid_Difference_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
3596 float sa = color.alpha();
3597 float sr = color.red();
3598 float sg = color.green();
3599 float sb = color.blue();
3601 for (
int i = 0; i < length; ++i) {
3602 QRgbaFloat32 d = dest[i];
3603 float da = d.alpha();
3605#define OP(a, b) difference_op_rgbafp(a, b, da, sa)
3606 float r = OP( d.red(), sr);
3607 float b = OP( d.blue(), sb);
3608 float g = OP(d.green(), sg);
3609 float a = mix_alpha_rgbafp(da, sa);
3612 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3616void QT_FASTCALL comp_func_solid_Difference_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
3618 if (const_alpha == 255)
3619 comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
3621 comp_func_solid_Difference_impl(dest, length, color, QPartialCoverage(const_alpha));
3625template <
typename T>
3628 for (
int i = 0; i < length; ++i) {
3635#define OP(a, b) difference_op(a, b, da, sa)
3636 int r =
OP( qRed(d), qRed(s));
3637 int b =
OP( qBlue(d), qBlue(s));
3638 int g =
OP(qGreen(d), qGreen(s));
3642 coverage.store(&dest[i], qRgba(r, g, b, a));
3648 if (const_alpha == 255)
3649 comp_func_Difference_impl(dest, src, length, QFullCoverage());
3651 comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
3654#if QT_CONFIG(raster_64bit)
3655template <
typename T>
3656static inline void comp_func_Difference_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3658 for (
int i = 0; i < length; ++i) {
3659 QRgba64 d = dest[i];
3662 uint da = d.alpha();
3663 uint sa = s.alpha();
3665#define OP(a, b) difference_op_rgb64(a, b, da, sa)
3666 uint r = OP( d.red(), s.red());
3667 uint b = OP( d.blue(), s.blue());
3668 uint g = OP(d.green(), s.green());
3669 uint a = mix_alpha_rgb64(da, sa);
3672 coverage.store(&dest[i], qRgba64(r, g, b, a));
3676void QT_FASTCALL comp_func_Difference_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3678 if (const_alpha == 255)
3679 comp_func_Difference_impl(dest, src, length, QFullCoverage());
3681 comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
3685#if QT_CONFIG(raster_fp)
3686template <
typename T>
3687static inline void comp_func_Difference_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3689 for (
int i = 0; i < length; ++i) {
3690 QRgbaFloat32 d = dest[i];
3691 QRgbaFloat32 s = src[i];
3693 float da = d.alpha();
3694 float sa = s.alpha();
3696#define OP(a, b) difference_op_rgbafp(a, b, da, sa)
3697 float r = OP( d.red(), s.red());
3698 float b = OP( d.blue(), s.blue());
3699 float g = OP(d.green(), s.green());
3700 float a = mix_alpha_rgbafp(da, sa);
3703 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3707void QT_FASTCALL comp_func_Difference_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3709 if (const_alpha == 255)
3710 comp_func_Difference_impl(dest, src, length, QFullCoverage());
3712 comp_func_Difference_impl(dest, src, length, QPartialCoverage(const_alpha));
3717
3718
3719template <
typename T>
3720static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(uint *dest,
int length, uint color,
const T &coverage)
3722 int sa = qAlpha(color);
3723 int sr = qRed(color);
3724 int sg = qGreen(color);
3725 int sb = qBlue(color);
3727 for (
int i = 0; i < length; ++i) {
3731#define OP(a, b) (a + b - qt_div_255(2
*(a*b)))
3732 int r =
OP( qRed(d), sr);
3733 int b =
OP( qBlue(d), sb);
3734 int g =
OP(qGreen(d), sg);
3735 int a = mix_alpha(da, sa);
3738 coverage.store(&dest[i], qRgba(r, g, b, a));
3742void QT_FASTCALL comp_func_solid_Exclusion(uint *dest,
int length, uint color, uint const_alpha)
3744 if (const_alpha == 255)
3745 comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
3747 comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
3750#if QT_CONFIG(raster_64bit)
3751template <
typename T>
3752static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgba64 *dest,
int length, QRgba64 color,
const T &coverage)
3754 uint sa = color.alpha();
3755 uint sr = color.red();
3756 uint sg = color.green();
3757 uint sb = color.blue();
3759 for (
int i = 0; i < length; ++i) {
3760 QRgba64 d = dest[i];
3761 uint da = d.alpha();
3763#define OP(a, b) (a + b - qt_div_65535(2
*(qint64(a)*b)))
3764 uint r = OP( d.red(), sr);
3765 uint b = OP( d.blue(), sb);
3766 uint g = OP(d.green(), sg);
3767 uint a = mix_alpha_rgb64(da, sa);
3770 coverage.store(&dest[i], qRgba64(r, g, b, a));
3774void QT_FASTCALL comp_func_solid_Exclusion_rgb64(QRgba64 *dest,
int length, QRgba64 color, uint const_alpha)
3776 if (const_alpha == 255)
3777 comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
3779 comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
3783#if QT_CONFIG(raster_fp)
3784template <
typename T>
3785static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color,
const T &coverage)
3787 float sa = color.alpha();
3788 float sr = color.red();
3789 float sg = color.green();
3790 float sb = color.blue();
3792 for (
int i = 0; i < length; ++i) {
3793 QRgbaFloat32 d = dest[i];
3794 float da = d.alpha();
3796#define OP(a, b) (a + b - (2.0f
* a * b))
3797 float r = OP( d.red(), sr);
3798 float b = OP( d.blue(), sb);
3799 float g = OP(d.green(), sg);
3800 float a = mix_alpha_rgbafp(da, sa);
3803 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3807void QT_FASTCALL comp_func_solid_Exclusion_rgbafp(QRgbaFloat32 *dest,
int length, QRgbaFloat32 color, uint const_alpha)
3809 if (const_alpha == 255)
3810 comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
3812 comp_func_solid_Exclusion_impl(dest, length, color, QPartialCoverage(const_alpha));
3816template <
typename T>
3819 for (
int i = 0; i < length; ++i) {
3826#define OP(a, b) (a + b - ((a*b) >> 7
))
3827 int r =
OP( qRed(d), qRed(s));
3828 int b =
OP( qBlue(d), qBlue(s));
3829 int g =
OP(qGreen(d), qGreen(s));
3833 coverage.store(&dest[i], qRgba(r, g, b, a));
3839 if (const_alpha == 255)
3840 comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
3842 comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
3845#if QT_CONFIG(raster_64bit)
3846template <
typename T>
3847static inline void comp_func_Exclusion_impl(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3849 for (
int i = 0; i < length; ++i) {
3850 QRgba64 d = dest[i];
3853 uint da = d.alpha();
3854 uint sa = s.alpha();
3856#define OP(a, b) (a + b - ((qint64(a)*b) >> 15
))
3857 uint r = OP( d.red(), s.red());
3858 uint b = OP( d.blue(), s.blue());
3859 uint g = OP(d.green(), s.green());
3860 uint a = mix_alpha_rgb64(da, sa);
3863 coverage.store(&dest[i], qRgba64(r, g, b, a));
3867void QT_FASTCALL comp_func_Exclusion_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
const QRgba64 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3869 if (const_alpha == 255)
3870 comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
3872 comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
3876#if QT_CONFIG(raster_fp)
3877template <
typename T>
3878static inline void comp_func_Exclusion_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length,
const T &coverage)
3880 for (
int i = 0; i < length; ++i) {
3881 QRgbaFloat32 d = dest[i];
3882 QRgbaFloat32 s = src[i];
3884 float da = d.alpha();
3885 float sa = s.alpha();
3887#define OP(a, b) (a + b - (2.0f
* a * b))
3888 float r = OP( d.red(), s.red());
3889 float b = OP( d.blue(), s.blue());
3890 float g = OP(d.green(), s.green());
3891 float a = mix_alpha_rgbafp(da, sa);
3894 coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
3898void QT_FASTCALL comp_func_Exclusion_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest,
const QRgbaFloat32 *Q_DECL_RESTRICT src,
int length, uint const_alpha)
3900 if (const_alpha == 255)
3901 comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
3903 comp_func_Exclusion_impl(dest, src, length, QPartialCoverage(const_alpha));
3912 Q_UNUSED(const_alpha);
3922 Q_UNUSED(const_alpha);
3932 Q_UNUSED(const_alpha);
3933 color |= 0xff000000;
3943 Q_UNUSED(const_alpha);
3945 *dest = (*src & *dest) | 0xff000000;
3955 Q_UNUSED(const_alpha);
3956 color &= 0x00ffffff;
3966 Q_UNUSED(const_alpha);
3968 *dest = (*src ^ *dest) | 0xff000000;
3978 Q_UNUSED(const_alpha);
3981 *dest = (color & ~(*dest)) | 0xff000000;
3991 Q_UNUSED(const_alpha);
3993 *dest = (~(*src) & ~(*dest)) | 0xff000000;
4003 Q_UNUSED(const_alpha);
4004 color = ~color | 0xff000000;
4006 *dest = color | ~(*dest);
4016 Q_UNUSED(const_alpha);
4018 *dest = ~(*src) | ~(*dest) | 0xff000000;
4028 Q_UNUSED(const_alpha);
4029 color = ~color & 0x00ffffff;
4031 *dest = color ^ (*dest);
4041 Q_UNUSED(const_alpha);
4043 *dest = ((~(*src)) ^ (*dest)) | 0xff000000;
4049 uint color, uint const_alpha)
4051 Q_UNUSED(const_alpha);
4052 qt_memfill(dest, ~color | 0xff000000, length);
4056 int length, uint const_alpha)
4058 Q_UNUSED(const_alpha);
4060 *dest++ = ~(*src++) | 0xff000000;
4068 Q_UNUSED(const_alpha);
4069 color = ~color | 0xff000000;
4071 *dest = color & *dest;
4081 Q_UNUSED(const_alpha);
4083 *dest = (~(*src) & *dest) | 0xff000000;
4093 Q_UNUSED(const_alpha);
4095 *dest = (color & ~(*dest)) | 0xff000000;
4105 Q_UNUSED(const_alpha);
4107 *dest = (*src & ~(*dest)) | 0xff000000;
4117 Q_UNUSED(const_alpha);
4119 *dest = (~(*src) | *dest) | 0xff000000;
4129 Q_UNUSED(const_alpha);
4130 color = ~color | 0xff000000;
4140 Q_UNUSED(const_alpha);
4142 *dest = (*src | ~(*dest)) | 0xff000000;
4152 Q_UNUSED(const_alpha);
4154 *dest = (color | ~(*dest)) | 0xff000000;
4165 comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);
4174 comp_func_solid_SourceOver (dest, length, 0xff000000, const_alpha);
4183 comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);
4192 comp_func_solid_SourceOver (dest, length, 0xffffffff, const_alpha);
4201 rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);
4210 rasterop_solid_SourceXorDestination (dest, length, 0x00ffffff, const_alpha);
4214 comp_func_solid_SourceOver,
4215 comp_func_solid_DestinationOver,
4216 comp_func_solid_Clear,
4217 comp_func_solid_Source,
4218 comp_func_solid_Destination,
4219 comp_func_solid_SourceIn,
4220 comp_func_solid_DestinationIn,
4221 comp_func_solid_SourceOut,
4222 comp_func_solid_DestinationOut,
4223 comp_func_solid_SourceAtop,
4224 comp_func_solid_DestinationAtop,
4225 comp_func_solid_XOR,
4226 comp_func_solid_Plus,
4227 comp_func_solid_Multiply,
4228 comp_func_solid_Screen,
4229 comp_func_solid_Overlay,
4230 comp_func_solid_Darken,
4231 comp_func_solid_Lighten,
4232 comp_func_solid_ColorDodge,
4233 comp_func_solid_ColorBurn,
4234 comp_func_solid_HardLight,
4235 comp_func_solid_SoftLight,
4236 comp_func_solid_Difference,
4237 comp_func_solid_Exclusion,
4238 rasterop_solid_SourceOrDestination,
4239 rasterop_solid_SourceAndDestination,
4240 rasterop_solid_SourceXorDestination,
4241 rasterop_solid_NotSourceAndNotDestination,
4242 rasterop_solid_NotSourceOrNotDestination,
4243 rasterop_solid_NotSourceXorDestination,
4244 rasterop_solid_NotSource,
4245 rasterop_solid_NotSourceAndDestination,
4246 rasterop_solid_SourceAndNotDestination,
4247 rasterop_solid_NotSourceOrDestination,
4248 rasterop_solid_SourceOrNotDestination,
4249 rasterop_solid_ClearDestination,
4250 rasterop_solid_SetDestination,
4251 rasterop_solid_NotDestination
4254static_assert(std::size(qt_functionForModeSolid_C) == QPainter::NCompositionModes);
4257#if QT_CONFIG(raster_64bit)
4258 comp_func_solid_SourceOver_rgb64,
4259 comp_func_solid_DestinationOver_rgb64,
4260 comp_func_solid_Clear_rgb64,
4261 comp_func_solid_Source_rgb64,
4262 comp_func_solid_Destination_rgb64,
4263 comp_func_solid_SourceIn_rgb64,
4264 comp_func_solid_DestinationIn_rgb64,
4265 comp_func_solid_SourceOut_rgb64,
4266 comp_func_solid_DestinationOut_rgb64,
4267 comp_func_solid_SourceAtop_rgb64,
4268 comp_func_solid_DestinationAtop_rgb64,
4269 comp_func_solid_XOR_rgb64,
4270 comp_func_solid_Plus_rgb64,
4271 comp_func_solid_Multiply_rgb64,
4272 comp_func_solid_Screen_rgb64,
4273 comp_func_solid_Overlay_rgb64,
4274 comp_func_solid_Darken_rgb64,
4275 comp_func_solid_Lighten_rgb64,
4276 comp_func_solid_ColorDodge_rgb64,
4277 comp_func_solid_ColorBurn_rgb64,
4278 comp_func_solid_HardLight_rgb64,
4279 comp_func_solid_SoftLight_rgb64,
4280 comp_func_solid_Difference_rgb64,
4281 comp_func_solid_Exclusion_rgb64,
4283 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4284 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4285 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4287 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4288 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
4291static_assert(std::size(qt_functionForModeSolid64_C) == QPainter::NCompositionModes);
4294#if QT_CONFIG(raster_fp)
4295 comp_func_solid_SourceOver_rgbafp,
4296 comp_func_solid_DestinationOver_rgbafp,
4297 comp_func_solid_Clear_rgbafp,
4298 comp_func_solid_Source_rgbafp,
4299 comp_func_solid_Destination_rgbafp,
4300 comp_func_solid_SourceIn_rgbafp,
4301 comp_func_solid_DestinationIn_rgbafp,
4302 comp_func_solid_SourceOut_rgbafp,
4303 comp_func_solid_DestinationOut_rgbafp,
4304 comp_func_solid_SourceAtop_rgbafp,
4305 comp_func_solid_DestinationAtop_rgbafp,
4306 comp_func_solid_XOR_rgbafp,
4307 comp_func_solid_Plus_rgbafp,
4308 comp_func_solid_Multiply_rgbafp,
4309 comp_func_solid_Screen_rgbafp,
4310 comp_func_solid_Overlay_rgbafp,
4311 comp_func_solid_Darken_rgbafp,
4312 comp_func_solid_Lighten_rgbafp,
4313 comp_func_solid_ColorDodge_rgbafp,
4314 comp_func_solid_ColorBurn_rgbafp,
4315 comp_func_solid_HardLight_rgbafp,
4316 comp_func_solid_SoftLight_rgbafp,
4317 comp_func_solid_Difference_rgbafp,
4318 comp_func_solid_Exclusion_rgbafp,
4320 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4321 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4323 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4324 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
4327static_assert(std::size(qt_functionForModeSolidFP_C) == QPainter::NCompositionModes);
4330 comp_func_SourceOver,
4331 comp_func_DestinationOver,
4334 comp_func_Destination,
4336 comp_func_DestinationIn,
4337 comp_func_SourceOut,
4338 comp_func_DestinationOut,
4339 comp_func_SourceAtop,
4340 comp_func_DestinationAtop,
4348 comp_func_ColorDodge,
4349 comp_func_ColorBurn,
4350 comp_func_HardLight,
4351 comp_func_SoftLight,
4352 comp_func_Difference,
4353 comp_func_Exclusion,
4354 rasterop_SourceOrDestination,
4355 rasterop_SourceAndDestination,
4356 rasterop_SourceXorDestination,
4357 rasterop_NotSourceAndNotDestination,
4358 rasterop_NotSourceOrNotDestination,
4359 rasterop_NotSourceXorDestination,
4361 rasterop_NotSourceAndDestination,
4362 rasterop_SourceAndNotDestination,
4363 rasterop_NotSourceOrDestination,
4364 rasterop_SourceOrNotDestination,
4365 rasterop_ClearDestination,
4366 rasterop_SetDestination,
4367 rasterop_NotDestination
4370static_assert(std::size(qt_functionForMode_C) == QPainter::NCompositionModes);
4373#if QT_CONFIG(raster_64bit)
4374 comp_func_SourceOver_rgb64,
4375 comp_func_DestinationOver_rgb64,
4376 comp_func_Clear_rgb64,
4377 comp_func_Source_rgb64,
4378 comp_func_Destination_rgb64,
4379 comp_func_SourceIn_rgb64,
4380 comp_func_DestinationIn_rgb64,
4381 comp_func_SourceOut_rgb64,
4382 comp_func_DestinationOut_rgb64,
4383 comp_func_SourceAtop_rgb64,
4384 comp_func_DestinationAtop_rgb64,
4385 comp_func_XOR_rgb64,
4386 comp_func_Plus_rgb64,
4387 comp_func_Multiply_rgb64,
4388 comp_func_Screen_rgb64,
4389 comp_func_Overlay_rgb64,
4390 comp_func_Darken_rgb64,
4391 comp_func_Lighten_rgb64,
4392 comp_func_ColorDodge_rgb64,
4393 comp_func_ColorBurn_rgb64,
4394 comp_func_HardLight_rgb64,
4395 comp_func_SoftLight_rgb64,
4396 comp_func_Difference_rgb64,
4397 comp_func_Exclusion_rgb64,
4399 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4400 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4401 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4403 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4404 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
4407static_assert(std::size(qt_functionForMode64_C) == QPainter::NCompositionModes);
4410#if QT_CONFIG(raster_fp)
4411 comp_func_SourceOver_rgbafp,
4412 comp_func_DestinationOver_rgbafp,
4413 comp_func_Clear_rgbafp,
4414 comp_func_Source_rgbafp,
4415 comp_func_Destination_rgbafp,
4416 comp_func_SourceIn_rgbafp,
4417 comp_func_DestinationIn_rgbafp,
4418 comp_func_SourceOut_rgbafp,
4419 comp_func_DestinationOut_rgbafp,
4420 comp_func_SourceAtop_rgbafp,
4421 comp_func_DestinationAtop_rgbafp,
4422 comp_func_XOR_rgbafp,
4423 comp_func_Plus_rgbafp,
4424 comp_func_Multiply_rgbafp,
4425 comp_func_Screen_rgbafp,
4426 comp_func_Overlay_rgbafp,
4427 comp_func_Darken_rgbafp,
4428 comp_func_Lighten_rgbafp,
4429 comp_func_ColorDodge_rgbafp,
4430 comp_func_ColorBurn_rgbafp,
4431 comp_func_HardLight_rgbafp,
4432 comp_func_SoftLight_rgbafp,
4433 comp_func_Difference_rgbafp,
4434 comp_func_Exclusion_rgbafp,
4436 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4437 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4439 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
4440 nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
4443static_assert(std::size(qt_functionForModeFP_C) == QPainter::NCompositionModes);
Combined button and popup list for selecting options.
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)