Changeset 331 for trunk/Packages/CevoComponents/UPixelPointer.pas
- Timestamp:
- Mar 26, 2021, 3:24:15 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/UPixelPointer.pas
r230 r331 9 9 TColor32 = type Cardinal; 10 10 TColor32Component = (ccBlue, ccGreen, ccRed, ccAlpha); 11 12 { TPixel32 } 13 11 14 TPixel32 = packed record 15 private 16 function GetRGB: Cardinal; 17 procedure SetRGB(AValue: Cardinal); 18 public 19 property RGB: Cardinal read GetRGB write SetRGB; 12 20 case Integer of 13 21 0: (B, G, R, A: Byte); … … 37 45 38 46 function PixelPointer(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline; 39 47 function SwapRedBlue(Color: TColor32): TColor32; 40 48 41 49 implementation 50 51 { TPixel32 } 52 53 function TPixel32.GetRGB: Cardinal; 54 begin 55 Result := ARGB and $ffffff; 56 end; 57 58 procedure TPixel32.SetRGB(AValue: Cardinal); 59 begin 60 R := (AValue shr 16) and $ff; 61 G := (AValue shr 8) and $ff; 62 B := (AValue shr 0) and $ff; 63 end; 42 64 43 65 { TPixelPointer } … … 86 108 end; 87 109 110 function SwapRedBlue(Color: TColor32): TColor32; 111 begin 112 Result := (Color and $ff00ff00) or ((Color and $ff) shl 16) or ((Color shr 16) and $ff); 113 end; 114 88 115 89 116 end.
Note:
See TracChangeset
for help on using the changeset viewer.