Ignore:
Timestamp:
May 30, 2023, 11:31:10 AM (11 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from unit names.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/PixelPointer.pas

    r455 r456  
    1 unit UPixelPointer;
     1unit PixelPointer;
    22
    33interface
     
    1515  private
    1616    procedure SetRGB(AValue: Cardinal);
    17     function GetRGB: Cardinal;   
     17    function GetRGB: Cardinal;
    1818  public
    1919    property RGB: Cardinal read GetRGB write SetRGB;
     
    4141    procedure SetXY(X, Y: Integer); inline; // Set pixel position relative to base
    4242    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;
    4344  end;
    4445  PPixelPointer = ^TPixelPointer;
    4546
    46   function PixelPointer(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline;
    4747  function SwapRedBlue(Color: TColor32): TColor32;
    4848  procedure BitmapCopyRect(DstBitmap: TRasterImage; DstRect: TRect; SrcBitmap: TRasterImage; SrcPos: TPoint);
     
    120120  SrcBitmap.BeginUpdate(True);
    121121  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);
    124124  for Y := 0 to DstRect.Height - 1 do begin
    125125    for X := 0 to DstRect.Width - 1 do begin
     
    150150  SrcBitmap.BeginUpdate(True);
    151151  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);
    154154  for Y := 0 to DstRect.Height - 1 do begin
    155155    for X := 0 to DstRect.Width - 1 do begin
     
    181181begin
    182182  Bitmap.BeginUpdate(True);
    183   Ptr := PixelPointer(Bitmap);
     183  Ptr := TPixelPointer.Create(Bitmap);
    184184  for Y := 0 to Bitmap.Height - 1 do begin
    185185    for X := 0 to Bitmap.Width - 1 do begin
     
    198198begin
    199199  Bitmap.BeginUpdate(True);
    200   Ptr := PixelPointer(Bitmap, Rect.Left, Rect.Top);
     200  Ptr := TPixelPointer.Create(Bitmap, Rect.Left, Rect.Top);
    201201  for Y := 0 to Rect.Height - 1 do begin
    202202    for X := 0 to Rect.Width - 1 do begin
     
    215215begin
    216216  Bitmap.BeginUpdate(True);
    217   Ptr := PixelPointer(Bitmap);
     217  Ptr := TPixelPointer.Create(Bitmap);
    218218  for Y := 0 to Bitmap.Height - 1 do begin
    219219    for X := 0 to Bitmap.Width - 1 do begin
     
    232232begin
    233233  Bitmap.BeginUpdate(True);
    234   Ptr := PixelPointer(Bitmap);
     234  Ptr := TPixelPointer.Create(Bitmap);
    235235  for Y := 0 to Bitmap.Height - 1 do begin
    236236    for X := 0 to Bitmap.Width - 1 do begin
     
    252252  Pixel := Color32ToPixel32(Color);
    253253  Bitmap.BeginUpdate(True);
    254   Ptr := PixelPointer(Bitmap);
     254  Ptr := TPixelPointer.Create(Bitmap);
    255255  for Y := 0 to Bitmap.Height - 1 do begin
    256256    for X := 0 to Bitmap.Width - 1 do begin
     
    295295end;
    296296
    297 function PixelPointer(Bitmap: TRasterImage; BaseX: Integer;
     297class function TPixelPointer.Create(Bitmap: TRasterImage; BaseX: Integer;
    298298  BaseY: Integer): TPixelPointer;
    299299begin
     
    310310end;
    311311
    312 
    313312end.
    314 
Note: See TracChangeset for help on using the changeset viewer.