App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

Blender_define_macro.hpp
Go to the documentation of this file.
1
6
7
10 #define DECLARE_BLEND_FUNCTIONS(NAME) \
11 static int blend_ ## NAME ## _argb_sd(PARAMS_SD); \
12 static int blend_ ## NAME ## _argb_sda(PARAMS_SDA); \
13 static int blend_ ## NAME ## _argb_sdm(PARAMS_SDM); \
14 static int blend_ ## NAME ## _argb_sdma(PARAMS_SDMA); \
15 static int blend_ ## NAME ## _argb_cdm(PARAMS_CDM); \
16 static int blend_ ## NAME ## _argb_cd(PARAMS_CD);
17
19
23 #define DECLARE_ARGB_FUNCTION_SELECTOR(MODE) static blendf_argb_ ## MODE getBlendFunction_argb_ ## MODE(BlendMode mode);
24
26
30 #define DEFINE_BLEND_FUNCTIONS(NAME, BIGNAME) \
31 int Blender::blend_ ## NAME ## _argb_sd(PARAMS_SD) { \
32 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
33 INIT_ALPHAS_SD(s,d) BLEND_ARGB_##BIGNAME(s, sa, d, da, sac, ra), \
34 AREA_INCREMENT_SD(s, d, dstAreaRowEnd, dstByteWidth, srcByteOffset, dstByteOffset) \
35 ) \
36 return 1; \
37 } \
38 \
39 int Blender::blend_ ## NAME ## _argb_sda(PARAMS_SDA) { \
40 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
41 INIT_ALPHAS_SDA(s,d,alpha) BLEND_ARGB_ ## BIGNAME(s, sa, d, da, sac, ra), \
42 AREA_INCREMENT_SD(s, d, dstAreaRowEnd, dstByteWidth, srcByteOffset, dstByteOffset) \
43 ) \
44 return 1; \
45 } \
46 \
47 int Blender::blend_ ## NAME ## _argb_sdm(PARAMS_SDM) { \
48 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
49 INIT_ALPHAS_SDM(s,d,m) BLEND_ARGB_ ## BIGNAME(s, sa, d, da, sac, ra), \
50 AREA_INCREMENT_SDM(s, d, m, dstAreaRowEnd, dstByteWidth, srcByteOffset, dstByteOffset, mskByteOffset) \
51 ) \
52 return 1; \
53 } \
54 \
55 int Blender::blend_ ## NAME ## _argb_sdma(PARAMS_SDMA) { \
56 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
57 INIT_ALPHAS_SDMA(s,d,m,alpha) BLEND_ARGB_ ## BIGNAME(s, sa, d, da, sac, ra), \
58 AREA_INCREMENT_SDM(s, d, m, dstAreaRowEnd, dstByteWidth, srcByteOffset, dstByteOffset, mskByteOffset) \
59 ) \
60 return 1; \
61 } \
62 \
63 int Blender::blend_ ## NAME ## _argb_cdm(PARAMS_CDM) { \
64 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
65 INIT_ALPHAS_SDM(c,d,m) BLEND_ARGB_ ## BIGNAME ## _CDM(c, sa, d, da, sac, ra, clrbpp), \
66 AREA_INCREMENT_CDM(d, m, dstAreaRowEnd, dstByteWidth,dstByteOffset, mskByteOffset) \
67 ) \
68 return 1; \
69 } \
70 \
71 int Blender::blend_ ## NAME ## _argb_cd(PARAMS_CD) { \
72 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
73 INIT_ALPHAS_SD(c,d) BLEND_ARGB_ ## BIGNAME ## _CDM(c, sa, d, da, sac, ra, clrbpp), \
74 AREA_INCREMENT_CD(d, dstAreaRowEnd, dstByteWidth,dstByteOffset) \
75 ) \
76 return 1; \
77 }
78
80
86 #define DEFINE_BLEND_FUNCTIONS_COMPLEX(NAME, BIGNAME) \
87 int Blender::blend_ ## NAME ## _argb_sd(PARAMS_SD) { \
88 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
89 BLEND_COMPLEX_##BIGNAME##_SD(s, d), \
90 AREA_INCREMENT_SD(s, d, dstAreaRowEnd, dstByteWidth, srcByteOffset, dstByteOffset) \
91 ) \
92 return 1; \
93 } \
94 \
95 int Blender::blend_ ## NAME ## _argb_sda(PARAMS_SDA) { \
96 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
97 BLEND_COMPLEX_##BIGNAME##_SDA(s, d, alpha), \
98 AREA_INCREMENT_SD(s, d, dstAreaRowEnd, dstByteWidth, srcByteOffset, dstByteOffset) \
99 ) \
100 return 1; \
101 } \
102 \
103 int Blender::blend_ ## NAME ## _argb_sdm(PARAMS_SDM) { \
104 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
105 BLEND_COMPLEX_##BIGNAME##_SDM(s, d, m), \
106 AREA_INCREMENT_SDM(s, d, m, dstAreaRowEnd, dstByteWidth, srcByteOffset, dstByteOffset, mskByteOffset) \
107 ) \
108 return 1; \
109 } \
110 \
111 int Blender::blend_ ## NAME ## _argb_sdma(PARAMS_SDMA) { \
112 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
113 BLEND_COMPLEX_##BIGNAME##_SDMA(s, d, m, alpha), \
114 AREA_INCREMENT_SDM(s, d, m, dstAreaRowEnd, dstByteWidth, srcByteOffset, dstByteOffset, mskByteOffset) \
115 ) \
116 return 1; \
117 } \
118 \
119 int Blender::blend_ ## NAME ## _argb_cdm(PARAMS_CDM) { \
120 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
121 BLEND_COMPLEX_##BIGNAME##_CDM(c, d, m), \
122 AREA_INCREMENT_CDM(d, m, dstAreaRowEnd, dstByteWidth,dstByteOffset, mskByteOffset) \
123 ) \
124 return 1; \
125 } \
126 \
127 int Blender::blend_ ## NAME ## _argb_cd(PARAMS_CD) { \
128 FOREACH(d, dstAreaEnd, dstAreaRowEnd, \
129 BLEND_COMPLEX_##BIGNAME##_CD(c, d), \
130 AREA_INCREMENT_CD(d, dstAreaRowEnd, dstByteWidth,dstByteOffset) \
131 ) \
132 return 1; \
133 }
134
136
139 #define DEFINE_ARGB_FUNCTION_SELECTOR(MODE) \
140 blendf_argb_ ## MODE Blender::getBlendFunction_argb_ ## MODE(BlendMode mode) { \
141 switch (mode) { \
142 case BLEND_MODE_NORMAL: \
143 return Blender::blend_normal_argb_ ## MODE; \
144 break; \
145 case BLEND_MODE_DISSOLVE: \
146 return Blender::blend_normal_argb_ ## MODE; \
147 break; \
148 \
149 case BLEND_MODE_BEHIND: \
150 return Blender::blend_behind_argb_ ## MODE; \
151 break; \
152 case BLEND_MODE_CLEAR: \
153 return Blender::blend_clear_argb_ ## MODE; \
154 break; \
155 \
156 case BLEND_MODE_DARKEN: \
157 return Blender::blend_darken_argb_ ## MODE; \
158 break; \
159 case BLEND_MODE_MULTIPLY: \
160 return Blender::blend_multiply_argb_ ## MODE; \
161 break; \
162 case BLEND_MODE_COLOR_BURN: \
163 return Blender::blend_colorBurn_argb_ ## MODE; \
164 break; \
165 case BLEND_MODE_LINEAR_BURN: \
166 return Blender::blend_linearBurn_argb_ ## MODE; \
167 break; \
168 case BLEND_MODE_DARKER_COLOR: \
169 return Blender::blend_darkerColor_argb_ ## MODE; \
170 break; \
171 \
172 case BLEND_MODE_LIGHTEN: \
173 return Blender::blend_lighten_argb_ ## MODE; \
174 break; \
175 case BLEND_MODE_SCREEN: \
176 return Blender::blend_screen_argb_ ## MODE; \
177 break; \
178 case BLEND_MODE_COLOR_DODGE: \
179 return Blender::blend_colorDodge_argb_ ## MODE; \
180 break; \
181 case BLEND_MODE_LINEAR_DODGE_ADD: \
182 return Blender::blend_linearDodgeAdd_argb_ ## MODE; \
183 break; \
184 case BLEND_MODE_LIGHTER_COLOR: \
185 return Blender::blend_lighterColor_argb_ ## MODE; \
186 break; \
187 \
188 case BLEND_MODE_OVERLAY: \
189 return Blender::blend_overlay_argb_ ## MODE; \
190 break; \
191 case BLEND_MODE_SOFT_LIGHT: \
192 return Blender::blend_softLight_argb_ ## MODE; \
193 break; \
194 case BLEND_MODE_HARD_LIGHT: \
195 return Blender::blend_hardLight_argb_ ## MODE; \
196 break; \
197 case BLEND_MODE_VIVID_LIGHT: \
198 return Blender::blend_vividLight_argb_ ## MODE; \
199 break; \
200 case BLEND_MODE_LINEAR_LIGHT: \
201 return Blender::blend_linearLight_argb_ ## MODE; \
202 break; \
203 case BLEND_MODE_PIN_LIGHT: \
204 return Blender::blend_pinLight_argb_ ## MODE; \
205 break; \
206 case BLEND_MODE_HARD_MIX: \
207 return Blender::blend_hardMix_argb_ ## MODE; \
208 break; \
209 \
210 case BLEND_MODE_DIFFERENCE: \
211 return Blender::blend_difference_argb_ ## MODE; \
212 break; \
213 case BLEND_MODE_EXCLUSION: \
214 return Blender::blend_exclusion_argb_ ## MODE; \
215 break; \
216 case BLEND_MODE_SUBTRACT: \
217 return Blender::blend_subtract_argb_ ## MODE; \
218 break; \
219 case BLEND_MODE_DIVIDE: \
220 return Blender::blend_divide_argb_ ## MODE; \
221 break; \
222 \
223 case BLEND_MODE_HUE: \
224 return Blender::blend_hue_argb_ ## MODE; \
225 break; \
226 case BLEND_MODE_SATURATION: \
227 return Blender::blend_saturation_argb_ ## MODE; \
228 break; \
229 case BLEND_MODE_COLOR: \
230 return Blender::blend_color_argb_ ## MODE; \
231 break; \
232 case BLEND_MODE_LUMINOSITY: \
233 return Blender::blend_luminosity_argb_ ## MODE; \
234 break; \
235 default: \
236 return NULL; \
237 break; \
238 } \
239 }