source: trunk/Packages/bgrabitmap/blendpixelsover.inc

Last change on this file was 2, checked in by chronos, 5 years ago
File size: 23.9 KB
Line 
1{************************* blend over ***************************}
2
3procedure FastBlendPixelsWithOpacity(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
4begin
5 while Count > 0 do
6 begin
7 FastBlendPixelInline(pdest, psrc^, opacity);
8 Inc(pdest);
9 Inc(psrc);
10 Dec(Count);
11 end;
12end;
13
14procedure DrawPixelsWithOpacity(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
15begin
16 while Count > 0 do
17 begin
18 DrawPixelInlineWithAlphaCheck(pdest, psrc^, opacity);
19 Inc(pdest);
20 Inc(psrc);
21 Dec(Count);
22 end;
23end;
24
25procedure LinearMultiplyPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
26var temp: TBGRAPixel;
27begin
28 while Count > 0 do
29 begin
30 temp := pdest^;
31 LinearMultiplyPixelInline(@temp, psrc^); //same look with non linear
32 FastBlendPixelInline(pdest, temp, opacity);
33 Inc(pdest);
34 Inc(psrc);
35 Dec(Count);
36 end;
37end;
38
39procedure LinearMultiplyPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
40var temp: TBGRAPixel;
41begin
42 while Count > 0 do
43 begin
44 temp := pdest^;
45 LinearMultiplyPixelInline(@temp, psrc^); //same look with non linear
46 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
47 Inc(pdest);
48 Inc(psrc);
49 Dec(Count);
50 end;
51end;
52
53procedure AddPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
54var temp: TBGRAPixel;
55begin
56 while Count > 0 do
57 begin
58 temp := pdest^;
59 AddPixelInline(@temp, psrc^);
60 FastBlendPixelInline(pdest, temp, opacity);
61 Inc(pdest);
62 Inc(psrc);
63 Dec(Count);
64 end;
65end;
66
67procedure AddPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
68var temp: TBGRAPixel;
69begin
70 while Count > 0 do
71 begin
72 temp := pdest^;
73 AddPixelInline(@temp, psrc^);
74 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
75 Inc(pdest);
76 Inc(psrc);
77 Dec(Count);
78 end;
79end;
80
81procedure LinearAddPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
82var temp: TBGRAPixel;
83begin
84 while Count > 0 do
85 begin
86 temp := pdest^;
87 LinearAddPixelInline(@temp, psrc^);
88 FastBlendPixelInline(pdest, temp, opacity);
89 Inc(pdest);
90 Inc(psrc);
91 Dec(Count);
92 end;
93end;
94
95procedure LinearAddPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
96var temp: TBGRAPixel;
97begin
98 while Count > 0 do
99 begin
100 temp := pdest^;
101 LinearAddPixelInline(@temp, psrc^);
102 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
103 Inc(pdest);
104 Inc(psrc);
105 Dec(Count);
106 end;
107end;
108
109procedure ColorBurnPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
110var temp: TBGRAPixel;
111begin
112 while Count > 0 do
113 begin
114 temp := pdest^;
115 ColorBurnPixelInline(@temp, psrc^);
116 FastBlendPixelInline(pdest, temp, opacity);
117 Inc(pdest);
118 Inc(psrc);
119 Dec(Count);
120 end;
121end;
122
123procedure ColorBurnPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
124var temp: TBGRAPixel;
125begin
126 while Count > 0 do
127 begin
128 temp := pdest^;
129 ColorBurnPixelInline(@temp, psrc^);
130 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
131 Inc(pdest);
132 Inc(psrc);
133 Dec(Count);
134 end;
135end;
136
137procedure ColorDodgePixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
138var temp: TBGRAPixel;
139begin
140 while Count > 0 do
141 begin
142 temp := pdest^;
143 ColorDodgePixelInline(@temp, psrc^);
144 FastBlendPixelInline(pdest, temp, opacity);
145 Inc(pdest);
146 Inc(psrc);
147 Dec(Count);
148 end;
149end;
150
151procedure ColorDodgePixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
152var temp: TBGRAPixel;
153begin
154 while Count > 0 do
155 begin
156 temp := pdest^;
157 ColorDodgePixelInline(@temp, psrc^);
158 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
159 Inc(pdest);
160 Inc(psrc);
161 Dec(Count);
162 end;
163end;
164
165procedure DividePixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
166var temp: TBGRAPixel;
167begin
168 while Count > 0 do
169 begin
170 temp := pdest^;
171 DividePixelInline(@temp, psrc^);
172 FastBlendPixelInline(pdest, temp, opacity);
173 Inc(pdest);
174 Inc(psrc);
175 Dec(Count);
176 end;
177end;
178
179procedure DividePixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
180var temp: TBGRAPixel;
181begin
182 while Count > 0 do
183 begin
184 temp := pdest^;
185 DividePixelInline(@temp, psrc^);
186 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
187 Inc(pdest);
188 Inc(psrc);
189 Dec(Count);
190 end;
191end;
192
193procedure ReflectPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
194var temp: TBGRAPixel;
195begin
196 while Count > 0 do
197 begin
198 temp := pdest^;
199 ReflectPixelInline(@temp, psrc^);
200 FastBlendPixelInline(pdest, temp, opacity);
201 Inc(pdest);
202 Inc(psrc);
203 Dec(Count);
204 end;
205end;
206
207procedure ReflectPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
208var temp: TBGRAPixel;
209begin
210 while Count > 0 do
211 begin
212 temp := pdest^;
213 ReflectPixelInline(@temp, psrc^);
214 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
215 Inc(pdest);
216 Inc(psrc);
217 Dec(Count);
218 end;
219end;
220
221procedure GlowPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
222var temp: TBGRAPixel;
223begin
224 while Count > 0 do
225 begin
226 temp := pdest^;
227 GlowPixelInline(@temp, psrc^);
228 FastBlendPixelInline(pdest, temp, opacity);
229 Inc(pdest);
230 Inc(psrc);
231 Dec(Count);
232 end;
233end;
234
235procedure GlowPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
236var temp: TBGRAPixel;
237begin
238 while Count > 0 do
239 begin
240 temp := pdest^;
241 GlowPixelInline(@temp, psrc^);
242 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
243 Inc(pdest);
244 Inc(psrc);
245 Dec(Count);
246 end;
247end;
248
249procedure NiceGlowPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
250var temp: TBGRAPixel;
251begin
252 while Count > 0 do
253 begin
254 temp := pdest^;
255 NiceGlowPixelInline(@temp, psrc^);
256 FastBlendPixelInline(pdest, temp, opacity);
257 Inc(pdest);
258 Inc(psrc);
259 Dec(Count);
260 end;
261end;
262
263procedure NiceGlowPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
264var temp: TBGRAPixel;
265begin
266 while Count > 0 do
267 begin
268 temp := pdest^;
269 NiceGlowPixelInline(@temp, psrc^);
270 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
271 Inc(pdest);
272 Inc(psrc);
273 Dec(Count);
274 end;
275end;
276
277procedure OverlayPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
278var temp: TBGRAPixel;
279begin
280 while Count > 0 do
281 begin
282 temp := pdest^;
283 OverlayPixelInline(@temp, psrc^);
284 FastBlendPixelInline(pdest, temp, opacity);
285 Inc(pdest);
286 Inc(psrc);
287 Dec(Count);
288 end;
289end;
290
291procedure OverlayPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
292var temp: TBGRAPixel;
293begin
294 while Count > 0 do
295 begin
296 temp := pdest^;
297 OverlayPixelInline(@temp, psrc^);
298 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
299 Inc(pdest);
300 Inc(psrc);
301 Dec(Count);
302 end;
303end;
304
305procedure LinearOverlayPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
306var temp: TBGRAPixel;
307begin
308 while Count > 0 do
309 begin
310 temp := pdest^;
311 LinearOverlayPixelInline(@temp, psrc^);
312 FastBlendPixelInline(pdest, temp, opacity);
313 Inc(pdest);
314 Inc(psrc);
315 Dec(Count);
316 end;
317end;
318
319procedure LinearOverlayPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
320var temp: TBGRAPixel;
321begin
322 while Count > 0 do
323 begin
324 temp := pdest^;
325 LinearOverlayPixelInline(@temp, psrc^);
326 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
327 Inc(pdest);
328 Inc(psrc);
329 Dec(Count);
330 end;
331end;
332
333procedure DifferencePixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
334var temp: TBGRAPixel;
335begin
336 while Count > 0 do
337 begin
338 temp := pdest^;
339 DifferencePixelInline(@temp, psrc^);
340 FastBlendPixelInline(pdest, temp, opacity);
341 Inc(pdest);
342 Inc(psrc);
343 Dec(Count);
344 end;
345end;
346
347procedure DifferencePixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
348var temp: TBGRAPixel;
349begin
350 while Count > 0 do
351 begin
352 temp := pdest^;
353 DifferencePixelInline(@temp, psrc^);
354 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
355 Inc(pdest);
356 Inc(psrc);
357 Dec(Count);
358 end;
359end;
360
361procedure LinearDifferencePixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
362var temp: TBGRAPixel;
363begin
364 while Count > 0 do
365 begin
366 temp := pdest^;
367 LinearDifferencePixelInline(@temp, psrc^);
368 FastBlendPixelInline(pdest, temp, opacity);
369 Inc(pdest);
370 Inc(psrc);
371 Dec(Count);
372 end;
373end;
374
375procedure LinearDifferencePixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
376var temp: TBGRAPixel;
377begin
378 while Count > 0 do
379 begin
380 temp := pdest^;
381 LinearDifferencePixelInline(@temp, psrc^);
382 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
383 Inc(pdest);
384 Inc(psrc);
385 Dec(Count);
386 end;
387end;
388
389procedure ExclusionPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
390var temp: TBGRAPixel;
391begin
392 while Count > 0 do
393 begin
394 temp := pdest^;
395 ExclusionPixelInline(@temp, psrc^);
396 FastBlendPixelInline(pdest, temp, opacity);
397 Inc(pdest);
398 Inc(psrc);
399 Dec(Count);
400 end;
401end;
402
403procedure ExclusionPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
404var temp: TBGRAPixel;
405begin
406 while Count > 0 do
407 begin
408 temp := pdest^;
409 ExclusionPixelInline(@temp, psrc^);
410 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
411 Inc(pdest);
412 Inc(psrc);
413 Dec(Count);
414 end;
415end;
416
417procedure LinearExclusionPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
418var temp: TBGRAPixel;
419begin
420 while Count > 0 do
421 begin
422 temp := pdest^;
423 LinearExclusionPixelInline(@temp, psrc^);
424 FastBlendPixelInline(pdest, temp, opacity);
425 Inc(pdest);
426 Inc(psrc);
427 Dec(Count);
428 end;
429end;
430
431procedure LinearExclusionPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
432var temp: TBGRAPixel;
433begin
434 while Count > 0 do
435 begin
436 temp := pdest^;
437 LinearExclusionPixelInline(@temp, psrc^);
438 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
439 Inc(pdest);
440 Inc(psrc);
441 Dec(Count);
442 end;
443end;
444
445procedure LinearSubtractPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
446var temp: TBGRAPixel;
447begin
448 while Count > 0 do
449 begin
450 temp := pdest^;
451 LinearSubtractPixelInline(@temp, psrc^);
452 FastBlendPixelInline(pdest, temp, opacity);
453 Inc(pdest);
454 Inc(psrc);
455 Dec(Count);
456 end;
457end;
458
459procedure LinearSubtractPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
460var temp: TBGRAPixel;
461begin
462 while Count > 0 do
463 begin
464 temp := pdest^;
465 LinearSubtractPixelInline(@temp, psrc^);
466 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
467 Inc(pdest);
468 Inc(psrc);
469 Dec(Count);
470 end;
471end;
472
473procedure LinearSubtractInversePixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
474var temp: TBGRAPixel;
475begin
476 while Count > 0 do
477 begin
478 temp := pdest^;
479 LinearSubtractInversePixelInline(@temp, psrc^);
480 FastBlendPixelInline(pdest, temp, opacity);
481 Inc(pdest);
482 Inc(psrc);
483 Dec(Count);
484 end;
485end;
486
487procedure LinearSubtractInversePixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
488var temp: TBGRAPixel;
489begin
490 while Count > 0 do
491 begin
492 temp := pdest^;
493 LinearSubtractInversePixelInline(@temp, psrc^);
494 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
495 Inc(pdest);
496 Inc(psrc);
497 Dec(Count);
498 end;
499end;
500
501procedure SubtractPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
502var temp: TBGRAPixel;
503begin
504 while Count > 0 do
505 begin
506 temp := pdest^;
507 SubtractPixelInline(@temp, psrc^);
508 FastBlendPixelInline(pdest, temp, opacity);
509 Inc(pdest);
510 Inc(psrc);
511 Dec(Count);
512 end;
513end;
514
515procedure SubtractPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
516var temp: TBGRAPixel;
517begin
518 while Count > 0 do
519 begin
520 temp := pdest^;
521 SubtractPixelInline(@temp, psrc^);
522 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
523 Inc(pdest);
524 Inc(psrc);
525 Dec(Count);
526 end;
527end;
528
529procedure SubtractInversePixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
530var temp: TBGRAPixel;
531begin
532 while Count > 0 do
533 begin
534 temp := pdest^;
535 SubtractInversePixelInline(@temp, psrc^);
536 FastBlendPixelInline(pdest, temp, opacity);
537 Inc(pdest);
538 Inc(psrc);
539 Dec(Count);
540 end;
541end;
542
543procedure SubtractInversePixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
544var temp: TBGRAPixel;
545begin
546 while Count > 0 do
547 begin
548 temp := pdest^;
549 SubtractInversePixelInline(@temp, psrc^);
550 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
551 Inc(pdest);
552 Inc(psrc);
553 Dec(Count);
554 end;
555end;
556
557procedure NegationPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
558var temp: TBGRAPixel;
559begin
560 while Count > 0 do
561 begin
562 temp := pdest^;
563 NegationPixelInline(@temp, psrc^);
564 FastBlendPixelInline(pdest, temp, opacity);
565 Inc(pdest);
566 Inc(psrc);
567 Dec(Count);
568 end;
569end;
570
571procedure NegationPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
572var temp: TBGRAPixel;
573begin
574 while Count > 0 do
575 begin
576 temp := pdest^;
577 NegationPixelInline(@temp, psrc^);
578 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
579 Inc(pdest);
580 Inc(psrc);
581 Dec(Count);
582 end;
583end;
584
585procedure LinearNegationPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
586var temp: TBGRAPixel;
587begin
588 while Count > 0 do
589 begin
590 temp := pdest^;
591 LinearNegationPixelInline(@temp, psrc^);
592 FastBlendPixelInline(pdest, temp, opacity);
593 Inc(pdest);
594 Inc(psrc);
595 Dec(Count);
596 end;
597end;
598
599procedure LinearNegationPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
600var temp: TBGRAPixel;
601begin
602 while Count > 0 do
603 begin
604 temp := pdest^;
605 LinearNegationPixelInline(@temp, psrc^);
606 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
607 Inc(pdest);
608 Inc(psrc);
609 Dec(Count);
610 end;
611end;
612
613procedure LightenPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
614var temp: TBGRAPixel;
615begin
616 while Count > 0 do
617 begin
618 temp := pdest^;
619 LightenPixelInline(@temp, psrc^);
620 FastBlendPixelInline(pdest, temp, opacity);
621 Inc(pdest);
622 Inc(psrc);
623 Dec(Count);
624 end;
625end;
626
627procedure LightenPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
628var temp: TBGRAPixel;
629begin
630 while Count > 0 do
631 begin
632 temp := pdest^;
633 LightenPixelInline(@temp, psrc^);
634 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
635 Inc(pdest);
636 Inc(psrc);
637 Dec(Count);
638 end;
639end;
640
641procedure DarkenPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
642var temp: TBGRAPixel;
643begin
644 while Count > 0 do
645 begin
646 temp := pdest^;
647 DarkenPixelInline(@temp, psrc^);
648 FastBlendPixelInline(pdest, temp, opacity);
649 Inc(pdest);
650 Inc(psrc);
651 Dec(Count);
652 end;
653end;
654
655procedure DarkenPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
656var temp: TBGRAPixel;
657begin
658 while Count > 0 do
659 begin
660 temp := pdest^;
661 DarkenPixelInline(@temp, psrc^);
662 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
663 Inc(pdest);
664 Inc(psrc);
665 Dec(Count);
666 end;
667end;
668
669procedure ScreenPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
670var temp: TBGRAPixel;
671begin
672 while Count > 0 do
673 begin
674 temp := pdest^;
675 ScreenPixelInline(@temp, psrc^);
676 FastBlendPixelInline(pdest, temp, opacity);
677 Inc(pdest);
678 Inc(psrc);
679 Dec(Count);
680 end;
681end;
682
683procedure ScreenPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
684var temp: TBGRAPixel;
685begin
686 while Count > 0 do
687 begin
688 temp := pdest^;
689 ScreenPixelInline(@temp, psrc^);
690 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
691 Inc(pdest);
692 Inc(psrc);
693 Dec(Count);
694 end;
695end;
696
697procedure SoftLightPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
698var temp: TBGRAPixel;
699begin
700 while Count > 0 do
701 begin
702 temp := pdest^;
703 SoftLightPixelInline(@temp, psrc^);
704 FastBlendPixelInline(pdest, temp, opacity);
705 Inc(pdest);
706 Inc(psrc);
707 Dec(Count);
708 end;
709end;
710
711procedure SvgSoftLightPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
712var temp: TBGRAPixel;
713begin
714 while Count > 0 do
715 begin
716 temp := pdest^;
717 SvgSoftLightPixelInline(@temp, psrc^);
718 FastBlendPixelInline(pdest, temp, opacity);
719 Inc(pdest);
720 Inc(psrc);
721 Dec(Count);
722 end;
723end;
724
725procedure SoftLightPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
726var temp: TBGRAPixel;
727begin
728 while Count > 0 do
729 begin
730 temp := pdest^;
731 SoftLightPixelInline(@temp, psrc^);
732 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
733 Inc(pdest);
734 Inc(psrc);
735 Dec(Count);
736 end;
737end;
738
739procedure SvgSoftLightPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
740var temp: TBGRAPixel;
741begin
742 while Count > 0 do
743 begin
744 temp := pdest^;
745 SvgSoftLightPixelInline(@temp, psrc^);
746 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
747 Inc(pdest);
748 Inc(psrc);
749 Dec(Count);
750 end;
751end;
752
753procedure HardLightPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
754var temp: TBGRAPixel;
755begin
756 while Count > 0 do
757 begin
758 temp := pdest^;
759 HardLightPixelInline(@temp, psrc^);
760 FastBlendPixelInline(pdest, temp, opacity);
761 Inc(pdest);
762 Inc(psrc);
763 Dec(Count);
764 end;
765end;
766
767procedure HardLightPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
768var temp: TBGRAPixel;
769begin
770 while Count > 0 do
771 begin
772 temp := pdest^;
773 HardLightPixelInline(@temp, psrc^);
774 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
775 Inc(pdest);
776 Inc(psrc);
777 Dec(Count);
778 end;
779end;
780
781procedure BlendXorPixelsLinearOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
782var temp: TBGRAPixel;
783begin
784 while Count > 0 do
785 begin
786 temp := pdest^;
787 BlendXorPixelInline(@temp, psrc^);
788 FastBlendPixelInline(pdest, temp, opacity);
789 Inc(pdest);
790 Inc(psrc);
791 Dec(Count);
792 end;
793end;
794
795procedure BlendXorPixelsDrawOver(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
796var temp: TBGRAPixel;
797begin
798 while Count > 0 do
799 begin
800 temp := pdest^;
801 BlendXorPixelInline(@temp, psrc^);
802 DrawPixelInlineWithAlphaCheck(pdest, temp, opacity);
803 Inc(pdest);
804 Inc(psrc);
805 Dec(Count);
806 end;
807end;
808
809{************************** table ****************************************}
810
811type
812 TBlendPixelsOverProc = procedure(pdest: PBGRAPixel; psrc: PBGRAPixel; Count: integer; Opacity: byte);
813
814const
815 BlendPixelsOverProc: array[Boolean, TBlendOperation] of TBlendPixelsOverProc =
816 ( (@FastBlendPixelsWithOpacity, @DrawPixelsWithOpacity,
817 @LightenPixelsDrawOver, @ScreenPixelsDrawOver, @AddPixelsDrawOver, @LinearAddPixelsDrawOver, @ColorDodgePixelsDrawOver, @DividePixelsDrawOver, @NiceGlowPixelsDrawOver, @SoftLightPixelsDrawOver, @HardLightPixelsDrawOver,
818 @GlowPixelsDrawOver, @ReflectPixelsDrawOver, @LinearOverlayPixelsDrawOver, @OverlayPixelsDrawOver, @DarkenPixelsDrawOver, @LinearMultiplyPixelsDrawOver, @ColorBurnPixelsDrawOver,
819 @DifferencePixelsDrawOver, @LinearDifferencePixelsDrawOver, @ExclusionPixelsDrawOver, @LinearExclusionPixelsDrawOver, @SubtractPixelsDrawOver, @LinearSubtractPixelsDrawOver,
820 @SubtractInversePixelsDrawOver, @LinearSubtractInversePixelsDrawOver, @NegationPixelsDrawOver, @LinearNegationPixelsDrawOver, @BlendXorPixelsDrawOver, @SvgSoftLightPixelsDrawOver),
821 (@FastBlendPixelsWithOpacity, @FastBlendPixelsWithOpacity,
822 @LightenPixelsLinearOver, @ScreenPixelsLinearOver, @AddPixelsLinearOver, @LinearAddPixelsLinearOver, @ColorDodgePixelsLinearOver, @DividePixelsLinearOver, @NiceGlowPixelsLinearOver, @SoftLightPixelsLinearOver, @HardLightPixelsLinearOver,
823 @GlowPixelsLinearOver, @ReflectPixelsLinearOver, @LinearOverlayPixelsLinearOver, @OverlayPixelsLinearOver, @DarkenPixelsLinearOver, @LinearMultiplyPixelsLinearOver, @ColorBurnPixelsLinearOver,
824 @DifferencePixelsLinearOver, @LinearDifferencePixelsLinearOver, @ExclusionPixelsLinearOver, @LinearExclusionPixelsLinearOver, @SubtractPixelsLinearOver, @LinearSubtractPixelsLinearOver,
825 @SubtractInversePixelsLinearOver, @LinearSubtractInversePixelsLinearOver, @NegationPixelsLinearOver, @LinearNegationPixelsLinearOver, @BlendXorPixelsLinearOver, @SvgSoftLightPixelsLinearOver));
826
827{************************* calling procedure ***************************}
828
829procedure BlendPixelsOver(pdest: PBGRAPixel; psrc: PBGRAPixel;
830 blendOp: TBlendOperation; Count: integer; opacity: byte; linearBlend: boolean);
831begin
832 BlendPixelsOverProc[linearblend, blendOp](pdest,psrc,count,opacity);
833end;
834
Note: See TracBrowser for help on using the repository browser.