Ignore:
Timestamp:
May 8, 2020, 6:12:35 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Remove warnings about uninitialized TPixelPointer variables. Initialize that types using PixelPointer function in similar way how TPoint is inicialized using Point function.
Location:
trunk/Packages/CevoComponents
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/CevoComponents.lpk

    r170 r206  
    9999      </Item13>
    100100      <Item14>
    101         <Filename Value="PixelPointer.pas"/>
    102         <UnitName Value="PixelPointer"/>
     101        <Filename Value="UPixelPointer.pas"/>
     102        <UnitName Value="UPixelPointer"/>
    103103      </Item14>
    104104    </Files>
  • trunk/Packages/CevoComponents/CevoComponents.pas

    r170 r206  
    1010uses
    1111  Area, ButtonA, ButtonB, ButtonC, ButtonN, EOTButton, ButtonBase, DrawDlg,
    12   Sound, BaseWin, PixelPointer, LazarusPackageIntf;
     12  Sound, BaseWin, UPixelPointer, LazarusPackageIntf;
    1313
    1414implementation
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r205 r206  
    208208
    209209uses
    210   Directories, Sound, PixelPointer;
     210  Directories, Sound, UPixelPointer;
    211211
    212212var
     
    360360begin
    361361  Bitmap.BeginUpdate;
    362   PixelPtr.Init(Bitmap);
     362  PixelPtr := PixelPointer(Bitmap);
    363363  for Y := 0 to Bitmap.Height - 1 do begin
    364364    for X := 0 to Bitmap.Width - 1 do begin
     
    377377begin
    378378  //Dst.SetSize(Src.Width, Src.Height);
    379   SrcPtr.Init(Src);
    380   DstPtr.Init(Dst);
     379  SrcPtr := PixelPointer(Src);
     380  DstPtr := PixelPointer(Dst);
    381381  for Y := 0 to Src.Height - 1 do begin
    382382    for X := 0 to Src.Width - 1 do begin
     
    501501    GrExt[nGrExt].Data.BeginUpdate;
    502502    GrExt[nGrExt].Mask.BeginUpdate;
    503     DataPixel.Init(GrExt[nGrExt].Data);
    504     MaskPixel.Init(GrExt[nGrExt].Mask);
     503    DataPixel := PixelPointer(GrExt[nGrExt].Data);
     504    MaskPixel := PixelPointer(GrExt[nGrExt].Mask);
    505505    for y := 0 to Source.Height - 1 do begin
    506506      for x := 0 to xmax - 1 do begin
     
    542542begin
    543543  Dst.BeginUpdate;
    544   PixelPtr.Init(Dst, X, Y);
     544  PixelPtr := PixelPointer(Dst, X, Y);
    545545  for yy := 0 to Height - 1 do begin
    546546    for xx := 0 to Width - 1 do begin
     
    585585  dst.BeginUpdate;
    586586  Src.BeginUpdate;
    587   PixelDst.Init(Dst, xDst, yDst);
    588   PixelSrc.Init(Src, xSrc, ySrc);
     587  PixelDst := PixelPointer(Dst, xDst, yDst);
     588  PixelSrc := PixelPointer(Src, xSrc, ySrc);
    589589  for Y := 0 to h - 1 do begin
    590590    for X := 0 to w - 1 do  begin
     
    644644  Src.BeginUpdate;
    645645  dst.BeginUpdate;
    646   SrcPixel.Init(Src, xSrc, ySrc);
    647   DstPixel.Init(Dst, xDst, yDst);
     646  SrcPixel := PixelPointer(Src, xSrc, ySrc);
     647  DstPixel := PixelPointer(Dst, xDst, yDst);
    648648  for iy := 0 to Height - 1 do begin
    649649    for ix := 0 to Width - 1 do begin
     
    687687  assert(bmp.PixelFormat = pf24bit);
    688688  h := y + h;
    689   PixelPtr.Init(Bmp, x, y);
     689  PixelPtr := PixelPointer(Bmp, x, y);
    690690  while y < h do begin
    691691    for i := 0 to w - 1 do begin
     
    837837begin
    838838  dst.BeginUpdate;
    839   DstPtr.Init(dst, x0, y0);
     839  DstPtr := PixelPointer(dst, x0, y0);
    840840  for y := -GlowRange + 1 to Height - 1 + GlowRange - 1 do begin
    841841    for x := -GlowRange + 1 to Width - 1 + GlowRange - 1 do begin
     
    14331433  TexWidth := Texture.Width;
    14341434  TexHeight := Texture.Height;
    1435   DstPixel.Init(Dest);
    1436   SrcPixel.Init(Texture);
     1435  DstPixel := PixelPointer(Dest);
     1436  SrcPixel := PixelPointer(Texture);
    14371437  for Y := 0 to Dest.Height - 1 do begin
    14381438    for X := 0 to Dest.Width - 1 do begin
     
    14561456begin
    14571457  Bitmap.BeginUpdate;
    1458   PicturePixel.Init(Bitmap);
     1458  PicturePixel := PixelPointer(Bitmap);
    14591459  for y := 0 to Bitmap.Height - 1 do begin
    14601460    for x := 0 to Bitmap.Width - 1 do begin
  • trunk/Packages/CevoComponents/UPixelPointer.pas

    r205 r206  
    1 unit PixelPointer;
     1unit UPixelPointer;
    22
    33interface
     
    3131    procedure SetXY(X, Y: Integer); inline; // Set pixel position relative to base
    3232    procedure SetX(X: Integer); inline; // Set horizontal pixel position relative to base
    33     procedure Init(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0); inline;
    3433  end;
    3534  PPixelPointer = ^TPixelPointer;
     35
     36  function PixelPointer(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline;
    3637
    3738
     
    6263end;
    6364
    64 procedure TPixelPointer.Init(Bitmap: TRasterImage; BaseX: Integer = 0;
    65   BaseY: Integer = 0); inline;
     65function PixelPointer(Bitmap: TRasterImage; BaseX: Integer;
     66  BaseY: Integer): TPixelPointer;
    6667begin
    67   BytesPerLine := Bitmap.RawImage.Description.BytesPerLine;
    68   BytesPerPixel := Bitmap.RawImage.Description.BitsPerPixel shr 3;
    69   Base := PPixel32(Bitmap.RawImage.Data + BaseX * BytesPerPixel + BaseY * BytesPerLine);
    70   SetXY(0, 0);
     68  Result.BytesPerLine := Bitmap.RawImage.Description.BytesPerLine;
     69  Result.BytesPerPixel := Bitmap.RawImage.Description.BitsPerPixel shr 3;
     70  Result.Base := PPixel32(Bitmap.RawImage.Data + BaseX * Result.BytesPerPixel +
     71    BaseY * Result.BytesPerLine);
     72  Result.SetXY(0, 0);
    7173end;
    7274
Note: See TracChangeset for help on using the changeset viewer.