Changeset 14 for trunk/ColorFormats/UColorRGBA8.pas
- Timestamp:
- Sep 22, 2014, 5:40:17 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ColorFormats/UColorRGBA8.pas
r9 r14 12 12 13 13 TGColorFormatRGBA8 = class(TGColorFormat) 14 function GetPixelSize: Integer; override; 15 function GetBitDepth: Integer; override; 16 function GetName: string; override; 17 function GetChannelBitPos(Channel: TGColorChannel): Integer; override; 18 function GetChannelBitWidth(Channel: TGColorChannel): Integer; override; 14 constructor Create; override; 19 15 end; 20 16 … … 24 20 { TGColorFormatRGBA8 } 25 21 26 function TGColorFormatRGBA8.GetPixelSize: Integer;22 constructor TGColorFormatRGBA8.Create; 27 23 begin 28 Result := 32; 29 end; 30 31 function TGColorFormatRGBA8.GetBitDepth: Integer; 32 begin 33 Result := 32; 34 end; 35 36 function TGColorFormatRGBA8.GetName: string; 37 begin 38 Result := 'RGBA8'; 39 end; 40 41 function TGColorFormatRGBA8.GetChannelBitPos(Channel: TGColorChannel): Integer; 42 begin 43 case Channel of 44 ccRed: Result := 0; 45 ccGreen: Result := 8; 46 ccBlue: Result := 16; 47 ccOpacity: Result := 24; 48 else Result := 0; 49 end; 50 end; 51 52 function TGColorFormatRGBA8.GetChannelBitWidth(Channel: TGColorChannel 53 ): Integer; 54 begin 55 if (Channel = ccBlue) or (Channel = ccRed) or (Channel = ccGreen) then 56 Result := 8 else Result := 0; 24 inherited Create; 25 BitDepth := 32; 26 Name := 'RGBA8'; 27 Channels[ccRed].Position := 0; 28 Channels[ccRed].BitWidth := 8; 29 Channels[ccGreen].Position := 8; 30 Channels[ccGreen].BitWidth := 8; 31 Channels[ccBlue].Position := 16; 32 Channels[ccBlue].BitWidth := 8; 33 Channels[ccOpacity].Position := 24; 34 Channels[ccOpacity].BitWidth := 8; 57 35 end; 58 36
Note:
See TracChangeset
for help on using the changeset viewer.