1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
/* check that all macros are correctly set
*/
#ifndef GDST_INCR
#error "GDST_INCR not defined"
#endif
#ifndef GDST_TYPE
#error "GDST_TYPE not defined"
#endif
#ifndef GDST_READ
#error "GDST_READ not defined"
#endif
#ifdef GBLENDER_STORE_BYTES
# ifndef GDST_STOREB
# error "GDST_STOREB not defined"
# endif
#else
# ifndef GDST_STOREP
# error "GDST_STOREP not defined"
# endif
#endif /* !STORE_BYTES */
#ifndef GDST_STOREC
#error "GDST_STOREC not defined"
#endif
#ifndef GDST_COPY
#error "GDST_COPY not defined"
#endif
#ifndef GDST_COPY_VAR
#error "GDST_COPY_VAR not defined"
#endif
#undef GCONCAT
#undef GCONCATX
#define GCONCAT(x,y) GCONCATX(x,y)
#define GCONCATX(x,y) x ## y
#include <stdio.h>
static void
GCONCAT( _gblender_blit_gray8_, GDST_TYPE )( GBlenderBlit blit,
GBlenderPixel color )
{
GBlender blender = blit->blender;
int r = (color >> 16) & 255;
int g = (color >> 8) & 255;
int b = (color) & 255;
GDST_COPY_VAR
#include "gblcolor.h"
}
static void
GCONCAT( _gblender_blit_hrgb_, GDST_TYPE )( GBlenderBlit blit,
GBlenderPixel color )
{
GBlender blender = blit->blender;
int r = (color >> 16) & 255;
int g = (color >> 8) & 255;
int b = (color) & 255;
GDST_COPY_VAR
#include "gblhrgb.h"
}
static void
GCONCAT( _gblender_blit_hbgr_, GDST_TYPE )( GBlenderBlit blit,
GBlenderPixel color )
{
GBlender blender = blit->blender;
int r = (color >> 16) & 255;
int g = (color >> 8) & 255;
int b = (color) & 255;
GDST_COPY_VAR
#include "gblhbgr.h"
}
static void
GCONCAT( _gblender_blit_vrgb_, GDST_TYPE )( GBlenderBlit blit,
GBlenderPixel color )
{
GBlender blender = blit->blender;
int r = (color >> 16) & 255;
int g = (color >> 8) & 255;
int b = (color) & 255;
GDST_COPY_VAR
#include "gblvrgb.h"
}
static void
GCONCAT( _gblender_blit_vbgr_, GDST_TYPE )( GBlenderBlit blit,
GBlenderPixel color )
{
GBlender blender = blit->blender;
int r = (color >> 16) & 255;
int g = (color >> 8) & 255;
int b = (color) & 255;
GDST_COPY_VAR
#include "gblvbgr.h"
}
/* unset the macros, to prevent accidental re-use
*/
#undef GCONCATX
#undef GCONCAT
#undef GDST_TYPE
#undef GDST_INCR
#undef GDST_READ
#undef GDST_COPY
#undef GDST_STOREB
#undef GDST_STOREP
#undef GDST_STOREC
#undef GDST_COPY_VAR
/* EOF */
|