Ignore:
Timestamp:
Jun 15, 2019, 4:07:03 PM (5 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.