Changeset 31 for trunk/Packages/FastGraphics/ColorFormats
- Timestamp:
- Jan 4, 2017, 11:49:56 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/FastGraphics/ColorFormats/UColorRGB8.pas
r29 r31 37 37 constructor Create(Color: TColorRGB8); 38 38 procedure SetColorName(ColorName: TColorName); override; 39 procedure SetColor(Color: TColor); override; 39 40 procedure SetRandom; override; 40 41 end; … … 47 48 function FillGetColor(Position: TPoint): TColorRGB8; 48 49 protected 50 function GetPixel(X, Y: Integer): IBColor; override; 51 procedure SetPixel(X, Y: Integer; AValue: IBColor); override; 49 52 procedure SetSize(AValue: TPoint); override; 50 53 public 51 54 Pixmap: TPixmapRGB8; 55 procedure Mirror; override; 56 procedure Flip; override; 52 57 procedure Fill(Color: IBColor); override; 53 58 procedure Fill(Func: TGetColorPos); override; … … 121 126 end; 122 127 128 procedure TBColorRGB8.SetColor(Color: TColor); 129 begin 130 Value := TColorRGB8.Create((Color shr 0) and $ff, (Color shr 8) and $ff, (Color shr 16) and $ff); 131 end; 132 123 133 procedure TBColorRGB8.SetRandom; 124 134 begin … … 131 141 begin 132 142 Result := (FillCallBack(Position) as TBColorRGB8).Value; 143 end; 144 145 function TBPixmapRGB8.GetPixel(X, Y: Integer): IBColor; 146 begin 147 Result := TBColorRGB8.Create(Pixmap.Pixels[X, Y]); 148 end; 149 150 procedure TBPixmapRGB8.SetPixel(X, Y: Integer; AValue: IBColor); 151 begin 152 Pixmap.Pixels[X, Y] := (AValue as TBColorRGB8).Value; 133 153 end; 134 154 … … 139 159 end; 140 160 161 procedure TBPixmapRGB8.Mirror; 162 begin 163 Pixmap.Mirror; 164 end; 165 166 procedure TBPixmapRGB8.Flip; 167 begin 168 Pixmap.Flip; 169 end; 170 141 171 procedure TBPixmapRGB8.Fill(Color: IBColor); 142 172 begin
Note:
See TracChangeset
for help on using the changeset viewer.