Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
7491 lines (7159 loc) · 271 KB

SDL_blit_auto.c

File metadata and controls

7491 lines (7159 loc) · 271 KB
 
1
2
/* DO NOT EDIT! This file is generated by sdlgenblit.pl */
/*
Apr 8, 2011
Apr 8, 2011
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Simple DirectMedia Layer
Copyright (C) 1997-2011 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.
21
22
23
24
25
26
*/
#include "SDL_config.h"
/* *INDENT-OFF* */
#include "SDL_video.h"
Aug 17, 2007
Aug 17, 2007
27
28
29
#include "SDL_blit.h"
#include "SDL_blit_auto.h"
Aug 17, 2007
Aug 17, 2007
30
static void SDL_Blit_RGB888_RGB888_Scale(SDL_BlitInfo *info)
31
32
33
34
35
36
37
{
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
38
39
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
41
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
42
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
43
44
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
45
46
47
48
49
50
51
52
53
54
55
56
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
57
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
58
59
60
61
62
63
}
*dst = *src;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
64
info->dst += info->dst_pitch;
65
66
67
}
}
Aug 17, 2007
Aug 17, 2007
68
static void SDL_Blit_RGB888_RGB888_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
70
const int flags = info->flags;
71
72
73
74
75
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
76
77
78
79
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
80
81
82
83
84
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 = 0xFF;
Aug 17, 2007
Aug 17, 2007
85
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
86
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
87
88
89
90
91
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
93
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
94
case SDL_COPY_BLEND:
95
96
97
98
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
99
case SDL_COPY_ADD:
100
101
102
103
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;
Feb 5, 2011
Feb 5, 2011
104
105
106
107
108
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
109
110
111
112
113
114
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
115
116
info->src += info->src_pitch;
info->dst += info->dst_pitch;
117
118
119
}
}
Aug 17, 2007
Aug 17, 2007
120
static void SDL_Blit_RGB888_RGB888_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
122
const int flags = info->flags;
123
124
125
126
127
128
129
130
131
132
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;
Aug 17, 2007
Aug 17, 2007
133
134
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
136
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
137
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
138
139
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
140
141
142
143
144
145
146
147
148
149
150
151
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
152
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
153
154
155
156
157
}
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 = 0xFF;
Aug 17, 2007
Aug 17, 2007
158
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
159
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
160
161
162
163
164
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
166
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
167
case SDL_COPY_BLEND:
168
169
170
171
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
172
case SDL_COPY_ADD:
173
174
175
176
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;
Feb 5, 2011
Feb 5, 2011
177
178
179
180
181
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
182
183
184
185
186
187
188
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
189
info->dst += info->dst_pitch;
190
191
192
}
}
Aug 17, 2007
Aug 17, 2007
193
static void SDL_Blit_RGB888_RGB888_Modulate(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
195
196
197
198
199
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;
200
201
202
Uint32 pixel;
Uint32 R, G, B, A;
Aug 17, 2007
Aug 17, 2007
203
204
205
206
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
207
208
209
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
Aug 17, 2007
Aug 17, 2007
210
if (flags & SDL_COPY_MODULATE_COLOR) {
211
212
213
214
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
215
if (flags & SDL_COPY_MODULATE_ALPHA) {
Aug 28, 2006
Aug 28, 2006
216
217
A = (A * modulateA) / 255;
}
218
219
220
221
222
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
223
224
info->src += info->src_pitch;
info->dst += info->dst_pitch;
225
226
227
}
}
Aug 17, 2007
Aug 17, 2007
228
static void SDL_Blit_RGB888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
230
231
232
233
234
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;
235
236
237
238
239
240
241
242
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
243
244
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
246
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
247
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
248
249
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
250
251
252
253
254
255
256
257
258
259
260
261
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
262
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
263
264
265
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
Aug 17, 2007
Aug 17, 2007
266
if (flags & SDL_COPY_MODULATE_COLOR) {
267
268
269
270
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
271
if (flags & SDL_COPY_MODULATE_ALPHA) {
Aug 28, 2006
Aug 28, 2006
272
273
A = (A * modulateA) / 255;
}
274
275
276
277
278
279
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
280
info->dst += info->dst_pitch;
281
282
283
}
}
Aug 17, 2007
Aug 17, 2007
284
static void SDL_Blit_RGB888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
286
287
288
289
290
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;
291
292
293
294
295
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
296
297
298
299
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
300
301
302
303
304
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 = 0xFF;
Aug 17, 2007
Aug 17, 2007
305
if (flags & SDL_COPY_MODULATE_COLOR) {
306
307
308
309
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
310
if (flags & SDL_COPY_MODULATE_ALPHA) {
311
312
srcA = (srcA * modulateA) / 255;
}
Aug 17, 2007
Aug 17, 2007
313
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
314
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
315
316
317
318
319
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
321
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
322
case SDL_COPY_BLEND:
323
324
325
326
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
327
case SDL_COPY_ADD:
328
329
330
331
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;
Feb 5, 2011
Feb 5, 2011
332
333
334
335
336
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
337
338
339
340
341
342
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
343
344
info->src += info->src_pitch;
info->dst += info->dst_pitch;
345
346
347
}
}
Aug 17, 2007
Aug 17, 2007
348
static void SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
350
351
352
353
354
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;
355
356
357
358
359
360
361
362
363
364
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;
Aug 17, 2007
Aug 17, 2007
365
366
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
368
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
369
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
370
371
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
372
373
374
375
376
377
378
379
380
381
382
383
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
384
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
385
386
387
388
389
}
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 = 0xFF;
Aug 17, 2007
Aug 17, 2007
390
if (flags & SDL_COPY_MODULATE_COLOR) {
391
392
393
394
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
395
if (flags & SDL_COPY_MODULATE_ALPHA) {
396
397
srcA = (srcA * modulateA) / 255;
}
Aug 17, 2007
Aug 17, 2007
398
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
399
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
400
401
402
403
404
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
406
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
407
case SDL_COPY_BLEND:
408
409
410
411
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
412
case SDL_COPY_ADD:
413
414
415
416
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;
Feb 5, 2011
Feb 5, 2011
417
418
419
420
421
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
422
423
424
425
426
427
428
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
429
info->dst += info->dst_pitch;
430
431
432
}
}
Aug 17, 2007
Aug 17, 2007
433
static void SDL_Blit_RGB888_BGR888_Scale(SDL_BlitInfo *info)
434
435
436
437
438
439
440
441
442
{
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
443
444
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
446
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
447
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
448
449
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
450
451
452
453
454
455
456
457
458
459
460
461
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
462
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
463
464
465
466
467
468
469
470
471
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
472
info->dst += info->dst_pitch;
473
474
475
}
}
Aug 17, 2007
Aug 17, 2007
476
static void SDL_Blit_RGB888_BGR888_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
478
const int flags = info->flags;
479
480
481
482
483
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
484
485
486
487
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
488
489
490
491
492
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; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
493
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
494
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
495
496
497
498
499
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
501
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
502
case SDL_COPY_BLEND:
503
504
505
506
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
507
case SDL_COPY_ADD:
508
509
510
511
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;
Feb 5, 2011
Feb 5, 2011
512
513
514
515
516
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
517
518
519
520
521
522
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
523
524
info->src += info->src_pitch;
info->dst += info->dst_pitch;
525
526
527
}
}
Aug 17, 2007
Aug 17, 2007
528
static void SDL_Blit_RGB888_BGR888_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
530
const int flags = info->flags;
531
532
533
534
535
536
537
538
539
540
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;
Aug 17, 2007
Aug 17, 2007
541
542
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
544
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
545
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
546
547
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
548
549
550
551
552
553
554
555
556
557
558
559
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
560
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
561
562
563
564
565
}
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; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
566
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
567
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
568
569
570
571
572
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
574
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
575
case SDL_COPY_BLEND:
576
577
578
579
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
580
case SDL_COPY_ADD:
581
582
583
584
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;
Feb 5, 2011
Feb 5, 2011
585
586
587
588
589
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
590
591
592
593
594
595
596
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
597
info->dst += info->dst_pitch;
598
599
600
}
}
Aug 17, 2007
Aug 17, 2007
601
static void SDL_Blit_RGB888_BGR888_Modulate(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
603
604
605
606
607
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;
608
609
610
Uint32 pixel;
Uint32 R, G, B, A;
Aug 17, 2007
Aug 17, 2007
611
612
613
614
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
615
616
617
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
Aug 17, 2007
Aug 17, 2007
618
if (flags & SDL_COPY_MODULATE_COLOR) {
619
620
621
622
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
623
if (flags & SDL_COPY_MODULATE_ALPHA) {
Aug 28, 2006
Aug 28, 2006
624
625
A = (A * modulateA) / 255;
}
626
627
628
629
630
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
631
632
info->src += info->src_pitch;
info->dst += info->dst_pitch;
633
634
635
}
}
Aug 17, 2007
Aug 17, 2007
636
static void SDL_Blit_RGB888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
638
639
640
641
642
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;
643
644
645
646
647
648
649
650
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
651
652
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
654
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
655
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
656
657
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
658
659
660
661
662
663
664
665
666
667
668
669
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
670
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
671
672
673
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
Aug 17, 2007
Aug 17, 2007
674
if (flags & SDL_COPY_MODULATE_COLOR) {
675
676
677
678
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
679
if (flags & SDL_COPY_MODULATE_ALPHA) {
Aug 28, 2006
Aug 28, 2006
680
681
A = (A * modulateA) / 255;
}
682
683
684
685
686
687
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
688
info->dst += info->dst_pitch;
689
690
691
}
}
Aug 17, 2007
Aug 17, 2007
692
static void SDL_Blit_RGB888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
694
695
696
697
698
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;
699
700
701
702
703
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
704
705
706
707
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
708
709
710
711
712
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; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
713
if (flags & SDL_COPY_MODULATE_COLOR) {
714
715
716
717
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
718
if (flags & SDL_COPY_MODULATE_ALPHA) {
719
720
srcA = (srcA * modulateA) / 255;
}
Aug 17, 2007
Aug 17, 2007
721
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
722
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
723
724
725
726
727
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
729
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
730
case SDL_COPY_BLEND:
731
732
733
734
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
735
case SDL_COPY_ADD:
736
737
738
739
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;
Feb 5, 2011
Feb 5, 2011
740
741
742
743
744
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
745
746
747
748
749
750
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
751
752
info->src += info->src_pitch;
info->dst += info->dst_pitch;
753
754
755
}
}
Aug 17, 2007
Aug 17, 2007
756
static void SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
758
759
760
761
762
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;
763
764
765
766
767
768
769
770
771
772
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;
Aug 17, 2007
Aug 17, 2007
773
774
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
776
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
777
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
778
779
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
780
781
782
783
784
785
786
787
788
789
790
791
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
792
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
793
794
795
796
797
}
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; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
798
if (flags & SDL_COPY_MODULATE_COLOR) {
799
800
801
802
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
803
if (flags & SDL_COPY_MODULATE_ALPHA) {
804
805
srcA = (srcA * modulateA) / 255;
}
Aug 17, 2007
Aug 17, 2007
806
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
807
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
808
809
810
811
812
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
814
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
815
case SDL_COPY_BLEND:
816
817
818
819
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
820
case SDL_COPY_ADD:
821
822
823
824
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;
Feb 5, 2011
Feb 5, 2011
825
826
827
828
829
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
830
831
832
833
834
835
836
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
837
info->dst += info->dst_pitch;
838
839
840
}
}
Nov 29, 2008
Nov 29, 2008
841
static void SDL_Blit_RGB888_ARGB8888_Scale(SDL_BlitInfo *info)
842
843
844
845
846
847
848
849
850
{
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
851
852
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
854
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
855
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
856
857
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
858
859
860
861
862
863
864
865
866
867
868
869
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
870
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
871
872
}
pixel = *src;
Nov 29, 2008
Nov 29, 2008
873
874
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
875
876
877
878
879
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
880
info->dst += info->dst_pitch;
881
882
883
}
}
Nov 29, 2008
Nov 29, 2008
884
static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
886
const int flags = info->flags;
887
888
889
890
891
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
892
893
894
895
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
896
897
while (n--) {
srcpixel = *src;
Nov 29, 2008
Nov 29, 2008
898
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
899
dstpixel = *dst;
Nov 29, 2008
Nov 29, 2008
900
dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
Aug 17, 2007
Aug 17, 2007
901
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
902
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
903
904
905
906
907
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
909
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
910
case SDL_COPY_BLEND:
911
912
913
914
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
915
case SDL_COPY_ADD:
916
917
918
919
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;
Feb 5, 2011
Feb 5, 2011
920
921
922
923
924
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
Nov 29, 2008
Nov 29, 2008
926
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
927
928
929
930
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
931
932
info->src += info->src_pitch;
info->dst += info->dst_pitch;
933
934
935
}
}
Nov 29, 2008
Nov 29, 2008
936
static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
938
const int flags = info->flags;
939
940
941
942
943
944
945
946
947
948
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;
Aug 17, 2007
Aug 17, 2007
949
950
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
952
while (info->dst_h--) {
Mar 7, 2011
Mar 7, 2011
953
Uint32 *src = 0;
Aug 17, 2007
Aug 17, 2007
954
955
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
956
957
958
959
960
961
962
963
964
965
966
967
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
968
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
969
970
}
srcpixel = *src;
Nov 29, 2008
Nov 29, 2008
971
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
972
dstpixel = *dst;
Nov 29, 2008
Nov 29, 2008
973
dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
Aug 17, 2007
Aug 17, 2007
974
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
975
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
976
977
978
979
980
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
982
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
983
case SDL_COPY_BLEND:
984
985
986
987
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
988
case SDL_COPY_ADD:
989
990
991
992
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;
Feb 5, 2011
Feb 5, 2011
993
994
995
996
997
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
Nov 29, 2008
Nov 29, 2008
999
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
1000
*dst = dstpixel;