1 /* DO NOT EDIT! This file is generated by sdlgenblit.pl */
3 Simple DirectMedia Layer
4 Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
6 This software is provided 'as-is', without any express or implied
7 warranty. In no event will the authors be held liable for any damages
8 arising from the use of this software.
10 Permission is granted to anyone to use this software for any purpose,
11 including commercial applications, and to alter it and redistribute it
12 freely, subject to the following restrictions:
14 1. The origin of this software must not be misrepresented; you must not
15 claim that you wrote the original software. If you use this software
16 in a product, an acknowledgment in the product documentation would be
17 appreciated but is not required.
18 2. Altered source versions must be plainly marked as such, and must not be
19 misrepresented as being the original software.
20 3. This notice may not be removed or altered from any source distribution.
22 #include "../SDL_internal.h"
26 #include "SDL_video.h"
28 #include "SDL_blit_auto.h"
30 static void SDL_Blit_RGB888_RGB888_Scale(SDL_BlitInfo *info)
38 incy = (info->src_h << 16) / info->dst_h;
39 incx = (info->src_w << 16) / info->dst_w;
41 while (info->dst_h--) {
43 Uint32 *dst = (Uint32 *)info->dst;
47 while (posy >= 0x10000L) {
52 if (posx >= 0x10000L) {
53 while (posx >= 0x10000L) {
57 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
64 info->dst += info->dst_pitch;
68 static void SDL_Blit_RGB888_RGB888_Blend(SDL_BlitInfo *info)
70 const int flags = info->flags;
72 Uint32 srcR, srcG, srcB, srcA;
74 Uint32 dstR, dstG, dstB;
76 while (info->dst_h--) {
77 Uint32 *src = (Uint32 *)info->src;
78 Uint32 *dst = (Uint32 *)info->dst;
82 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
84 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
85 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
86 /* This goes away if we ever use premultiplied alpha */
88 srcR = (srcR * srcA) / 255;
89 srcG = (srcG * srcA) / 255;
90 srcB = (srcB * srcA) / 255;
93 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
95 dstR = srcR + ((255 - srcA) * dstR) / 255;
96 dstG = srcG + ((255 - srcA) * dstG) / 255;
97 dstB = srcB + ((255 - srcA) * dstB) / 255;
100 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
101 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
102 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
105 dstR = (srcR * dstR) / 255;
106 dstG = (srcG * dstG) / 255;
107 dstB = (srcB * dstB) / 255;
110 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
115 info->src += info->src_pitch;
116 info->dst += info->dst_pitch;
120 static void SDL_Blit_RGB888_RGB888_Blend_Scale(SDL_BlitInfo *info)
122 const int flags = info->flags;
124 Uint32 srcR, srcG, srcB, srcA;
126 Uint32 dstR, dstG, dstB;
133 incy = (info->src_h << 16) / info->dst_h;
134 incx = (info->src_w << 16) / info->dst_w;
136 while (info->dst_h--) {
138 Uint32 *dst = (Uint32 *)info->dst;
142 while (posy >= 0x10000L) {
147 if (posx >= 0x10000L) {
148 while (posx >= 0x10000L) {
152 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
155 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
157 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
158 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
159 /* This goes away if we ever use premultiplied alpha */
161 srcR = (srcR * srcA) / 255;
162 srcG = (srcG * srcA) / 255;
163 srcB = (srcB * srcA) / 255;
166 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
168 dstR = srcR + ((255 - srcA) * dstR) / 255;
169 dstG = srcG + ((255 - srcA) * dstG) / 255;
170 dstB = srcB + ((255 - srcA) * dstB) / 255;
173 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
174 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
175 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
178 dstR = (srcR * dstR) / 255;
179 dstG = (srcG * dstG) / 255;
180 dstB = (srcB * dstB) / 255;
183 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
189 info->dst += info->dst_pitch;
193 static void SDL_Blit_RGB888_RGB888_Modulate(SDL_BlitInfo *info)
195 const int flags = info->flags;
196 const Uint32 modulateR = info->r;
197 const Uint32 modulateG = info->g;
198 const Uint32 modulateB = info->b;
202 while (info->dst_h--) {
203 Uint32 *src = (Uint32 *)info->src;
204 Uint32 *dst = (Uint32 *)info->dst;
208 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
209 if (flags & SDL_COPY_MODULATE_COLOR) {
210 R = (R * modulateR) / 255;
211 G = (G * modulateG) / 255;
212 B = (B * modulateB) / 255;
214 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
219 info->src += info->src_pitch;
220 info->dst += info->dst_pitch;
224 static void SDL_Blit_RGB888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
226 const int flags = info->flags;
227 const Uint32 modulateR = info->r;
228 const Uint32 modulateG = info->g;
229 const Uint32 modulateB = info->b;
238 incy = (info->src_h << 16) / info->dst_h;
239 incx = (info->src_w << 16) / info->dst_w;
241 while (info->dst_h--) {
243 Uint32 *dst = (Uint32 *)info->dst;
247 while (posy >= 0x10000L) {
252 if (posx >= 0x10000L) {
253 while (posx >= 0x10000L) {
257 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
260 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
261 if (flags & SDL_COPY_MODULATE_COLOR) {
262 R = (R * modulateR) / 255;
263 G = (G * modulateG) / 255;
264 B = (B * modulateB) / 255;
266 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
272 info->dst += info->dst_pitch;
276 static void SDL_Blit_RGB888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
278 const int flags = info->flags;
279 const Uint32 modulateR = info->r;
280 const Uint32 modulateG = info->g;
281 const Uint32 modulateB = info->b;
282 const Uint32 modulateA = info->a;
284 Uint32 srcR, srcG, srcB, srcA;
286 Uint32 dstR, dstG, dstB;
288 while (info->dst_h--) {
289 Uint32 *src = (Uint32 *)info->src;
290 Uint32 *dst = (Uint32 *)info->dst;
294 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
296 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
297 if (flags & SDL_COPY_MODULATE_COLOR) {
298 srcR = (srcR * modulateR) / 255;
299 srcG = (srcG * modulateG) / 255;
300 srcB = (srcB * modulateB) / 255;
302 if (flags & SDL_COPY_MODULATE_ALPHA) {
303 srcA = (srcA * modulateA) / 255;
305 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
306 /* This goes away if we ever use premultiplied alpha */
308 srcR = (srcR * srcA) / 255;
309 srcG = (srcG * srcA) / 255;
310 srcB = (srcB * srcA) / 255;
313 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
315 dstR = srcR + ((255 - srcA) * dstR) / 255;
316 dstG = srcG + ((255 - srcA) * dstG) / 255;
317 dstB = srcB + ((255 - srcA) * dstB) / 255;
320 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
321 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
322 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
325 dstR = (srcR * dstR) / 255;
326 dstG = (srcG * dstG) / 255;
327 dstB = (srcB * dstB) / 255;
330 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
335 info->src += info->src_pitch;
336 info->dst += info->dst_pitch;
340 static void SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
342 const int flags = info->flags;
343 const Uint32 modulateR = info->r;
344 const Uint32 modulateG = info->g;
345 const Uint32 modulateB = info->b;
346 const Uint32 modulateA = info->a;
348 Uint32 srcR, srcG, srcB, srcA;
350 Uint32 dstR, dstG, dstB;
357 incy = (info->src_h << 16) / info->dst_h;
358 incx = (info->src_w << 16) / info->dst_w;
360 while (info->dst_h--) {
362 Uint32 *dst = (Uint32 *)info->dst;
366 while (posy >= 0x10000L) {
371 if (posx >= 0x10000L) {
372 while (posx >= 0x10000L) {
376 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
379 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
381 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
382 if (flags & SDL_COPY_MODULATE_COLOR) {
383 srcR = (srcR * modulateR) / 255;
384 srcG = (srcG * modulateG) / 255;
385 srcB = (srcB * modulateB) / 255;
387 if (flags & SDL_COPY_MODULATE_ALPHA) {
388 srcA = (srcA * modulateA) / 255;
390 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
391 /* This goes away if we ever use premultiplied alpha */
393 srcR = (srcR * srcA) / 255;
394 srcG = (srcG * srcA) / 255;
395 srcB = (srcB * srcA) / 255;
398 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
400 dstR = srcR + ((255 - srcA) * dstR) / 255;
401 dstG = srcG + ((255 - srcA) * dstG) / 255;
402 dstB = srcB + ((255 - srcA) * dstB) / 255;
405 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
406 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
407 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
410 dstR = (srcR * dstR) / 255;
411 dstG = (srcG * dstG) / 255;
412 dstB = (srcB * dstB) / 255;
415 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
421 info->dst += info->dst_pitch;
425 static void SDL_Blit_RGB888_BGR888_Scale(SDL_BlitInfo *info)
435 incy = (info->src_h << 16) / info->dst_h;
436 incx = (info->src_w << 16) / info->dst_w;
438 while (info->dst_h--) {
440 Uint32 *dst = (Uint32 *)info->dst;
444 while (posy >= 0x10000L) {
449 if (posx >= 0x10000L) {
450 while (posx >= 0x10000L) {
454 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
457 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
458 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
464 info->dst += info->dst_pitch;
468 static void SDL_Blit_RGB888_BGR888_Blend(SDL_BlitInfo *info)
470 const int flags = info->flags;
472 Uint32 srcR, srcG, srcB, srcA;
474 Uint32 dstR, dstG, dstB;
476 while (info->dst_h--) {
477 Uint32 *src = (Uint32 *)info->src;
478 Uint32 *dst = (Uint32 *)info->dst;
482 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
484 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
485 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
486 /* This goes away if we ever use premultiplied alpha */
488 srcR = (srcR * srcA) / 255;
489 srcG = (srcG * srcA) / 255;
490 srcB = (srcB * srcA) / 255;
493 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
495 dstR = srcR + ((255 - srcA) * dstR) / 255;
496 dstG = srcG + ((255 - srcA) * dstG) / 255;
497 dstB = srcB + ((255 - srcA) * dstB) / 255;
500 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
501 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
502 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
505 dstR = (srcR * dstR) / 255;
506 dstG = (srcG * dstG) / 255;
507 dstB = (srcB * dstB) / 255;
510 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
515 info->src += info->src_pitch;
516 info->dst += info->dst_pitch;
520 static void SDL_Blit_RGB888_BGR888_Blend_Scale(SDL_BlitInfo *info)
522 const int flags = info->flags;
524 Uint32 srcR, srcG, srcB, srcA;
526 Uint32 dstR, dstG, dstB;
533 incy = (info->src_h << 16) / info->dst_h;
534 incx = (info->src_w << 16) / info->dst_w;
536 while (info->dst_h--) {
538 Uint32 *dst = (Uint32 *)info->dst;
542 while (posy >= 0x10000L) {
547 if (posx >= 0x10000L) {
548 while (posx >= 0x10000L) {
552 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
555 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
557 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
558 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
559 /* This goes away if we ever use premultiplied alpha */
561 srcR = (srcR * srcA) / 255;
562 srcG = (srcG * srcA) / 255;
563 srcB = (srcB * srcA) / 255;
566 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
568 dstR = srcR + ((255 - srcA) * dstR) / 255;
569 dstG = srcG + ((255 - srcA) * dstG) / 255;
570 dstB = srcB + ((255 - srcA) * dstB) / 255;
573 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
574 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
575 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
578 dstR = (srcR * dstR) / 255;
579 dstG = (srcG * dstG) / 255;
580 dstB = (srcB * dstB) / 255;
583 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
589 info->dst += info->dst_pitch;
593 static void SDL_Blit_RGB888_BGR888_Modulate(SDL_BlitInfo *info)
595 const int flags = info->flags;
596 const Uint32 modulateR = info->r;
597 const Uint32 modulateG = info->g;
598 const Uint32 modulateB = info->b;
602 while (info->dst_h--) {
603 Uint32 *src = (Uint32 *)info->src;
604 Uint32 *dst = (Uint32 *)info->dst;
608 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
609 if (flags & SDL_COPY_MODULATE_COLOR) {
610 R = (R * modulateR) / 255;
611 G = (G * modulateG) / 255;
612 B = (B * modulateB) / 255;
614 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
619 info->src += info->src_pitch;
620 info->dst += info->dst_pitch;
624 static void SDL_Blit_RGB888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
626 const int flags = info->flags;
627 const Uint32 modulateR = info->r;
628 const Uint32 modulateG = info->g;
629 const Uint32 modulateB = info->b;
638 incy = (info->src_h << 16) / info->dst_h;
639 incx = (info->src_w << 16) / info->dst_w;
641 while (info->dst_h--) {
643 Uint32 *dst = (Uint32 *)info->dst;
647 while (posy >= 0x10000L) {
652 if (posx >= 0x10000L) {
653 while (posx >= 0x10000L) {
657 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
660 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
661 if (flags & SDL_COPY_MODULATE_COLOR) {
662 R = (R * modulateR) / 255;
663 G = (G * modulateG) / 255;
664 B = (B * modulateB) / 255;
666 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
672 info->dst += info->dst_pitch;
676 static void SDL_Blit_RGB888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
678 const int flags = info->flags;
679 const Uint32 modulateR = info->r;
680 const Uint32 modulateG = info->g;
681 const Uint32 modulateB = info->b;
682 const Uint32 modulateA = info->a;
684 Uint32 srcR, srcG, srcB, srcA;
686 Uint32 dstR, dstG, dstB;
688 while (info->dst_h--) {
689 Uint32 *src = (Uint32 *)info->src;
690 Uint32 *dst = (Uint32 *)info->dst;
694 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
696 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
697 if (flags & SDL_COPY_MODULATE_COLOR) {
698 srcR = (srcR * modulateR) / 255;
699 srcG = (srcG * modulateG) / 255;
700 srcB = (srcB * modulateB) / 255;
702 if (flags & SDL_COPY_MODULATE_ALPHA) {
703 srcA = (srcA * modulateA) / 255;
705 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
706 /* This goes away if we ever use premultiplied alpha */
708 srcR = (srcR * srcA) / 255;
709 srcG = (srcG * srcA) / 255;
710 srcB = (srcB * srcA) / 255;
713 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
715 dstR = srcR + ((255 - srcA) * dstR) / 255;
716 dstG = srcG + ((255 - srcA) * dstG) / 255;
717 dstB = srcB + ((255 - srcA) * dstB) / 255;
720 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
721 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
722 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
725 dstR = (srcR * dstR) / 255;
726 dstG = (srcG * dstG) / 255;
727 dstB = (srcB * dstB) / 255;
730 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
735 info->src += info->src_pitch;
736 info->dst += info->dst_pitch;
740 static void SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
742 const int flags = info->flags;
743 const Uint32 modulateR = info->r;
744 const Uint32 modulateG = info->g;
745 const Uint32 modulateB = info->b;
746 const Uint32 modulateA = info->a;
748 Uint32 srcR, srcG, srcB, srcA;
750 Uint32 dstR, dstG, dstB;
757 incy = (info->src_h << 16) / info->dst_h;
758 incx = (info->src_w << 16) / info->dst_w;
760 while (info->dst_h--) {
762 Uint32 *dst = (Uint32 *)info->dst;
766 while (posy >= 0x10000L) {
771 if (posx >= 0x10000L) {
772 while (posx >= 0x10000L) {
776 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
779 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
781 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
782 if (flags & SDL_COPY_MODULATE_COLOR) {
783 srcR = (srcR * modulateR) / 255;
784 srcG = (srcG * modulateG) / 255;
785 srcB = (srcB * modulateB) / 255;
787 if (flags & SDL_COPY_MODULATE_ALPHA) {
788 srcA = (srcA * modulateA) / 255;
790 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
791 /* This goes away if we ever use premultiplied alpha */
793 srcR = (srcR * srcA) / 255;
794 srcG = (srcG * srcA) / 255;
795 srcB = (srcB * srcA) / 255;
798 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
800 dstR = srcR + ((255 - srcA) * dstR) / 255;
801 dstG = srcG + ((255 - srcA) * dstG) / 255;
802 dstB = srcB + ((255 - srcA) * dstB) / 255;
805 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
806 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
807 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
810 dstR = (srcR * dstR) / 255;
811 dstG = (srcG * dstG) / 255;
812 dstB = (srcB * dstB) / 255;
815 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
821 info->dst += info->dst_pitch;
825 static void SDL_Blit_RGB888_ARGB8888_Scale(SDL_BlitInfo *info)
835 incy = (info->src_h << 16) / info->dst_h;
836 incx = (info->src_w << 16) / info->dst_w;
838 while (info->dst_h--) {
840 Uint32 *dst = (Uint32 *)info->dst;
844 while (posy >= 0x10000L) {
849 if (posx >= 0x10000L) {
850 while (posx >= 0x10000L) {
854 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
857 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
858 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
864 info->dst += info->dst_pitch;
868 static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info)
870 const int flags = info->flags;
872 Uint32 srcR, srcG, srcB, srcA;
874 Uint32 dstR, dstG, dstB, dstA;
876 while (info->dst_h--) {
877 Uint32 *src = (Uint32 *)info->src;
878 Uint32 *dst = (Uint32 *)info->dst;
882 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
884 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
885 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
886 /* This goes away if we ever use premultiplied alpha */
888 srcR = (srcR * srcA) / 255;
889 srcG = (srcG * srcA) / 255;
890 srcB = (srcB * srcA) / 255;
893 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
895 dstR = srcR + ((255 - srcA) * dstR) / 255;
896 dstG = srcG + ((255 - srcA) * dstG) / 255;
897 dstB = srcB + ((255 - srcA) * dstB) / 255;
898 dstA = srcA + ((255 - srcA) * dstA) / 255;
901 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
902 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
903 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
906 dstR = (srcR * dstR) / 255;
907 dstG = (srcG * dstG) / 255;
908 dstB = (srcB * dstB) / 255;
911 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
916 info->src += info->src_pitch;
917 info->dst += info->dst_pitch;
921 static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
923 const int flags = info->flags;
925 Uint32 srcR, srcG, srcB, srcA;
927 Uint32 dstR, dstG, dstB, dstA;
934 incy = (info->src_h << 16) / info->dst_h;
935 incx = (info->src_w << 16) / info->dst_w;
937 while (info->dst_h--) {
939 Uint32 *dst = (Uint32 *)info->dst;
943 while (posy >= 0x10000L) {
948 if (posx >= 0x10000L) {
949 while (posx >= 0x10000L) {
953 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
956 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
958 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
959 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
960 /* This goes away if we ever use premultiplied alpha */
962 srcR = (srcR * srcA) / 255;
963 srcG = (srcG * srcA) / 255;
964 srcB = (srcB * srcA) / 255;
967 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
969 dstR = srcR + ((255 - srcA) * dstR) / 255;
970 dstG = srcG + ((255 - srcA) * dstG) / 255;
971 dstB = srcB + ((255 - srcA) * dstB) / 255;
972 dstA = srcA + ((255 - srcA) * dstA) / 255;
975 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
976 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
977 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
980 dstR = (srcR * dstR) / 255;
981 dstG = (srcG * dstG) / 255;
982 dstB = (srcB * dstB) / 255;
985 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
991 info->dst += info->dst_pitch;
995 static void SDL_Blit_RGB888_ARGB8888_Modulate(SDL_BlitInfo *info)
997 const int flags = info->flags;
998 const Uint32 modulateR = info->r;
999 const Uint32 modulateG = info->g;
1000 const Uint32 modulateB = info->b;
1001 const Uint32 modulateA = info->a;
1005 while (info->dst_h--) {
1006 Uint32 *src = (Uint32 *)info->src;
1007 Uint32 *dst = (Uint32 *)info->dst;
1008 int n = info->dst_w;
1011 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
1012 if (flags & SDL_COPY_MODULATE_COLOR) {
1013 R = (R * modulateR) / 255;
1014 G = (G * modulateG) / 255;
1015 B = (B * modulateB) / 255;
1017 if (flags & SDL_COPY_MODULATE_ALPHA) {
1018 A = (A * modulateA) / 255;
1020 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
1025 info->src += info->src_pitch;
1026 info->dst += info->dst_pitch;
1030 static void SDL_Blit_RGB888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
1032 const int flags = info->flags;
1033 const Uint32 modulateR = info->r;
1034 const Uint32 modulateG = info->g;
1035 const Uint32 modulateB = info->b;
1036 const Uint32 modulateA = info->a;
1045 incy = (info->src_h << 16) / info->dst_h;
1046 incx = (info->src_w << 16) / info->dst_w;
1048 while (info->dst_h--) {
1050 Uint32 *dst = (Uint32 *)info->dst;
1051 int n = info->dst_w;
1054 while (posy >= 0x10000L) {
1059 if (posx >= 0x10000L) {
1060 while (posx >= 0x10000L) {
1064 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1067 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
1068 if (flags & SDL_COPY_MODULATE_COLOR) {
1069 R = (R * modulateR) / 255;
1070 G = (G * modulateG) / 255;
1071 B = (B * modulateB) / 255;
1073 if (flags & SDL_COPY_MODULATE_ALPHA) {
1074 A = (A * modulateA) / 255;
1076 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
1082 info->dst += info->dst_pitch;
1086 static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
1088 const int flags = info->flags;
1089 const Uint32 modulateR = info->r;
1090 const Uint32 modulateG = info->g;
1091 const Uint32 modulateB = info->b;
1092 const Uint32 modulateA = info->a;
1094 Uint32 srcR, srcG, srcB, srcA;
1096 Uint32 dstR, dstG, dstB, dstA;
1098 while (info->dst_h--) {
1099 Uint32 *src = (Uint32 *)info->src;
1100 Uint32 *dst = (Uint32 *)info->dst;
1101 int n = info->dst_w;
1104 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
1106 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
1107 if (flags & SDL_COPY_MODULATE_COLOR) {
1108 srcR = (srcR * modulateR) / 255;
1109 srcG = (srcG * modulateG) / 255;
1110 srcB = (srcB * modulateB) / 255;
1112 if (flags & SDL_COPY_MODULATE_ALPHA) {
1113 srcA = (srcA * modulateA) / 255;
1115 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1116 /* This goes away if we ever use premultiplied alpha */
1118 srcR = (srcR * srcA) / 255;
1119 srcG = (srcG * srcA) / 255;
1120 srcB = (srcB * srcA) / 255;
1123 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
1124 case SDL_COPY_BLEND:
1125 dstR = srcR + ((255 - srcA) * dstR) / 255;
1126 dstG = srcG + ((255 - srcA) * dstG) / 255;
1127 dstB = srcB + ((255 - srcA) * dstB) / 255;
1128 dstA = srcA + ((255 - srcA) * dstA) / 255;
1131 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
1132 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
1133 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
1136 dstR = (srcR * dstR) / 255;
1137 dstG = (srcG * dstG) / 255;
1138 dstB = (srcB * dstB) / 255;
1141 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
1146 info->src += info->src_pitch;
1147 info->dst += info->dst_pitch;
1151 static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
1153 const int flags = info->flags;
1154 const Uint32 modulateR = info->r;
1155 const Uint32 modulateG = info->g;
1156 const Uint32 modulateB = info->b;
1157 const Uint32 modulateA = info->a;
1159 Uint32 srcR, srcG, srcB, srcA;
1161 Uint32 dstR, dstG, dstB, dstA;
1168 incy = (info->src_h << 16) / info->dst_h;
1169 incx = (info->src_w << 16) / info->dst_w;
1171 while (info->dst_h--) {
1173 Uint32 *dst = (Uint32 *)info->dst;
1174 int n = info->dst_w;
1177 while (posy >= 0x10000L) {
1182 if (posx >= 0x10000L) {
1183 while (posx >= 0x10000L) {
1187 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1190 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
1192 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
1193 if (flags & SDL_COPY_MODULATE_COLOR) {
1194 srcR = (srcR * modulateR) / 255;
1195 srcG = (srcG * modulateG) / 255;
1196 srcB = (srcB * modulateB) / 255;
1198 if (flags & SDL_COPY_MODULATE_ALPHA) {
1199 srcA = (srcA * modulateA) / 255;
1201 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1202 /* This goes away if we ever use premultiplied alpha */
1204 srcR = (srcR * srcA) / 255;
1205 srcG = (srcG * srcA) / 255;
1206 srcB = (srcB * srcA) / 255;
1209 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
1210 case SDL_COPY_BLEND:
1211 dstR = srcR + ((255 - srcA) * dstR) / 255;
1212 dstG = srcG + ((255 - srcA) * dstG) / 255;
1213 dstB = srcB + ((255 - srcA) * dstB) / 255;
1214 dstA = srcA + ((255 - srcA) * dstA) / 255;
1217 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
1218 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
1219 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
1222 dstR = (srcR * dstR) / 255;
1223 dstG = (srcG * dstG) / 255;
1224 dstB = (srcB * dstB) / 255;
1227 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
1233 info->dst += info->dst_pitch;
1237 static void SDL_Blit_BGR888_RGB888_Scale(SDL_BlitInfo *info)
1247 incy = (info->src_h << 16) / info->dst_h;
1248 incx = (info->src_w << 16) / info->dst_w;
1250 while (info->dst_h--) {
1252 Uint32 *dst = (Uint32 *)info->dst;
1253 int n = info->dst_w;
1256 while (posy >= 0x10000L) {
1261 if (posx >= 0x10000L) {
1262 while (posx >= 0x10000L) {
1266 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1269 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
1270 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
1276 info->dst += info->dst_pitch;
1280 static void SDL_Blit_BGR888_RGB888_Blend(SDL_BlitInfo *info)
1282 const int flags = info->flags;
1284 Uint32 srcR, srcG, srcB, srcA;
1286 Uint32 dstR, dstG, dstB;
1288 while (info->dst_h--) {
1289 Uint32 *src = (Uint32 *)info->src;
1290 Uint32 *dst = (Uint32 *)info->dst;
1291 int n = info->dst_w;
1294 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
1296 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
1297 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1298 /* This goes away if we ever use premultiplied alpha */
1300 srcR = (srcR * srcA) / 255;
1301 srcG = (srcG * srcA) / 255;
1302 srcB = (srcB * srcA) / 255;
1305 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
1306 case SDL_COPY_BLEND:
1307 dstR = srcR + ((255 - srcA) * dstR) / 255;
1308 dstG = srcG + ((255 - srcA) * dstG) / 255;
1309 dstB = srcB + ((255 - srcA) * dstB) / 255;
1312 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
1313 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
1314 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
1317 dstR = (srcR * dstR) / 255;
1318 dstG = (srcG * dstG) / 255;
1319 dstB = (srcB * dstB) / 255;
1322 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
1327 info->src += info->src_pitch;
1328 info->dst += info->dst_pitch;
1332 static void SDL_Blit_BGR888_RGB888_Blend_Scale(SDL_BlitInfo *info)
1334 const int flags = info->flags;
1336 Uint32 srcR, srcG, srcB, srcA;
1338 Uint32 dstR, dstG, dstB;
1345 incy = (info->src_h << 16) / info->dst_h;
1346 incx = (info->src_w << 16) / info->dst_w;
1348 while (info->dst_h--) {
1350 Uint32 *dst = (Uint32 *)info->dst;
1351 int n = info->dst_w;
1354 while (posy >= 0x10000L) {
1359 if (posx >= 0x10000L) {
1360 while (posx >= 0x10000L) {
1364 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1367 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
1369 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
1370 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1371 /* This goes away if we ever use premultiplied alpha */
1373 srcR = (srcR * srcA) / 255;
1374 srcG = (srcG * srcA) / 255;
1375 srcB = (srcB * srcA) / 255;
1378 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
1379 case SDL_COPY_BLEND:
1380 dstR = srcR + ((255 - srcA) * dstR) / 255;
1381 dstG = srcG + ((255 - srcA) * dstG) / 255;
1382 dstB = srcB + ((255 - srcA) * dstB) / 255;
1385 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
1386 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
1387 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
1390 dstR = (srcR * dstR) / 255;
1391 dstG = (srcG * dstG) / 255;
1392 dstB = (srcB * dstB) / 255;
1395 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
1401 info->dst += info->dst_pitch;
1405 static void SDL_Blit_BGR888_RGB888_Modulate(SDL_BlitInfo *info)
1407 const int flags = info->flags;
1408 const Uint32 modulateR = info->r;
1409 const Uint32 modulateG = info->g;
1410 const Uint32 modulateB = info->b;
1414 while (info->dst_h--) {
1415 Uint32 *src = (Uint32 *)info->src;
1416 Uint32 *dst = (Uint32 *)info->dst;
1417 int n = info->dst_w;
1420 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
1421 if (flags & SDL_COPY_MODULATE_COLOR) {
1422 R = (R * modulateR) / 255;
1423 G = (G * modulateG) / 255;
1424 B = (B * modulateB) / 255;
1426 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
1431 info->src += info->src_pitch;
1432 info->dst += info->dst_pitch;
1436 static void SDL_Blit_BGR888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
1438 const int flags = info->flags;
1439 const Uint32 modulateR = info->r;
1440 const Uint32 modulateG = info->g;
1441 const Uint32 modulateB = info->b;
1450 incy = (info->src_h << 16) / info->dst_h;
1451 incx = (info->src_w << 16) / info->dst_w;
1453 while (info->dst_h--) {
1455 Uint32 *dst = (Uint32 *)info->dst;
1456 int n = info->dst_w;
1459 while (posy >= 0x10000L) {
1464 if (posx >= 0x10000L) {
1465 while (posx >= 0x10000L) {
1469 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1472 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
1473 if (flags & SDL_COPY_MODULATE_COLOR) {
1474 R = (R * modulateR) / 255;
1475 G = (G * modulateG) / 255;
1476 B = (B * modulateB) / 255;
1478 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
1484 info->dst += info->dst_pitch;
1488 static void SDL_Blit_BGR888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
1490 const int flags = info->flags;
1491 const Uint32 modulateR = info->r;
1492 const Uint32 modulateG = info->g;
1493 const Uint32 modulateB = info->b;
1494 const Uint32 modulateA = info->a;
1496 Uint32 srcR, srcG, srcB, srcA;
1498 Uint32 dstR, dstG, dstB;
1500 while (info->dst_h--) {
1501 Uint32 *src = (Uint32 *)info->src;
1502 Uint32 *dst = (Uint32 *)info->dst;
1503 int n = info->dst_w;
1506 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
1508 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
1509 if (flags & SDL_COPY_MODULATE_COLOR) {
1510 srcR = (srcR * modulateR) / 255;
1511 srcG = (srcG * modulateG) / 255;
1512 srcB = (srcB * modulateB) / 255;
1514 if (flags & SDL_COPY_MODULATE_ALPHA) {
1515 srcA = (srcA * modulateA) / 255;
1517 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1518 /* This goes away if we ever use premultiplied alpha */
1520 srcR = (srcR * srcA) / 255;
1521 srcG = (srcG * srcA) / 255;
1522 srcB = (srcB * srcA) / 255;
1525 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
1526 case SDL_COPY_BLEND:
1527 dstR = srcR + ((255 - srcA) * dstR) / 255;
1528 dstG = srcG + ((255 - srcA) * dstG) / 255;
1529 dstB = srcB + ((255 - srcA) * dstB) / 255;
1532 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
1533 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
1534 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
1537 dstR = (srcR * dstR) / 255;
1538 dstG = (srcG * dstG) / 255;
1539 dstB = (srcB * dstB) / 255;
1542 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
1547 info->src += info->src_pitch;
1548 info->dst += info->dst_pitch;
1552 static void SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
1554 const int flags = info->flags;
1555 const Uint32 modulateR = info->r;
1556 const Uint32 modulateG = info->g;
1557 const Uint32 modulateB = info->b;
1558 const Uint32 modulateA = info->a;
1560 Uint32 srcR, srcG, srcB, srcA;
1562 Uint32 dstR, dstG, dstB;
1569 incy = (info->src_h << 16) / info->dst_h;
1570 incx = (info->src_w << 16) / info->dst_w;
1572 while (info->dst_h--) {
1574 Uint32 *dst = (Uint32 *)info->dst;
1575 int n = info->dst_w;
1578 while (posy >= 0x10000L) {
1583 if (posx >= 0x10000L) {
1584 while (posx >= 0x10000L) {
1588 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1591 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
1593 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
1594 if (flags & SDL_COPY_MODULATE_COLOR) {
1595 srcR = (srcR * modulateR) / 255;
1596 srcG = (srcG * modulateG) / 255;
1597 srcB = (srcB * modulateB) / 255;
1599 if (flags & SDL_COPY_MODULATE_ALPHA) {
1600 srcA = (srcA * modulateA) / 255;
1602 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1603 /* This goes away if we ever use premultiplied alpha */
1605 srcR = (srcR * srcA) / 255;
1606 srcG = (srcG * srcA) / 255;
1607 srcB = (srcB * srcA) / 255;
1610 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
1611 case SDL_COPY_BLEND:
1612 dstR = srcR + ((255 - srcA) * dstR) / 255;
1613 dstG = srcG + ((255 - srcA) * dstG) / 255;
1614 dstB = srcB + ((255 - srcA) * dstB) / 255;
1617 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
1618 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
1619 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
1622 dstR = (srcR * dstR) / 255;
1623 dstG = (srcG * dstG) / 255;
1624 dstB = (srcB * dstB) / 255;
1627 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
1633 info->dst += info->dst_pitch;
1637 static void SDL_Blit_BGR888_BGR888_Scale(SDL_BlitInfo *info)
1645 incy = (info->src_h << 16) / info->dst_h;
1646 incx = (info->src_w << 16) / info->dst_w;
1648 while (info->dst_h--) {
1650 Uint32 *dst = (Uint32 *)info->dst;
1651 int n = info->dst_w;
1654 while (posy >= 0x10000L) {
1659 if (posx >= 0x10000L) {
1660 while (posx >= 0x10000L) {
1664 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1671 info->dst += info->dst_pitch;
1675 static void SDL_Blit_BGR888_BGR888_Blend(SDL_BlitInfo *info)
1677 const int flags = info->flags;
1679 Uint32 srcR, srcG, srcB, srcA;
1681 Uint32 dstR, dstG, dstB;
1683 while (info->dst_h--) {
1684 Uint32 *src = (Uint32 *)info->src;
1685 Uint32 *dst = (Uint32 *)info->dst;
1686 int n = info->dst_w;
1689 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
1691 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
1692 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1693 /* This goes away if we ever use premultiplied alpha */
1695 srcR = (srcR * srcA) / 255;
1696 srcG = (srcG * srcA) / 255;
1697 srcB = (srcB * srcA) / 255;
1700 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
1701 case SDL_COPY_BLEND:
1702 dstR = srcR + ((255 - srcA) * dstR) / 255;
1703 dstG = srcG + ((255 - srcA) * dstG) / 255;
1704 dstB = srcB + ((255 - srcA) * dstB) / 255;
1707 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
1708 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
1709 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
1712 dstR = (srcR * dstR) / 255;
1713 dstG = (srcG * dstG) / 255;
1714 dstB = (srcB * dstB) / 255;
1717 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
1722 info->src += info->src_pitch;
1723 info->dst += info->dst_pitch;
1727 static void SDL_Blit_BGR888_BGR888_Blend_Scale(SDL_BlitInfo *info)
1729 const int flags = info->flags;
1731 Uint32 srcR, srcG, srcB, srcA;
1733 Uint32 dstR, dstG, dstB;
1740 incy = (info->src_h << 16) / info->dst_h;
1741 incx = (info->src_w << 16) / info->dst_w;
1743 while (info->dst_h--) {
1745 Uint32 *dst = (Uint32 *)info->dst;
1746 int n = info->dst_w;
1749 while (posy >= 0x10000L) {
1754 if (posx >= 0x10000L) {
1755 while (posx >= 0x10000L) {
1759 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1762 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
1764 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
1765 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1766 /* This goes away if we ever use premultiplied alpha */
1768 srcR = (srcR * srcA) / 255;
1769 srcG = (srcG * srcA) / 255;
1770 srcB = (srcB * srcA) / 255;
1773 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
1774 case SDL_COPY_BLEND:
1775 dstR = srcR + ((255 - srcA) * dstR) / 255;
1776 dstG = srcG + ((255 - srcA) * dstG) / 255;
1777 dstB = srcB + ((255 - srcA) * dstB) / 255;
1780 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
1781 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
1782 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
1785 dstR = (srcR * dstR) / 255;
1786 dstG = (srcG * dstG) / 255;
1787 dstB = (srcB * dstB) / 255;
1790 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
1796 info->dst += info->dst_pitch;
1800 static void SDL_Blit_BGR888_BGR888_Modulate(SDL_BlitInfo *info)
1802 const int flags = info->flags;
1803 const Uint32 modulateR = info->r;
1804 const Uint32 modulateG = info->g;
1805 const Uint32 modulateB = info->b;
1809 while (info->dst_h--) {
1810 Uint32 *src = (Uint32 *)info->src;
1811 Uint32 *dst = (Uint32 *)info->dst;
1812 int n = info->dst_w;
1815 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
1816 if (flags & SDL_COPY_MODULATE_COLOR) {
1817 R = (R * modulateR) / 255;
1818 G = (G * modulateG) / 255;
1819 B = (B * modulateB) / 255;
1821 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
1826 info->src += info->src_pitch;
1827 info->dst += info->dst_pitch;
1831 static void SDL_Blit_BGR888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
1833 const int flags = info->flags;
1834 const Uint32 modulateR = info->r;
1835 const Uint32 modulateG = info->g;
1836 const Uint32 modulateB = info->b;
1845 incy = (info->src_h << 16) / info->dst_h;
1846 incx = (info->src_w << 16) / info->dst_w;
1848 while (info->dst_h--) {
1850 Uint32 *dst = (Uint32 *)info->dst;
1851 int n = info->dst_w;
1854 while (posy >= 0x10000L) {
1859 if (posx >= 0x10000L) {
1860 while (posx >= 0x10000L) {
1864 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1867 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
1868 if (flags & SDL_COPY_MODULATE_COLOR) {
1869 R = (R * modulateR) / 255;
1870 G = (G * modulateG) / 255;
1871 B = (B * modulateB) / 255;
1873 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
1879 info->dst += info->dst_pitch;
1883 static void SDL_Blit_BGR888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
1885 const int flags = info->flags;
1886 const Uint32 modulateR = info->r;
1887 const Uint32 modulateG = info->g;
1888 const Uint32 modulateB = info->b;
1889 const Uint32 modulateA = info->a;
1891 Uint32 srcR, srcG, srcB, srcA;
1893 Uint32 dstR, dstG, dstB;
1895 while (info->dst_h--) {
1896 Uint32 *src = (Uint32 *)info->src;
1897 Uint32 *dst = (Uint32 *)info->dst;
1898 int n = info->dst_w;
1901 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
1903 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
1904 if (flags & SDL_COPY_MODULATE_COLOR) {
1905 srcR = (srcR * modulateR) / 255;
1906 srcG = (srcG * modulateG) / 255;
1907 srcB = (srcB * modulateB) / 255;
1909 if (flags & SDL_COPY_MODULATE_ALPHA) {
1910 srcA = (srcA * modulateA) / 255;
1912 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1913 /* This goes away if we ever use premultiplied alpha */
1915 srcR = (srcR * srcA) / 255;
1916 srcG = (srcG * srcA) / 255;
1917 srcB = (srcB * srcA) / 255;
1920 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
1921 case SDL_COPY_BLEND:
1922 dstR = srcR + ((255 - srcA) * dstR) / 255;
1923 dstG = srcG + ((255 - srcA) * dstG) / 255;
1924 dstB = srcB + ((255 - srcA) * dstB) / 255;
1927 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
1928 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
1929 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
1932 dstR = (srcR * dstR) / 255;
1933 dstG = (srcG * dstG) / 255;
1934 dstB = (srcB * dstB) / 255;
1937 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
1942 info->src += info->src_pitch;
1943 info->dst += info->dst_pitch;
1947 static void SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
1949 const int flags = info->flags;
1950 const Uint32 modulateR = info->r;
1951 const Uint32 modulateG = info->g;
1952 const Uint32 modulateB = info->b;
1953 const Uint32 modulateA = info->a;
1955 Uint32 srcR, srcG, srcB, srcA;
1957 Uint32 dstR, dstG, dstB;
1964 incy = (info->src_h << 16) / info->dst_h;
1965 incx = (info->src_w << 16) / info->dst_w;
1967 while (info->dst_h--) {
1969 Uint32 *dst = (Uint32 *)info->dst;
1970 int n = info->dst_w;
1973 while (posy >= 0x10000L) {
1978 if (posx >= 0x10000L) {
1979 while (posx >= 0x10000L) {
1983 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
1986 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
1988 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
1989 if (flags & SDL_COPY_MODULATE_COLOR) {
1990 srcR = (srcR * modulateR) / 255;
1991 srcG = (srcG * modulateG) / 255;
1992 srcB = (srcB * modulateB) / 255;
1994 if (flags & SDL_COPY_MODULATE_ALPHA) {
1995 srcA = (srcA * modulateA) / 255;
1997 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
1998 /* This goes away if we ever use premultiplied alpha */
2000 srcR = (srcR * srcA) / 255;
2001 srcG = (srcG * srcA) / 255;
2002 srcB = (srcB * srcA) / 255;
2005 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2006 case SDL_COPY_BLEND:
2007 dstR = srcR + ((255 - srcA) * dstR) / 255;
2008 dstG = srcG + ((255 - srcA) * dstG) / 255;
2009 dstB = srcB + ((255 - srcA) * dstB) / 255;
2012 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2013 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2014 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2017 dstR = (srcR * dstR) / 255;
2018 dstG = (srcG * dstG) / 255;
2019 dstB = (srcB * dstB) / 255;
2022 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
2028 info->dst += info->dst_pitch;
2032 static void SDL_Blit_BGR888_ARGB8888_Scale(SDL_BlitInfo *info)
2042 incy = (info->src_h << 16) / info->dst_h;
2043 incx = (info->src_w << 16) / info->dst_w;
2045 while (info->dst_h--) {
2047 Uint32 *dst = (Uint32 *)info->dst;
2048 int n = info->dst_w;
2051 while (posy >= 0x10000L) {
2056 if (posx >= 0x10000L) {
2057 while (posx >= 0x10000L) {
2061 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2064 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
2065 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
2071 info->dst += info->dst_pitch;
2075 static void SDL_Blit_BGR888_ARGB8888_Blend(SDL_BlitInfo *info)
2077 const int flags = info->flags;
2079 Uint32 srcR, srcG, srcB, srcA;
2081 Uint32 dstR, dstG, dstB, dstA;
2083 while (info->dst_h--) {
2084 Uint32 *src = (Uint32 *)info->src;
2085 Uint32 *dst = (Uint32 *)info->dst;
2086 int n = info->dst_w;
2089 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
2091 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
2092 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2093 /* This goes away if we ever use premultiplied alpha */
2095 srcR = (srcR * srcA) / 255;
2096 srcG = (srcG * srcA) / 255;
2097 srcB = (srcB * srcA) / 255;
2100 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2101 case SDL_COPY_BLEND:
2102 dstR = srcR + ((255 - srcA) * dstR) / 255;
2103 dstG = srcG + ((255 - srcA) * dstG) / 255;
2104 dstB = srcB + ((255 - srcA) * dstB) / 255;
2105 dstA = srcA + ((255 - srcA) * dstA) / 255;
2108 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2109 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2110 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2113 dstR = (srcR * dstR) / 255;
2114 dstG = (srcG * dstG) / 255;
2115 dstB = (srcB * dstB) / 255;
2118 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
2123 info->src += info->src_pitch;
2124 info->dst += info->dst_pitch;
2128 static void SDL_Blit_BGR888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
2130 const int flags = info->flags;
2132 Uint32 srcR, srcG, srcB, srcA;
2134 Uint32 dstR, dstG, dstB, dstA;
2141 incy = (info->src_h << 16) / info->dst_h;
2142 incx = (info->src_w << 16) / info->dst_w;
2144 while (info->dst_h--) {
2146 Uint32 *dst = (Uint32 *)info->dst;
2147 int n = info->dst_w;
2150 while (posy >= 0x10000L) {
2155 if (posx >= 0x10000L) {
2156 while (posx >= 0x10000L) {
2160 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2163 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
2165 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
2166 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2167 /* This goes away if we ever use premultiplied alpha */
2169 srcR = (srcR * srcA) / 255;
2170 srcG = (srcG * srcA) / 255;
2171 srcB = (srcB * srcA) / 255;
2174 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2175 case SDL_COPY_BLEND:
2176 dstR = srcR + ((255 - srcA) * dstR) / 255;
2177 dstG = srcG + ((255 - srcA) * dstG) / 255;
2178 dstB = srcB + ((255 - srcA) * dstB) / 255;
2179 dstA = srcA + ((255 - srcA) * dstA) / 255;
2182 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2183 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2184 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2187 dstR = (srcR * dstR) / 255;
2188 dstG = (srcG * dstG) / 255;
2189 dstB = (srcB * dstB) / 255;
2192 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
2198 info->dst += info->dst_pitch;
2202 static void SDL_Blit_BGR888_ARGB8888_Modulate(SDL_BlitInfo *info)
2204 const int flags = info->flags;
2205 const Uint32 modulateR = info->r;
2206 const Uint32 modulateG = info->g;
2207 const Uint32 modulateB = info->b;
2208 const Uint32 modulateA = info->a;
2212 while (info->dst_h--) {
2213 Uint32 *src = (Uint32 *)info->src;
2214 Uint32 *dst = (Uint32 *)info->dst;
2215 int n = info->dst_w;
2218 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
2219 if (flags & SDL_COPY_MODULATE_COLOR) {
2220 R = (R * modulateR) / 255;
2221 G = (G * modulateG) / 255;
2222 B = (B * modulateB) / 255;
2224 if (flags & SDL_COPY_MODULATE_ALPHA) {
2225 A = (A * modulateA) / 255;
2227 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
2232 info->src += info->src_pitch;
2233 info->dst += info->dst_pitch;
2237 static void SDL_Blit_BGR888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
2239 const int flags = info->flags;
2240 const Uint32 modulateR = info->r;
2241 const Uint32 modulateG = info->g;
2242 const Uint32 modulateB = info->b;
2243 const Uint32 modulateA = info->a;
2252 incy = (info->src_h << 16) / info->dst_h;
2253 incx = (info->src_w << 16) / info->dst_w;
2255 while (info->dst_h--) {
2257 Uint32 *dst = (Uint32 *)info->dst;
2258 int n = info->dst_w;
2261 while (posy >= 0x10000L) {
2266 if (posx >= 0x10000L) {
2267 while (posx >= 0x10000L) {
2271 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2274 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
2275 if (flags & SDL_COPY_MODULATE_COLOR) {
2276 R = (R * modulateR) / 255;
2277 G = (G * modulateG) / 255;
2278 B = (B * modulateB) / 255;
2280 if (flags & SDL_COPY_MODULATE_ALPHA) {
2281 A = (A * modulateA) / 255;
2283 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
2289 info->dst += info->dst_pitch;
2293 static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
2295 const int flags = info->flags;
2296 const Uint32 modulateR = info->r;
2297 const Uint32 modulateG = info->g;
2298 const Uint32 modulateB = info->b;
2299 const Uint32 modulateA = info->a;
2301 Uint32 srcR, srcG, srcB, srcA;
2303 Uint32 dstR, dstG, dstB, dstA;
2305 while (info->dst_h--) {
2306 Uint32 *src = (Uint32 *)info->src;
2307 Uint32 *dst = (Uint32 *)info->dst;
2308 int n = info->dst_w;
2311 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
2313 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
2314 if (flags & SDL_COPY_MODULATE_COLOR) {
2315 srcR = (srcR * modulateR) / 255;
2316 srcG = (srcG * modulateG) / 255;
2317 srcB = (srcB * modulateB) / 255;
2319 if (flags & SDL_COPY_MODULATE_ALPHA) {
2320 srcA = (srcA * modulateA) / 255;
2322 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2323 /* This goes away if we ever use premultiplied alpha */
2325 srcR = (srcR * srcA) / 255;
2326 srcG = (srcG * srcA) / 255;
2327 srcB = (srcB * srcA) / 255;
2330 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2331 case SDL_COPY_BLEND:
2332 dstR = srcR + ((255 - srcA) * dstR) / 255;
2333 dstG = srcG + ((255 - srcA) * dstG) / 255;
2334 dstB = srcB + ((255 - srcA) * dstB) / 255;
2335 dstA = srcA + ((255 - srcA) * dstA) / 255;
2338 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2339 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2340 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2343 dstR = (srcR * dstR) / 255;
2344 dstG = (srcG * dstG) / 255;
2345 dstB = (srcB * dstB) / 255;
2348 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
2353 info->src += info->src_pitch;
2354 info->dst += info->dst_pitch;
2358 static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
2360 const int flags = info->flags;
2361 const Uint32 modulateR = info->r;
2362 const Uint32 modulateG = info->g;
2363 const Uint32 modulateB = info->b;
2364 const Uint32 modulateA = info->a;
2366 Uint32 srcR, srcG, srcB, srcA;
2368 Uint32 dstR, dstG, dstB, dstA;
2375 incy = (info->src_h << 16) / info->dst_h;
2376 incx = (info->src_w << 16) / info->dst_w;
2378 while (info->dst_h--) {
2380 Uint32 *dst = (Uint32 *)info->dst;
2381 int n = info->dst_w;
2384 while (posy >= 0x10000L) {
2389 if (posx >= 0x10000L) {
2390 while (posx >= 0x10000L) {
2394 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2397 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
2399 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
2400 if (flags & SDL_COPY_MODULATE_COLOR) {
2401 srcR = (srcR * modulateR) / 255;
2402 srcG = (srcG * modulateG) / 255;
2403 srcB = (srcB * modulateB) / 255;
2405 if (flags & SDL_COPY_MODULATE_ALPHA) {
2406 srcA = (srcA * modulateA) / 255;
2408 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2409 /* This goes away if we ever use premultiplied alpha */
2411 srcR = (srcR * srcA) / 255;
2412 srcG = (srcG * srcA) / 255;
2413 srcB = (srcB * srcA) / 255;
2416 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2417 case SDL_COPY_BLEND:
2418 dstR = srcR + ((255 - srcA) * dstR) / 255;
2419 dstG = srcG + ((255 - srcA) * dstG) / 255;
2420 dstB = srcB + ((255 - srcA) * dstB) / 255;
2421 dstA = srcA + ((255 - srcA) * dstA) / 255;
2424 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2425 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2426 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2429 dstR = (srcR * dstR) / 255;
2430 dstG = (srcG * dstG) / 255;
2431 dstB = (srcB * dstB) / 255;
2434 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
2440 info->dst += info->dst_pitch;
2444 static void SDL_Blit_ARGB8888_RGB888_Scale(SDL_BlitInfo *info)
2454 incy = (info->src_h << 16) / info->dst_h;
2455 incx = (info->src_w << 16) / info->dst_w;
2457 while (info->dst_h--) {
2459 Uint32 *dst = (Uint32 *)info->dst;
2460 int n = info->dst_w;
2463 while (posy >= 0x10000L) {
2468 if (posx >= 0x10000L) {
2469 while (posx >= 0x10000L) {
2473 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2476 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
2477 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
2483 info->dst += info->dst_pitch;
2487 static void SDL_Blit_ARGB8888_RGB888_Blend(SDL_BlitInfo *info)
2489 const int flags = info->flags;
2491 Uint32 srcR, srcG, srcB, srcA;
2493 Uint32 dstR, dstG, dstB;
2495 while (info->dst_h--) {
2496 Uint32 *src = (Uint32 *)info->src;
2497 Uint32 *dst = (Uint32 *)info->dst;
2498 int n = info->dst_w;
2501 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
2503 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
2504 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2505 /* This goes away if we ever use premultiplied alpha */
2507 srcR = (srcR * srcA) / 255;
2508 srcG = (srcG * srcA) / 255;
2509 srcB = (srcB * srcA) / 255;
2512 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2513 case SDL_COPY_BLEND:
2514 dstR = srcR + ((255 - srcA) * dstR) / 255;
2515 dstG = srcG + ((255 - srcA) * dstG) / 255;
2516 dstB = srcB + ((255 - srcA) * dstB) / 255;
2519 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2520 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2521 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2524 dstR = (srcR * dstR) / 255;
2525 dstG = (srcG * dstG) / 255;
2526 dstB = (srcB * dstB) / 255;
2529 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
2534 info->src += info->src_pitch;
2535 info->dst += info->dst_pitch;
2539 static void SDL_Blit_ARGB8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
2541 const int flags = info->flags;
2543 Uint32 srcR, srcG, srcB, srcA;
2545 Uint32 dstR, dstG, dstB;
2552 incy = (info->src_h << 16) / info->dst_h;
2553 incx = (info->src_w << 16) / info->dst_w;
2555 while (info->dst_h--) {
2557 Uint32 *dst = (Uint32 *)info->dst;
2558 int n = info->dst_w;
2561 while (posy >= 0x10000L) {
2566 if (posx >= 0x10000L) {
2567 while (posx >= 0x10000L) {
2571 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2574 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
2576 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
2577 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2578 /* This goes away if we ever use premultiplied alpha */
2580 srcR = (srcR * srcA) / 255;
2581 srcG = (srcG * srcA) / 255;
2582 srcB = (srcB * srcA) / 255;
2585 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2586 case SDL_COPY_BLEND:
2587 dstR = srcR + ((255 - srcA) * dstR) / 255;
2588 dstG = srcG + ((255 - srcA) * dstG) / 255;
2589 dstB = srcB + ((255 - srcA) * dstB) / 255;
2592 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2593 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2594 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2597 dstR = (srcR * dstR) / 255;
2598 dstG = (srcG * dstG) / 255;
2599 dstB = (srcB * dstB) / 255;
2602 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
2608 info->dst += info->dst_pitch;
2612 static void SDL_Blit_ARGB8888_RGB888_Modulate(SDL_BlitInfo *info)
2614 const int flags = info->flags;
2615 const Uint32 modulateR = info->r;
2616 const Uint32 modulateG = info->g;
2617 const Uint32 modulateB = info->b;
2621 while (info->dst_h--) {
2622 Uint32 *src = (Uint32 *)info->src;
2623 Uint32 *dst = (Uint32 *)info->dst;
2624 int n = info->dst_w;
2627 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
2628 if (flags & SDL_COPY_MODULATE_COLOR) {
2629 R = (R * modulateR) / 255;
2630 G = (G * modulateG) / 255;
2631 B = (B * modulateB) / 255;
2633 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
2638 info->src += info->src_pitch;
2639 info->dst += info->dst_pitch;
2643 static void SDL_Blit_ARGB8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
2645 const int flags = info->flags;
2646 const Uint32 modulateR = info->r;
2647 const Uint32 modulateG = info->g;
2648 const Uint32 modulateB = info->b;
2657 incy = (info->src_h << 16) / info->dst_h;
2658 incx = (info->src_w << 16) / info->dst_w;
2660 while (info->dst_h--) {
2662 Uint32 *dst = (Uint32 *)info->dst;
2663 int n = info->dst_w;
2666 while (posy >= 0x10000L) {
2671 if (posx >= 0x10000L) {
2672 while (posx >= 0x10000L) {
2676 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2679 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
2680 if (flags & SDL_COPY_MODULATE_COLOR) {
2681 R = (R * modulateR) / 255;
2682 G = (G * modulateG) / 255;
2683 B = (B * modulateB) / 255;
2685 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
2691 info->dst += info->dst_pitch;
2695 static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
2697 const int flags = info->flags;
2698 const Uint32 modulateR = info->r;
2699 const Uint32 modulateG = info->g;
2700 const Uint32 modulateB = info->b;
2701 const Uint32 modulateA = info->a;
2703 Uint32 srcR, srcG, srcB, srcA;
2705 Uint32 dstR, dstG, dstB;
2707 while (info->dst_h--) {
2708 Uint32 *src = (Uint32 *)info->src;
2709 Uint32 *dst = (Uint32 *)info->dst;
2710 int n = info->dst_w;
2713 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
2715 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
2716 if (flags & SDL_COPY_MODULATE_COLOR) {
2717 srcR = (srcR * modulateR) / 255;
2718 srcG = (srcG * modulateG) / 255;
2719 srcB = (srcB * modulateB) / 255;
2721 if (flags & SDL_COPY_MODULATE_ALPHA) {
2722 srcA = (srcA * modulateA) / 255;
2724 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2725 /* This goes away if we ever use premultiplied alpha */
2727 srcR = (srcR * srcA) / 255;
2728 srcG = (srcG * srcA) / 255;
2729 srcB = (srcB * srcA) / 255;
2732 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2733 case SDL_COPY_BLEND:
2734 dstR = srcR + ((255 - srcA) * dstR) / 255;
2735 dstG = srcG + ((255 - srcA) * dstG) / 255;
2736 dstB = srcB + ((255 - srcA) * dstB) / 255;
2739 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2740 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2741 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2744 dstR = (srcR * dstR) / 255;
2745 dstG = (srcG * dstG) / 255;
2746 dstB = (srcB * dstB) / 255;
2749 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
2754 info->src += info->src_pitch;
2755 info->dst += info->dst_pitch;
2759 static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
2761 const int flags = info->flags;
2762 const Uint32 modulateR = info->r;
2763 const Uint32 modulateG = info->g;
2764 const Uint32 modulateB = info->b;
2765 const Uint32 modulateA = info->a;
2767 Uint32 srcR, srcG, srcB, srcA;
2769 Uint32 dstR, dstG, dstB;
2776 incy = (info->src_h << 16) / info->dst_h;
2777 incx = (info->src_w << 16) / info->dst_w;
2779 while (info->dst_h--) {
2781 Uint32 *dst = (Uint32 *)info->dst;
2782 int n = info->dst_w;
2785 while (posy >= 0x10000L) {
2790 if (posx >= 0x10000L) {
2791 while (posx >= 0x10000L) {
2795 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2798 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
2800 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
2801 if (flags & SDL_COPY_MODULATE_COLOR) {
2802 srcR = (srcR * modulateR) / 255;
2803 srcG = (srcG * modulateG) / 255;
2804 srcB = (srcB * modulateB) / 255;
2806 if (flags & SDL_COPY_MODULATE_ALPHA) {
2807 srcA = (srcA * modulateA) / 255;
2809 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2810 /* This goes away if we ever use premultiplied alpha */
2812 srcR = (srcR * srcA) / 255;
2813 srcG = (srcG * srcA) / 255;
2814 srcB = (srcB * srcA) / 255;
2817 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2818 case SDL_COPY_BLEND:
2819 dstR = srcR + ((255 - srcA) * dstR) / 255;
2820 dstG = srcG + ((255 - srcA) * dstG) / 255;
2821 dstB = srcB + ((255 - srcA) * dstB) / 255;
2824 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2825 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2826 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2829 dstR = (srcR * dstR) / 255;
2830 dstG = (srcG * dstG) / 255;
2831 dstB = (srcB * dstB) / 255;
2834 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
2840 info->dst += info->dst_pitch;
2844 static void SDL_Blit_ARGB8888_BGR888_Scale(SDL_BlitInfo *info)
2854 incy = (info->src_h << 16) / info->dst_h;
2855 incx = (info->src_w << 16) / info->dst_w;
2857 while (info->dst_h--) {
2859 Uint32 *dst = (Uint32 *)info->dst;
2860 int n = info->dst_w;
2863 while (posy >= 0x10000L) {
2868 if (posx >= 0x10000L) {
2869 while (posx >= 0x10000L) {
2873 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2876 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
2877 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
2883 info->dst += info->dst_pitch;
2887 static void SDL_Blit_ARGB8888_BGR888_Blend(SDL_BlitInfo *info)
2889 const int flags = info->flags;
2891 Uint32 srcR, srcG, srcB, srcA;
2893 Uint32 dstR, dstG, dstB;
2895 while (info->dst_h--) {
2896 Uint32 *src = (Uint32 *)info->src;
2897 Uint32 *dst = (Uint32 *)info->dst;
2898 int n = info->dst_w;
2901 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
2903 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
2904 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2905 /* This goes away if we ever use premultiplied alpha */
2907 srcR = (srcR * srcA) / 255;
2908 srcG = (srcG * srcA) / 255;
2909 srcB = (srcB * srcA) / 255;
2912 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2913 case SDL_COPY_BLEND:
2914 dstR = srcR + ((255 - srcA) * dstR) / 255;
2915 dstG = srcG + ((255 - srcA) * dstG) / 255;
2916 dstB = srcB + ((255 - srcA) * dstB) / 255;
2919 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2920 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2921 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2924 dstR = (srcR * dstR) / 255;
2925 dstG = (srcG * dstG) / 255;
2926 dstB = (srcB * dstB) / 255;
2929 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
2934 info->src += info->src_pitch;
2935 info->dst += info->dst_pitch;
2939 static void SDL_Blit_ARGB8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
2941 const int flags = info->flags;
2943 Uint32 srcR, srcG, srcB, srcA;
2945 Uint32 dstR, dstG, dstB;
2952 incy = (info->src_h << 16) / info->dst_h;
2953 incx = (info->src_w << 16) / info->dst_w;
2955 while (info->dst_h--) {
2957 Uint32 *dst = (Uint32 *)info->dst;
2958 int n = info->dst_w;
2961 while (posy >= 0x10000L) {
2966 if (posx >= 0x10000L) {
2967 while (posx >= 0x10000L) {
2971 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
2974 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
2976 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
2977 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
2978 /* This goes away if we ever use premultiplied alpha */
2980 srcR = (srcR * srcA) / 255;
2981 srcG = (srcG * srcA) / 255;
2982 srcB = (srcB * srcA) / 255;
2985 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
2986 case SDL_COPY_BLEND:
2987 dstR = srcR + ((255 - srcA) * dstR) / 255;
2988 dstG = srcG + ((255 - srcA) * dstG) / 255;
2989 dstB = srcB + ((255 - srcA) * dstB) / 255;
2992 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
2993 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
2994 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
2997 dstR = (srcR * dstR) / 255;
2998 dstG = (srcG * dstG) / 255;
2999 dstB = (srcB * dstB) / 255;
3002 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
3008 info->dst += info->dst_pitch;
3012 static void SDL_Blit_ARGB8888_BGR888_Modulate(SDL_BlitInfo *info)
3014 const int flags = info->flags;
3015 const Uint32 modulateR = info->r;
3016 const Uint32 modulateG = info->g;
3017 const Uint32 modulateB = info->b;
3021 while (info->dst_h--) {
3022 Uint32 *src = (Uint32 *)info->src;
3023 Uint32 *dst = (Uint32 *)info->dst;
3024 int n = info->dst_w;
3027 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
3028 if (flags & SDL_COPY_MODULATE_COLOR) {
3029 R = (R * modulateR) / 255;
3030 G = (G * modulateG) / 255;
3031 B = (B * modulateB) / 255;
3033 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
3038 info->src += info->src_pitch;
3039 info->dst += info->dst_pitch;
3043 static void SDL_Blit_ARGB8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
3045 const int flags = info->flags;
3046 const Uint32 modulateR = info->r;
3047 const Uint32 modulateG = info->g;
3048 const Uint32 modulateB = info->b;
3057 incy = (info->src_h << 16) / info->dst_h;
3058 incx = (info->src_w << 16) / info->dst_w;
3060 while (info->dst_h--) {
3062 Uint32 *dst = (Uint32 *)info->dst;
3063 int n = info->dst_w;
3066 while (posy >= 0x10000L) {
3071 if (posx >= 0x10000L) {
3072 while (posx >= 0x10000L) {
3076 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
3079 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
3080 if (flags & SDL_COPY_MODULATE_COLOR) {
3081 R = (R * modulateR) / 255;
3082 G = (G * modulateG) / 255;
3083 B = (B * modulateB) / 255;
3085 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
3091 info->dst += info->dst_pitch;
3095 static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
3097 const int flags = info->flags;
3098 const Uint32 modulateR = info->r;
3099 const Uint32 modulateG = info->g;
3100 const Uint32 modulateB = info->b;
3101 const Uint32 modulateA = info->a;
3103 Uint32 srcR, srcG, srcB, srcA;
3105 Uint32 dstR, dstG, dstB;
3107 while (info->dst_h--) {
3108 Uint32 *src = (Uint32 *)info->src;
3109 Uint32 *dst = (Uint32 *)info->dst;
3110 int n = info->dst_w;
3113 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
3115 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
3116 if (flags & SDL_COPY_MODULATE_COLOR) {
3117 srcR = (srcR * modulateR) / 255;
3118 srcG = (srcG * modulateG) / 255;
3119 srcB = (srcB * modulateB) / 255;
3121 if (flags & SDL_COPY_MODULATE_ALPHA) {
3122 srcA = (srcA * modulateA) / 255;
3124 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
3125 /* This goes away if we ever use premultiplied alpha */
3127 srcR = (srcR * srcA) / 255;
3128 srcG = (srcG * srcA) / 255;
3129 srcB = (srcB * srcA) / 255;
3132 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
3133 case SDL_COPY_BLEND:
3134 dstR = srcR + ((255 - srcA) * dstR) / 255;
3135 dstG = srcG + ((255 - srcA) * dstG) / 255;
3136 dstB = srcB + ((255 - srcA) * dstB) / 255;
3139 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
3140 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
3141 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
3144 dstR = (srcR * dstR) / 255;
3145 dstG = (srcG * dstG) / 255;
3146 dstB = (srcB * dstB) / 255;
3149 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
3154 info->src += info->src_pitch;
3155 info->dst += info->dst_pitch;
3159 static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
3161 const int flags = info->flags;
3162 const Uint32 modulateR = info->r;
3163 const Uint32 modulateG = info->g;
3164 const Uint32 modulateB = info->b;
3165 const Uint32 modulateA = info->a;
3167 Uint32 srcR, srcG, srcB, srcA;
3169 Uint32 dstR, dstG, dstB;
3176 incy = (info->src_h << 16) / info->dst_h;
3177 incx = (info->src_w << 16) / info->dst_w;
3179 while (info->dst_h--) {
3181 Uint32 *dst = (Uint32 *)info->dst;
3182 int n = info->dst_w;
3185 while (posy >= 0x10000L) {
3190 if (posx >= 0x10000L) {
3191 while (posx >= 0x10000L) {
3195 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
3198 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
3200 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
3201 if (flags & SDL_COPY_MODULATE_COLOR) {
3202 srcR = (srcR * modulateR) / 255;
3203 srcG = (srcG * modulateG) / 255;
3204 srcB = (srcB * modulateB) / 255;
3206 if (flags & SDL_COPY_MODULATE_ALPHA) {
3207 srcA = (srcA * modulateA) / 255;
3209 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
3210 /* This goes away if we ever use premultiplied alpha */
3212 srcR = (srcR * srcA) / 255;
3213 srcG = (srcG * srcA) / 255;
3214 srcB = (srcB * srcA) / 255;
3217 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
3218 case SDL_COPY_BLEND:
3219 dstR = srcR + ((255 - srcA) * dstR) / 255;
3220 dstG = srcG + ((255 - srcA) * dstG) / 255;
3221 dstB = srcB + ((255 - srcA) * dstB) / 255;
3224 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
3225 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
3226 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
3229 dstR = (srcR * dstR) / 255;
3230 dstG = (srcG * dstG) / 255;
3231 dstB = (srcB * dstB) / 255;
3234 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
3240 info->dst += info->dst_pitch;
3244 static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info)
3252 incy = (info->src_h << 16) / info->dst_h;
3253 incx = (info->src_w << 16) / info->dst_w;
3255 while (info->dst_h--) {
3257 Uint32 *dst = (Uint32 *)info->dst;
3258 int n = info->dst_w;
3261 while (posy >= 0x10000L) {
3266 if (posx >= 0x10000L) {
3267 while (posx >= 0x10000L) {
3271 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
3278 info->dst += info->dst_pitch;
3282 static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info)
3284 const int flags = info->flags;
3286 Uint32 srcR, srcG, srcB, srcA;
3288 Uint32 dstR, dstG, dstB, dstA;
3290 while (info->dst_h--) {
3291 Uint32 *src = (Uint32 *)info->src;
3292 Uint32 *dst = (Uint32 *)info->dst;
3293 int n = info->dst_w;
3296 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
3298 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
3299 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
3300 /* This goes away if we ever use premultiplied alpha */
3302 srcR = (srcR * srcA) / 255;
3303 srcG = (srcG * srcA) / 255;
3304 srcB = (srcB * srcA) / 255;
3307 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
3308 case SDL_COPY_BLEND:
3309 dstR = srcR + ((255 - srcA) * dstR) / 255;
3310 dstG = srcG + ((255 - srcA) * dstG) / 255;
3311 dstB = srcB + ((255 - srcA) * dstB) / 255;
3312 dstA = srcA + ((255 - srcA) * dstA) / 255;
3315 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
3316 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
3317 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
3320 dstR = (srcR * dstR) / 255;
3321 dstG = (srcG * dstG) / 255;
3322 dstB = (srcB * dstB) / 255;
3325 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
3330 info->src += info->src_pitch;
3331 info->dst += info->dst_pitch;
3335 static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
3337 const int flags = info->flags;
3339 Uint32 srcR, srcG, srcB, srcA;
3341 Uint32 dstR, dstG, dstB, dstA;
3348 incy = (info->src_h << 16) / info->dst_h;
3349 incx = (info->src_w << 16) / info->dst_w;
3351 while (info->dst_h--) {
3353 Uint32 *dst = (Uint32 *)info->dst;
3354 int n = info->dst_w;
3357 while (posy >= 0x10000L) {
3362 if (posx >= 0x10000L) {
3363 while (posx >= 0x10000L) {
3367 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
3370 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
3372 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
3373 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
3374 /* This goes away if we ever use premultiplied alpha */
3376 srcR = (srcR * srcA) / 255;
3377 srcG = (srcG * srcA) / 255;
3378 srcB = (srcB * srcA) / 255;
3381 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
3382 case SDL_COPY_BLEND:
3383 dstR = srcR + ((255 - srcA) * dstR) / 255;
3384 dstG = srcG + ((255 - srcA) * dstG) / 255;
3385 dstB = srcB + ((255 - srcA) * dstB) / 255;
3386 dstA = srcA + ((255 - srcA) * dstA) / 255;
3389 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
3390 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
3391 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
3394 dstR = (srcR * dstR) / 255;
3395 dstG = (srcG * dstG) / 255;
3396 dstB = (srcB * dstB) / 255;
3399 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
3405 info->dst += info->dst_pitch;
3409 static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info)
3411 const int flags = info->flags;
3412 const Uint32 modulateR = info->r;
3413 const Uint32 modulateG = info->g;
3414 const Uint32 modulateB = info->b;
3415 const Uint32 modulateA = info->a;
3419 while (info->dst_h--) {
3420 Uint32 *src = (Uint32 *)info->src;
3421 Uint32 *dst = (Uint32 *)info->dst;
3422 int n = info->dst_w;
3425 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24);
3426 if (flags & SDL_COPY_MODULATE_COLOR) {
3427 R = (R * modulateR) / 255;
3428 G = (G * modulateG) / 255;
3429 B = (B * modulateB) / 255;
3431 if (flags & SDL_COPY_MODULATE_ALPHA) {
3432 A = (A * modulateA) / 255;
3434 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
3439 info->src += info->src_pitch;
3440 info->dst += info->dst_pitch;
3444 static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
3446 const int flags = info->flags;
3447 const Uint32 modulateR = info->r;
3448 const Uint32 modulateG = info->g;
3449 const Uint32 modulateB = info->b;
3450 const Uint32 modulateA = info->a;
3459 incy = (info->src_h << 16) / info->dst_h;
3460 incx = (info->src_w << 16) / info->dst_w;
3462 while (info->dst_h--) {
3464 Uint32 *dst = (Uint32 *)info->dst;
3465 int n = info->dst_w;
3468 while (posy >= 0x10000L) {
3473 if (posx >= 0x10000L) {
3474 while (posx >= 0x10000L) {
3478 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
3481 R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24);
3482 if (flags & SDL_COPY_MODULATE_COLOR) {
3483 R = (R * modulateR) / 255;
3484 G = (G * modulateG) / 255;
3485 B = (B * modulateB) / 255;
3487 if (flags & SDL_COPY_MODULATE_ALPHA) {
3488 A = (A * modulateA) / 255;
3490 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
3496 info->dst += info->dst_pitch;
3500 static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
3502 const int flags = info->flags;
3503 const Uint32 modulateR = info->r;
3504 const Uint32 modulateG = info->g;
3505 const Uint32 modulateB = info->b;
3506 const Uint32 modulateA = info->a;
3508 Uint32 srcR, srcG, srcB, srcA;
3510 Uint32 dstR, dstG, dstB, dstA;
3512 while (info->dst_h--) {
3513 Uint32 *src = (Uint32 *)info->src;
3514 Uint32 *dst = (Uint32 *)info->dst;
3515 int n = info->dst_w;
3518 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
3520 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
3521 if (flags & SDL_COPY_MODULATE_COLOR) {
3522 srcR = (srcR * modulateR) / 255;
3523 srcG = (srcG * modulateG) / 255;
3524 srcB = (srcB * modulateB) / 255;
3526 if (flags & SDL_COPY_MODULATE_ALPHA) {
3527 srcA = (srcA * modulateA) / 255;
3529 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
3530 /* This goes away if we ever use premultiplied alpha */
3532 srcR = (srcR * srcA) / 255;
3533 srcG = (srcG * srcA) / 255;
3534 srcB = (srcB * srcA) / 255;
3537 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
3538 case SDL_COPY_BLEND:
3539 dstR = srcR + ((255 - srcA) * dstR) / 255;
3540 dstG = srcG + ((255 - srcA) * dstG) / 255;
3541 dstB = srcB + ((255 - srcA) * dstB) / 255;
3542 dstA = srcA + ((255 - srcA) * dstA) / 255;
3545 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
3546 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
3547 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
3550 dstR = (srcR * dstR) / 255;
3551 dstG = (srcG * dstG) / 255;
3552 dstB = (srcB * dstB) / 255;
3555 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
3560 info->src += info->src_pitch;
3561 info->dst += info->dst_pitch;
3565 static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
3567 const int flags = info->flags;
3568 const Uint32 modulateR = info->r;
3569 const Uint32 modulateG = info->g;
3570 const Uint32 modulateB = info->b;
3571 const Uint32 modulateA = info->a;
3573 Uint32 srcR, srcG, srcB, srcA;
3575 Uint32 dstR, dstG, dstB, dstA;
3582 incy = (info->src_h << 16) / info->dst_h;
3583 incx = (info->src_w << 16) / info->dst_w;
3585 while (info->dst_h--) {
3587 Uint32 *dst = (Uint32 *)info->dst;
3588 int n = info->dst_w;
3591 while (posy >= 0x10000L) {
3596 if (posx >= 0x10000L) {
3597 while (posx >= 0x10000L) {
3601 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
3604 srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
3606 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
3607 if (flags & SDL_COPY_MODULATE_COLOR) {
3608 srcR = (srcR * modulateR) / 255;
3609 srcG = (srcG * modulateG) / 255;
3610 srcB = (srcB * modulateB) / 255;
3612 if (flags & SDL_COPY_MODULATE_ALPHA) {
3613 srcA = (srcA * modulateA) / 255;
3615 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
3616 /* This goes away if we ever use premultiplied alpha */
3618 srcR = (srcR * srcA) / 255;
3619 srcG = (srcG * srcA) / 255;
3620 srcB = (srcB * srcA) / 255;
3623 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
3624 case SDL_COPY_BLEND:
3625 dstR = srcR + ((255 - srcA) * dstR) / 255;
3626 dstG = srcG + ((255 - srcA) * dstG) / 255;
3627 dstB = srcB + ((255 - srcA) * dstB) / 255;
3628 dstA = srcA + ((255 - srcA) * dstA) / 255;
3631 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
3632 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
3633 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
3636 dstR = (srcR * dstR) / 255;
3637 dstG = (srcG * dstG) / 255;
3638 dstB = (srcB * dstB) / 255;
3641 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
3647 info->dst += info->dst_pitch;
3651 static void SDL_Blit_RGBA8888_RGB888_Scale(SDL_BlitInfo *info)
3661 incy = (info->src_h << 16) / info->dst_h;
3662 incx = (info->src_w << 16) / info->dst_w;
3664 while (info->dst_h--) {
3666 Uint32 *dst = (Uint32 *)info->dst;
3667 int n = info->dst_w;
3670 while (posy >= 0x10000L) {
3675 if (posx >= 0x10000L) {
3676 while (posx >= 0x10000L) {
3680 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
3683 R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
3684 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
3690 info->dst += info->dst_pitch;
3694 static void SDL_Blit_RGBA8888_RGB888_Blend(SDL_BlitInfo *info)
3696 const int flags = info->flags;
3698 Uint32 srcR, srcG, srcB, srcA;
3700 Uint32 dstR, dstG, dstB;
3702 while (info->dst_h--) {
3703 Uint32 *src = (Uint32 *)info->src;
3704 Uint32 *dst = (Uint32 *)info->dst;
3705 int n = info->dst_w;
3708 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
3710 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
3711 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
3712 /* This goes away if we ever use premultiplied alpha */
3714 srcR = (srcR * srcA) / 255;
3715 srcG = (srcG * srcA) / 255;
3716 srcB = (srcB * srcA) / 255;
3719 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
3720 case SDL_COPY_BLEND:
3721 dstR = srcR + ((255 - srcA) * dstR) / 255;
3722 dstG = srcG + ((255 - srcA) * dstG) / 255;
3723 dstB = srcB + ((255 - srcA) * dstB) / 255;
3726 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
3727 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
3728 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
3731 dstR = (srcR * dstR) / 255;
3732 dstG = (srcG * dstG) / 255;
3733 dstB = (srcB * dstB) / 255;
3736 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
3741 info->src += info->src_pitch;
3742 info->dst += info->dst_pitch;
3746 static void SDL_Blit_RGBA8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
3748 const int flags = info->flags;
3750 Uint32 srcR, srcG, srcB, srcA;
3752 Uint32 dstR, dstG, dstB;
3759 incy = (info->src_h << 16) / info->dst_h;
3760 incx = (info->src_w << 16) / info->dst_w;
3762 while (info->dst_h--) {
3764 Uint32 *dst = (Uint32 *)info->dst;
3765 int n = info->dst_w;
3768 while (posy >= 0x10000L) {
3773 if (posx >= 0x10000L) {
3774 while (posx >= 0x10000L) {
3778 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
3781 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
3783 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
3784 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
3785 /* This goes away if we ever use premultiplied alpha */
3787 srcR = (srcR * srcA) / 255;
3788 srcG = (srcG * srcA) / 255;
3789 srcB = (srcB * srcA) / 255;
3792 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
3793 case SDL_COPY_BLEND:
3794 dstR = srcR + ((255 - srcA) * dstR) / 255;
3795 dstG = srcG + ((255 - srcA) * dstG) / 255;
3796 dstB = srcB + ((255 - srcA) * dstB) / 255;
3799 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
3800 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
3801 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
3804 dstR = (srcR * dstR) / 255;
3805 dstG = (srcG * dstG) / 255;
3806 dstB = (srcB * dstB) / 255;
3809 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
3815 info->dst += info->dst_pitch;
3819 static void SDL_Blit_RGBA8888_RGB888_Modulate(SDL_BlitInfo *info)
3821 const int flags = info->flags;
3822 const Uint32 modulateR = info->r;
3823 const Uint32 modulateG = info->g;
3824 const Uint32 modulateB = info->b;
3828 while (info->dst_h--) {
3829 Uint32 *src = (Uint32 *)info->src;
3830 Uint32 *dst = (Uint32 *)info->dst;
3831 int n = info->dst_w;
3834 R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
3835 if (flags & SDL_COPY_MODULATE_COLOR) {
3836 R = (R * modulateR) / 255;
3837 G = (G * modulateG) / 255;
3838 B = (B * modulateB) / 255;
3840 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
3845 info->src += info->src_pitch;
3846 info->dst += info->dst_pitch;
3850 static void SDL_Blit_RGBA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
3852 const int flags = info->flags;
3853 const Uint32 modulateR = info->r;
3854 const Uint32 modulateG = info->g;
3855 const Uint32 modulateB = info->b;
3864 incy = (info->src_h << 16) / info->dst_h;
3865 incx = (info->src_w << 16) / info->dst_w;
3867 while (info->dst_h--) {
3869 Uint32 *dst = (Uint32 *)info->dst;
3870 int n = info->dst_w;
3873 while (posy >= 0x10000L) {
3878 if (posx >= 0x10000L) {
3879 while (posx >= 0x10000L) {
3883 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
3886 R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
3887 if (flags & SDL_COPY_MODULATE_COLOR) {
3888 R = (R * modulateR) / 255;
3889 G = (G * modulateG) / 255;
3890 B = (B * modulateB) / 255;
3892 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
3898 info->dst += info->dst_pitch;
3902 static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
3904 const int flags = info->flags;
3905 const Uint32 modulateR = info->r;
3906 const Uint32 modulateG = info->g;
3907 const Uint32 modulateB = info->b;
3908 const Uint32 modulateA = info->a;
3910 Uint32 srcR, srcG, srcB, srcA;
3912 Uint32 dstR, dstG, dstB;
3914 while (info->dst_h--) {
3915 Uint32 *src = (Uint32 *)info->src;
3916 Uint32 *dst = (Uint32 *)info->dst;
3917 int n = info->dst_w;
3920 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
3922 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
3923 if (flags & SDL_COPY_MODULATE_COLOR) {
3924 srcR = (srcR * modulateR) / 255;
3925 srcG = (srcG * modulateG) / 255;
3926 srcB = (srcB * modulateB) / 255;
3928 if (flags & SDL_COPY_MODULATE_ALPHA) {
3929 srcA = (srcA * modulateA) / 255;
3931 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
3932 /* This goes away if we ever use premultiplied alpha */
3934 srcR = (srcR * srcA) / 255;
3935 srcG = (srcG * srcA) / 255;
3936 srcB = (srcB * srcA) / 255;
3939 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
3940 case SDL_COPY_BLEND:
3941 dstR = srcR + ((255 - srcA) * dstR) / 255;
3942 dstG = srcG + ((255 - srcA) * dstG) / 255;
3943 dstB = srcB + ((255 - srcA) * dstB) / 255;
3946 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
3947 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
3948 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
3951 dstR = (srcR * dstR) / 255;
3952 dstG = (srcG * dstG) / 255;
3953 dstB = (srcB * dstB) / 255;
3956 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
3961 info->src += info->src_pitch;
3962 info->dst += info->dst_pitch;
3966 static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
3968 const int flags = info->flags;
3969 const Uint32 modulateR = info->r;
3970 const Uint32 modulateG = info->g;
3971 const Uint32 modulateB = info->b;
3972 const Uint32 modulateA = info->a;
3974 Uint32 srcR, srcG, srcB, srcA;
3976 Uint32 dstR, dstG, dstB;
3983 incy = (info->src_h << 16) / info->dst_h;
3984 incx = (info->src_w << 16) / info->dst_w;
3986 while (info->dst_h--) {
3988 Uint32 *dst = (Uint32 *)info->dst;
3989 int n = info->dst_w;
3992 while (posy >= 0x10000L) {
3997 if (posx >= 0x10000L) {
3998 while (posx >= 0x10000L) {
4002 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4005 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
4007 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
4008 if (flags & SDL_COPY_MODULATE_COLOR) {
4009 srcR = (srcR * modulateR) / 255;
4010 srcG = (srcG * modulateG) / 255;
4011 srcB = (srcB * modulateB) / 255;
4013 if (flags & SDL_COPY_MODULATE_ALPHA) {
4014 srcA = (srcA * modulateA) / 255;
4016 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4017 /* This goes away if we ever use premultiplied alpha */
4019 srcR = (srcR * srcA) / 255;
4020 srcG = (srcG * srcA) / 255;
4021 srcB = (srcB * srcA) / 255;
4024 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4025 case SDL_COPY_BLEND:
4026 dstR = srcR + ((255 - srcA) * dstR) / 255;
4027 dstG = srcG + ((255 - srcA) * dstG) / 255;
4028 dstB = srcB + ((255 - srcA) * dstB) / 255;
4031 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4032 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4033 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4036 dstR = (srcR * dstR) / 255;
4037 dstG = (srcG * dstG) / 255;
4038 dstB = (srcB * dstB) / 255;
4041 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
4047 info->dst += info->dst_pitch;
4051 static void SDL_Blit_RGBA8888_BGR888_Scale(SDL_BlitInfo *info)
4061 incy = (info->src_h << 16) / info->dst_h;
4062 incx = (info->src_w << 16) / info->dst_w;
4064 while (info->dst_h--) {
4066 Uint32 *dst = (Uint32 *)info->dst;
4067 int n = info->dst_w;
4070 while (posy >= 0x10000L) {
4075 if (posx >= 0x10000L) {
4076 while (posx >= 0x10000L) {
4080 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4083 R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
4084 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
4090 info->dst += info->dst_pitch;
4094 static void SDL_Blit_RGBA8888_BGR888_Blend(SDL_BlitInfo *info)
4096 const int flags = info->flags;
4098 Uint32 srcR, srcG, srcB, srcA;
4100 Uint32 dstR, dstG, dstB;
4102 while (info->dst_h--) {
4103 Uint32 *src = (Uint32 *)info->src;
4104 Uint32 *dst = (Uint32 *)info->dst;
4105 int n = info->dst_w;
4108 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
4110 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
4111 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4112 /* This goes away if we ever use premultiplied alpha */
4114 srcR = (srcR * srcA) / 255;
4115 srcG = (srcG * srcA) / 255;
4116 srcB = (srcB * srcA) / 255;
4119 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4120 case SDL_COPY_BLEND:
4121 dstR = srcR + ((255 - srcA) * dstR) / 255;
4122 dstG = srcG + ((255 - srcA) * dstG) / 255;
4123 dstB = srcB + ((255 - srcA) * dstB) / 255;
4126 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4127 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4128 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4131 dstR = (srcR * dstR) / 255;
4132 dstG = (srcG * dstG) / 255;
4133 dstB = (srcB * dstB) / 255;
4136 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
4141 info->src += info->src_pitch;
4142 info->dst += info->dst_pitch;
4146 static void SDL_Blit_RGBA8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
4148 const int flags = info->flags;
4150 Uint32 srcR, srcG, srcB, srcA;
4152 Uint32 dstR, dstG, dstB;
4159 incy = (info->src_h << 16) / info->dst_h;
4160 incx = (info->src_w << 16) / info->dst_w;
4162 while (info->dst_h--) {
4164 Uint32 *dst = (Uint32 *)info->dst;
4165 int n = info->dst_w;
4168 while (posy >= 0x10000L) {
4173 if (posx >= 0x10000L) {
4174 while (posx >= 0x10000L) {
4178 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4181 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
4183 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
4184 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4185 /* This goes away if we ever use premultiplied alpha */
4187 srcR = (srcR * srcA) / 255;
4188 srcG = (srcG * srcA) / 255;
4189 srcB = (srcB * srcA) / 255;
4192 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4193 case SDL_COPY_BLEND:
4194 dstR = srcR + ((255 - srcA) * dstR) / 255;
4195 dstG = srcG + ((255 - srcA) * dstG) / 255;
4196 dstB = srcB + ((255 - srcA) * dstB) / 255;
4199 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4200 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4201 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4204 dstR = (srcR * dstR) / 255;
4205 dstG = (srcG * dstG) / 255;
4206 dstB = (srcB * dstB) / 255;
4209 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
4215 info->dst += info->dst_pitch;
4219 static void SDL_Blit_RGBA8888_BGR888_Modulate(SDL_BlitInfo *info)
4221 const int flags = info->flags;
4222 const Uint32 modulateR = info->r;
4223 const Uint32 modulateG = info->g;
4224 const Uint32 modulateB = info->b;
4228 while (info->dst_h--) {
4229 Uint32 *src = (Uint32 *)info->src;
4230 Uint32 *dst = (Uint32 *)info->dst;
4231 int n = info->dst_w;
4234 R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
4235 if (flags & SDL_COPY_MODULATE_COLOR) {
4236 R = (R * modulateR) / 255;
4237 G = (G * modulateG) / 255;
4238 B = (B * modulateB) / 255;
4240 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
4245 info->src += info->src_pitch;
4246 info->dst += info->dst_pitch;
4250 static void SDL_Blit_RGBA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
4252 const int flags = info->flags;
4253 const Uint32 modulateR = info->r;
4254 const Uint32 modulateG = info->g;
4255 const Uint32 modulateB = info->b;
4264 incy = (info->src_h << 16) / info->dst_h;
4265 incx = (info->src_w << 16) / info->dst_w;
4267 while (info->dst_h--) {
4269 Uint32 *dst = (Uint32 *)info->dst;
4270 int n = info->dst_w;
4273 while (posy >= 0x10000L) {
4278 if (posx >= 0x10000L) {
4279 while (posx >= 0x10000L) {
4283 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4286 R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
4287 if (flags & SDL_COPY_MODULATE_COLOR) {
4288 R = (R * modulateR) / 255;
4289 G = (G * modulateG) / 255;
4290 B = (B * modulateB) / 255;
4292 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
4298 info->dst += info->dst_pitch;
4302 static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
4304 const int flags = info->flags;
4305 const Uint32 modulateR = info->r;
4306 const Uint32 modulateG = info->g;
4307 const Uint32 modulateB = info->b;
4308 const Uint32 modulateA = info->a;
4310 Uint32 srcR, srcG, srcB, srcA;
4312 Uint32 dstR, dstG, dstB;
4314 while (info->dst_h--) {
4315 Uint32 *src = (Uint32 *)info->src;
4316 Uint32 *dst = (Uint32 *)info->dst;
4317 int n = info->dst_w;
4320 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
4322 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
4323 if (flags & SDL_COPY_MODULATE_COLOR) {
4324 srcR = (srcR * modulateR) / 255;
4325 srcG = (srcG * modulateG) / 255;
4326 srcB = (srcB * modulateB) / 255;
4328 if (flags & SDL_COPY_MODULATE_ALPHA) {
4329 srcA = (srcA * modulateA) / 255;
4331 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4332 /* This goes away if we ever use premultiplied alpha */
4334 srcR = (srcR * srcA) / 255;
4335 srcG = (srcG * srcA) / 255;
4336 srcB = (srcB * srcA) / 255;
4339 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4340 case SDL_COPY_BLEND:
4341 dstR = srcR + ((255 - srcA) * dstR) / 255;
4342 dstG = srcG + ((255 - srcA) * dstG) / 255;
4343 dstB = srcB + ((255 - srcA) * dstB) / 255;
4346 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4347 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4348 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4351 dstR = (srcR * dstR) / 255;
4352 dstG = (srcG * dstG) / 255;
4353 dstB = (srcB * dstB) / 255;
4356 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
4361 info->src += info->src_pitch;
4362 info->dst += info->dst_pitch;
4366 static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
4368 const int flags = info->flags;
4369 const Uint32 modulateR = info->r;
4370 const Uint32 modulateG = info->g;
4371 const Uint32 modulateB = info->b;
4372 const Uint32 modulateA = info->a;
4374 Uint32 srcR, srcG, srcB, srcA;
4376 Uint32 dstR, dstG, dstB;
4383 incy = (info->src_h << 16) / info->dst_h;
4384 incx = (info->src_w << 16) / info->dst_w;
4386 while (info->dst_h--) {
4388 Uint32 *dst = (Uint32 *)info->dst;
4389 int n = info->dst_w;
4392 while (posy >= 0x10000L) {
4397 if (posx >= 0x10000L) {
4398 while (posx >= 0x10000L) {
4402 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4405 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
4407 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
4408 if (flags & SDL_COPY_MODULATE_COLOR) {
4409 srcR = (srcR * modulateR) / 255;
4410 srcG = (srcG * modulateG) / 255;
4411 srcB = (srcB * modulateB) / 255;
4413 if (flags & SDL_COPY_MODULATE_ALPHA) {
4414 srcA = (srcA * modulateA) / 255;
4416 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4417 /* This goes away if we ever use premultiplied alpha */
4419 srcR = (srcR * srcA) / 255;
4420 srcG = (srcG * srcA) / 255;
4421 srcB = (srcB * srcA) / 255;
4424 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4425 case SDL_COPY_BLEND:
4426 dstR = srcR + ((255 - srcA) * dstR) / 255;
4427 dstG = srcG + ((255 - srcA) * dstG) / 255;
4428 dstB = srcB + ((255 - srcA) * dstB) / 255;
4431 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4432 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4433 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4436 dstR = (srcR * dstR) / 255;
4437 dstG = (srcG * dstG) / 255;
4438 dstB = (srcB * dstB) / 255;
4441 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
4447 info->dst += info->dst_pitch;
4451 static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info)
4461 incy = (info->src_h << 16) / info->dst_h;
4462 incx = (info->src_w << 16) / info->dst_w;
4464 while (info->dst_h--) {
4466 Uint32 *dst = (Uint32 *)info->dst;
4467 int n = info->dst_w;
4470 while (posy >= 0x10000L) {
4475 if (posx >= 0x10000L) {
4476 while (posx >= 0x10000L) {
4480 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4483 R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
4484 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
4490 info->dst += info->dst_pitch;
4494 static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info)
4496 const int flags = info->flags;
4498 Uint32 srcR, srcG, srcB, srcA;
4500 Uint32 dstR, dstG, dstB, dstA;
4502 while (info->dst_h--) {
4503 Uint32 *src = (Uint32 *)info->src;
4504 Uint32 *dst = (Uint32 *)info->dst;
4505 int n = info->dst_w;
4508 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
4510 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
4511 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4512 /* This goes away if we ever use premultiplied alpha */
4514 srcR = (srcR * srcA) / 255;
4515 srcG = (srcG * srcA) / 255;
4516 srcB = (srcB * srcA) / 255;
4519 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4520 case SDL_COPY_BLEND:
4521 dstR = srcR + ((255 - srcA) * dstR) / 255;
4522 dstG = srcG + ((255 - srcA) * dstG) / 255;
4523 dstB = srcB + ((255 - srcA) * dstB) / 255;
4524 dstA = srcA + ((255 - srcA) * dstA) / 255;
4527 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4528 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4529 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4532 dstR = (srcR * dstR) / 255;
4533 dstG = (srcG * dstG) / 255;
4534 dstB = (srcB * dstB) / 255;
4537 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
4542 info->src += info->src_pitch;
4543 info->dst += info->dst_pitch;
4547 static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
4549 const int flags = info->flags;
4551 Uint32 srcR, srcG, srcB, srcA;
4553 Uint32 dstR, dstG, dstB, dstA;
4560 incy = (info->src_h << 16) / info->dst_h;
4561 incx = (info->src_w << 16) / info->dst_w;
4563 while (info->dst_h--) {
4565 Uint32 *dst = (Uint32 *)info->dst;
4566 int n = info->dst_w;
4569 while (posy >= 0x10000L) {
4574 if (posx >= 0x10000L) {
4575 while (posx >= 0x10000L) {
4579 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4582 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
4584 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
4585 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4586 /* This goes away if we ever use premultiplied alpha */
4588 srcR = (srcR * srcA) / 255;
4589 srcG = (srcG * srcA) / 255;
4590 srcB = (srcB * srcA) / 255;
4593 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4594 case SDL_COPY_BLEND:
4595 dstR = srcR + ((255 - srcA) * dstR) / 255;
4596 dstG = srcG + ((255 - srcA) * dstG) / 255;
4597 dstB = srcB + ((255 - srcA) * dstB) / 255;
4598 dstA = srcA + ((255 - srcA) * dstA) / 255;
4601 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4602 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4603 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4606 dstR = (srcR * dstR) / 255;
4607 dstG = (srcG * dstG) / 255;
4608 dstB = (srcB * dstB) / 255;
4611 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
4617 info->dst += info->dst_pitch;
4621 static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
4623 const int flags = info->flags;
4624 const Uint32 modulateR = info->r;
4625 const Uint32 modulateG = info->g;
4626 const Uint32 modulateB = info->b;
4627 const Uint32 modulateA = info->a;
4631 while (info->dst_h--) {
4632 Uint32 *src = (Uint32 *)info->src;
4633 Uint32 *dst = (Uint32 *)info->dst;
4634 int n = info->dst_w;
4637 R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
4638 if (flags & SDL_COPY_MODULATE_COLOR) {
4639 R = (R * modulateR) / 255;
4640 G = (G * modulateG) / 255;
4641 B = (B * modulateB) / 255;
4643 if (flags & SDL_COPY_MODULATE_ALPHA) {
4644 A = (A * modulateA) / 255;
4646 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
4651 info->src += info->src_pitch;
4652 info->dst += info->dst_pitch;
4656 static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
4658 const int flags = info->flags;
4659 const Uint32 modulateR = info->r;
4660 const Uint32 modulateG = info->g;
4661 const Uint32 modulateB = info->b;
4662 const Uint32 modulateA = info->a;
4671 incy = (info->src_h << 16) / info->dst_h;
4672 incx = (info->src_w << 16) / info->dst_w;
4674 while (info->dst_h--) {
4676 Uint32 *dst = (Uint32 *)info->dst;
4677 int n = info->dst_w;
4680 while (posy >= 0x10000L) {
4685 if (posx >= 0x10000L) {
4686 while (posx >= 0x10000L) {
4690 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4693 R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
4694 if (flags & SDL_COPY_MODULATE_COLOR) {
4695 R = (R * modulateR) / 255;
4696 G = (G * modulateG) / 255;
4697 B = (B * modulateB) / 255;
4699 if (flags & SDL_COPY_MODULATE_ALPHA) {
4700 A = (A * modulateA) / 255;
4702 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
4708 info->dst += info->dst_pitch;
4712 static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
4714 const int flags = info->flags;
4715 const Uint32 modulateR = info->r;
4716 const Uint32 modulateG = info->g;
4717 const Uint32 modulateB = info->b;
4718 const Uint32 modulateA = info->a;
4720 Uint32 srcR, srcG, srcB, srcA;
4722 Uint32 dstR, dstG, dstB, dstA;
4724 while (info->dst_h--) {
4725 Uint32 *src = (Uint32 *)info->src;
4726 Uint32 *dst = (Uint32 *)info->dst;
4727 int n = info->dst_w;
4730 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
4732 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
4733 if (flags & SDL_COPY_MODULATE_COLOR) {
4734 srcR = (srcR * modulateR) / 255;
4735 srcG = (srcG * modulateG) / 255;
4736 srcB = (srcB * modulateB) / 255;
4738 if (flags & SDL_COPY_MODULATE_ALPHA) {
4739 srcA = (srcA * modulateA) / 255;
4741 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4742 /* This goes away if we ever use premultiplied alpha */
4744 srcR = (srcR * srcA) / 255;
4745 srcG = (srcG * srcA) / 255;
4746 srcB = (srcB * srcA) / 255;
4749 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4750 case SDL_COPY_BLEND:
4751 dstR = srcR + ((255 - srcA) * dstR) / 255;
4752 dstG = srcG + ((255 - srcA) * dstG) / 255;
4753 dstB = srcB + ((255 - srcA) * dstB) / 255;
4754 dstA = srcA + ((255 - srcA) * dstA) / 255;
4757 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4758 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4759 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4762 dstR = (srcR * dstR) / 255;
4763 dstG = (srcG * dstG) / 255;
4764 dstB = (srcB * dstB) / 255;
4767 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
4772 info->src += info->src_pitch;
4773 info->dst += info->dst_pitch;
4777 static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
4779 const int flags = info->flags;
4780 const Uint32 modulateR = info->r;
4781 const Uint32 modulateG = info->g;
4782 const Uint32 modulateB = info->b;
4783 const Uint32 modulateA = info->a;
4785 Uint32 srcR, srcG, srcB, srcA;
4787 Uint32 dstR, dstG, dstB, dstA;
4794 incy = (info->src_h << 16) / info->dst_h;
4795 incx = (info->src_w << 16) / info->dst_w;
4797 while (info->dst_h--) {
4799 Uint32 *dst = (Uint32 *)info->dst;
4800 int n = info->dst_w;
4803 while (posy >= 0x10000L) {
4808 if (posx >= 0x10000L) {
4809 while (posx >= 0x10000L) {
4813 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4816 srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
4818 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
4819 if (flags & SDL_COPY_MODULATE_COLOR) {
4820 srcR = (srcR * modulateR) / 255;
4821 srcG = (srcG * modulateG) / 255;
4822 srcB = (srcB * modulateB) / 255;
4824 if (flags & SDL_COPY_MODULATE_ALPHA) {
4825 srcA = (srcA * modulateA) / 255;
4827 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4828 /* This goes away if we ever use premultiplied alpha */
4830 srcR = (srcR * srcA) / 255;
4831 srcG = (srcG * srcA) / 255;
4832 srcB = (srcB * srcA) / 255;
4835 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4836 case SDL_COPY_BLEND:
4837 dstR = srcR + ((255 - srcA) * dstR) / 255;
4838 dstG = srcG + ((255 - srcA) * dstG) / 255;
4839 dstB = srcB + ((255 - srcA) * dstB) / 255;
4840 dstA = srcA + ((255 - srcA) * dstA) / 255;
4843 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4844 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4845 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4848 dstR = (srcR * dstR) / 255;
4849 dstG = (srcG * dstG) / 255;
4850 dstB = (srcB * dstB) / 255;
4853 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
4859 info->dst += info->dst_pitch;
4863 static void SDL_Blit_ABGR8888_RGB888_Scale(SDL_BlitInfo *info)
4873 incy = (info->src_h << 16) / info->dst_h;
4874 incx = (info->src_w << 16) / info->dst_w;
4876 while (info->dst_h--) {
4878 Uint32 *dst = (Uint32 *)info->dst;
4879 int n = info->dst_w;
4882 while (posy >= 0x10000L) {
4887 if (posx >= 0x10000L) {
4888 while (posx >= 0x10000L) {
4892 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4895 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
4896 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
4902 info->dst += info->dst_pitch;
4906 static void SDL_Blit_ABGR8888_RGB888_Blend(SDL_BlitInfo *info)
4908 const int flags = info->flags;
4910 Uint32 srcR, srcG, srcB, srcA;
4912 Uint32 dstR, dstG, dstB;
4914 while (info->dst_h--) {
4915 Uint32 *src = (Uint32 *)info->src;
4916 Uint32 *dst = (Uint32 *)info->dst;
4917 int n = info->dst_w;
4920 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
4922 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
4923 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4924 /* This goes away if we ever use premultiplied alpha */
4926 srcR = (srcR * srcA) / 255;
4927 srcG = (srcG * srcA) / 255;
4928 srcB = (srcB * srcA) / 255;
4931 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
4932 case SDL_COPY_BLEND:
4933 dstR = srcR + ((255 - srcA) * dstR) / 255;
4934 dstG = srcG + ((255 - srcA) * dstG) / 255;
4935 dstB = srcB + ((255 - srcA) * dstB) / 255;
4938 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
4939 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
4940 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
4943 dstR = (srcR * dstR) / 255;
4944 dstG = (srcG * dstG) / 255;
4945 dstB = (srcB * dstB) / 255;
4948 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
4953 info->src += info->src_pitch;
4954 info->dst += info->dst_pitch;
4958 static void SDL_Blit_ABGR8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
4960 const int flags = info->flags;
4962 Uint32 srcR, srcG, srcB, srcA;
4964 Uint32 dstR, dstG, dstB;
4971 incy = (info->src_h << 16) / info->dst_h;
4972 incx = (info->src_w << 16) / info->dst_w;
4974 while (info->dst_h--) {
4976 Uint32 *dst = (Uint32 *)info->dst;
4977 int n = info->dst_w;
4980 while (posy >= 0x10000L) {
4985 if (posx >= 0x10000L) {
4986 while (posx >= 0x10000L) {
4990 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
4993 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
4995 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
4996 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
4997 /* This goes away if we ever use premultiplied alpha */
4999 srcR = (srcR * srcA) / 255;
5000 srcG = (srcG * srcA) / 255;
5001 srcB = (srcB * srcA) / 255;
5004 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5005 case SDL_COPY_BLEND:
5006 dstR = srcR + ((255 - srcA) * dstR) / 255;
5007 dstG = srcG + ((255 - srcA) * dstG) / 255;
5008 dstB = srcB + ((255 - srcA) * dstB) / 255;
5011 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5012 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5013 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5016 dstR = (srcR * dstR) / 255;
5017 dstG = (srcG * dstG) / 255;
5018 dstB = (srcB * dstB) / 255;
5021 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
5027 info->dst += info->dst_pitch;
5031 static void SDL_Blit_ABGR8888_RGB888_Modulate(SDL_BlitInfo *info)
5033 const int flags = info->flags;
5034 const Uint32 modulateR = info->r;
5035 const Uint32 modulateG = info->g;
5036 const Uint32 modulateB = info->b;
5040 while (info->dst_h--) {
5041 Uint32 *src = (Uint32 *)info->src;
5042 Uint32 *dst = (Uint32 *)info->dst;
5043 int n = info->dst_w;
5046 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
5047 if (flags & SDL_COPY_MODULATE_COLOR) {
5048 R = (R * modulateR) / 255;
5049 G = (G * modulateG) / 255;
5050 B = (B * modulateB) / 255;
5052 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
5057 info->src += info->src_pitch;
5058 info->dst += info->dst_pitch;
5062 static void SDL_Blit_ABGR8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
5064 const int flags = info->flags;
5065 const Uint32 modulateR = info->r;
5066 const Uint32 modulateG = info->g;
5067 const Uint32 modulateB = info->b;
5076 incy = (info->src_h << 16) / info->dst_h;
5077 incx = (info->src_w << 16) / info->dst_w;
5079 while (info->dst_h--) {
5081 Uint32 *dst = (Uint32 *)info->dst;
5082 int n = info->dst_w;
5085 while (posy >= 0x10000L) {
5090 if (posx >= 0x10000L) {
5091 while (posx >= 0x10000L) {
5095 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
5098 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
5099 if (flags & SDL_COPY_MODULATE_COLOR) {
5100 R = (R * modulateR) / 255;
5101 G = (G * modulateG) / 255;
5102 B = (B * modulateB) / 255;
5104 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
5110 info->dst += info->dst_pitch;
5114 static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
5116 const int flags = info->flags;
5117 const Uint32 modulateR = info->r;
5118 const Uint32 modulateG = info->g;
5119 const Uint32 modulateB = info->b;
5120 const Uint32 modulateA = info->a;
5122 Uint32 srcR, srcG, srcB, srcA;
5124 Uint32 dstR, dstG, dstB;
5126 while (info->dst_h--) {
5127 Uint32 *src = (Uint32 *)info->src;
5128 Uint32 *dst = (Uint32 *)info->dst;
5129 int n = info->dst_w;
5132 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
5134 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
5135 if (flags & SDL_COPY_MODULATE_COLOR) {
5136 srcR = (srcR * modulateR) / 255;
5137 srcG = (srcG * modulateG) / 255;
5138 srcB = (srcB * modulateB) / 255;
5140 if (flags & SDL_COPY_MODULATE_ALPHA) {
5141 srcA = (srcA * modulateA) / 255;
5143 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
5144 /* This goes away if we ever use premultiplied alpha */
5146 srcR = (srcR * srcA) / 255;
5147 srcG = (srcG * srcA) / 255;
5148 srcB = (srcB * srcA) / 255;
5151 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5152 case SDL_COPY_BLEND:
5153 dstR = srcR + ((255 - srcA) * dstR) / 255;
5154 dstG = srcG + ((255 - srcA) * dstG) / 255;
5155 dstB = srcB + ((255 - srcA) * dstB) / 255;
5158 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5159 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5160 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5163 dstR = (srcR * dstR) / 255;
5164 dstG = (srcG * dstG) / 255;
5165 dstB = (srcB * dstB) / 255;
5168 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
5173 info->src += info->src_pitch;
5174 info->dst += info->dst_pitch;
5178 static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
5180 const int flags = info->flags;
5181 const Uint32 modulateR = info->r;
5182 const Uint32 modulateG = info->g;
5183 const Uint32 modulateB = info->b;
5184 const Uint32 modulateA = info->a;
5186 Uint32 srcR, srcG, srcB, srcA;
5188 Uint32 dstR, dstG, dstB;
5195 incy = (info->src_h << 16) / info->dst_h;
5196 incx = (info->src_w << 16) / info->dst_w;
5198 while (info->dst_h--) {
5200 Uint32 *dst = (Uint32 *)info->dst;
5201 int n = info->dst_w;
5204 while (posy >= 0x10000L) {
5209 if (posx >= 0x10000L) {
5210 while (posx >= 0x10000L) {
5214 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
5217 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
5219 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
5220 if (flags & SDL_COPY_MODULATE_COLOR) {
5221 srcR = (srcR * modulateR) / 255;
5222 srcG = (srcG * modulateG) / 255;
5223 srcB = (srcB * modulateB) / 255;
5225 if (flags & SDL_COPY_MODULATE_ALPHA) {
5226 srcA = (srcA * modulateA) / 255;
5228 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
5229 /* This goes away if we ever use premultiplied alpha */
5231 srcR = (srcR * srcA) / 255;
5232 srcG = (srcG * srcA) / 255;
5233 srcB = (srcB * srcA) / 255;
5236 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5237 case SDL_COPY_BLEND:
5238 dstR = srcR + ((255 - srcA) * dstR) / 255;
5239 dstG = srcG + ((255 - srcA) * dstG) / 255;
5240 dstB = srcB + ((255 - srcA) * dstB) / 255;
5243 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5244 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5245 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5248 dstR = (srcR * dstR) / 255;
5249 dstG = (srcG * dstG) / 255;
5250 dstB = (srcB * dstB) / 255;
5253 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
5259 info->dst += info->dst_pitch;
5263 static void SDL_Blit_ABGR8888_BGR888_Scale(SDL_BlitInfo *info)
5273 incy = (info->src_h << 16) / info->dst_h;
5274 incx = (info->src_w << 16) / info->dst_w;
5276 while (info->dst_h--) {
5278 Uint32 *dst = (Uint32 *)info->dst;
5279 int n = info->dst_w;
5282 while (posy >= 0x10000L) {
5287 if (posx >= 0x10000L) {
5288 while (posx >= 0x10000L) {
5292 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
5295 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
5296 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
5302 info->dst += info->dst_pitch;
5306 static void SDL_Blit_ABGR8888_BGR888_Blend(SDL_BlitInfo *info)
5308 const int flags = info->flags;
5310 Uint32 srcR, srcG, srcB, srcA;
5312 Uint32 dstR, dstG, dstB;
5314 while (info->dst_h--) {
5315 Uint32 *src = (Uint32 *)info->src;
5316 Uint32 *dst = (Uint32 *)info->dst;
5317 int n = info->dst_w;
5320 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
5322 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
5323 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
5324 /* This goes away if we ever use premultiplied alpha */
5326 srcR = (srcR * srcA) / 255;
5327 srcG = (srcG * srcA) / 255;
5328 srcB = (srcB * srcA) / 255;
5331 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5332 case SDL_COPY_BLEND:
5333 dstR = srcR + ((255 - srcA) * dstR) / 255;
5334 dstG = srcG + ((255 - srcA) * dstG) / 255;
5335 dstB = srcB + ((255 - srcA) * dstB) / 255;
5338 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5339 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5340 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5343 dstR = (srcR * dstR) / 255;
5344 dstG = (srcG * dstG) / 255;
5345 dstB = (srcB * dstB) / 255;
5348 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
5353 info->src += info->src_pitch;
5354 info->dst += info->dst_pitch;
5358 static void SDL_Blit_ABGR8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
5360 const int flags = info->flags;
5362 Uint32 srcR, srcG, srcB, srcA;
5364 Uint32 dstR, dstG, dstB;
5371 incy = (info->src_h << 16) / info->dst_h;
5372 incx = (info->src_w << 16) / info->dst_w;
5374 while (info->dst_h--) {
5376 Uint32 *dst = (Uint32 *)info->dst;
5377 int n = info->dst_w;
5380 while (posy >= 0x10000L) {
5385 if (posx >= 0x10000L) {
5386 while (posx >= 0x10000L) {
5390 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
5393 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
5395 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
5396 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
5397 /* This goes away if we ever use premultiplied alpha */
5399 srcR = (srcR * srcA) / 255;
5400 srcG = (srcG * srcA) / 255;
5401 srcB = (srcB * srcA) / 255;
5404 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5405 case SDL_COPY_BLEND:
5406 dstR = srcR + ((255 - srcA) * dstR) / 255;
5407 dstG = srcG + ((255 - srcA) * dstG) / 255;
5408 dstB = srcB + ((255 - srcA) * dstB) / 255;
5411 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5412 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5413 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5416 dstR = (srcR * dstR) / 255;
5417 dstG = (srcG * dstG) / 255;
5418 dstB = (srcB * dstB) / 255;
5421 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
5427 info->dst += info->dst_pitch;
5431 static void SDL_Blit_ABGR8888_BGR888_Modulate(SDL_BlitInfo *info)
5433 const int flags = info->flags;
5434 const Uint32 modulateR = info->r;
5435 const Uint32 modulateG = info->g;
5436 const Uint32 modulateB = info->b;
5440 while (info->dst_h--) {
5441 Uint32 *src = (Uint32 *)info->src;
5442 Uint32 *dst = (Uint32 *)info->dst;
5443 int n = info->dst_w;
5446 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
5447 if (flags & SDL_COPY_MODULATE_COLOR) {
5448 R = (R * modulateR) / 255;
5449 G = (G * modulateG) / 255;
5450 B = (B * modulateB) / 255;
5452 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
5457 info->src += info->src_pitch;
5458 info->dst += info->dst_pitch;
5462 static void SDL_Blit_ABGR8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
5464 const int flags = info->flags;
5465 const Uint32 modulateR = info->r;
5466 const Uint32 modulateG = info->g;
5467 const Uint32 modulateB = info->b;
5476 incy = (info->src_h << 16) / info->dst_h;
5477 incx = (info->src_w << 16) / info->dst_w;
5479 while (info->dst_h--) {
5481 Uint32 *dst = (Uint32 *)info->dst;
5482 int n = info->dst_w;
5485 while (posy >= 0x10000L) {
5490 if (posx >= 0x10000L) {
5491 while (posx >= 0x10000L) {
5495 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
5498 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
5499 if (flags & SDL_COPY_MODULATE_COLOR) {
5500 R = (R * modulateR) / 255;
5501 G = (G * modulateG) / 255;
5502 B = (B * modulateB) / 255;
5504 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
5510 info->dst += info->dst_pitch;
5514 static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
5516 const int flags = info->flags;
5517 const Uint32 modulateR = info->r;
5518 const Uint32 modulateG = info->g;
5519 const Uint32 modulateB = info->b;
5520 const Uint32 modulateA = info->a;
5522 Uint32 srcR, srcG, srcB, srcA;
5524 Uint32 dstR, dstG, dstB;
5526 while (info->dst_h--) {
5527 Uint32 *src = (Uint32 *)info->src;
5528 Uint32 *dst = (Uint32 *)info->dst;
5529 int n = info->dst_w;
5532 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
5534 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
5535 if (flags & SDL_COPY_MODULATE_COLOR) {
5536 srcR = (srcR * modulateR) / 255;
5537 srcG = (srcG * modulateG) / 255;
5538 srcB = (srcB * modulateB) / 255;
5540 if (flags & SDL_COPY_MODULATE_ALPHA) {
5541 srcA = (srcA * modulateA) / 255;
5543 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
5544 /* This goes away if we ever use premultiplied alpha */
5546 srcR = (srcR * srcA) / 255;
5547 srcG = (srcG * srcA) / 255;
5548 srcB = (srcB * srcA) / 255;
5551 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5552 case SDL_COPY_BLEND:
5553 dstR = srcR + ((255 - srcA) * dstR) / 255;
5554 dstG = srcG + ((255 - srcA) * dstG) / 255;
5555 dstB = srcB + ((255 - srcA) * dstB) / 255;
5558 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5559 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5560 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5563 dstR = (srcR * dstR) / 255;
5564 dstG = (srcG * dstG) / 255;
5565 dstB = (srcB * dstB) / 255;
5568 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
5573 info->src += info->src_pitch;
5574 info->dst += info->dst_pitch;
5578 static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
5580 const int flags = info->flags;
5581 const Uint32 modulateR = info->r;
5582 const Uint32 modulateG = info->g;
5583 const Uint32 modulateB = info->b;
5584 const Uint32 modulateA = info->a;
5586 Uint32 srcR, srcG, srcB, srcA;
5588 Uint32 dstR, dstG, dstB;
5595 incy = (info->src_h << 16) / info->dst_h;
5596 incx = (info->src_w << 16) / info->dst_w;
5598 while (info->dst_h--) {
5600 Uint32 *dst = (Uint32 *)info->dst;
5601 int n = info->dst_w;
5604 while (posy >= 0x10000L) {
5609 if (posx >= 0x10000L) {
5610 while (posx >= 0x10000L) {
5614 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
5617 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
5619 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
5620 if (flags & SDL_COPY_MODULATE_COLOR) {
5621 srcR = (srcR * modulateR) / 255;
5622 srcG = (srcG * modulateG) / 255;
5623 srcB = (srcB * modulateB) / 255;
5625 if (flags & SDL_COPY_MODULATE_ALPHA) {
5626 srcA = (srcA * modulateA) / 255;
5628 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
5629 /* This goes away if we ever use premultiplied alpha */
5631 srcR = (srcR * srcA) / 255;
5632 srcG = (srcG * srcA) / 255;
5633 srcB = (srcB * srcA) / 255;
5636 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5637 case SDL_COPY_BLEND:
5638 dstR = srcR + ((255 - srcA) * dstR) / 255;
5639 dstG = srcG + ((255 - srcA) * dstG) / 255;
5640 dstB = srcB + ((255 - srcA) * dstB) / 255;
5643 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5644 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5645 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5648 dstR = (srcR * dstR) / 255;
5649 dstG = (srcG * dstG) / 255;
5650 dstB = (srcB * dstB) / 255;
5653 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
5659 info->dst += info->dst_pitch;
5663 static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info)
5673 incy = (info->src_h << 16) / info->dst_h;
5674 incx = (info->src_w << 16) / info->dst_w;
5676 while (info->dst_h--) {
5678 Uint32 *dst = (Uint32 *)info->dst;
5679 int n = info->dst_w;
5682 while (posy >= 0x10000L) {
5687 if (posx >= 0x10000L) {
5688 while (posx >= 0x10000L) {
5692 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
5695 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24);
5696 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
5702 info->dst += info->dst_pitch;
5706 static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info)
5708 const int flags = info->flags;
5710 Uint32 srcR, srcG, srcB, srcA;
5712 Uint32 dstR, dstG, dstB, dstA;
5714 while (info->dst_h--) {
5715 Uint32 *src = (Uint32 *)info->src;
5716 Uint32 *dst = (Uint32 *)info->dst;
5717 int n = info->dst_w;
5720 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
5722 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
5723 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
5724 /* This goes away if we ever use premultiplied alpha */
5726 srcR = (srcR * srcA) / 255;
5727 srcG = (srcG * srcA) / 255;
5728 srcB = (srcB * srcA) / 255;
5731 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5732 case SDL_COPY_BLEND:
5733 dstR = srcR + ((255 - srcA) * dstR) / 255;
5734 dstG = srcG + ((255 - srcA) * dstG) / 255;
5735 dstB = srcB + ((255 - srcA) * dstB) / 255;
5736 dstA = srcA + ((255 - srcA) * dstA) / 255;
5739 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5740 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5741 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5744 dstR = (srcR * dstR) / 255;
5745 dstG = (srcG * dstG) / 255;
5746 dstB = (srcB * dstB) / 255;
5749 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
5754 info->src += info->src_pitch;
5755 info->dst += info->dst_pitch;
5759 static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
5761 const int flags = info->flags;
5763 Uint32 srcR, srcG, srcB, srcA;
5765 Uint32 dstR, dstG, dstB, dstA;
5772 incy = (info->src_h << 16) / info->dst_h;
5773 incx = (info->src_w << 16) / info->dst_w;
5775 while (info->dst_h--) {
5777 Uint32 *dst = (Uint32 *)info->dst;
5778 int n = info->dst_w;
5781 while (posy >= 0x10000L) {
5786 if (posx >= 0x10000L) {
5787 while (posx >= 0x10000L) {
5791 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
5794 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
5796 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
5797 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
5798 /* This goes away if we ever use premultiplied alpha */
5800 srcR = (srcR * srcA) / 255;
5801 srcG = (srcG * srcA) / 255;
5802 srcB = (srcB * srcA) / 255;
5805 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5806 case SDL_COPY_BLEND:
5807 dstR = srcR + ((255 - srcA) * dstR) / 255;
5808 dstG = srcG + ((255 - srcA) * dstG) / 255;
5809 dstB = srcB + ((255 - srcA) * dstB) / 255;
5810 dstA = srcA + ((255 - srcA) * dstA) / 255;
5813 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5814 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5815 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5818 dstR = (srcR * dstR) / 255;
5819 dstG = (srcG * dstG) / 255;
5820 dstB = (srcB * dstB) / 255;
5823 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
5829 info->dst += info->dst_pitch;
5833 static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info)
5835 const int flags = info->flags;
5836 const Uint32 modulateR = info->r;
5837 const Uint32 modulateG = info->g;
5838 const Uint32 modulateB = info->b;
5839 const Uint32 modulateA = info->a;
5843 while (info->dst_h--) {
5844 Uint32 *src = (Uint32 *)info->src;
5845 Uint32 *dst = (Uint32 *)info->dst;
5846 int n = info->dst_w;
5849 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24);
5850 if (flags & SDL_COPY_MODULATE_COLOR) {
5851 R = (R * modulateR) / 255;
5852 G = (G * modulateG) / 255;
5853 B = (B * modulateB) / 255;
5855 if (flags & SDL_COPY_MODULATE_ALPHA) {
5856 A = (A * modulateA) / 255;
5858 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
5863 info->src += info->src_pitch;
5864 info->dst += info->dst_pitch;
5868 static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
5870 const int flags = info->flags;
5871 const Uint32 modulateR = info->r;
5872 const Uint32 modulateG = info->g;
5873 const Uint32 modulateB = info->b;
5874 const Uint32 modulateA = info->a;
5883 incy = (info->src_h << 16) / info->dst_h;
5884 incx = (info->src_w << 16) / info->dst_w;
5886 while (info->dst_h--) {
5888 Uint32 *dst = (Uint32 *)info->dst;
5889 int n = info->dst_w;
5892 while (posy >= 0x10000L) {
5897 if (posx >= 0x10000L) {
5898 while (posx >= 0x10000L) {
5902 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
5905 B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24);
5906 if (flags & SDL_COPY_MODULATE_COLOR) {
5907 R = (R * modulateR) / 255;
5908 G = (G * modulateG) / 255;
5909 B = (B * modulateB) / 255;
5911 if (flags & SDL_COPY_MODULATE_ALPHA) {
5912 A = (A * modulateA) / 255;
5914 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
5920 info->dst += info->dst_pitch;
5924 static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
5926 const int flags = info->flags;
5927 const Uint32 modulateR = info->r;
5928 const Uint32 modulateG = info->g;
5929 const Uint32 modulateB = info->b;
5930 const Uint32 modulateA = info->a;
5932 Uint32 srcR, srcG, srcB, srcA;
5934 Uint32 dstR, dstG, dstB, dstA;
5936 while (info->dst_h--) {
5937 Uint32 *src = (Uint32 *)info->src;
5938 Uint32 *dst = (Uint32 *)info->dst;
5939 int n = info->dst_w;
5942 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
5944 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
5945 if (flags & SDL_COPY_MODULATE_COLOR) {
5946 srcR = (srcR * modulateR) / 255;
5947 srcG = (srcG * modulateG) / 255;
5948 srcB = (srcB * modulateB) / 255;
5950 if (flags & SDL_COPY_MODULATE_ALPHA) {
5951 srcA = (srcA * modulateA) / 255;
5953 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
5954 /* This goes away if we ever use premultiplied alpha */
5956 srcR = (srcR * srcA) / 255;
5957 srcG = (srcG * srcA) / 255;
5958 srcB = (srcB * srcA) / 255;
5961 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
5962 case SDL_COPY_BLEND:
5963 dstR = srcR + ((255 - srcA) * dstR) / 255;
5964 dstG = srcG + ((255 - srcA) * dstG) / 255;
5965 dstB = srcB + ((255 - srcA) * dstB) / 255;
5966 dstA = srcA + ((255 - srcA) * dstA) / 255;
5969 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
5970 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
5971 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
5974 dstR = (srcR * dstR) / 255;
5975 dstG = (srcG * dstG) / 255;
5976 dstB = (srcB * dstB) / 255;
5979 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
5984 info->src += info->src_pitch;
5985 info->dst += info->dst_pitch;
5989 static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
5991 const int flags = info->flags;
5992 const Uint32 modulateR = info->r;
5993 const Uint32 modulateG = info->g;
5994 const Uint32 modulateB = info->b;
5995 const Uint32 modulateA = info->a;
5997 Uint32 srcR, srcG, srcB, srcA;
5999 Uint32 dstR, dstG, dstB, dstA;
6006 incy = (info->src_h << 16) / info->dst_h;
6007 incx = (info->src_w << 16) / info->dst_w;
6009 while (info->dst_h--) {
6011 Uint32 *dst = (Uint32 *)info->dst;
6012 int n = info->dst_w;
6015 while (posy >= 0x10000L) {
6020 if (posx >= 0x10000L) {
6021 while (posx >= 0x10000L) {
6025 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6028 srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
6030 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
6031 if (flags & SDL_COPY_MODULATE_COLOR) {
6032 srcR = (srcR * modulateR) / 255;
6033 srcG = (srcG * modulateG) / 255;
6034 srcB = (srcB * modulateB) / 255;
6036 if (flags & SDL_COPY_MODULATE_ALPHA) {
6037 srcA = (srcA * modulateA) / 255;
6039 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6040 /* This goes away if we ever use premultiplied alpha */
6042 srcR = (srcR * srcA) / 255;
6043 srcG = (srcG * srcA) / 255;
6044 srcB = (srcB * srcA) / 255;
6047 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6048 case SDL_COPY_BLEND:
6049 dstR = srcR + ((255 - srcA) * dstR) / 255;
6050 dstG = srcG + ((255 - srcA) * dstG) / 255;
6051 dstB = srcB + ((255 - srcA) * dstB) / 255;
6052 dstA = srcA + ((255 - srcA) * dstA) / 255;
6055 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6056 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6057 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6060 dstR = (srcR * dstR) / 255;
6061 dstG = (srcG * dstG) / 255;
6062 dstB = (srcB * dstB) / 255;
6065 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
6071 info->dst += info->dst_pitch;
6075 static void SDL_Blit_BGRA8888_RGB888_Scale(SDL_BlitInfo *info)
6085 incy = (info->src_h << 16) / info->dst_h;
6086 incx = (info->src_w << 16) / info->dst_w;
6088 while (info->dst_h--) {
6090 Uint32 *dst = (Uint32 *)info->dst;
6091 int n = info->dst_w;
6094 while (posy >= 0x10000L) {
6099 if (posx >= 0x10000L) {
6100 while (posx >= 0x10000L) {
6104 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6107 B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
6108 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
6114 info->dst += info->dst_pitch;
6118 static void SDL_Blit_BGRA8888_RGB888_Blend(SDL_BlitInfo *info)
6120 const int flags = info->flags;
6122 Uint32 srcR, srcG, srcB, srcA;
6124 Uint32 dstR, dstG, dstB;
6126 while (info->dst_h--) {
6127 Uint32 *src = (Uint32 *)info->src;
6128 Uint32 *dst = (Uint32 *)info->dst;
6129 int n = info->dst_w;
6132 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
6134 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
6135 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6136 /* This goes away if we ever use premultiplied alpha */
6138 srcR = (srcR * srcA) / 255;
6139 srcG = (srcG * srcA) / 255;
6140 srcB = (srcB * srcA) / 255;
6143 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6144 case SDL_COPY_BLEND:
6145 dstR = srcR + ((255 - srcA) * dstR) / 255;
6146 dstG = srcG + ((255 - srcA) * dstG) / 255;
6147 dstB = srcB + ((255 - srcA) * dstB) / 255;
6150 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6151 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6152 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6155 dstR = (srcR * dstR) / 255;
6156 dstG = (srcG * dstG) / 255;
6157 dstB = (srcB * dstB) / 255;
6160 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
6165 info->src += info->src_pitch;
6166 info->dst += info->dst_pitch;
6170 static void SDL_Blit_BGRA8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
6172 const int flags = info->flags;
6174 Uint32 srcR, srcG, srcB, srcA;
6176 Uint32 dstR, dstG, dstB;
6183 incy = (info->src_h << 16) / info->dst_h;
6184 incx = (info->src_w << 16) / info->dst_w;
6186 while (info->dst_h--) {
6188 Uint32 *dst = (Uint32 *)info->dst;
6189 int n = info->dst_w;
6192 while (posy >= 0x10000L) {
6197 if (posx >= 0x10000L) {
6198 while (posx >= 0x10000L) {
6202 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6205 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
6207 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
6208 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6209 /* This goes away if we ever use premultiplied alpha */
6211 srcR = (srcR * srcA) / 255;
6212 srcG = (srcG * srcA) / 255;
6213 srcB = (srcB * srcA) / 255;
6216 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6217 case SDL_COPY_BLEND:
6218 dstR = srcR + ((255 - srcA) * dstR) / 255;
6219 dstG = srcG + ((255 - srcA) * dstG) / 255;
6220 dstB = srcB + ((255 - srcA) * dstB) / 255;
6223 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6224 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6225 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6228 dstR = (srcR * dstR) / 255;
6229 dstG = (srcG * dstG) / 255;
6230 dstB = (srcB * dstB) / 255;
6233 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
6239 info->dst += info->dst_pitch;
6243 static void SDL_Blit_BGRA8888_RGB888_Modulate(SDL_BlitInfo *info)
6245 const int flags = info->flags;
6246 const Uint32 modulateR = info->r;
6247 const Uint32 modulateG = info->g;
6248 const Uint32 modulateB = info->b;
6252 while (info->dst_h--) {
6253 Uint32 *src = (Uint32 *)info->src;
6254 Uint32 *dst = (Uint32 *)info->dst;
6255 int n = info->dst_w;
6258 B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
6259 if (flags & SDL_COPY_MODULATE_COLOR) {
6260 R = (R * modulateR) / 255;
6261 G = (G * modulateG) / 255;
6262 B = (B * modulateB) / 255;
6264 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
6269 info->src += info->src_pitch;
6270 info->dst += info->dst_pitch;
6274 static void SDL_Blit_BGRA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
6276 const int flags = info->flags;
6277 const Uint32 modulateR = info->r;
6278 const Uint32 modulateG = info->g;
6279 const Uint32 modulateB = info->b;
6288 incy = (info->src_h << 16) / info->dst_h;
6289 incx = (info->src_w << 16) / info->dst_w;
6291 while (info->dst_h--) {
6293 Uint32 *dst = (Uint32 *)info->dst;
6294 int n = info->dst_w;
6297 while (posy >= 0x10000L) {
6302 if (posx >= 0x10000L) {
6303 while (posx >= 0x10000L) {
6307 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6310 B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
6311 if (flags & SDL_COPY_MODULATE_COLOR) {
6312 R = (R * modulateR) / 255;
6313 G = (G * modulateG) / 255;
6314 B = (B * modulateB) / 255;
6316 pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
6322 info->dst += info->dst_pitch;
6326 static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
6328 const int flags = info->flags;
6329 const Uint32 modulateR = info->r;
6330 const Uint32 modulateG = info->g;
6331 const Uint32 modulateB = info->b;
6332 const Uint32 modulateA = info->a;
6334 Uint32 srcR, srcG, srcB, srcA;
6336 Uint32 dstR, dstG, dstB;
6338 while (info->dst_h--) {
6339 Uint32 *src = (Uint32 *)info->src;
6340 Uint32 *dst = (Uint32 *)info->dst;
6341 int n = info->dst_w;
6344 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
6346 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
6347 if (flags & SDL_COPY_MODULATE_COLOR) {
6348 srcR = (srcR * modulateR) / 255;
6349 srcG = (srcG * modulateG) / 255;
6350 srcB = (srcB * modulateB) / 255;
6352 if (flags & SDL_COPY_MODULATE_ALPHA) {
6353 srcA = (srcA * modulateA) / 255;
6355 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6356 /* This goes away if we ever use premultiplied alpha */
6358 srcR = (srcR * srcA) / 255;
6359 srcG = (srcG * srcA) / 255;
6360 srcB = (srcB * srcA) / 255;
6363 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6364 case SDL_COPY_BLEND:
6365 dstR = srcR + ((255 - srcA) * dstR) / 255;
6366 dstG = srcG + ((255 - srcA) * dstG) / 255;
6367 dstB = srcB + ((255 - srcA) * dstB) / 255;
6370 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6371 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6372 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6375 dstR = (srcR * dstR) / 255;
6376 dstG = (srcG * dstG) / 255;
6377 dstB = (srcB * dstB) / 255;
6380 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
6385 info->src += info->src_pitch;
6386 info->dst += info->dst_pitch;
6390 static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
6392 const int flags = info->flags;
6393 const Uint32 modulateR = info->r;
6394 const Uint32 modulateG = info->g;
6395 const Uint32 modulateB = info->b;
6396 const Uint32 modulateA = info->a;
6398 Uint32 srcR, srcG, srcB, srcA;
6400 Uint32 dstR, dstG, dstB;
6407 incy = (info->src_h << 16) / info->dst_h;
6408 incx = (info->src_w << 16) / info->dst_w;
6410 while (info->dst_h--) {
6412 Uint32 *dst = (Uint32 *)info->dst;
6413 int n = info->dst_w;
6416 while (posy >= 0x10000L) {
6421 if (posx >= 0x10000L) {
6422 while (posx >= 0x10000L) {
6426 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6429 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
6431 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
6432 if (flags & SDL_COPY_MODULATE_COLOR) {
6433 srcR = (srcR * modulateR) / 255;
6434 srcG = (srcG * modulateG) / 255;
6435 srcB = (srcB * modulateB) / 255;
6437 if (flags & SDL_COPY_MODULATE_ALPHA) {
6438 srcA = (srcA * modulateA) / 255;
6440 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6441 /* This goes away if we ever use premultiplied alpha */
6443 srcR = (srcR * srcA) / 255;
6444 srcG = (srcG * srcA) / 255;
6445 srcB = (srcB * srcA) / 255;
6448 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6449 case SDL_COPY_BLEND:
6450 dstR = srcR + ((255 - srcA) * dstR) / 255;
6451 dstG = srcG + ((255 - srcA) * dstG) / 255;
6452 dstB = srcB + ((255 - srcA) * dstB) / 255;
6455 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6456 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6457 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6460 dstR = (srcR * dstR) / 255;
6461 dstG = (srcG * dstG) / 255;
6462 dstB = (srcB * dstB) / 255;
6465 dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
6471 info->dst += info->dst_pitch;
6475 static void SDL_Blit_BGRA8888_BGR888_Scale(SDL_BlitInfo *info)
6485 incy = (info->src_h << 16) / info->dst_h;
6486 incx = (info->src_w << 16) / info->dst_w;
6488 while (info->dst_h--) {
6490 Uint32 *dst = (Uint32 *)info->dst;
6491 int n = info->dst_w;
6494 while (posy >= 0x10000L) {
6499 if (posx >= 0x10000L) {
6500 while (posx >= 0x10000L) {
6504 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6507 B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
6508 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
6514 info->dst += info->dst_pitch;
6518 static void SDL_Blit_BGRA8888_BGR888_Blend(SDL_BlitInfo *info)
6520 const int flags = info->flags;
6522 Uint32 srcR, srcG, srcB, srcA;
6524 Uint32 dstR, dstG, dstB;
6526 while (info->dst_h--) {
6527 Uint32 *src = (Uint32 *)info->src;
6528 Uint32 *dst = (Uint32 *)info->dst;
6529 int n = info->dst_w;
6532 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
6534 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
6535 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6536 /* This goes away if we ever use premultiplied alpha */
6538 srcR = (srcR * srcA) / 255;
6539 srcG = (srcG * srcA) / 255;
6540 srcB = (srcB * srcA) / 255;
6543 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6544 case SDL_COPY_BLEND:
6545 dstR = srcR + ((255 - srcA) * dstR) / 255;
6546 dstG = srcG + ((255 - srcA) * dstG) / 255;
6547 dstB = srcB + ((255 - srcA) * dstB) / 255;
6550 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6551 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6552 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6555 dstR = (srcR * dstR) / 255;
6556 dstG = (srcG * dstG) / 255;
6557 dstB = (srcB * dstB) / 255;
6560 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
6565 info->src += info->src_pitch;
6566 info->dst += info->dst_pitch;
6570 static void SDL_Blit_BGRA8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
6572 const int flags = info->flags;
6574 Uint32 srcR, srcG, srcB, srcA;
6576 Uint32 dstR, dstG, dstB;
6583 incy = (info->src_h << 16) / info->dst_h;
6584 incx = (info->src_w << 16) / info->dst_w;
6586 while (info->dst_h--) {
6588 Uint32 *dst = (Uint32 *)info->dst;
6589 int n = info->dst_w;
6592 while (posy >= 0x10000L) {
6597 if (posx >= 0x10000L) {
6598 while (posx >= 0x10000L) {
6602 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6605 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
6607 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
6608 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6609 /* This goes away if we ever use premultiplied alpha */
6611 srcR = (srcR * srcA) / 255;
6612 srcG = (srcG * srcA) / 255;
6613 srcB = (srcB * srcA) / 255;
6616 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6617 case SDL_COPY_BLEND:
6618 dstR = srcR + ((255 - srcA) * dstR) / 255;
6619 dstG = srcG + ((255 - srcA) * dstG) / 255;
6620 dstB = srcB + ((255 - srcA) * dstB) / 255;
6623 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6624 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6625 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6628 dstR = (srcR * dstR) / 255;
6629 dstG = (srcG * dstG) / 255;
6630 dstB = (srcB * dstB) / 255;
6633 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
6639 info->dst += info->dst_pitch;
6643 static void SDL_Blit_BGRA8888_BGR888_Modulate(SDL_BlitInfo *info)
6645 const int flags = info->flags;
6646 const Uint32 modulateR = info->r;
6647 const Uint32 modulateG = info->g;
6648 const Uint32 modulateB = info->b;
6652 while (info->dst_h--) {
6653 Uint32 *src = (Uint32 *)info->src;
6654 Uint32 *dst = (Uint32 *)info->dst;
6655 int n = info->dst_w;
6658 B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
6659 if (flags & SDL_COPY_MODULATE_COLOR) {
6660 R = (R * modulateR) / 255;
6661 G = (G * modulateG) / 255;
6662 B = (B * modulateB) / 255;
6664 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
6669 info->src += info->src_pitch;
6670 info->dst += info->dst_pitch;
6674 static void SDL_Blit_BGRA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
6676 const int flags = info->flags;
6677 const Uint32 modulateR = info->r;
6678 const Uint32 modulateG = info->g;
6679 const Uint32 modulateB = info->b;
6688 incy = (info->src_h << 16) / info->dst_h;
6689 incx = (info->src_w << 16) / info->dst_w;
6691 while (info->dst_h--) {
6693 Uint32 *dst = (Uint32 *)info->dst;
6694 int n = info->dst_w;
6697 while (posy >= 0x10000L) {
6702 if (posx >= 0x10000L) {
6703 while (posx >= 0x10000L) {
6707 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6710 B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
6711 if (flags & SDL_COPY_MODULATE_COLOR) {
6712 R = (R * modulateR) / 255;
6713 G = (G * modulateG) / 255;
6714 B = (B * modulateB) / 255;
6716 pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
6722 info->dst += info->dst_pitch;
6726 static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
6728 const int flags = info->flags;
6729 const Uint32 modulateR = info->r;
6730 const Uint32 modulateG = info->g;
6731 const Uint32 modulateB = info->b;
6732 const Uint32 modulateA = info->a;
6734 Uint32 srcR, srcG, srcB, srcA;
6736 Uint32 dstR, dstG, dstB;
6738 while (info->dst_h--) {
6739 Uint32 *src = (Uint32 *)info->src;
6740 Uint32 *dst = (Uint32 *)info->dst;
6741 int n = info->dst_w;
6744 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
6746 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
6747 if (flags & SDL_COPY_MODULATE_COLOR) {
6748 srcR = (srcR * modulateR) / 255;
6749 srcG = (srcG * modulateG) / 255;
6750 srcB = (srcB * modulateB) / 255;
6752 if (flags & SDL_COPY_MODULATE_ALPHA) {
6753 srcA = (srcA * modulateA) / 255;
6755 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6756 /* This goes away if we ever use premultiplied alpha */
6758 srcR = (srcR * srcA) / 255;
6759 srcG = (srcG * srcA) / 255;
6760 srcB = (srcB * srcA) / 255;
6763 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6764 case SDL_COPY_BLEND:
6765 dstR = srcR + ((255 - srcA) * dstR) / 255;
6766 dstG = srcG + ((255 - srcA) * dstG) / 255;
6767 dstB = srcB + ((255 - srcA) * dstB) / 255;
6770 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6771 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6772 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6775 dstR = (srcR * dstR) / 255;
6776 dstG = (srcG * dstG) / 255;
6777 dstB = (srcB * dstB) / 255;
6780 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
6785 info->src += info->src_pitch;
6786 info->dst += info->dst_pitch;
6790 static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
6792 const int flags = info->flags;
6793 const Uint32 modulateR = info->r;
6794 const Uint32 modulateG = info->g;
6795 const Uint32 modulateB = info->b;
6796 const Uint32 modulateA = info->a;
6798 Uint32 srcR, srcG, srcB, srcA;
6800 Uint32 dstR, dstG, dstB;
6807 incy = (info->src_h << 16) / info->dst_h;
6808 incx = (info->src_w << 16) / info->dst_w;
6810 while (info->dst_h--) {
6812 Uint32 *dst = (Uint32 *)info->dst;
6813 int n = info->dst_w;
6816 while (posy >= 0x10000L) {
6821 if (posx >= 0x10000L) {
6822 while (posx >= 0x10000L) {
6826 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6829 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
6831 dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
6832 if (flags & SDL_COPY_MODULATE_COLOR) {
6833 srcR = (srcR * modulateR) / 255;
6834 srcG = (srcG * modulateG) / 255;
6835 srcB = (srcB * modulateB) / 255;
6837 if (flags & SDL_COPY_MODULATE_ALPHA) {
6838 srcA = (srcA * modulateA) / 255;
6840 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6841 /* This goes away if we ever use premultiplied alpha */
6843 srcR = (srcR * srcA) / 255;
6844 srcG = (srcG * srcA) / 255;
6845 srcB = (srcB * srcA) / 255;
6848 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6849 case SDL_COPY_BLEND:
6850 dstR = srcR + ((255 - srcA) * dstR) / 255;
6851 dstG = srcG + ((255 - srcA) * dstG) / 255;
6852 dstB = srcB + ((255 - srcA) * dstB) / 255;
6855 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6856 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6857 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6860 dstR = (srcR * dstR) / 255;
6861 dstG = (srcG * dstG) / 255;
6862 dstB = (srcB * dstB) / 255;
6865 dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
6871 info->dst += info->dst_pitch;
6875 static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info)
6885 incy = (info->src_h << 16) / info->dst_h;
6886 incx = (info->src_w << 16) / info->dst_w;
6888 while (info->dst_h--) {
6890 Uint32 *dst = (Uint32 *)info->dst;
6891 int n = info->dst_w;
6894 while (posy >= 0x10000L) {
6899 if (posx >= 0x10000L) {
6900 while (posx >= 0x10000L) {
6904 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
6907 B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
6908 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
6914 info->dst += info->dst_pitch;
6918 static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info)
6920 const int flags = info->flags;
6922 Uint32 srcR, srcG, srcB, srcA;
6924 Uint32 dstR, dstG, dstB, dstA;
6926 while (info->dst_h--) {
6927 Uint32 *src = (Uint32 *)info->src;
6928 Uint32 *dst = (Uint32 *)info->dst;
6929 int n = info->dst_w;
6932 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
6934 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
6935 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
6936 /* This goes away if we ever use premultiplied alpha */
6938 srcR = (srcR * srcA) / 255;
6939 srcG = (srcG * srcA) / 255;
6940 srcB = (srcB * srcA) / 255;
6943 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
6944 case SDL_COPY_BLEND:
6945 dstR = srcR + ((255 - srcA) * dstR) / 255;
6946 dstG = srcG + ((255 - srcA) * dstG) / 255;
6947 dstB = srcB + ((255 - srcA) * dstB) / 255;
6948 dstA = srcA + ((255 - srcA) * dstA) / 255;
6951 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
6952 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
6953 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
6956 dstR = (srcR * dstR) / 255;
6957 dstG = (srcG * dstG) / 255;
6958 dstB = (srcB * dstB) / 255;
6961 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
6966 info->src += info->src_pitch;
6967 info->dst += info->dst_pitch;
6971 static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
6973 const int flags = info->flags;
6975 Uint32 srcR, srcG, srcB, srcA;
6977 Uint32 dstR, dstG, dstB, dstA;
6984 incy = (info->src_h << 16) / info->dst_h;
6985 incx = (info->src_w << 16) / info->dst_w;
6987 while (info->dst_h--) {
6989 Uint32 *dst = (Uint32 *)info->dst;
6990 int n = info->dst_w;
6993 while (posy >= 0x10000L) {
6998 if (posx >= 0x10000L) {
6999 while (posx >= 0x10000L) {
7003 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
7006 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
7008 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
7009 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
7010 /* This goes away if we ever use premultiplied alpha */
7012 srcR = (srcR * srcA) / 255;
7013 srcG = (srcG * srcA) / 255;
7014 srcB = (srcB * srcA) / 255;
7017 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
7018 case SDL_COPY_BLEND:
7019 dstR = srcR + ((255 - srcA) * dstR) / 255;
7020 dstG = srcG + ((255 - srcA) * dstG) / 255;
7021 dstB = srcB + ((255 - srcA) * dstB) / 255;
7022 dstA = srcA + ((255 - srcA) * dstA) / 255;
7025 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
7026 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
7027 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
7030 dstR = (srcR * dstR) / 255;
7031 dstG = (srcG * dstG) / 255;
7032 dstB = (srcB * dstB) / 255;
7035 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
7041 info->dst += info->dst_pitch;
7045 static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
7047 const int flags = info->flags;
7048 const Uint32 modulateR = info->r;
7049 const Uint32 modulateG = info->g;
7050 const Uint32 modulateB = info->b;
7051 const Uint32 modulateA = info->a;
7055 while (info->dst_h--) {
7056 Uint32 *src = (Uint32 *)info->src;
7057 Uint32 *dst = (Uint32 *)info->dst;
7058 int n = info->dst_w;
7061 B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
7062 if (flags & SDL_COPY_MODULATE_COLOR) {
7063 R = (R * modulateR) / 255;
7064 G = (G * modulateG) / 255;
7065 B = (B * modulateB) / 255;
7067 if (flags & SDL_COPY_MODULATE_ALPHA) {
7068 A = (A * modulateA) / 255;
7070 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
7075 info->src += info->src_pitch;
7076 info->dst += info->dst_pitch;
7080 static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
7082 const int flags = info->flags;
7083 const Uint32 modulateR = info->r;
7084 const Uint32 modulateG = info->g;
7085 const Uint32 modulateB = info->b;
7086 const Uint32 modulateA = info->a;
7095 incy = (info->src_h << 16) / info->dst_h;
7096 incx = (info->src_w << 16) / info->dst_w;
7098 while (info->dst_h--) {
7100 Uint32 *dst = (Uint32 *)info->dst;
7101 int n = info->dst_w;
7104 while (posy >= 0x10000L) {
7109 if (posx >= 0x10000L) {
7110 while (posx >= 0x10000L) {
7114 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
7117 B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
7118 if (flags & SDL_COPY_MODULATE_COLOR) {
7119 R = (R * modulateR) / 255;
7120 G = (G * modulateG) / 255;
7121 B = (B * modulateB) / 255;
7123 if (flags & SDL_COPY_MODULATE_ALPHA) {
7124 A = (A * modulateA) / 255;
7126 pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
7132 info->dst += info->dst_pitch;
7136 static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
7138 const int flags = info->flags;
7139 const Uint32 modulateR = info->r;
7140 const Uint32 modulateG = info->g;
7141 const Uint32 modulateB = info->b;
7142 const Uint32 modulateA = info->a;
7144 Uint32 srcR, srcG, srcB, srcA;
7146 Uint32 dstR, dstG, dstB, dstA;
7148 while (info->dst_h--) {
7149 Uint32 *src = (Uint32 *)info->src;
7150 Uint32 *dst = (Uint32 *)info->dst;
7151 int n = info->dst_w;
7154 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
7156 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
7157 if (flags & SDL_COPY_MODULATE_COLOR) {
7158 srcR = (srcR * modulateR) / 255;
7159 srcG = (srcG * modulateG) / 255;
7160 srcB = (srcB * modulateB) / 255;
7162 if (flags & SDL_COPY_MODULATE_ALPHA) {
7163 srcA = (srcA * modulateA) / 255;
7165 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
7166 /* This goes away if we ever use premultiplied alpha */
7168 srcR = (srcR * srcA) / 255;
7169 srcG = (srcG * srcA) / 255;
7170 srcB = (srcB * srcA) / 255;
7173 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
7174 case SDL_COPY_BLEND:
7175 dstR = srcR + ((255 - srcA) * dstR) / 255;
7176 dstG = srcG + ((255 - srcA) * dstG) / 255;
7177 dstB = srcB + ((255 - srcA) * dstB) / 255;
7178 dstA = srcA + ((255 - srcA) * dstA) / 255;
7181 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
7182 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
7183 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
7186 dstR = (srcR * dstR) / 255;
7187 dstG = (srcG * dstG) / 255;
7188 dstB = (srcB * dstB) / 255;
7191 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
7196 info->src += info->src_pitch;
7197 info->dst += info->dst_pitch;
7201 static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
7203 const int flags = info->flags;
7204 const Uint32 modulateR = info->r;
7205 const Uint32 modulateG = info->g;
7206 const Uint32 modulateB = info->b;
7207 const Uint32 modulateA = info->a;
7209 Uint32 srcR, srcG, srcB, srcA;
7211 Uint32 dstR, dstG, dstB, dstA;
7218 incy = (info->src_h << 16) / info->dst_h;
7219 incx = (info->src_w << 16) / info->dst_w;
7221 while (info->dst_h--) {
7223 Uint32 *dst = (Uint32 *)info->dst;
7224 int n = info->dst_w;
7227 while (posy >= 0x10000L) {
7232 if (posx >= 0x10000L) {
7233 while (posx >= 0x10000L) {
7237 src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
7240 srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
7242 dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
7243 if (flags & SDL_COPY_MODULATE_COLOR) {
7244 srcR = (srcR * modulateR) / 255;
7245 srcG = (srcG * modulateG) / 255;
7246 srcB = (srcB * modulateB) / 255;
7248 if (flags & SDL_COPY_MODULATE_ALPHA) {
7249 srcA = (srcA * modulateA) / 255;
7251 if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
7252 /* This goes away if we ever use premultiplied alpha */
7254 srcR = (srcR * srcA) / 255;
7255 srcG = (srcG * srcA) / 255;
7256 srcB = (srcB * srcA) / 255;
7259 switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
7260 case SDL_COPY_BLEND:
7261 dstR = srcR + ((255 - srcA) * dstR) / 255;
7262 dstG = srcG + ((255 - srcA) * dstG) / 255;
7263 dstB = srcB + ((255 - srcA) * dstB) / 255;
7264 dstA = srcA + ((255 - srcA) * dstA) / 255;
7267 dstR = srcR + dstR; if (dstR > 255) dstR = 255;
7268 dstG = srcG + dstG; if (dstG > 255) dstG = 255;
7269 dstB = srcB + dstB; if (dstB > 255) dstB = 255;
7272 dstR = (srcR * dstR) / 255;
7273 dstG = (srcG * dstG) / 255;
7274 dstB = (srcB * dstB) / 255;
7277 dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
7283 info->dst += info->dst_pitch;
7287 SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[] = {
7288 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Scale },
7289 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend },
7290 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend_Scale },
7291 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate },
7292 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Scale },
7293 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend },
7294 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale },
7295 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Scale },
7296 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend },
7297 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend_Scale },
7298 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate },
7299 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Scale },
7300 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend },
7301 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale },
7302 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Scale },
7303 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend },
7304 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend_Scale },
7305 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate },
7306 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Scale },
7307 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend },
7308 { SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale },
7309 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Scale },
7310 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend },
7311 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend_Scale },
7312 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate },
7313 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Scale },
7314 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend },
7315 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale },
7316 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Scale },
7317 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend },
7318 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend_Scale },
7319 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate },
7320 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Scale },
7321 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend },
7322 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale },
7323 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Scale },
7324 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend },
7325 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend_Scale },
7326 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate },
7327 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Scale },
7328 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend },
7329 { SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale },
7330 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Scale },
7331 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend },
7332 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend_Scale },
7333 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate },
7334 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Scale },
7335 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend },
7336 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale },
7337 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Scale },
7338 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend },
7339 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend_Scale },
7340 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate },
7341 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Scale },
7342 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend },
7343 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale },
7344 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Scale },
7345 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend },
7346 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend_Scale },
7347 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate },
7348 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale },
7349 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend },
7350 { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale },
7351 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Scale },
7352 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend },
7353 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend_Scale },
7354 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate },
7355 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Scale },
7356 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend },
7357 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale },
7358 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Scale },
7359 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend },
7360 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend_Scale },
7361 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate },
7362 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Scale },
7363 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend },
7364 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale },
7365 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Scale },
7366 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend },
7367 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend_Scale },
7368 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate },
7369 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale },
7370 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend },
7371 { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale },
7372 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Scale },
7373 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend },
7374 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend_Scale },
7375 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate },
7376 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Scale },
7377 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend },
7378 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale },
7379 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Scale },
7380 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend },
7381 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend_Scale },
7382 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate },
7383 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Scale },
7384 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend },
7385 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale },
7386 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Scale },
7387 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend },
7388 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend_Scale },
7389 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate },
7390 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale },
7391 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend },
7392 { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale },
7393 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Scale },
7394 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend },
7395 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend_Scale },
7396 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate },
7397 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Scale },
7398 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend },
7399 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale },
7400 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Scale },
7401 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend },
7402 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend_Scale },
7403 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate },
7404 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Scale },
7405 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend },
7406 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale },
7407 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Scale },
7408 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend },
7409 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend_Scale },
7410 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate },
7411 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale },
7412 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend },
7413 { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale },
7414 { 0, 0, 0, 0, NULL }
7419 /* vi: set ts=4 sw=4 expandtab: */