Changeset 60 for trunk/ScreenTools.pas
- Timestamp:
- Jan 13, 2017, 6:51:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ScreenTools.pas
r52 r60 653 653 // X channel = background amp (old Dst content), 128=original brightness 654 654 var 655 i, Brightness, test: integer; 655 X, Y: Integer; 656 Brightness, test: integer; 656 657 PixelSrc: ^Byte; 657 658 PixelDst: PPixel32; 658 659 begin 659 {TODO assert(Src.PixelFormat = pf8bit);}660 assert(dst.PixelFormat = pf24bit);660 //TODO Assert(Src.PixelFormat = pf8bit); 661 Assert(dst.PixelFormat = pf24bit); 661 662 if xDst < 0 then 662 663 begin … … 680 681 dst.BeginUpdate; 681 682 Src.BeginUpdate; 682 h := yDst + h; 683 while yDst < h do 684 begin 685 PixelDst := GetBitmapPixelPtr(dst, xDst, yDst); 686 PixelSrc := Src.ScanLine[ySrc] + xSrc; 687 for i := 0 to w - 1 do 688 begin 683 for Y := 0 to h - 1 do begin 684 PixelDst := GetBitmapPixelPtr(dst, xDst, yDst + Y); 685 PixelSrc := Pointer(GetBitmapPixelPtr(Src, xSrc, ySrc + Y)); 686 for X := 0 to w - 1 do begin 689 687 Brightness := PixelSrc^; 690 688 test := (PixelDst^.R * Brightness) shr 7; … … 700 698 PixelDst^.B := test; // Blue 701 699 PixelDst := Pointer(PixelDst) + (Dst.RawImage.Description.BitsPerPixel shr 3); 702 PixelSrc := Pointer(PixelSrc) + 1; 703 end; 704 inc(yDst); 705 inc(ySrc); 700 PixelSrc := Pointer(PixelSrc) + (Src.RawImage.Description.BitsPerPixel shr 3); 701 end; 706 702 end; 707 703 src.EndUpdate;
Note:
See TracChangeset
for help on using the changeset viewer.