source: trunk/Packages/bgrabitmap/blendpixels.inc

Last change on this file was 2, checked in by chronos, 5 years ago
File size: 8.3 KB
Line 
1procedure FastBlendPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
2begin
3 while Count > 0 do
4 begin
5 FastBlendPixelInline(pdest, psrc^);
6 Inc(pdest);
7 Inc(psrc);
8 Dec(Count);
9 end;
10end;
11
12procedure DrawTransparentPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
13begin
14 while Count > 0 do
15 begin
16 DrawPixelInlineWithAlphaCheck(pdest, psrc^);
17 Inc(pdest);
18 Inc(psrc);
19 Dec(Count);
20 end;
21end;
22
23procedure LinearMultiplyPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
24begin
25 while Count > 0 do
26 begin
27 LinearMultiplyPixelInline(pdest, psrc^); //same look with non linear
28 Inc(pdest);
29 Inc(psrc);
30 Dec(Count);
31 end;
32end;
33
34procedure AddPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
35begin
36 while Count > 0 do
37 begin
38 AddPixelInline(pdest, psrc^);
39 Inc(pdest);
40 Inc(psrc);
41 Dec(Count);
42 end;
43end;
44
45procedure LinearAddPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
46begin
47 while Count > 0 do
48 begin
49 LinearAddPixelInline(pdest, psrc^);
50 Inc(pdest);
51 Inc(psrc);
52 Dec(Count);
53 end;
54end;
55
56procedure ColorBurnPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
57begin
58 while Count > 0 do
59 begin
60 ColorBurnPixelInline(pdest, psrc^);
61 Inc(pdest);
62 Inc(psrc);
63 Dec(Count);
64 end;
65end;
66
67procedure ColorDodgePixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
68begin
69 while Count > 0 do
70 begin
71 ColorDodgePixelInline(pdest, psrc^);
72 Inc(pdest);
73 Inc(psrc);
74 Dec(Count);
75 end;
76end;
77
78procedure DividePixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
79begin
80 while Count > 0 do
81 begin
82 DividePixelInline(pdest, psrc^);
83 Inc(pdest);
84 Inc(psrc);
85 Dec(Count);
86 end;
87end;
88
89procedure ReflectPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
90begin
91 while Count > 0 do
92 begin
93 ReflectPixelInline(pdest, psrc^);
94 Inc(pdest);
95 Inc(psrc);
96 Dec(Count);
97 end;
98end;
99
100procedure GlowPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
101begin
102 while Count > 0 do
103 begin
104 GlowPixelInline(pdest, psrc^);
105 Inc(pdest);
106 Inc(psrc);
107 Dec(Count);
108 end;
109end;
110
111procedure NiceGlowPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
112begin
113 while Count > 0 do
114 begin
115 NiceGlowPixelInline(pdest, psrc^);
116 Inc(pdest);
117 Inc(psrc);
118 Dec(Count);
119 end;
120end;
121
122procedure OverlayPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
123begin
124 while Count > 0 do
125 begin
126 OverlayPixelInline(pdest, psrc^);
127 Inc(pdest);
128 Inc(psrc);
129 Dec(Count);
130 end;
131end;
132
133procedure LinearOverlayPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
134begin
135 while Count > 0 do
136 begin
137 LinearOverlayPixelInline(pdest, psrc^);
138 Inc(pdest);
139 Inc(psrc);
140 Dec(Count);
141 end;
142end;
143
144procedure DifferencePixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
145begin
146 while Count > 0 do
147 begin
148 DifferencePixelInline(pdest, psrc^);
149 Inc(pdest);
150 Inc(psrc);
151 Dec(Count);
152 end;
153end;
154
155procedure LinearDifferencePixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
156begin
157 while Count > 0 do
158 begin
159 LinearDifferencePixelInline(pdest, psrc^);
160 Inc(pdest);
161 Inc(psrc);
162 Dec(Count);
163 end;
164end;
165
166procedure ExclusionPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
167begin
168 while Count > 0 do
169 begin
170 ExclusionPixelInline(pdest, psrc^);
171 Inc(pdest);
172 Inc(psrc);
173 Dec(Count);
174 end;
175end;
176
177procedure LinearExclusionPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
178begin
179 while Count > 0 do
180 begin
181 LinearExclusionPixelInline(pdest, psrc^);
182 Inc(pdest);
183 Inc(psrc);
184 Dec(Count);
185 end;
186end;
187
188procedure LinearSubtractPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
189begin
190 while Count > 0 do
191 begin
192 LinearSubtractPixelInline(pdest, psrc^);
193 Inc(pdest);
194 Inc(psrc);
195 Dec(Count);
196 end;
197end;
198
199procedure LinearSubtractInversePixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
200begin
201 while Count > 0 do
202 begin
203 LinearSubtractInversePixelInline(pdest, psrc^);
204 Inc(pdest);
205 Inc(psrc);
206 Dec(Count);
207 end;
208end;
209
210procedure SubtractPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
211begin
212 while Count > 0 do
213 begin
214 SubtractPixelInline(pdest, psrc^);
215 Inc(pdest);
216 Inc(psrc);
217 Dec(Count);
218 end;
219end;
220
221procedure SubtractInversePixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
222begin
223 while Count > 0 do
224 begin
225 SubtractInversePixelInline(pdest, psrc^);
226 Inc(pdest);
227 Inc(psrc);
228 Dec(Count);
229 end;
230end;
231
232procedure NegationPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
233begin
234 while Count > 0 do
235 begin
236 NegationPixelInline(pdest, psrc^);
237 Inc(pdest);
238 Inc(psrc);
239 Dec(Count);
240 end;
241end;
242
243procedure LinearNegationPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
244begin
245 while Count > 0 do
246 begin
247 LinearNegationPixelInline(pdest, psrc^);
248 Inc(pdest);
249 Inc(psrc);
250 Dec(Count);
251 end;
252end;
253
254procedure LightenPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
255begin
256 while Count > 0 do
257 begin
258 LightenPixelInline(pdest, psrc^);
259 Inc(pdest);
260 Inc(psrc);
261 Dec(Count);
262 end;
263end;
264
265procedure DarkenPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
266begin
267 while Count > 0 do
268 begin
269 DarkenPixelInline(pdest, psrc^);
270 Inc(pdest);
271 Inc(psrc);
272 Dec(Count);
273 end;
274end;
275
276procedure ScreenPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
277begin
278 while Count > 0 do
279 begin
280 ScreenPixelInline(pdest, psrc^);
281 Inc(pdest);
282 Inc(psrc);
283 Dec(Count);
284 end;
285end;
286
287procedure SoftLightPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
288begin
289 while Count > 0 do
290 begin
291 SoftLightPixelInline(pdest, psrc^);
292 Inc(pdest);
293 Inc(psrc);
294 Dec(Count);
295 end;
296end;
297
298procedure SvgSoftLightPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
299begin
300 while Count > 0 do
301 begin
302 SvgSoftLightPixelInline(pdest, psrc^);
303 Inc(pdest);
304 Inc(psrc);
305 Dec(Count);
306 end;
307end;
308
309procedure HardLightPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
310begin
311 while Count > 0 do
312 begin
313 HardLightPixelInline(pdest, psrc^);
314 Inc(pdest);
315 Inc(psrc);
316 Dec(Count);
317 end;
318end;
319
320procedure BlendXorPixels(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
321begin
322 while Count > 0 do
323 begin
324 BlendXorPixelInline(pdest, psrc^);
325 Inc(pdest);
326 Inc(psrc);
327 Dec(Count);
328 end;
329end;
330
331type
332 TBlendPixelsProc = procedure(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer);
333
334const
335 BlendPixelsProc: array[TBlendOperation] of TBlendPixelsProc =
336 ( @FastBlendPixels, @DrawTransparentPixels,
337 @LightenPixels, @ScreenPixels, @AddPixels, @LinearAddPixels, @ColorDodgePixels, @DividePixels, @NiceGlowPixels, @SoftLightPixels, @HardLightPixels,
338 @GlowPixels, @ReflectPixels, @LinearOverlayPixels, @OverlayPixels, @DarkenPixels, @LinearMultiplyPixels, @ColorBurnPixels,
339 @DifferencePixels, @LinearDifferencePixels, @ExclusionPixels, @LinearExclusionPixels, @SubtractPixels, @LinearSubtractPixels,
340 @SubtractInversePixels, @LinearSubtractInversePixels, @NegationPixels, @LinearNegationPixels, @BlendXorPixels, @SvgSoftLightPixels);
341
342procedure BlendPixels(pdest: PBGRAPixel; psrc: PBGRAPixel;
343 blendOp: TBlendOperation; Count: integer);
344begin
345 BlendPixelsProc[blendOp](pdest,psrc,count);
346end;
347
Note: See TracBrowser for help on using the repository browser.