Changeset 36 for trunk/Packages/FastGraphics/ColorFormats
- Timestamp:
- May 4, 2018, 1:36:00 PM (7 years ago)
- File:
-
- 1 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
Note:
See TracChangeset
for help on using the changeset viewer.