Changeset 521 for GraphicTest/Packages/bgrabitmap/bgrafilterscanner.pas
- Timestamp:
- Apr 17, 2019, 12:58:41 AM (5 years ago)
- Location:
- GraphicTest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest
- Property svn:ignore
-
old new 8 8 GraphicTest.lps 9 9 GraphicTest.dbg 10 heaptrclog.trc
-
- Property svn:ignore
-
GraphicTest/Packages/bgrabitmap/bgrafilterscanner.pas
r494 r521 61 61 ADest: PBGRAPixel; ACount: integer); override; 62 62 public 63 constructor Create(ASource: IBGRAScanner; ABounds: TRect); 64 constructor Create(ASource: TBGRACustomBitmap); 63 constructor Create(ASource: IBGRAScanner; ABounds: TRect); overload; 64 constructor Create(ASource: TBGRACustomBitmap); overload; 65 65 property SourceBorderColor: TBGRAPixel read FSourceBorderColor write FSourceBorderColor; 66 66 property DestinationBorderColor: TBGRAPixel read FDestinationBorderColor write FDestinationBorderColor; … … 79 79 public 80 80 constructor Create(ASource: IBGRAScanner; ABounds: TRect; 81 AGammaCorrection: boolean = False); 81 AGammaCorrection: boolean = False); overload; 82 82 constructor Create(ASource: TBGRACustomBitmap; 83 AGammaCorrection: boolean = False); 83 AGammaCorrection: boolean = False); overload; 84 84 property Opacity: Byte read FOpacity write FOpacity; 85 85 end; … … 93 93 public 94 94 constructor Create(ASource: IBGRAScanner; ABounds: TRect; 95 AAmount: integer = 256); 95 AAmount: integer = 256); overload; 96 96 constructor Create(ASource: TBGRACustomBitmap; 97 AAmount: integer = 256); 97 AAmount: integer = 256); overload; 98 98 end; 99 99 … … 108 108 procedure SetSourceChannel(AValue: TChannel); 109 109 public 110 constructor Create(ASource: IBGRAScanner; ABounds: TRect; ABoundsVisible: Boolean); 111 constructor Create(ASource: TBGRACustomBitmap; ABoundsVisible: Boolean); 110 constructor Create(ASource: IBGRAScanner; ABounds: TRect; ABoundsVisible: Boolean); overload; 111 constructor Create(ASource: TBGRACustomBitmap; ABoundsVisible: Boolean); overload; 112 112 property FillSelection: boolean read FFillSelection write FFillSelection; 113 113 property SourceChannel: TChannel read FSourceChannel write SetSourceChannel; … … 138 138 highlight: TBGRAPixel; 139 139 begin 140 sum := (PByte(PTop)+FChannelOffset)^ + (PByte(PTop+1)+FChannelOffset)^+ 141 (PByte(PMiddle)+FChannelOffset)^ - (PByte(PMiddle+2)+FChannelOffset)^ - 142 (PByte(PBottom+1)+FChannelOffset)^ - (PByte(PBottom+2)+FChannelOffset)^; 140 sum := NativeInt((PByte(PTop)+FChannelOffset)^) + 141 NativeInt((PByte(PTop+1)+FChannelOffset)^) + 142 NativeInt((PByte(PMiddle)+FChannelOffset)^) - 143 NativeInt((PByte(PMiddle+2)+FChannelOffset)^) - 144 NativeInt((PByte(PBottom+1)+FChannelOffset)^) - 145 NativeInt((PByte(PBottom+2)+FChannelOffset)^); 143 146 sum := 128 - sum div 3; 144 147 if sum > 255 then … … 711 714 begin 712 715 if ADest^.alpha <> 0 then 713 DWord(ADest^) := DWord(ADest^) xor ( not ($ff shl TBGRAPixel_AlphaShift));716 DWord(ADest^) := DWord(ADest^) xor ($ffffffff and not ($ff shl TBGRAPixel_AlphaShift)); 714 717 Inc(ADest); 715 718 dec(ACount); … … 738 741 ADest^ := BGRAPixelTransparent 739 742 else 740 DWord(ADest^) := DWord(ASource^) xor ( not ($ff shl TBGRAPixel_AlphaShift));743 DWord(ADest^) := DWord(ASource^) xor ($ffffffff and not ($ff shl TBGRAPixel_AlphaShift)); 741 744 inc(ASource); 742 745 Inc(ADest);
Note:
See TracChangeset
for help on using the changeset viewer.