SDL_blit_auto.c
Go to the documentation of this file.
/* DO NOT EDIT! This file is generated by sdlgenblit.pl */
/*
Simple DirectMedia Layer
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include "../SDL_internal.h"
/* *INDENT-OFF* */
#include "SDL_video.h"
#include "SDL_blit.h"
#include "SDL_blit_auto.h"
static void SDL_Blit_RGB888_RGB888_Scale(SDL_BlitInfo *info)
{
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
*dst = *src;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_RGB888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_RGB888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_RGB888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_BGR888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_BGR888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_BGR888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_BGR888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_ARGB8888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_ARGB8888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_RGB888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_RGB888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_RGB888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_RGB888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_BGR888_Scale(SDL_BlitInfo *info)
{
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
*dst = *src;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_BGR888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_BGR888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_BGR888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_ARGB8888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_ARGB8888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_ARGB8888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = 0xFF;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_RGB888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_RGB888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_RGB888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_BGR888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_BGR888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_BGR888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info)
{
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
*dst = *src;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_RGB888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_RGB888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_RGB888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_BGR888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_BGR888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_BGR888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_RGB888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_RGB888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_RGB888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_BGR888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_BGR888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_BGR888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24);
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24);
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_RGB888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_RGB888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_RGB888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_BGR888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_BGR888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_BGR888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
Uint32 pixel;
Uint32 R, G, B;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8);
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info)
{
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
pixel = *src;
B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
pixel = *src;
B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel;
if (flags & SDL_COPY_MODULATE_COLOR) {
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
A = (A * modulateA) / 255;
}
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
while (n--) {
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
info->src += info->src_pitch;
info->dst += info->dst_pitch;
}
}
static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
{
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
while (info->dst_h--) {
Uint32 *src = 0;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
}
srcpixel = *src;
srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24);
if (flags & SDL_COPY_MODULATE_COLOR) {
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
if (flags & SDL_COPY_MODULATE_ALPHA) {
srcA = (srcA * modulateA) / 255;
}
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
/* This goes away if we ever use premultiplied alpha */
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
}
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
case SDL_COPY_BLEND:
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
dstA = srcA + ((255 - srcA) * dstA) / 255;
break;
case SDL_COPY_ADD:
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
}
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
info->dst += info->dst_pitch;
}
}
SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[] = {
{ SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Scale },
{ SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_RGB888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Scale },
{ SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_BGR888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Scale },
{ SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGB888_ARGB8888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Scale },
{ SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_RGB888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Scale },
{ SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_BGR888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Scale },
{ SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_BGR888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGR888_ARGB8888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Scale },
{ SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_RGB888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Scale },
{ SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_BGR888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Scale },
{ SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Scale },
{ SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_RGB888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Scale },
{ SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_BGR888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Scale },
{ SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Scale },
{ SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_RGB888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Scale },
{ SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_BGR888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Scale },
{ SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Scale },
{ SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_RGB888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_RGB888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Scale },
{ SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_BGR888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_BGR888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Scale },
{ SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend },
{ 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 },
{ SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate },
{ 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 },
{ 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 },
{ 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 },
{ 0, 0, 0, 0, NULL }
};
/* *INDENT-ON* */
/* vi: set ts=4 sw=4 expandtab: */
SDL_Blit_BGR888_ARGB8888_Blend
static void SDL_Blit_BGR888_ARGB8888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2075
SDL_Blit_RGB888_BGR888_Blend
static void SDL_Blit_RGB888_BGR888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:468
SDL_PIXELFORMAT_ARGB8888
Definition: SDL_pixels.h:247
dst
GLenum GLenum dst
Definition: SDL_opengl_glext.h:1737
SDL_BlitInfo::r
Uint8 r
Definition: SDL_blit.h:70
SDL_COPY_MODULATE_COLOR
#define SDL_COPY_MODULATE_COLOR
Definition: SDL_blit.h:34
SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale
static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6790
SDL_Blit_ARGB8888_BGR888_Blend_Scale
static void SDL_Blit_ARGB8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2939
SDL_Blit_RGBA8888_RGB888_Blend
static void SDL_Blit_RGBA8888_RGB888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3694
SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale
static void SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:740
SDL_BlitInfo::b
Uint8 b
Definition: SDL_blit.h:70
SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale
static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:7080
SDL_Blit_RGB888_ARGB8888_Modulate_Scale
static void SDL_Blit_RGB888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1030
SDL_Blit_BGRA8888_ARGB8888_Blend_Scale
static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6971
SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale
static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:7201
SDL_Blit_RGBA8888_ARGB8888_Blend_Scale
static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4547
SDL_Blit_BGRA8888_BGR888_Modulate_Scale
static void SDL_Blit_BGRA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6674
SDL_Blit_RGB888_ARGB8888_Modulate
static void SDL_Blit_RGB888_ARGB8888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:995
SDL_Blit_BGRA8888_RGB888_Scale
static void SDL_Blit_BGRA8888_RGB888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6075
n
GLdouble n
Definition: SDL_opengl_glext.h:1952
SDL_Blit_BGRA8888_BGR888_Blend
static void SDL_Blit_BGRA8888_BGR888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6518
Uint32
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:157
SDL_Blit_BGR888_BGR888_Modulate_Blend
static void SDL_Blit_BGR888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1883
SDL_Blit_ARGB8888_RGB888_Blend
static void SDL_Blit_ARGB8888_RGB888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2487
SDL_Blit_RGBA8888_ARGB8888_Scale
static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4451
SDL_Blit_BGR888_ARGB8888_Modulate_Scale
static void SDL_Blit_BGR888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2237
SDL_Blit_BGRA8888_ARGB8888_Scale
static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6875
SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale
static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3444
SDL_Blit_ARGB8888_RGB888_Scale
static void SDL_Blit_ARGB8888_RGB888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2444
SDL_Blit_ARGB8888_RGB888_Blend_Scale
static void SDL_Blit_ARGB8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2539
SDL_BlitInfo::flags
int flags
Definition: SDL_blit.h:68
SDL_Blit_ARGB8888_RGB888_Modulate_Scale
static void SDL_Blit_ARGB8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2643
SDL_BlitInfo::g
Uint8 g
Definition: SDL_blit.h:70
SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend
static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4712
SDL_Blit_ARGB8888_BGR888_Modulate
static void SDL_Blit_ARGB8888_BGR888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3012
SDL_COPY_MOD
#define SDL_COPY_MOD
Definition: SDL_blit.h:38
SDL_BlitInfo::src_h
int src_h
Definition: SDL_blit.h:58
SDL_Blit_RGBA8888_ARGB8888_Modulate
static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4621
SDL_Blit_BGR888_RGB888_Blend
static void SDL_Blit_BGR888_RGB888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1280
SDL_Blit_RGB888_BGR888_Scale
static void SDL_Blit_RGB888_BGR888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:425
SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale
static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4777
SDL_Blit_RGBA8888_BGR888_Modulate
static void SDL_Blit_RGBA8888_BGR888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4219
SDL_Blit_BGRA8888_RGB888_Modulate_Scale
static void SDL_Blit_BGRA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6274
SDL_BlitInfo::dst_pitch
int dst_pitch
Definition: SDL_blit.h:63
SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale
static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6390
SDL_BlitInfo::src_w
int src_w
Definition: SDL_blit.h:58
SDL_Blit_BGRA8888_ARGB8888_Modulate
static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:7045
SDL_BlitInfo::dst_h
int dst_h
Definition: SDL_blit.h:62
SDL_Blit_BGR888_ARGB8888_Modulate
static void SDL_Blit_BGR888_ARGB8888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2202
SDL_Blit_BGR888_ARGB8888_Modulate_Blend
static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2293
SDL_Blit_BGR888_ARGB8888_Scale
static void SDL_Blit_BGR888_ARGB8888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2032
SDL_Blit_ABGR8888_RGB888_Modulate
static void SDL_Blit_ABGR8888_RGB888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5031
SDL_Blit_BGR888_RGB888_Blend_Scale
static void SDL_Blit_BGR888_RGB888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1332
SDL_PIXELFORMAT_RGB888
Definition: SDL_pixels.h:235
SDL_PIXELFORMAT_BGR888
Definition: SDL_pixels.h:241
SDL_Blit_ABGR8888_BGR888_Blend
static void SDL_Blit_ABGR8888_BGR888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5306
SDL_Blit_ABGR8888_RGB888_Modulate_Blend
static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5114
SDL_Blit_ARGB8888_ARGB8888_Scale
static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3244
SDL_COPY_ADD
#define SDL_COPY_ADD
Definition: SDL_blit.h:37
SDL_Blit_RGB888_RGB888_Modulate_Scale
static void SDL_Blit_RGB888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:224
SDL_Blit_RGBA8888_RGB888_Modulate_Blend
static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3902
SDL_Blit_RGBA8888_RGB888_Blend_Scale
static void SDL_Blit_RGBA8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3746
SDL_Blit_BGR888_RGB888_Modulate_Scale
static void SDL_Blit_BGR888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1436
SDL_Blit_BGR888_BGR888_Blend_Scale
static void SDL_Blit_BGR888_BGR888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1727
SDL_PIXELFORMAT_RGBA8888
Definition: SDL_pixels.h:250
SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale
static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1151
SDL_COPY_NEAREST
#define SDL_COPY_NEAREST
Definition: SDL_blit.h:40
SDL_Blit_RGB888_BGR888_Modulate_Scale
static void SDL_Blit_RGB888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:624
SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale
static void SDL_Blit_BGR888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1947
SDL_Blit_RGBA8888_BGR888_Modulate_Scale
static void SDL_Blit_RGBA8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4250
SDL_BlitInfo::dst
Uint8 * dst
Definition: SDL_blit.h:61
SDL_Blit_BGR888_BGR888_Modulate
static void SDL_Blit_BGR888_BGR888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1800
SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale
static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5578
SDL_video.h
SDL_blit_auto.h
SDL_Blit_ABGR8888_RGB888_Scale
static void SDL_Blit_ABGR8888_RGB888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4863
SDL_Blit_BGRA8888_ARGB8888_Blend
static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6918
SDL_PIXELFORMAT_ABGR8888
Definition: SDL_pixels.h:253
SDL_BlitInfo
Definition: SDL_blit.h:55
SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale
static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3565
Uint8
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:139
SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale
static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3159
SDL_Blit_RGB888_RGB888_Modulate_Blend
static void SDL_Blit_RGB888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:276
SDL_Blit_RGB888_RGB888_Scale
static void SDL_Blit_RGB888_RGB888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:30
SDL_Blit_RGB888_ARGB8888_Blend
static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:868
SDL_Blit_ABGR8888_BGR888_Scale
static void SDL_Blit_ABGR8888_BGR888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5263
SDL_Blit_ARGB8888_ARGB8888_Blend_Scale
static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3335
SDL_Blit_ARGB8888_ARGB8888_Modulate
static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3409
SDL_Blit_RGBA8888_RGB888_Modulate
static void SDL_Blit_RGBA8888_RGB888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3819
SDL_Blit_RGB888_RGB888_Blend_Scale
static void SDL_Blit_RGB888_RGB888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:120
SDL_Blit_ABGR8888_BGR888_Blend_Scale
static void SDL_Blit_ABGR8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5358
SDL_Blit_ARGB8888_ARGB8888_Blend
static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3282
SDL_Blit_BGR888_BGR888_Blend
static void SDL_Blit_BGR888_BGR888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1675
SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale
static void SDL_Blit_ABGR8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5178
SDL_BlitInfo::src
Uint8 * src
Definition: SDL_blit.h:57
SDL_Blit_ABGR8888_BGR888_Modulate_Blend
static void SDL_Blit_ABGR8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5514
SDL_Blit_RGB888_RGB888_Modulate
static void SDL_Blit_RGB888_RGB888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:193
SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale
static void SDL_Blit_BGR888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2358
SDL_Blit_ABGR8888_RGB888_Blend
static void SDL_Blit_ABGR8888_RGB888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4906
SDL_BlitFuncEntry
Definition: SDL_blit.h:75
SDL_Blit_ARGB8888_BGR888_Modulate_Blend
static void SDL_Blit_ARGB8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3095
SDL_GeneratedBlitFuncTable
SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[]
Definition: SDL_blit_auto.c:7287
SDL_BlitInfo::src_pitch
int src_pitch
Definition: SDL_blit.h:59
SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale
static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5868
SDL_Blit_BGR888_ARGB8888_Blend_Scale
static void SDL_Blit_BGR888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2128
SDL_Blit_RGBA8888_BGR888_Modulate_Blend
static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4302
SDL_Blit_BGRA8888_RGB888_Blend_Scale
static void SDL_Blit_BGRA8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6170
SDL_Blit_BGR888_BGR888_Modulate_Scale
static void SDL_Blit_BGR888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1831
SDL_Blit_BGRA8888_RGB888_Blend
static void SDL_Blit_BGRA8888_RGB888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6118
NULL
#define NULL
Definition: begin_code.h:143
SDL_Blit_ABGR8888_BGR888_Modulate_Scale
static void SDL_Blit_ABGR8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5462
SDL_Blit_BGR888_RGB888_Scale
static void SDL_Blit_BGR888_RGB888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1237
SDL_Blit_ABGR8888_ARGB8888_Blend
static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5706
SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale
static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2759
SDL_Blit_RGB888_BGR888_Modulate_Blend
static void SDL_Blit_RGB888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:676
SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend
static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3500
SDL_Blit_ARGB8888_BGR888_Modulate_Scale
static void SDL_Blit_ARGB8888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3043
SDL_Blit_BGR888_RGB888_Modulate
static void SDL_Blit_BGR888_RGB888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1405
SDL_blit.h
SDL_Blit_BGRA8888_BGR888_Modulate
static void SDL_Blit_BGRA8888_BGR888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6643
SDL_Blit_BGRA8888_BGR888_Modulate_Blend
static void SDL_Blit_BGRA8888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6726
SDL_COPY_MODULATE_ALPHA
#define SDL_COPY_MODULATE_ALPHA
Definition: SDL_blit.h:35
SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale
static void SDL_Blit_BGR888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1552
SDL_Blit_ABGR8888_RGB888_Modulate_Scale
static void SDL_Blit_ABGR8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5062
SDL_Blit_ARGB8888_RGB888_Modulate_Blend
static void SDL_Blit_ARGB8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2695
G
#define G(x, y, z)
Definition: SDL_test_md5.c:74
SDL_Blit_BGR888_BGR888_Scale
static void SDL_Blit_BGR888_BGR888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1637
SDL_Blit_BGR888_RGB888_Modulate_Blend
static void SDL_Blit_BGR888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1488
SDL_Blit_RGBA8888_ARGB8888_Blend
static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4494
SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale
static void SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:340
SDL_Blit_RGB888_BGR888_Modulate
static void SDL_Blit_RGB888_BGR888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:593
SDL_Blit_BGRA8888_BGR888_Blend_Scale
static void SDL_Blit_BGRA8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6570
flags
GLbitfield flags
Definition: SDL_opengl_glext.h:1480
SDL_Blit_ARGB8888_BGR888_Blend
static void SDL_Blit_ARGB8888_BGR888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2887
SDL_Blit_ABGR8888_BGR888_Modulate
static void SDL_Blit_ABGR8888_BGR888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5431
SDL_Blit_RGBA8888_RGB888_Modulate_Scale
static void SDL_Blit_RGBA8888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3850
SDL_Blit_RGB888_ARGB8888_Blend_Scale
static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:921
SDL_Blit_ABGR8888_ARGB8888_Blend_Scale
static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5759
SDL_CPU_ANY
#define SDL_CPU_ANY
Definition: SDL_blit.h:47
SDL_PIXELFORMAT_BGRA8888
Definition: SDL_pixels.h:256
SDL_Blit_RGBA8888_RGB888_Scale
static void SDL_Blit_RGBA8888_RGB888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3651
SDL_BlitInfo::dst_w
int dst_w
Definition: SDL_blit.h:62
SDL_Blit_RGB888_ARGB8888_Scale
static void SDL_Blit_RGB888_ARGB8888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:825
SDL_Blit_RGBA8888_BGR888_Scale
static void SDL_Blit_RGBA8888_BGR888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4051
SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend
static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:7136
SDL_Blit_ABGR8888_ARGB8888_Scale
static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5663
SDL_Blit_RGBA8888_BGR888_Blend_Scale
static void SDL_Blit_RGBA8888_BGR888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4146
SDL_Blit_BGRA8888_RGB888_Modulate_Blend
static void SDL_Blit_BGRA8888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6326
SDL_Blit_BGRA8888_RGB888_Modulate
static void SDL_Blit_BGRA8888_RGB888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6243
src
GLenum src
Definition: SDL_opengl_glext.h:1737
SDL_Blit_ABGR8888_RGB888_Blend_Scale
static void SDL_Blit_ABGR8888_RGB888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4958
SDL_Blit_BGRA8888_BGR888_Scale
static void SDL_Blit_BGRA8888_BGR888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:6475
SDL_Blit_RGB888_ARGB8888_Modulate_Blend
static void SDL_Blit_RGB888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:1086
SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale
static void SDL_Blit_RGBA8888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:3966
SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale
static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4656
SDL_COPY_BLEND
#define SDL_COPY_BLEND
Definition: SDL_blit.h:36
SDL_Blit_RGB888_BGR888_Blend_Scale
static void SDL_Blit_RGB888_BGR888_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:520
SDL_Blit_ARGB8888_RGB888_Modulate
static void SDL_Blit_ARGB8888_RGB888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2612
SDL_Blit_ABGR8888_ARGB8888_Modulate
static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5833
SDL_Blit_RGBA8888_BGR888_Blend
static void SDL_Blit_RGBA8888_BGR888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4094
SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale
static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5989
SDL_BlitInfo::a
Uint8 a
Definition: SDL_blit.h:70
SDL_Blit_RGB888_RGB888_Blend
static void SDL_Blit_RGB888_RGB888_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:68
SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend
static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:5924
SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale
static void SDL_Blit_RGBA8888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:4366
SDL_Blit_ARGB8888_BGR888_Scale
static void SDL_Blit_ARGB8888_BGR888_Scale(SDL_BlitInfo *info)
Definition: SDL_blit_auto.c:2844