Changeset 456 for trunk/Packages/Common/PixelPointer.pas
- Timestamp:
- May 30, 2023, 11:31:10 AM (18 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/PixelPointer.pas
r455 r456 1 unit UPixelPointer;1 unit PixelPointer; 2 2 3 3 interface … … 15 15 private 16 16 procedure SetRGB(AValue: Cardinal); 17 function GetRGB: Cardinal; 17 function GetRGB: Cardinal; 18 18 public 19 19 property RGB: Cardinal read GetRGB write SetRGB; … … 41 41 procedure SetXY(X, Y: Integer); inline; // Set pixel position relative to base 42 42 procedure SetX(X: Integer); inline; // Set horizontal pixel position relative to base 43 class function Create(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline; static; 43 44 end; 44 45 PPixelPointer = ^TPixelPointer; 45 46 46 function PixelPointer(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline;47 47 function SwapRedBlue(Color: TColor32): TColor32; 48 48 procedure BitmapCopyRect(DstBitmap: TRasterImage; DstRect: TRect; SrcBitmap: TRasterImage; SrcPos: TPoint); … … 120 120 SrcBitmap.BeginUpdate(True); 121 121 DstBitmap.BeginUpdate(True); 122 SrcPtr := PixelPointer(SrcBitmap, SrcPos.X, SrcPos.Y);123 DstPtr := PixelPointer(DstBitmap, DstRect.Left, DstRect.Top);122 SrcPtr := TPixelPointer.Create(SrcBitmap, SrcPos.X, SrcPos.Y); 123 DstPtr := TPixelPointer.Create(DstBitmap, DstRect.Left, DstRect.Top); 124 124 for Y := 0 to DstRect.Height - 1 do begin 125 125 for X := 0 to DstRect.Width - 1 do begin … … 150 150 SrcBitmap.BeginUpdate(True); 151 151 DstBitmap.BeginUpdate(True); 152 SrcPtr := PixelPointer(SrcBitmap, SrcRect.Left, SrcRect.Top);153 DstPtr := PixelPointer(DstBitmap, DstRect.Left, DstRect.Top);152 SrcPtr := TPixelPointer.Create(SrcBitmap, SrcRect.Left, SrcRect.Top); 153 DstPtr := TPixelPointer.Create(DstBitmap, DstRect.Left, DstRect.Top); 154 154 for Y := 0 to DstRect.Height - 1 do begin 155 155 for X := 0 to DstRect.Width - 1 do begin … … 181 181 begin 182 182 Bitmap.BeginUpdate(True); 183 Ptr := PixelPointer(Bitmap);183 Ptr := TPixelPointer.Create(Bitmap); 184 184 for Y := 0 to Bitmap.Height - 1 do begin 185 185 for X := 0 to Bitmap.Width - 1 do begin … … 198 198 begin 199 199 Bitmap.BeginUpdate(True); 200 Ptr := PixelPointer(Bitmap, Rect.Left, Rect.Top);200 Ptr := TPixelPointer.Create(Bitmap, Rect.Left, Rect.Top); 201 201 for Y := 0 to Rect.Height - 1 do begin 202 202 for X := 0 to Rect.Width - 1 do begin … … 215 215 begin 216 216 Bitmap.BeginUpdate(True); 217 Ptr := PixelPointer(Bitmap);217 Ptr := TPixelPointer.Create(Bitmap); 218 218 for Y := 0 to Bitmap.Height - 1 do begin 219 219 for X := 0 to Bitmap.Width - 1 do begin … … 232 232 begin 233 233 Bitmap.BeginUpdate(True); 234 Ptr := PixelPointer(Bitmap);234 Ptr := TPixelPointer.Create(Bitmap); 235 235 for Y := 0 to Bitmap.Height - 1 do begin 236 236 for X := 0 to Bitmap.Width - 1 do begin … … 252 252 Pixel := Color32ToPixel32(Color); 253 253 Bitmap.BeginUpdate(True); 254 Ptr := PixelPointer(Bitmap);254 Ptr := TPixelPointer.Create(Bitmap); 255 255 for Y := 0 to Bitmap.Height - 1 do begin 256 256 for X := 0 to Bitmap.Width - 1 do begin … … 295 295 end; 296 296 297 function PixelPointer(Bitmap: TRasterImage; BaseX: Integer;297 class function TPixelPointer.Create(Bitmap: TRasterImage; BaseX: Integer; 298 298 BaseY: Integer): TPixelPointer; 299 299 begin … … 310 310 end; 311 311 312 313 312 end. 314
Note:
See TracChangeset
for help on using the changeset viewer.