Changeset 36 for trunk/Packages
- Timestamp:
- May 4, 2018, 1:36:00 PM (7 years ago)
- Location:
- trunk/Packages/FastGraphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/FastGraphics/ColorFormats/UColorRGB8.pas
r31 r36 47 47 FillCallBack: TGetColorPos; 48 48 function FillGetColor(Position: TPoint): TColorRGB8; 49 function NegativeFunc(Position: TPoint): TColorRGB8; 49 50 protected 50 51 function GetPixel(X, Y: Integer): IBColor; override; … … 55 56 procedure Mirror; override; 56 57 procedure Flip; override; 58 procedure Negative; override; 57 59 procedure Fill(Color: IBColor); override; 58 60 procedure Fill(Func: TGetColorPos); override; 61 procedure Line(P1, P2: TPoint; Color: IBColor); override; 59 62 procedure PaintToCanvas(Canvas: TCanvas); override; 60 63 procedure PaintToCanvas(Canvas: TCanvas; Rect: TRect); override; … … 143 146 end; 144 147 148 function TBPixmapRGB8.NegativeFunc(Position: TPoint): TColorRGB8; 149 var 150 C: TColorRGB8; 151 begin 152 C := Pixmap.Pixels[Position.X, Position.Y]; 153 Result.R := 255 - C.R; 154 Result.G := 255 - C.G; 155 Result.B := 255 - C.B; 156 end; 157 145 158 function TBPixmapRGB8.GetPixel(X, Y: Integer): IBColor; 146 159 begin … … 169 182 end; 170 183 184 procedure TBPixmapRGB8.Negative; 185 begin 186 Pixmap.Fill(NegativeFunc); 187 end; 188 171 189 procedure TBPixmapRGB8.Fill(Color: IBColor); 172 190 begin … … 181 199 end; 182 200 201 procedure TBPixmapRGB8.Line(P1, P2: TPoint; Color: IBColor); 202 begin 203 Pixmap.Canvas.Pen.Color := (Color as TBColorRGB8).Value; 204 Pixmap.Canvas.Pen.MoveTo(P1); 205 Pixmap.Canvas.Pen.LineTo(P2); 206 end; 207 183 208 procedure TBPixmapRGB8.PaintToCanvas(Canvas: TCanvas); 184 209 begin -
trunk/Packages/FastGraphics/UFGraphics.pas
r33 r36 42 42 procedure Mirror; virtual; 43 43 procedure Flip; virtual; 44 procedure Negative; virtual; 44 45 procedure Fill(Color: IBColor); virtual; overload; 45 46 procedure Fill(Func: TGetColorPos); virtual; overload; … … 391 392 procedure TBImage.Mirror; 392 393 begin 393 394 394 end; 395 395 396 396 procedure TBImage.Flip; 397 begin 398 end; 399 400 procedure TBImage.Negative; 397 401 begin 398 402 end; … … 505 509 procedure TFPixmap.Negative; 506 510 begin 507 511 FBackend.Negative; 508 512 end; 509 513 -
trunk/Packages/FastGraphics/UGGraphics.pas
r35 r36 344 344 for X := 0 to FSize.X - 1 do begin 345 345 if (X >= 0) and (X < FSize.X) and (Y >= 0) and (Y < FSize.Y) then 346 P Integer(DstPtr.Pixel)^ := ColorConvertFunc(PInteger(SrcPtr.Pixel)^);346 PGColor(DstPtr.Pixel)^ := ColorConvertFunc(PInteger(SrcPtr.Pixel)^); 347 347 SrcPtr.NextPixel; 348 348 DstPtr.NextPixel;
Note:
See TracChangeset
for help on using the changeset viewer.