Changeset 14 for trunk/ColorFormats/UColorRGB565.pas
- Timestamp:
- Sep 22, 2014, 5:40:17 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ColorFormats/UColorRGB565.pas
r11 r14 6 6 7 7 uses 8 Classes, SysUtils, Graphics, UGraphic , UMemory;8 Classes, SysUtils, Graphics, UGraphic; 9 9 10 10 type … … 12 12 13 13 TGColorFormatRGB565 = 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 { TGColorFormatRGB565 } 25 21 26 function TGColorFormatRGB565.GetPixelSize: Integer;22 constructor TGColorFormatRGB565.Create; 27 23 begin 28 Result := 16; 29 end; 30 31 function TGColorFormatRGB565.GetBitDepth: Integer; 32 begin 33 Result := 16; 34 end; 35 36 function TGColorFormatRGB565.GetName: string; 37 begin 38 Result := 'RGB565'; 39 end; 40 41 function TGColorFormatRGB565.GetChannelBitPos(Channel: TGColorChannel): Integer; 42 begin 43 case Channel of 44 ccRed: Result := 0; 45 ccGreen: Result := 5; 46 ccBlue: Result := 11; 47 else Result := 0; 48 end; 49 end; 50 51 function TGColorFormatRGB565.GetChannelBitWidth(Channel: TGColorChannel 52 ): Integer; 53 begin 54 case Channel of 55 ccRed: Result := 5; 56 ccGreen: Result := 6; 57 ccBlue: Result := 5; 58 else Result := 0; 59 end; 24 inherited Create; 25 BitDepth := 16; 26 Name := 'RGB565'; 27 Channels[ccRed].Position := 0; 28 Channels[ccRed].BitWidth := 5; 29 Channels[ccGreen].Position := 5; 30 Channels[ccGreen].BitWidth := 6; 31 Channels[ccBlue].Position := 9; 32 Channels[ccBlue].BitWidth := 6; 60 33 end; 61 34
Note:
See TracChangeset
for help on using the changeset viewer.