Changeset 21 for trunk/ScreenTools.pas
- Timestamp:
- Jan 8, 2017, 3:12:18 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ScreenTools.pas
r20 r21 9 9 {$ENDIF} 10 10 StringTables, 11 LCLIntf, LCLType, LMessages, Messages,SysUtils, Classes, Graphics, Controls,11 LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, 12 12 Forms, Menus; 13 13 … … 192 192 193 193 uses 194 Directories, Sound, ButtonBase, ButtonA, ButtonB, 195 196 Registry; 194 Directories, Sound, Registry; 197 195 198 196 var … … 386 384 procedure ApplyGamma(Start, Stop: pbyte); 387 385 begin 388 while integer(Start) < integer(Stop)do386 while Start < Stop do 389 387 begin 390 388 Start^ := GammaLUT[Start^]; … … 443 441 FirstLine := bmp.ScanLine[0]; 444 442 LastLine := bmp.ScanLine[bmp.Height - 1]; 445 if integer(FirstLine) < integer(LastLine)then443 if FirstLine < LastLine then 446 444 ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width]) 447 445 else … … 501 499 FirstLine := bmp.ScanLine[0]; 502 500 LastLine := bmp.ScanLine[bmp.Height - 1]; 503 if integer(FirstLine) < integer(LastLine)then501 if FirstLine < LastLine then 504 502 ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width]) 505 503 else … … 612 610 // X channel = background amp (old Dst content), 128=original brightness 613 611 type 614 TPixel = array [0 .. 2] of Byte; 612 TPixel = array [0..2] of Byte; 613 PPixel = ^TPixel; 615 614 var 616 615 i, Brightness, test: integer; 617 616 PixelSrc: ^Byte; 618 PixelDst: ^TPixel;617 PixelDst: PPixel; 619 618 begin 620 619 {TODO assert(Src.PixelFormat = pf8bit);} … … 642 641 while yDst < h do 643 642 begin 644 PixelDst := pointer(integer(dst.ScanLine[yDst]) + 3 * xDst);645 PixelSrc := pointer(integer(Src.ScanLine[ySrc]) + xSrc);643 PixelDst := dst.ScanLine[yDst] + 3 * xDst; 644 PixelSrc := Src.ScanLine[ySrc] + xSrc; 646 645 for i := 0 to w - 1 do 647 646 begin … … 662 661 else 663 662 PixelDst[0] := test; // Blue 664 PixelDst := pointer(integer(PixelDst) + 3);665 PixelSrc := pointer(integer(PixelSrc) + 1);663 PixelDst := Pointer(PixelDst) + 3; 664 PixelSrc := Pointer(PixelSrc) + 1; 666 665 end; 667 666 inc(yDst); … … 751 750 while y < h do 752 751 begin 753 Pixel := pointer(integer(bmp.ScanLine[y]) + 3 * x);752 Pixel := bmp.ScanLine[y] + 3 * x; 754 753 for i := 0 to w - 1 do 755 754 begin … … 764 763 Pixel[1] := Green; 765 764 Pixel[2] := Red; 766 Pixel := pointer(integer(Pixel) + 3);765 Pixel := Pointer(Pixel) + 3; 767 766 end; 768 767 inc(y);
Note:
See TracChangeset
for help on using the changeset viewer.