Changeset 7 for trunk/UGraphic.pas
- Timestamp:
- Sep 19, 2014, 9:25:56 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGraphic.pas
r5 r7 22 22 function GetPixelSize: Integer; virtual; 23 23 function GetName: string; virtual; 24 function GetChannelB ytePos(Channel: TGColorChannel): Integer; virtual;24 function GetChannelBitPos(Channel: TGColorChannel): Integer; virtual; 25 25 function GetChannelBitWidth(Channel: TGColorChannel): Integer; virtual; 26 26 function ChannelUsed(Channel: TGColorChannel): Boolean; … … 75 75 procedure Clear; 76 76 procedure Random; 77 procedure Flip; 78 procedure Mirror; 77 79 constructor Create; virtual; 78 80 destructor Destroy; override; … … 242 244 end; 243 245 244 function TGColorFormat.GetChannelB ytePos(Channel: TGColorChannel): Integer;246 function TGColorFormat.GetChannelBitPos(Channel: TGColorChannel): Integer; 245 247 begin 246 248 … … 437 439 end; 438 440 441 procedure TGBitmap.Flip; 442 var 443 X, Y: Integer; 444 Color: TGColor; 445 begin 446 for Y := 0 to Size.Y div 2 - 1 do 447 for X := 0 to Size.X - 1 do begin 448 Color := Pixels[X, Y]; 449 Pixels[X, Y] := Pixels[X, Size.Y - 1 - Y]; 450 Pixels[X, Size.Y - 1 - Y] := Color; 451 Color.Free; 452 end; 453 end; 454 455 procedure TGBitmap.Mirror; 456 var 457 X, Y: Integer; 458 Color: TGColor; 459 begin 460 for Y := 0 to Size.Y - 1 do 461 for X := 0 to Size.X div 2 - 1 do begin 462 Color := Pixels[X, Y]; 463 Pixels[X, Y] := Pixels[Size.X - 1 - X, Y]; 464 Pixels[Size.X - 1 - X, Y] := Color; 465 Color.Free; 466 end; 467 end; 468 439 469 constructor TGBitmap.Create; 440 470 begin
Note:
See TracChangeset
for help on using the changeset viewer.