Changeset 170 for trunk/Packages/CevoComponents/ScreenTools.pas
- Timestamp:
- Jun 15, 2019, 4:07:03 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ScreenTools.pas
r167 r170 16 16 clPage, clCover: TColor; 17 17 end; 18 19 TColor32 = type cardinal;20 TColor32Component = (ccBlue, ccGreen, ccRed, ccAlpha);21 TPixel32 = packed record22 case integer of23 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 = record33 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 line40 procedure NextPixel; inline; // Move pointer to next pixel41 procedure SetXY(X, Y: integer); inline; // Set pixel position relative to base42 procedure SetX(X: integer); inline; // Set horizontal pixel position relative to base43 procedure Init(Bitmap: TRasterImage; BaseX: integer = 0; BaseY: integer = 0); inline;44 end;45 PPixelPointer = ^TPixelPointer;46 18 47 19 {$IFDEF WINDOWS} … … 218 190 219 191 uses 220 Directories, Sound, Registry ;192 Directories, Sound, Registry, PixelPointer; 221 193 222 194 var … … 1429 1401 end; 1430 1402 1431 { TPixelPointer }1432 1433 procedure TPixelPointer.NextLine; inline;1434 begin1435 Line := Pointer(Line) + BytesPerLine;1436 Pixel := Line;1437 end;1438 1439 procedure TPixelPointer.NextPixel; inline;1440 begin1441 Pixel := Pointer(Pixel) + BytesPerPixel;1442 end;1443 1444 procedure TPixelPointer.SetXY(X, Y: Integer); inline;1445 begin1446 Line := Pointer(Base) + Y * BytesPerLine;1447 SetX(X);1448 end;1449 1450 procedure TPixelPointer.SetX(X: Integer); inline;1451 begin1452 Pixel := Pointer(Line) + X * BytesPerPixel;1453 end;1454 1455 procedure TPixelPointer.Init(Bitmap: TRasterImage; BaseX: Integer = 0;1456 BaseY: integer = 0); inline;1457 begin1458 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 1464 1403 procedure LoadPhrases; 1465 1404 begin
Note:
See TracChangeset
for help on using the changeset viewer.