Changeset 4 for trunk/ColorFormats/UColorRGBA8.pas
- Timestamp:
- Sep 16, 2014, 11:55:35 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ColorFormats/UColorRGBA8.pas
r3 r4 18 18 function GetChannelBitWidth(Channel: TGColorChannel): Integer; override; 19 19 function ColorToTColor(Color: TGColor): TColor; override; 20 procedure ColorFromTColor(GColor: TGColor; Color: TColor); override; 20 21 function GetColorClass: TGColorClass; override; 21 22 end; … … 66 67 end; 67 68 69 procedure TGColorFormatRGBA8.ColorFromTColor(GColor: TGColor; Color: TColor); 70 begin 71 PByte(GColor.Data + GetChannelBytePos(ccRed))^ := Color and $ff; 72 PByte(GColor.Data + GetChannelBytePos(ccGreen))^ := (Color shr 8) and $ff; 73 PByte(GColor.Data + GetChannelBytePos(ccBlue))^ := (Color shr 16) and $ff; 74 end; 75 68 76 function TGColorFormatRGBA8.GetColorClass: TGColorClass; 69 77 begin
Note:
See TracChangeset
for help on using the changeset viewer.