Ignore:
Timestamp:
Jun 15, 2019, 4:07:03 PM (6 years ago)
Author:
chronos
Message:
Location:
trunk/Packages/CevoComponents
Files:
1 added
3 edited

Legend:

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

    r166 r170  
    3737    <Description Value="C-evo components"/>
    3838    <Version Major="1" Minor="2"/>
    39     <Files Count="13">
     39    <Files Count="14">
    4040      <Item1>
    4141        <Filename Value="Area.pas"/>
     
    9696        <Filename Value="BaseWin.pas"/>
    9797        <HasRegisterProc Value="True"/>
     98        <UnitName Value="BaseWin"/>
    9899      </Item13>
     100      <Item14>
     101        <Filename Value="PixelPointer.pas"/>
     102        <UnitName Value="PixelPointer"/>
     103      </Item14>
    99104    </Files>
    100105    <RequiredPkgs Count="2">
  • trunk/Packages/CevoComponents/CevoComponents.pas

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

    r167 r170  
    1616    clPage, clCover: TColor;
    1717  end;
    18 
    19   TColor32 = type cardinal;
    20   TColor32Component = (ccBlue, ccGreen, ccRed, ccAlpha);
    21   TPixel32 = packed record
    22     case integer of
    23       0: (B, G, R, A: byte);
    24       1: (ARGB: TColor32);
    25       2: (Planes: array[0..3] of byte);
    26       3: (Components: array[TColor32Component] of byte);
    27   end;
    28   PPixel32 = ^TPixel32;
    29 
    30   { TPixelPointer }
    31 
    32   TPixelPointer = record
    33     Base: PPixel32;
    34     Pixel: PPixel32;
    35     Line: PPixel32;
    36     RelLine: PPixel32;
    37     BytesPerPixel: integer;
    38     BytesPerLine: integer;
    39     procedure NextLine; inline; // Move pointer to start of new base line
    40     procedure NextPixel; inline; // Move pointer to next pixel
    41     procedure SetXY(X, Y: integer); inline; // Set pixel position relative to base
    42     procedure SetX(X: integer); inline; // Set horizontal pixel position relative to base
    43     procedure Init(Bitmap: TRasterImage; BaseX: integer = 0; BaseY: integer = 0); inline;
    44   end;
    45   PPixelPointer = ^TPixelPointer;
    4618
    4719{$IFDEF WINDOWS}
     
    218190
    219191uses
    220   Directories, Sound, Registry;
     192  Directories, Sound, Registry, PixelPointer;
    221193
    222194var
     
    14291401end;
    14301402
    1431 { TPixelPointer }
    1432 
    1433 procedure TPixelPointer.NextLine; inline;
    1434 begin
    1435   Line := Pointer(Line) + BytesPerLine;
    1436   Pixel := Line;
    1437 end;
    1438 
    1439 procedure TPixelPointer.NextPixel; inline;
    1440 begin
    1441   Pixel := Pointer(Pixel) + BytesPerPixel;
    1442 end;
    1443 
    1444 procedure TPixelPointer.SetXY(X, Y: Integer); inline;
    1445 begin
    1446   Line := Pointer(Base) + Y * BytesPerLine;
    1447   SetX(X);
    1448 end;
    1449 
    1450 procedure TPixelPointer.SetX(X: Integer); inline;
    1451 begin
    1452   Pixel := Pointer(Line) + X * BytesPerPixel;
    1453 end;
    1454 
    1455 procedure TPixelPointer.Init(Bitmap: TRasterImage; BaseX: Integer = 0;
    1456   BaseY: integer = 0); inline;
    1457 begin
    1458   BytesPerLine := Bitmap.RawImage.Description.BytesPerLine;
    1459   BytesPerPixel := Bitmap.RawImage.Description.BitsPerPixel shr 3;
    1460   Base := PPixel32(Bitmap.RawImage.Data + BaseX * BytesPerPixel + BaseY * BytesPerLine);
    1461   SetXY(0, 0);
    1462 end;
    1463 
    14641403procedure LoadPhrases;
    14651404begin
Note: See TracChangeset for help on using the changeset viewer.