Last change
on this file was 73, checked in by chronos, 8 months ago |
- Modified: Removed U prefix from unit names.
|
File size:
562 bytes
|
Line | |
---|
1 | unit FastPixel;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils;
|
---|
7 |
|
---|
8 | type
|
---|
9 | TFastBitmapPixelComponents = packed record
|
---|
10 | B, G, R, A: Byte;
|
---|
11 | end;
|
---|
12 |
|
---|
13 | function SwapBRComponent(Value: Cardinal): Cardinal; inline;
|
---|
14 |
|
---|
15 | implementation
|
---|
16 |
|
---|
17 | function SwapBRComponent(Value: Cardinal): Cardinal; inline;
|
---|
18 | begin
|
---|
19 | // Result := (Value and $00ff00) or ((Value shr 16) and $ff) or ((Value and $ff) shl 16);
|
---|
20 | Result := Value;
|
---|
21 | TFastBitmapPixelComponents(Result).R := TFastBitmapPixelComponents(Value).B;
|
---|
22 | TFastBitmapPixelComponents(Result).B := TFastBitmapPixelComponents(Value).R;
|
---|
23 | end;
|
---|
24 |
|
---|
25 | end.
|
---|
26 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.