Sign in Join
Wiki copytemporary

BGRABitmap Pixel types: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11List of pixel types and functions of [[BGRABitmap]] library. They are provided by *BGRABitmapTypes* unit.
22
33### Pixel types and functions
44
5-<table style="border-collapse: collapse;">
6-
7-<tr style="background: white;">
8-
9-<td colspan="3">
10-
115*PBGRAPixel* = ^TBGRAPixel;
126
13-</td>
14-
15-</tr>
16-
17-<tr style="background: white;">
18-
19-<td width="10%">
20-
21-</td>
22-
23-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
24-
257Pointer for direct pixel access. Data is stored as a sequence of TBGRAPixel. See [[BGRABitmap tutorial 4|Tutorial 4]]
268
27-</td>
28-
29-</tr>
30-
31-<tr style="height: 8px;">
32-
33-<td colspan="3">
34-
35-</td>
36-
37-</tr>
38-
39-<tr style="background: #f0f0ff;">
40-
41-<td colspan="3">
42-
439*TBGRAPixel* = **packed** **record**
4410
45-</td>
46-
47-</tr>
48-
49-<tr style="background: #f0f0ff;">
50-
51-<td width="10%">
52-
53-</td>
54-
55-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
56-
5711Each pixel is a sequence of 4 bytes containing blue, green, red and alpha channel. Values range from 0 to 255, color is in sRGB colorspace. The alpha value of 0 is transparent and 255 is opaque. In the bitmap data, when the pixel is fully transparent, the RGB values are supposed to be set to zero.
5812
59-</td>
60-
61-</tr>
62-
63-<tr style="height: 8px;">
64-
65-<td colspan="3">
66-
67-</td>
68-
69-</tr>
70-
71-<tr>
72-
73-<td width="10%">
74-
75-</td>
76-
77-<td colspan="2" style="background: white;">
78-
7913*red*, *green*, *blue*, *alpha*: byte;
8014
81-</td>
82-
83-</tr>
84-
85-<tr>
86-
87-<td width="10%">
88-
89-</td>
90-
91-<td width="10%" style="background: white;">
92-
93-</td>
94-
95-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
96-
9715Fields if ordered RGBA ordered
9816
99-</td>
100-
101-</tr>
102-
103-<tr style="height: 8px;">
104-
105-<td colspan="3">
106-
107-</td>
108-
109-</tr>
110-
111-<tr>
112-
113-<td width="10%">
114-
115-</td>
116-
117-<td colspan="2" style="background: #f0f0ff;">
118-
11917*blue*, *green*, *red*, *alpha*: byte;
12018
121-</td>
122-
123-</tr>
124-
125-<tr>
126-
127-<td width="10%">
128-
129-</td>
130-
131-<td width="10%" style="background: #f0f0ff;">
132-
133-</td>
134-
135-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
136-
13719Fields if ordered BGRA ordered
13820
139-</td>
140-
141-</tr>
142-
143-<tr style="height: 8px;">
144-
145-<td colspan="3">
146-
147-</td>
148-
149-</tr>
150-
151-<tr>
152-
153-<td width="10%">
154-
155-</td>
156-
157-<td colspan="2" style="background: white;">
158-
15921**procedure** FromRGB(ARed,AGreen,ABlue: Byte; AAlpha: Byte = 255);
16022
161-</td>
162-
163-</tr>
164-
165-<tr>
166-
167-<td width="10%">
168-
169-</td>
170-
171-<td width="10%" style="background: white;">
172-
173-</td>
174-
175-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
176-
17723Sets the pixel with given RGB values
17824
179-</td>
180-
181-</tr>
182-
183-<tr style="height: 8px;">
184-
185-<td colspan="3">
186-
187-</td>
188-
189-</tr>
190-
191-<tr>
192-
193-<td width="10%">
194-
195-</td>
196-
197-<td colspan="2" style="background: #f0f0ff;">
198-
19925**procedure** FromColor(AColor: TColor; AAlpha: Byte = 255);
20026
201-</td>
202-
203-</tr>
204-
205-<tr>
206-
207-<td width="10%">
208-
209-</td>
210-
211-<td width="10%" style="background: #f0f0ff;">
212-
213-</td>
214-
215-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
216-
21727Sets the pixel with given TColor
21828
219-</td>
220-
221-</tr>
222-
223-<tr style="height: 8px;">
224-
225-<td colspan="3">
226-
227-</td>
228-
229-</tr>
230-
231-<tr>
232-
233-<td width="10%">
234-
235-</td>
236-
237-<td colspan="2" style="background: white;">
238-
23929**procedure** FromString(AStr: **string**);
24030
241-</td>
242-
243-</tr>
244-
245-<tr>
246-
247-<td width="10%">
248-
249-</td>
250-
251-<td width="10%" style="background: white;">
252-
253-</td>
254-
255-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
256-
25731Sets the pixel according to a color name or CSS expression
25832
259-</td>
260-
261-</tr>
262-
263-<tr style="height: 8px;">
264-
265-<td colspan="3">
266-
267-</td>
268-
269-</tr>
270-
271-<tr>
272-
273-<td width="10%">
274-
275-</td>
276-
277-<td colspan="2" style="background: #f0f0ff;">
278-
27933**procedure** FromFPColor(AColor: TFPColor);
28034
281-</td>
282-
283-</tr>
284-
285-<tr>
286-
287-<td width="10%">
288-
289-</td>
290-
291-<td width="10%" style="background: #f0f0ff;">
292-
293-</td>
294-
295-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
296-
29735Sets the pixel with given TFPColor (16-bit per channel)
29836
299-</td>
300-
301-</tr>
302-
303-<tr style="height: 8px;">
304-
305-<td colspan="3">
306-
307-</td>
308-
309-</tr>
310-
311-<tr>
312-
313-<td width="10%">
314-
315-</td>
316-
317-<td colspan="2" style="background: white;">
318-
31937**procedure** ToRGB(**out** ARed,AGreen,ABlue,AAlpha: Byte); **overload**;
32038
321-</td>
322-
323-</tr>
324-
325-<tr>
326-
327-<td width="10%">
328-
329-</td>
330-
331-<td width="10%" style="background: white;">
332-
333-</td>
334-
335-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
336-
33739Extras RGBA channels
33840
339-</td>
340-
341-</tr>
342-
343-<tr style="height: 8px;">
344-
345-<td colspan="3">
346-
347-</td>
348-
349-</tr>
350-
351-<tr>
352-
353-<td width="10%">
354-
355-</td>
356-
357-<td colspan="2" style="background: #f0f0ff;">
358-
35941**procedure** ToRGB(**out** ARed,AGreen,ABlue: Byte); **overload**;
36042
361-</td>
362-
363-</tr>
364-
365-<tr>
366-
367-<td width="10%">
368-
369-</td>
370-
371-<td width="10%" style="background: #f0f0ff;">
372-
373-</td>
374-
375-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
376-
37743Extras RGB channels
37844
379-</td>
380-
381-</tr>
382-
383-<tr style="height: 8px;">
384-
385-<td colspan="3">
386-
387-</td>
388-
389-</tr>
390-
391-<tr>
392-
393-<td width="10%">
394-
395-</td>
396-
397-<td colspan="2" style="background: white;">
398-
39945**function** ToColor: TColor;
40046
401-</td>
402-
403-</tr>
404-
405-<tr>
406-
407-<td width="10%">
408-
409-</td>
410-
411-<td width="10%" style="background: white;">
412-
413-</td>
414-
415-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
416-
41747Converts to TColor
41848
419-</td>
420-
421-</tr>
422-
423-<tr style="height: 8px;">
424-
425-<td colspan="3">
426-
427-</td>
428-
429-</tr>
430-
431-<tr>
432-
433-<td width="10%">
434-
435-</td>
436-
437-<td colspan="2" style="background: #f0f0ff;">
438-
43949**function** ToString: **string**;
44050
441-</td>
442-
443-</tr>
444-
445-<tr>
446-
447-<td width="10%">
448-
449-</td>
450-
451-<td width="10%" style="background: #f0f0ff;">
452-
453-</td>
454-
455-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
456-
45751Converts to a CSS string representation
45852
459-</td>
460-
461-</tr>
462-
463-<tr style="height: 8px;">
464-
465-<td colspan="3">
466-
467-</td>
468-
469-</tr>
470-
471-<tr>
472-
473-<td width="10%">
474-
475-</td>
476-
477-<td colspan="2" style="background: white;">
478-
47953**function** ToGrayscale(AGammaCorrection: boolean = true): TBGRAPixel;
48054
481-</td>
482-
483-</tr>
484-
485-<tr>
486-
487-<td width="10%">
488-
489-</td>
490-
491-<td width="10%" style="background: white;">
492-
493-</td>
494-
495-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
496-
49755Compute grayscale equivalent
49856
499-</td>
500-
501-</tr>
502-
503-<tr style="height: 8px;">
504-
505-<td colspan="3">
506-
507-</td>
508-
509-</tr>
510-
511-<tr>
512-
513-<td width="10%">
514-
515-</td>
516-
517-<td colspan="2" style="background: #f0f0ff;">
518-
51957**function** ToFPColor: TFPColor;
52058
521-</td>
522-
523-</tr>
524-
525-<tr>
526-
527-<td width="10%">
528-
529-</td>
530-
531-<td width="10%" style="background: #f0f0ff;">
532-
533-</td>
534-
535-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
536-
53759Converts to TFPColor (16-bit per channel)
53860
539-</td>
540-
541-</tr>
542-
543-<tr style="height: 8px;">
544-
545-<td colspan="3">
546-
547-</td>
548-
549-</tr>
550-
551-<tr>
552-
553-<td width="10%">
554-
555-</td>
556-
557-<td colspan="2" style="background: white;">
558-
55961**function** EqualsExactly(constref AColor: TBGRAPixel): boolean;
56062
561-</td>
562-
563-</tr>
564-
565-<tr>
566-
567-<td width="10%">
568-
569-</td>
570-
571-<td width="10%" style="background: white;">
572-
573-</td>
574-
575-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
576-
57763Check whether all channels are equal (this is generally not necessary to use this fonction unless the RGB value of a transparent color matter)
57864
579-</td>
580-
581-</tr>
582-
583-<tr style="height: 8px;">
584-
585-<td colspan="3">
586-
587-</td>
588-
589-</tr>
590-
591-<tr>
592-
593-<td width="10%">
594-
595-</td>
596-
597-<td colspan="2" style="background: #f0f0ff;">
598-
59965**class** **operator** := (Source: TBGRAPixel): TColor;
60066
601-</td>
602-
603-</tr>
604-
605-<tr>
606-
607-<td width="10%">
608-
609-</td>
610-
611-<td width="10%" style="background: #f0f0ff;">
612-
613-</td>
614-
615-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
616-
61767Assign a TBGRAPixel to a TColor
61868
619-</td>
620-
621-</tr>
622-
623-<tr style="height: 8px;">
624-
625-<td colspan="3">
626-
627-</td>
628-
629-</tr>
630-
631-<tr>
632-
633-<td width="10%">
634-
635-</td>
636-
637-<td colspan="2" style="background: white;">
638-
63969**class** **operator** := (Source: TColor): TBGRAPixel;
64070
641-</td>
642-
643-</tr>
644-
645-<tr>
646-
647-<td width="10%">
648-
649-</td>
650-
651-<td width="10%" style="background: white;">
652-
653-</td>
654-
655-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
656-
65771Assign a TColor to a TBGRAPixel
65872
659-</td>
660-
661-</tr>
662-
663-<tr style="height: 8px;">
664-
665-<td colspan="3">
666-
667-</td>
668-
669-</tr>
670-
671-<tr>
672-
673-<td width="10%">
674-
675-</td>
676-
677-<td colspan="2" style="background: #f0f0ff;">
678-
67973**property** Intensity: word **read** GetClassIntensity **write** SetClassIntensity;
68074
681-</td>
682-
683-</tr>
684-
685-<tr>
686-
687-<td width="10%">
688-
689-</td>
690-
691-<td width="10%" style="background: #f0f0ff;">
692-
693-</td>
694-
695-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
696-
69775Intensity of the color (how much channels are saturated)
69876
699-</td>
700-
701-</tr>
702-
703-<tr style="height: 8px;">
704-
705-<td colspan="3">
706-
707-</td>
708-
709-</tr>
710-
711-<tr>
712-
713-<td width="10%">
714-
715-</td>
716-
717-<td colspan="2" style="background: white;">
718-
71977**property** Lightness: word **read** GetClassLightness **write** SetClassLightness;
72078
721-</td>
722-
723-</tr>
724-
725-<tr>
726-
727-<td width="10%">
728-
729-</td>
730-
731-<td width="10%" style="background: white;">
732-
733-</td>
734-
735-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
736-
73779Lightness of the color (the resulting lightness of combined channels)
73880
739-</td>
740-
741-</tr>
742-
743-<tr style="height: 8px;">
744-
745-<td colspan="3">
746-
747-</td>
748-
749-</tr>
750-
751-<tr>
752-
753-<td width="10%">
754-
755-</td>
756-
757-<td colspan="2" style="background: #f0f0ff;">
758-
75981**operator** = (**const** c1, c2: TBGRAPixel): boolean; **inline**;
76082
761-</td>
762-
763-</tr>
764-
765-<tr>
766-
767-<td width="10%">
768-
769-</td>
770-
771-<td width="10%" style="background: #f0f0ff;">
772-
773-</td>
774-
775-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
776-
77783Checks if two pixels are equal. If they are both transparent, RGB values are ignored
77884
779-</td>
780-
781-</tr>
782-
783-<tr style="height: 8px;">
784-
785-<td colspan="3">
786-
787-</td>
788-
789-</tr>
790-
791-<tr>
792-
793-<td width="10%">
794-
795-</td>
796-
797-<td colspan="2" style="background: white;">
798-
79985**const** TBGRAPixel_RGBAOrder = False;
80086
801-</td>
802-
803-</tr>
804-
805-<tr>
806-
807-<td width="10%">
808-
809-</td>
810-
811-<td width="10%" style="background: white;">
812-
813-</td>
814-
815-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
816-
81787Order of the channels (when BGRA)
81888
819-</td>
820-
821-</tr>
822-
823-<tr style="height: 8px;">
824-
825-<td colspan="3">
826-
827-</td>
828-
829-</tr>
830-
831-<tr>
832-
833-<td width="10%">
834-
835-</td>
836-
837-<td colspan="2" style="background: #f0f0ff;">
838-
83989**const** TBGRAPixel_BlueByteOffset = 0;
84090
841-</td>
842-
843-</tr>
844-
845-<tr>
846-
847-<td width="10%">
848-
849-</td>
850-
851-<td width="10%" style="background: #f0f0ff;">
852-
853-</td>
854-
855-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
856-
85791Offset of the blue channel (when BGRA)
85892
859-</td>
860-
861-</tr>
862-
863-<tr style="height: 8px;">
864-
865-<td colspan="3">
866-
867-</td>
868-
869-</tr>
870-
871-<tr>
872-
873-<td width="10%">
874-
875-</td>
876-
877-<td colspan="2" style="background: white;">
878-
87993**const** TBGRAPixel_GreenByteOffset = 1;
88094
881-</td>
882-
883-</tr>
884-
885-<tr>
886-
887-<td width="10%">
888-
889-</td>
890-
891-<td width="10%" style="background: white;">
892-
893-</td>
894-
895-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
896-
89795Offset of the green channel (when BGRA)
89896
899-</td>
900-
901-</tr>
902-
903-<tr style="height: 8px;">
904-
905-<td colspan="3">
906-
907-</td>
908-
909-</tr>
910-
911-<tr>
912-
913-<td width="10%">
914-
915-</td>
916-
917-<td colspan="2" style="background: #f0f0ff;">
918-
91997**const** TBGRAPixel_RedByteOffset = 2;
92098
921-</td>
922-
923-</tr>
924-
925-<tr>
926-
927-<td width="10%">
928-
929-</td>
930-
931-<td width="10%" style="background: #f0f0ff;">
932-
933-</td>
934-
935-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
936-
93799Offset of the blue channel (when BGRA)
938100
939-</td>
940-
941-</tr>
942-
943-<tr style="height: 8px;">
944-
945-<td colspan="3">
946-
947-</td>
948-
949-</tr>
950-
951-<tr>
952-
953-<td width="10%">
954-
955-</td>
956-
957-<td colspan="2" style="background: white;">
958-
959101**const** TBGRAPixel_AlphaByteOffset = 3;
960102
961-</td>
962-
963-</tr>
964-
965-<tr>
966-
967-<td width="10%">
968-
969-</td>
970-
971-<td width="10%" style="background: white;">
972-
973-</td>
974-
975-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
976-
977103Offset of the alpha channel
978104
979-</td>
980-
981-</tr>
982-
983-<tr style="height: 8px;">
984-
985-<td colspan="3">
986-
987-</td>
988-
989-</tr>
990-
991-<tr style="background: #f0f0ff;">
992-
993-<td colspan="3">
994-
995105**function** BGRA(red, green, blue, alpha: byte): TBGRAPixel; **overload**; **inline**;
996106
997-</td>
998-
999-</tr>
1000-
1001-<tr style="background: #f0f0ff;">
1002-
1003-<td width="10%">
1004-
1005-</td>
1006-
1007-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1008-
1009107Creates a pixel with given RGBA values
1010108
1011-</td>
1012-
1013-</tr>
1014-
1015-<tr style="height: 8px;">
1016-
1017-<td colspan="3">
1018-
1019-</td>
1020-
1021-</tr>
1022-
1023-<tr style="background: white;">
1024-
1025-<td colspan="3">
1026-
1027109**function** BGRA(red, green, blue: byte): TBGRAPixel; **overload**; **inline**;
1028110
1029-</td>
1030-
1031-</tr>
1032-
1033-<tr style="background: white;">
1034-
1035-<td width="10%">
1036-
1037-</td>
1038-
1039-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1040-
1041111Creates a opaque pixel with given RGB values
1042112
1043-</td>
1044-
1045-</tr>
1046-
1047-<tr style="height: 8px;">
1048-
1049-<td colspan="3">
1050-
1051-</td>
1052-
1053-</tr>
1054-
1055-<tr style="background: #f0f0ff;">
1056-
1057-<td colspan="3">
1058-
1059113**function** GetIntensity(c: TBGRAPixel): word; **inline**;
1060114
1061-</td>
1062-
1063-</tr>
1064-
1065-<tr style="background: #f0f0ff;">
1066-
1067-<td width="10%">
1068-
1069-</td>
1070-
1071-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1072-
1073115Returns the intensity of a pixel. The intensity is the maximum value reached by any component
1074116
1075-</td>
1076-
1077-</tr>
1078-
1079-<tr style="height: 8px;">
1080-
1081-<td colspan="3">
1082-
1083-</td>
1084-
1085-</tr>
1086-
1087-<tr style="background: white;">
1088-
1089-<td colspan="3">
1090-
1091117**function** SetIntensity(c: TBGRAPixel; intensity: word): TBGRAPixel;
1092118
1093-</td>
1094-
1095-</tr>
1096-
1097-<tr style="background: white;">
1098-
1099-<td width="10%">
1100-
1101-</td>
1102-
1103-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1104-
1105119Sets the intensity of a pixel
1106120
1107-</td>
1108-
1109-</tr>
1110-
1111-<tr style="height: 8px;">
1112-
1113-<td colspan="3">
1114-
1115-</td>
1116-
1117-</tr>
1118-
1119-<tr style="background: #f0f0ff;">
1120-
1121-<td colspan="3">
1122-
1123121**function** GetLightness(c: TBGRAPixel): word; **overload**;
1124122
1125-</td>
1126-
1127-</tr>
1128-
1129-<tr style="background: #f0f0ff;">
1130-
1131-<td width="10%">
1132-
1133-</td>
1134-
1135-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1136-
1137123Returns the lightness of a pixel. The lightness is the perceived brightness, 0 being black and 65535 being white
1138124
1139-</td>
1140-
1141-</tr>
1142-
1143-<tr style="height: 8px;">
1144-
1145-<td colspan="3">
1146-
1147-</td>
1148-
1149-</tr>
1150-
1151-<tr style="background: white;">
1152-
1153-<td colspan="3">
1154-
1155125**function** SetLightness(c: TBGRAPixel; lightness: word): TBGRAPixel; **overload**;
1156126
1157-</td>
1158-
1159-</tr>
1160-
1161-<tr style="background: white;">
1162-
1163-<td width="10%">
1164-
1165-</td>
1166-
1167-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1168-
1169127Sets the lightness of a pixel
1170128
1171-</td>
1172-
1173-</tr>
1174-
1175-<tr style="height: 8px;">
1176-
1177-<td colspan="3">
1178-
1179-</td>
1180-
1181-</tr>
1182-
1183-<tr style="background: #f0f0ff;">
1184-
1185-<td colspan="3">
1186-
1187129**function** ApplyLightnessFast(color: TBGRAPixel; lightness: word): TBGRAPixel; **inline**;
1188130
1189-</td>
1190-
1191-</tr>
1192-
1193-<tr style="background: #f0f0ff;">
1194-
1195-<td width="10%">
1196-
1197-</td>
1198-
1199-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1200-
1201131Sets the lightness quickly, by fading towards black if *lightness* is less than 32768, and fading towards white if *lightness* is more than 32768
1202132
1203-</td>
1204-
1205-</tr>
1206-
1207-<tr style="height: 8px;">
1208-
1209-<td colspan="3">
1210-
1211-</td>
1212-
1213-</tr>
1214-
1215-<tr style="background: white;">
1216-
1217-<td colspan="3">
1218-
1219133**function** ApplyIntensityFast(color: TBGRAPixel; lightness: LongWord): TBGRAPixel;
1220134
1221-</td>
1222-
1223-</tr>
1224-
1225-<tr style="background: white;">
1226-
1227-<td width="10%">
1228-
1229-</td>
1230-
1231-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1232-
1233135Sets the intensity quickly, by fading towards black if *lightness* is less than 32768, and multiplying all components if *lightness* is more than 32768. In case of saturation, it fades towards white
1234136
1235-</td>
1236-
1237-</tr>
1238-
1239-<tr style="height: 8px;">
1240-
1241-<td colspan="3">
1242-
1243-</td>
1244-
1245-</tr>
1246-
1247-<tr style="background: #f0f0ff;">
1248-
1249-<td colspan="3">
1250-
1251137**function** CombineLightness(lightness1,lightness2: Int32or64): Int32or64;
1252138
1253-</td>
1254-
1255-</tr>
1256-
1257-<tr style="background: #f0f0ff;">
1258-
1259-<td width="10%">
1260-
1261-</td>
1262-
1263-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1264-
1265139Combines two lightnesses together. A value of 32768 is neutral. The result may exceed 65535
1266140
1267-</td>
1268-
1269-</tr>
1270-
1271-<tr style="height: 8px;">
1272-
1273-<td colspan="3">
1274-
1275-</td>
1276-
1277-</tr>
1278-
1279-<tr style="background: white;">
1280-
1281-<td colspan="3">
1282-
1283141**function** BGRAToGrayscale(c: TBGRAPixel): TBGRAPixel;
1284142
1285-</td>
1286-
1287-</tr>
1288-
1289-<tr style="background: white;">
1290-
1291-<td width="10%">
1292-
1293-</td>
1294-
1295-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1296-
1297143Converts a color into grayscale
1298144
1299-</td>
1300-
1301-</tr>
1302-
1303-<tr style="height: 8px;">
1304-
1305-<td colspan="3">
1306-
1307-</td>
1308-
1309-</tr>
1310-
1311-<tr style="background: #f0f0ff;">
1312-
1313-<td colspan="3">
1314-
1315145**function** BGRAToGrayscaleLinear(c: TBGRAPixel): TBGRAPixel;
1316146
1317-</td>
1318-
1319-</tr>
1320-
1321-<tr style="background: #f0f0ff;">
1322-
1323-<td width="10%">
1324-
1325-</td>
1326-
1327-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1328-
1329147Converts a color into grayscale assuming linear colorspace
1330148
1331-</td>
1332-
1333-</tr>
1334-
1335-<tr style="height: 8px;">
1336-
1337-<td colspan="3">
1338-
1339-</td>
1340-
1341-</tr>
1342-
1343-<tr style="background: white;">
1344-
1345-<td colspan="3">
1346-
1347149**function** GrayscaleToBGRA(lightness: word): TBGRAPixel;
1348150
1349-</td>
1350-
1351-</tr>
1352-
1353-<tr style="background: white;">
1354-
1355-<td width="10%">
1356-
1357-</td>
1358-
1359-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1360-
1361151Create a gray color with the given *lightness*
1362152
1363-</td>
1364-
1365-</tr>
1366-
1367-<tr style="height: 8px;">
1368-
1369-<td colspan="3">
1370-
1371-</td>
1372-
1373-</tr>
1374-
1375-<tr style="background: #f0f0ff;">
1376-
1377-<td colspan="3">
1378-
1379153**function** MergeBGRA(c1, c2: TBGRAPixel): TBGRAPixel; **overload**;
1380154
1381-</td>
1382-
1383-</tr>
1384-
1385-<tr style="background: #f0f0ff;">
1386-
1387-<td width="10%">
1388-
1389-</td>
1390-
1391-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1392-
1393155Merge two colors without gamma correction
1394156
1395-</td>
1396-
1397-</tr>
1398-
1399-<tr style="height: 8px;">
1400-
1401-<td colspan="3">
1402-
1403-</td>
1404-
1405-</tr>
1406-
1407-<tr style="background: white;">
1408-
1409-<td colspan="3">
1410-
1411157**function** MergeBGRA(c1: TBGRAPixel; weight1: integer; c2: TBGRAPixel; weight2: integer): TBGRAPixel; **overload**;
1412158
1413-</td>
1414-
1415-</tr>
1416-
1417-<tr style="background: white;">
1418-
1419-<td width="10%">
1420-
1421-</td>
1422-
1423-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1424-
1425159Merge two colors without gamma correction. *weight1* and *weight2* indicates the weight of the color barycentre
1426160
1427-</td>
1428-
1429-</tr>
1430-
1431-<tr style="height: 8px;">
1432-
1433-<td colspan="3">
1434-
1435-</td>
1436-
1437-</tr>
1438-
1439-<tr style="background: #f0f0ff;">
1440-
1441-<td colspan="3">
1442-
1443161**function** MergeBGRAWithGammaCorrection(c1: TBGRAPixel; weight1: byte; c2: TBGRAPixel; weight2: byte): TBGRAPixel;
1444162
1445-</td>
1446-
1447-</tr>
1448-
1449-<tr style="background: #f0f0ff;">
1450-
1451-<td width="10%">
1452-
1453-</td>
1454-
1455-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1456-
1457163Merge two colors with gamma correction. *weight1* and *weight2* indicates the weight of the color barycentre
1458164
1459-</td>
1460-
1461-</tr>
1462-
1463-<tr style="height: 8px;">
1464-
1465-<td colspan="3">
1466-
1467-</td>
1468-
1469-</tr>
1470-
1471-<tr style="background: white;">
1472-
1473-<td colspan="3">
1474-
1475165**function** ColorToBGRA(color: TColor): TBGRAPixel; **overload**;
1476166
1477-</td>
1478-
1479-</tr>
1480-
1481-<tr style="background: white;">
1482-
1483-<td width="10%">
1484-
1485-</td>
1486-
1487-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1488-
1489167Converts a TColor value into an opaque pixel
1490168
1491-</td>
1492-
1493-</tr>
1494-
1495-<tr style="height: 8px;">
1496-
1497-<td colspan="3">
1498-
1499-</td>
1500-
1501-</tr>
1502-
1503-<tr style="background: #f0f0ff;">
1504-
1505-<td colspan="3">
1506-
1507169**function** ColorToBGRA(color: TColor; opacity: byte): TBGRAPixel; **overload**;
1508170
1509-</td>
1510-
1511-</tr>
1512-
1513-<tr style="background: #f0f0ff;">
1514-
1515-<td width="10%">
1516-
1517-</td>
1518-
1519-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1520-
1521171Converts a TColor value into a pixel with given *opacity*
1522172
1523-</td>
1524-
1525-</tr>
1526-
1527-<tr style="height: 8px;">
1528-
1529-<td colspan="3">
1530-
1531-</td>
1532-
1533-</tr>
1534-
1535-<tr style="background: white;">
1536-
1537-<td colspan="3">
1538-
1539173**function** BGRAToColor(c: TBGRAPixel): TColor;
1540174
1541-</td>
1542-
1543-</tr>
1544-
1545-<tr style="background: white;">
1546-
1547-<td width="10%">
1548-
1549-</td>
1550-
1551-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1552-
1553175Converts a pixel into a TColor value, discarding the alpha value
1554176
1555-</td>
1556-
1557-</tr>
1558-
1559-<tr style="height: 8px;">
1560-
1561-<td colspan="3">
1562-
1563-</td>
1564-
1565-</tr>
1566-
1567-<tr style="background: #f0f0ff;">
1568-
1569-<td colspan="3">
1570-
1571177**function** FastRoundDiv257(valueWord: LongWord): byte; **inline**;
1572178
1573-</td>
1574-
1575-</tr>
1576-
1577-<tr style="background: #f0f0ff;">
1578-
1579-<td width="10%">
1580-
1581-</td>
1582-
1583-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1584-
1585179Fonction to divide by 257 (not quite the same as **shr** 8)
1586180
1587-</td>
1588-
1589-</tr>
1590-
1591-<tr style="height: 8px;">
1592-
1593-<td colspan="3">
1594-
1595-</td>
1596-
1597-</tr>
1598-
1599-<tr style="background: white;">
1600-
1601-<td colspan="3">
1602-
1603181**function** FPColorToBGRA(AValue: TFPColor): TBGRAPixel;
1604182
1605-</td>
1606-
1607-</tr>
1608-
1609-<tr style="background: white;">
1610-
1611-<td width="10%">
1612-
1613-</td>
1614-
1615-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1616-
1617183Converts a TFPColor value into a pixel. Note that even if TFPColor have 16-bit values, they are not considered as gamma expanded
1618184
1619-</td>
1620-
1621-</tr>
1622-
1623-<tr style="height: 8px;">
1624-
1625-<td colspan="3">
1626-
1627-</td>
1628-
1629-</tr>
1630-
1631-<tr style="background: #f0f0ff;">
1632-
1633-<td colspan="3">
1634-
1635185**function** BGRAToFPColor(AValue: TBGRAPixel): TFPColor; **inline**;
1636186
1637-</td>
1638-
1639-</tr>
1640-
1641-<tr style="background: #f0f0ff;">
1642-
1643-<td width="10%">
1644-
1645-</td>
1646-
1647-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1648-
1649187Converts a pixel into a TFPColor
1650188
1651-</td>
1652-
1653-</tr>
1654-
1655-<tr style="height: 8px;">
1656-
1657-<td colspan="3">
1658-
1659-</td>
1660-
1661-</tr>
1662-
1663-<tr style="background: white;">
1664-
1665-<td colspan="3">
1666-
1667189**function** Color16BitToBGRA(AColor: Word): TBGRAPixel;
1668190
1669-</td>
1670-
1671-</tr>
1672-
1673-<tr style="background: white;">
1674-
1675-<td width="10%">
1676-
1677-</td>
1678-
1679-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1680-
1681191Converts a 16-bit packed color into a TBGRAPixel
1682192
1683-</td>
1684-
1685-</tr>
1686-
1687-<tr style="height: 8px;">
1688-
1689-<td colspan="3">
1690-
1691-</td>
1692-
1693-</tr>
1694-
1695-<tr style="background: #f0f0ff;">
1696-
1697-<td colspan="3">
1698-
1699193**function** BGRAToColor16Bit(**const** AColor: TBGRAPixel): Word;
1700194
1701-</td>
1702-
1703-</tr>
1704-
1705-<tr style="background: #f0f0ff;">
1706-
1707-<td width="10%">
1708-
1709-</td>
1710-
1711-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1712-
1713195Converts a TBGRAPixel into a 16-bit packed color
1714196
1715-</td>
1716-
1717-</tr>
1718-
1719-<tr style="height: 8px;">
1720-
1721-<td colspan="3">
1722-
1723-</td>
1724-
1725-</tr>
1726-
1727-<tr style="background: white;">
1728-
1729-<td colspan="3">
1730-
1731197**function** BGRAWordDiff(c1, c2: TBGRAPixel): word;
1732198
1733-</td>
1734-
1735-</tr>
1736-
1737-<tr style="background: white;">
1738-
1739-<td width="10%">
1740-
1741-</td>
1742-
1743-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1744-
1745199Computes the difference (with gamma correction) between two pixels, taking into account all dimensions, including transparency. The result ranges from 0 to 65535
1746200
1747-</td>
1748-
1749-</tr>
1750-
1751-<tr style="height: 8px;">
1752-
1753-<td colspan="3">
1754-
1755-</td>
1756-
1757-</tr>
1758-
1759-<tr style="background: #f0f0ff;">
1760-
1761-<td colspan="3">
1762-
1763201**function** BGRADiff(c1, c2: TBGRAPixel): byte;
1764202
1765-</td>
1766-
1767-</tr>
1768-
1769-<tr style="background: #f0f0ff;">
1770-
1771-<td width="10%">
1772-
1773-</td>
1774-
1775-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1776-
1777203Computes the difference (with gamma correction) between two pixels, taking into account all dimensions, including transparency. The result ranges from 0 to 255
1778204
1779-</td>
1780-
1781-</tr>
1782-
1783-<tr style="height: 8px;">
1784-
1785-<td colspan="3">
1786-
1787-</td>
1788-
1789-</tr>
1790-
1791-<tr style="background: white;">
1792-
1793-<td colspan="3">
1794-
1795205**function** FastBGRALinearDiff(c1,c2: TBGRAPixel): byte;
1796206
1797-</td>
1798-
1799-</tr>
1800-
1801-<tr style="background: white;">
1802-
1803-<td width="10%">
1804-
1805-</td>
1806-
1807-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1808-
1809207Fast computation of difference, without weighing the alpha channel and without gamma correction
1810208
1811-</td>
1812-
1813-</tr>
1814-
1815-<tr style="height: 8px;">
1816-
1817-<td colspan="3">
1818-
1819-</td>
1820-
1821-</tr>
1822-
1823-<tr style="background: #f0f0ff;">
1824-
1825-<td colspan="3">
1826-
1827209**function** FastBGRAExpandedDiff(c1,c2: TBGRAPixel): word;
1828210
1829-</td>
1830-
1831-</tr>
1832-
1833-<tr style="background: #f0f0ff;">
1834-
1835-<td width="10%">
1836-
1837-</td>
1838-
1839-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1840-
1841211Fast computation of difference, without weighing the alpha channel
1842212
1843-</td>
1844-
1845-</tr>
1846-
1847-<tr style="height: 8px;">
1848-
1849-<td colspan="3">
1850-
1851-</td>
1852-
1853-</tr>
1854-
1855-<tr style="background: white;">
1856-
1857-<td colspan="3">
1858-
1859213**function** MapHeight(Color: TBGRAPixel): Single;
1860214
1861-</td>
1862-
1863-</tr>
1864-
1865-<tr style="background: white;">
1866-
1867-<td width="10%">
1868-
1869-</td>
1870-
1871-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1872-
1873215Get height \[0..1\] stored in a TBGRAPixel
1874216
1875-</td>
1876-
1877-</tr>
1878-
1879-<tr style="height: 8px;">
1880-
1881-<td colspan="3">
1882-
1883-</td>
1884-
1885-</tr>
1886-
1887-<tr style="background: #f0f0ff;">
1888-
1889-<td colspan="3">
1890-
1891217**function** MapHeightToBGRA(Height: Single; Alpha: Byte): TBGRAPixel;
1892218
1893-</td>
1894-
1895-</tr>
1896-
1897-<tr style="background: #f0f0ff;">
1898-
1899-<td width="10%">
1900-
1901-</td>
1902-
1903-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1904-
1905219Get TBGRAPixel to store height \[0..1\]
1906220
1907-</td>
1908-
1909-</tr>
1910-
1911-<tr style="height: 8px;">
1912-
1913-<td colspan="3">
1914-
1915-</td>
1916-
1917-</tr>
1918-
1919-<tr style="background: white;">
1920-
1921-<td colspan="3">
1922-
1923221*TBGRAPixelBuffer* = **packed** **array** **of** TBGRAPixel;
1924222
1925-</td>
1926-
1927-</tr>
1928-
1929-<tr style="background: white;">
1930-
1931-<td width="10%">
1932-
1933-</td>
1934-
1935-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
1936-
1937223Array of TBGRAPixel to be used as a buffer
1938224
1939-</td>
1940-
1941-</tr>
1942-
1943-<tr style="height: 8px;">
1944-
1945-<td colspan="3">
1946-
1947-</td>
1948-
1949-</tr>
1950-
1951-<tr>
1952-
1953-<td width="10%">
1954-
1955-</td>
1956-
1957-<td colspan="2" style="background: #f0f0ff;">
1958-
1959225**procedure** AllocateBGRAPixelBuffer(**var** ABuffer: TBGRAPixelBuffer; ASize: integer);
1960226
1961-</td>
1962-
1963-</tr>
1964-
1965-<tr>
1966-
1967-<td width="10%">
1968-
1969-</td>
1970-
1971-<td width="10%" style="background: #f0f0ff;">
1972-
1973-</td>
1974-
1975-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
1976-
1977227Allocate a buffer of TBGRAPixel
1978228
1979-</td>
1980-
1981-</tr>
1982-
1983-<tr style="height: 8px;">
1984-
1985-<td colspan="3">
1986-
1987-</td>
1988-
1989-</tr>
1990-
1991-<tr>
1992-
1993-<td width="10%">
1994-
1995-</td>
1996-
1997-<td colspan="2" style="background: white;">
1998-
1999229*ArrayOfTBGRAPixel* = **array** **of** TBGRAPixel;
2000230
2001-</td>
2002-
2003-</tr>
2004-
2005-<tr>
2006-
2007-<td width="10%">
2008-
2009-</td>
2010-
2011-<td width="10%" style="background: white;">
2012-
2013-</td>
2014-
2015-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2016-
2017231Array of pixels, not to be used as a buffer
2018232
2019-</td>
2020-
2021-</tr>
2022-
2023-<tr style="height: 8px;">
2024-
2025-<td colspan="3">
2026-
2027-</td>
2028-
2029-</tr>
2030-
2031-<tr>
2032-
2033-<td width="10%">
2034-
2035-</td>
2036-
2037-<td colspan="2" style="background: #f0f0ff;">
2038-
2039233**function** MergeBGRA(**const** colors: **array** **of** TBGRAPixel): TBGRAPixel; **overload**;
2040234
2041-</td>
2042-
2043-</tr>
2044-
2045-<tr>
2046-
2047-<td width="10%">
2048-
2049-</td>
2050-
2051-<td width="10%" style="background: #f0f0ff;">
2052-
2053-</td>
2054-
2055-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2056-
2057235Merge given colors without gamma correction
2058236
2059-</td>
2060-
2061-</tr>
2062-
2063-<tr style="height: 8px;">
2064-
2065-<td colspan="3">
2066-
2067-</td>
2068-
2069-</tr>
2070-
2071-<tr style="background: white;">
2072-
2073-<td colspan="3">
2074-
2075237*TDrawMode* = (
2076238
2077-</td>
2078-
2079-</tr>
2080-
2081-<tr style="background: white;">
2082-
2083-<td width="10%">
2084-
2085-</td>
2086-
2087-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
2088-
2089239Possible modes when drawing a pixel over another one
2090240
2091-</td>
2092-
2093-</tr>
2094-
2095-<tr style="height: 8px;">
2096-
2097-<td colspan="3">
2098-
2099-</td>
2100-
2101-</tr>
2102-
2103-<tr>
2104-
2105-<td width="10%">
2106-
2107-</td>
2108-
2109-<td colspan="2" style="background: #f0f0ff;">
2110-
2111241*dmSet*,
2112242
2113-</td>
2114-
2115-</tr>
2116-
2117-<tr>
2118-
2119-<td width="10%">
2120-
2121-</td>
2122-
2123-<td width="10%" style="background: #f0f0ff;">
2124-
2125-</td>
2126-
2127-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2128-
2129243The pixel is replaced
2130244
2131-</td>
2132-
2133-</tr>
2134-
2135-<tr style="height: 8px;">
2136-
2137-<td colspan="3">
2138-
2139-</td>
2140-
2141-</tr>
2142-
2143-<tr>
2144-
2145-<td width="10%">
2146-
2147-</td>
2148-
2149-<td colspan="2" style="background: white;">
2150-
2151245*dmSetExceptTransparent*,
2152246
2153-</td>
2154-
2155-</tr>
2156-
2157-<tr>
2158-
2159-<td width="10%">
2160-
2161-</td>
2162-
2163-<td width="10%" style="background: white;">
2164-
2165-</td>
2166-
2167-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2168-
2169247The pixel is replaced if the pixel over has an alpha value of 255
2170248
2171-</td>
2172-
2173-</tr>
2174-
2175-<tr style="height: 8px;">
2176-
2177-<td colspan="3">
2178-
2179-</td>
2180-
2181-</tr>
2182-
2183-<tr>
2184-
2185-<td width="10%">
2186-
2187-</td>
2188-
2189-<td colspan="2" style="background: #f0f0ff;">
2190-
2191249*dmLinearBlend*,
2192250
2193-</td>
2194-
2195-</tr>
2196-
2197-<tr>
2198-
2199-<td width="10%">
2200-
2201-</td>
2202-
2203-<td width="10%" style="background: #f0f0ff;">
2204-
2205-</td>
2206-
2207-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2208-
2209251The pixel is blend over the other one according to alpha values, however no gamma correction is applied. In other words, the color space is assumed to be linear
2210252
2211-</td>
2212-
2213-</tr>
2214-
2215-<tr style="height: 8px;">
2216-
2217-<td colspan="3">
2218-
2219-</td>
2220-
2221-</tr>
2222-
2223-<tr>
2224-
2225-<td width="10%">
2226-
2227-</td>
2228-
2229-<td colspan="2" style="background: white;">
2230-
2231253*dmDrawWithTransparency*,
2232254
2233-</td>
2234-
2235-</tr>
2236-
2237-<tr>
2238-
2239-<td width="10%">
2240-
2241-</td>
2242-
2243-<td width="10%" style="background: white;">
2244-
2245-</td>
2246-
2247-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2248-
2249255The pixel is blend over the other one according to alpha values, and a gamma correction is applied. In other word, the color space is assumed to be sRGB
2250256
2251-</td>
2252-
2253-</tr>
2254-
2255-<tr style="height: 8px;">
2256-
2257-<td colspan="3">
2258-
2259-</td>
2260-
2261-</tr>
2262-
2263-<tr>
2264-
2265-<td width="10%">
2266-
2267-</td>
2268-
2269-<td colspan="2" style="background: #f0f0ff;">
2270-
2271257*dmXor*);
2272258
2273-</td>
2274-
2275-</tr>
2276-
2277-<tr>
2278-
2279-<td width="10%">
2280-
2281-</td>
2282-
2283-<td width="10%" style="background: #f0f0ff;">
2284-
2285-</td>
2286-
2287-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2288-
2289259Values of all channels are combined with Xor. This is useful to compute the binary difference, however it is not something that makes much sense to display on the screen
2290260
2291-</td>
2292-
2293-</tr>
2294-
2295-<tr style="height: 8px;">
2296-
2297-<td colspan="3">
2298-
2299-</td>
2300-
2301-</tr>
2302-
2303-<tr>
2304-
2305-<td width="10%">
2306-
2307-</td>
2308-
2309-<td colspan="2" style="background: white;">
2310-
2311261*dmFastBlend* = dmLinearBlend;
2312262
2313-</td>
2314-
2315-</tr>
2316-
2317-<tr>
2318-
2319-<td width="10%">
2320-
2321-</td>
2322-
2323-<td width="10%" style="background: white;">
2324-
2325-</td>
2326-
2327-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2328-
2329263An alias for the linear blend, because it is faster than blending with gamma correction
2330264
2331-</td>
2332-
2333-</tr>
2334-
2335-<tr style="height: 8px;">
2336-
2337-<td colspan="3">
2338-
2339-</td>
2340-
2341-</tr>
2342-
2343-<tr style="background: #f0f0ff;">
2344-
2345-<td colspan="3">
2346-
2347265*TBlendOperation* = (
2348266
2349-</td>
2350-
2351-</tr>
2352-
2353-<tr style="background: #f0f0ff;">
2354-
2355-<td width="10%">
2356-
2357-</td>
2358-
2359-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
2360-
2361267Advanced blending modes. See [Paint.NET blend modes](http://www.brighthub.com/multimedia/photography/articles/18301.aspx) and [Formulas](http://www.pegtop.net/delphi/articles/blendmodes/). Blending layers has two steps. The first one is to apply the blend operations listed below, and the second is the actual merging of the colors
2362268
2363-</td>
2364-
2365-</tr>
2366-
2367-<tr style="height: 8px;">
2368-
2369-<td colspan="3">
2370-
2371-</td>
2372-
2373-</tr>
2374-
2375-<tr>
2376-
2377-<td width="10%">
2378-
2379-</td>
2380-
2381-<td colspan="2" style="background: white;">
2382-
2383269*boLinearBlend*,
2384270
2385-</td>
2386-
2387-</tr>
2388-
2389-<tr>
2390-
2391-<td width="10%">
2392-
2393-</td>
2394-
2395-<td width="10%" style="background: white;">
2396-
2397-</td>
2398-
2399-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2400-
2401271Simple blend, except that it forces a linear merge so it is equivalent to *dmLinearBlend*
2402272
2403-</td>
2404-
2405-</tr>
2406-
2407-<tr style="height: 8px;">
2408-
2409-<td colspan="3">
2410-
2411-</td>
2412-
2413-</tr>
2414-
2415-<tr>
2416-
2417-<td width="10%">
2418-
2419-</td>
2420-
2421-<td colspan="2" style="background: #f0f0ff;">
2422-
2423273*boTransparent*,
2424274
2425-</td>
2426-
2427-</tr>
2428-
2429-<tr>
2430-
2431-<td width="10%">
2432-
2433-</td>
2434-
2435-<td width="10%" style="background: #f0f0ff;">
2436-
2437-</td>
2438-
2439-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2440-
2441275Simple blend. It is equivalent to *dmLinearBlend* or *dmDrawWithTransparency*
2442276
2443-</td>
2444-
2445-</tr>
2446-
2447-<tr style="height: 8px;">
2448-
2449-<td colspan="3">
2450-
2451-</td>
2452-
2453-</tr>
2454-
2455-<tr>
2456-
2457-<td width="10%">
2458-
2459-</td>
2460-
2461-<td colspan="2" style="background: white;">
2462-
2463277*boLighten*, *boScreen*, *boAdditive*, *boLinearAdd*, *boColorDodge*, *boDivide*, *boNiceGlow*, *boSoftLight*, *boHardLight*,
2464278
2465-</td>
2466-
2467-</tr>
2468-
2469-<tr>
2470-
2471-<td width="10%">
2472-
2473-</td>
2474-
2475-<td width="10%" style="background: white;">
2476-
2477-</td>
2478-
2479-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2480-
2481279Lighting blend modes (tends to increase the luminosity)
2482280
2483-</td>
2484-
2485-</tr>
2486-
2487-<tr style="height: 8px;">
2488-
2489-<td colspan="3">
2490-
2491-</td>
2492-
2493-</tr>
2494-
2495-<tr>
2496-
2497-<td width="10%">
2498-
2499-</td>
2500-
2501-<td colspan="2" style="background: #f0f0ff;">
2502-
2503281*boGlow*, *boReflect*, *boOverlay*, *boDarkOverlay*, *boDarken*, *boMultiply*, *boColorBurn*,
2504282
2505-</td>
2506-
2507-</tr>
2508-
2509-<tr>
2510-
2511-<td width="10%">
2512-
2513-</td>
2514-
2515-<td width="10%" style="background: #f0f0ff;">
2516-
2517-</td>
2518-
2519-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2520-
2521283Masking blend modes (tends to decrease the luminosity)
2522284
2523-</td>
2524-
2525-</tr>
2526-
2527-<tr style="height: 8px;">
2528-
2529-<td colspan="3">
2530-
2531-</td>
2532-
2533-</tr>
2534-
2535-<tr>
2536-
2537-<td width="10%">
2538-
2539-</td>
2540-
2541-<td colspan="2" style="background: white;">
2542-
2543285*boDifference*, *boLinearDifference*, *boExclusion*, *boLinearExclusion*, *boSubtract*, *boLinearSubtract*, *boSubtractInverse*, *boLinearSubtractInverse*,
2544286
2545-</td>
2546-
2547-</tr>
2548-
2549-<tr>
2550-
2551-<td width="10%">
2552-
2553-</td>
2554-
2555-<td width="10%" style="background: white;">
2556-
2557-</td>
2558-
2559-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2560-
2561287Difference blend modes
2562288
2563-</td>
2564-
2565-</tr>
2566-
2567-<tr style="height: 8px;">
2568-
2569-<td colspan="3">
2570-
2571-</td>
2572-
2573-</tr>
2574-
2575-<tr>
2576-
2577-<td width="10%">
2578-
2579-</td>
2580-
2581-<td colspan="2" style="background: #f0f0ff;">
2582-
2583289*boNegation*, *boLinearNegation*,
2584290
2585-</td>
2586-
2587-</tr>
2588-
2589-<tr>
2590-
2591-<td width="10%">
2592-
2593-</td>
2594-
2595-<td width="10%" style="background: #f0f0ff;">
2596-
2597-</td>
2598-
2599-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2600-
2601291Negation blend modes
2602292
2603-</td>
2604-
2605-</tr>
2606-
2607-<tr style="height: 8px;">
2608-
2609-<td colspan="3">
2610-
2611-</td>
2612-
2613-</tr>
2614-
2615-<tr>
2616-
2617-<td width="10%">
2618-
2619-</td>
2620-
2621-<td colspan="2" style="background: white;">
2622-
2623293*boXor*,
2624294
2625-</td>
2626-
2627-</tr>
2628-
2629-<tr>
2630-
2631-<td width="10%">
2632-
2633-</td>
2634-
2635-<td width="10%" style="background: white;">
2636-
2637-</td>
2638-
2639-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2640-
2641295Xor blend mode. It is sightly different from *dmXor* because the alpha value is used like in other blends modes
2642296
2643-</td>
2644-
2645-</tr>
2646-
2647-<tr style="height: 8px;">
2648-
2649-<td colspan="3">
2650-
2651-</td>
2652-
2653-</tr>
2654-
2655-<tr>
2656-
2657-<td width="10%">
2658-
2659-</td>
2660-
2661-<td colspan="2" style="background: #f0f0ff;">
2662-
2663297*boSvgSoftLight*,
2664298
2665-</td>
2666-
2667-</tr>
2668-
2669-<tr>
2670-
2671-<td width="10%">
2672-
2673-</td>
2674-
2675-<td width="10%" style="background: #f0f0ff;">
2676-
2677-</td>
2678-
2679-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2680-
2681299SVG implementation of soft light
2682300
2683-</td>
2684-
2685-</tr>
2686-
2687-<tr style="height: 8px;">
2688-
2689-<td colspan="3">
2690-
2691-</td>
2692-
2693-</tr>
2694-
2695-<tr>
2696-
2697-<td width="10%">
2698-
2699-</td>
2700-
2701-<td colspan="2" style="background: white;">
2702-
2703301*boMask*,
2704302
2705-</td>
2706-
2707-</tr>
2708-
2709-<tr>
2710-
2711-<td width="10%">
2712-
2713-</td>
2714-
2715-<td width="10%" style="background: white;">
2716-
2717-</td>
2718-
2719-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2720-
2721303Apply mask
2722304
2723-</td>
2724-
2725-</tr>
2726-
2727-<tr style="height: 8px;">
2728-
2729-<td colspan="3">
2730-
2731-</td>
2732-
2733-</tr>
2734-
2735-<tr>
2736-
2737-<td width="10%">
2738-
2739-</td>
2740-
2741-<td colspan="2" style="background: #f0f0ff;">
2742-
2743305*boLinearMultiplySaturation*, *boLinearHue*, *boLinearColor*, *boLinearLightness*, *boLinearSaturation*,
2744306
2745-</td>
2746-
2747-</tr>
2748-
2749-<tr>
2750-
2751-<td width="10%">
2752-
2753-</td>
2754-
2755-<td width="10%" style="background: #f0f0ff;">
2756-
2757-</td>
2758-
2759-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2760-
2761307Standard HSL colorspace
2762308
2763-</td>
2764-
2765-</tr>
2766-
2767-<tr style="height: 8px;">
2768-
2769-<td colspan="3">
2770-
2771-</td>
2772-
2773-</tr>
2774-
2775-<tr>
2776-
2777-<td width="10%">
2778-
2779-</td>
2780-
2781-<td colspan="2" style="background: white;">
2782-
2783309*boCorrectedHue*, *boCorrectedColor*, *boCorrectedLightness*, *boCorrectedSaturation*
2784310
2785-</td>
2786-
2787-</tr>
2788-
2789-<tr>
2790-
2791-<td width="10%">
2792-
2793-</td>
2794-
2795-<td width="10%" style="background: white;">
2796-
2797-</td>
2798-
2799-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2800-
2801311Corrected HSL colorspace (GSB)
2802312
2803-</td>
2804-
2805-</tr>
2806-
2807-<tr style="height: 8px;">
2808-
2809-<td colspan="3">
2810-
2811-</td>
2812-
2813-</tr>
2814-
2815-<tr>
2816-
2817-<td width="10%">
2818-
2819-</td>
2820-
2821-<td colspan="2" style="background: #f0f0ff;">
2822-
2823313*boGlowMask* = boGlow;
2824314
2825-</td>
2826-
2827-</tr>
2828-
2829-<tr>
2830-
2831-<td width="10%">
2832-
2833-</td>
2834-
2835-<td width="10%" style="background: #f0f0ff;">
2836-
2837-</td>
2838-
2839-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2840-
2841315Alias to glow that express that this blend mode masks the part where the top layer is black
2842316
2843-</td>
2844-
2845-</tr>
2846-
2847-<tr style="height: 8px;">
2848-
2849-<td colspan="3">
2850-
2851-</td>
2852-
2853-</tr>
2854-
2855-<tr>
2856-
2857-<td width="10%">
2858-
2859-</td>
2860-
2861-<td colspan="2" style="background: white;">
2862-
2863317*boLinearMultiply* = boMultiply;
2864318
2865-</td>
2866-
2867-</tr>
2868-
2869-<tr>
2870-
2871-<td width="10%">
2872-
2873-</td>
2874-
2875-<td width="10%" style="background: white;">
2876-
2877-</td>
2878-
2879-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2880-
2881319Alias because linear or non linear multiply modes are identical
2882320
2883-</td>
2884-
2885-</tr>
2886-
2887-<tr style="height: 8px;">
2888-
2889-<td colspan="3">
2890-
2891-</td>
2892-
2893-</tr>
2894-
2895-<tr>
2896-
2897-<td width="10%">
2898-
2899-</td>
2900-
2901-<td colspan="2" style="background: #f0f0ff;">
2902-
2903321*boNonLinearOverlay* = boDarkOverlay;
2904322
2905-</td>
2906-
2907-</tr>
2908-
2909-<tr>
2910-
2911-<td width="10%">
2912-
2913-</td>
2914-
2915-<td width="10%" style="background: #f0f0ff;">
2916-
2917-</td>
2918-
2919-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2920-
2921323Alias to express that dark overlay is simply an overlay with gamma correction
2922324
2923-</td>
2924-
2925-</tr>
2926-
2927-<tr style="height: 8px;">
2928-
2929-<td colspan="3">
2930-
2931-</td>
2932-
2933-</tr>
2934-
2935-<tr>
2936-
2937-<td width="10%">
2938-
2939-</td>
2940-
2941-<td colspan="2" style="background: white;">
2942-
2943325*BlendOperationStr* : **array**\[TBlendOperation\] **of** **string**
2944326
2945-</td>
2946-
2947-</tr>
2948-
2949-<tr>
2950-
2951-<td width="10%">
2952-
2953-</td>
2954-
2955-<td width="10%" style="background: white;">
2956-
2957-</td>
2958-
2959-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
2960-
2961327String constants for blend modes
2962328
2963-</td>
2964-
2965-</tr>
2966-
2967-<tr style="height: 8px;">
2968-
2969-<td colspan="3">
2970-
2971-</td>
2972-
2973-</tr>
2974-
2975-<tr>
2976-
2977-<td width="10%">
2978-
2979-</td>
2980-
2981-<td colspan="2" style="background: #f0f0ff;">
2982-
2983329**function** StrToBlendOperation(str: **string**): TBlendOperation;
2984330
2985-</td>
2986-
2987-</tr>
2988-
2989-<tr>
2990-
2991-<td width="10%">
2992-
2993-</td>
2994-
2995-<td width="10%" style="background: #f0f0ff;">
2996-
2997-</td>
2998-
2999-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
3000-
3001331Returns the blend mode expressed by the string
3002332
3003-</td>
3004-
3005-</tr>
3006-
3007-<tr style="height: 8px;">
3008-
3009-<td colspan="3">
3010-
3011-</td>
3012-
3013-</tr>
3014-
3015-<tr style="background: white;">
3016-
3017-<td colspan="3">
3018-
3019333*TAlphaChannelPaletteOption* = (
3020334
3021-</td>
3022-
3023-</tr>
3024-
3025-<tr style="background: white;">
3026-
3027-<td width="10%">
3028-
3029-</td>
3030-
3031-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
3032-
3033335Specifies how a palette handles the alpha channel
3034336
3035-</td>
3036-
3037-</tr>
3038-
3039-<tr style="height: 8px;">
3040-
3041-<td colspan="3">
3042-
3043-</td>
3044-
3045-</tr>
3046-
3047-<tr>
3048-
3049-<td width="10%">
3050-
3051-</td>
3052-
3053-<td colspan="2" style="background: #f0f0ff;">
3054-
3055337*acIgnore*,
3056338
3057-</td>
3058-
3059-</tr>
3060-
3061-<tr>
3062-
3063-<td width="10%">
3064-
3065-</td>
3066-
3067-<td width="10%" style="background: #f0f0ff;">
3068-
3069-</td>
3070-
3071-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
3072-
3073339The alpha channel is ignored. The alpha channel is considered to be stored elsewhere
3074340
3075-</td>
3076-
3077-</tr>
3078-
3079-<tr style="height: 8px;">
3080-
3081-<td colspan="3">
3082-
3083-</td>
3084-
3085-</tr>
3086-
3087-<tr>
3088-
3089-<td width="10%">
3090-
3091-</td>
3092-
3093-<td colspan="2" style="background: white;">
3094-
3095341*acTransparentEntry*,
3096342
3097-</td>
3098-
3099-</tr>
3100-
3101-<tr>
3102-
3103-<td width="10%">
3104-
3105-</td>
3106-
3107-<td width="10%" style="background: white;">
3108-
3109-</td>
3110-
3111-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
3112-
3113343One entry is allocated the fully transparent color
3114344
3115-</td>
3116-
3117-</tr>
3118-
3119-<tr style="height: 8px;">
3120-
3121-<td colspan="3">
3122-
3123-</td>
3124-
3125-</tr>
3126-
3127-<tr>
3128-
3129-<td width="10%">
3130-
3131-</td>
3132-
3133-<td colspan="2" style="background: #f0f0ff;">
3134-
3135345*acFullChannelInPalette*);
3136346
3137-</td>
3138-
3139-</tr>
3140-
3141-<tr>
3142-
3143-<td width="10%">
3144-
3145-</td>
3146-
3147-<td width="10%" style="background: #f0f0ff;">
3148-
3149-</td>
3150-
3151-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
3152-
3153347The alpha channel is fully embedded in the palette so that a color is identified by its four RGBA channels
3154348
3155-</td>
3156-
3157-</tr>
3158-
3159-<tr style="height: 8px;">
3160-
3161-<td colspan="3">
3162-
3163-</td>
3164-
3165-</tr>
3166-
3167-<tr style="background: white;">
3168-
3169-<td colspan="3">
3170-
3171349*TDitheringAlgorithm* = (
3172350
3173-</td>
3174-
3175-</tr>
3176-
3177-<tr style="background: white;">
3178-
3179-<td width="10%">
3180-
3181-</td>
3182-
3183-<td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">
3184-
3185351Dithering algorithms that specifies how to handle colors that are not found in the palette
3186352
3187-</td>
3188-
3189-</tr>
3190-
3191-<tr style="height: 8px;">
3192-
3193-<td colspan="3">
3194-
3195-</td>
3196-
3197-</tr>
3198-
3199-<tr>
3200-
3201-<td width="10%">
3202-
3203-</td>
3204-
3205-<td colspan="2" style="background: #f0f0ff;">
3206-
3207353*daNearestNeighbor*,
3208354
3209-</td>
3210-
3211-</tr>
3212-
3213-<tr>
3214-
3215-<td width="10%">
3216-
3217-</td>
3218-
3219-<td width="10%" style="background: #f0f0ff;">
3220-
3221-</td>
3222-
3223-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
3224-
3225355The nearest color is to be used instead
3226356
3227-</td>
3228-
3229-</tr>
3230-
3231-<tr style="height: 8px;">
3232-
3233-<td colspan="3">
3234-
3235-</td>
3236-
3237-</tr>
3238-
3239-<tr>
3240-
3241-<td width="10%">
3242-
3243-</td>
3244-
3245-<td colspan="2" style="background: white;">
3246-
3247357*daFloydSteinberg*);
3248358
3249-</td>
3250-
3251-</tr>
3252-
3253-<tr>
3254-
3255-<td width="10%">
3256-
3257-</td>
3258-
3259-<td width="10%" style="background: white;">
3260-
3261-</td>
3262-
3263-<td style="border: 1px solid #e0e0a0; background: #ffffe4;">
3264-
3265359The nearest color may be used however another color may be used to compensate for the error, following Floyd-Steinberg algorithm
3266-
3267-</td>
3268-
3269-</tr>
3270-
3271-<tr style="height: 8px;">
3272-
3273-<td colspan="3">
3274-
3275-</td>
3276-
3277-</tr>
3278-
3279-</table>
3280360
3281361---
3282362*From the Free Pascal wiki, page "BGRABitmap Pixel types", as it stood on 2023-12-14 after a change by Circular, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
3283363Category: BGRABitmap

Back to history