source: trunk/FastPixel.pas

Last change on this file was 73, checked in by chronos, 7 weeks ago
  • Modified: Removed U prefix from unit names.
File size: 562 bytes
Line 
1unit FastPixel;
2
3interface
4
5uses
6 Classes, SysUtils;
7
8type
9 TFastBitmapPixelComponents = packed record
10 B, G, R, A: Byte;
11 end;
12
13 function SwapBRComponent(Value: Cardinal): Cardinal; inline;
14
15implementation
16
17function SwapBRComponent(Value: Cardinal): Cardinal; inline;
18begin
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;
23end;
24
25end.
26
Note: See TracBrowser for help on using the repository browser.