source: trunk/Packages/FastGraphics/ColorFormats/UColorGray8.pas

Last change on this file was 26, checked in by chronos, 8 years ago
File size: 688 bytes
Line 
1unit UColorGray8;
2
3{$mode delphi}
4
5interface
6
7uses
8 Classes, SysUtils, UFGraphics, UGGraphics, Graphics;
9
10type
11 { TColorFormatGray8 }
12
13 TColorFormatGray8 = class(TColorFormat)
14 constructor Create; override;
15 end;
16
17 TColorGray8 = Byte;
18
19 TPixmapGray8 = class(TGPixmap<TColorGray8>)
20 function Gray8ToColor(Value: TColorGray8): TColor;
21 end;
22
23
24implementation
25
26{ TColorFormatGray8 }
27
28constructor TColorFormatGray8.Create;
29begin
30 inherited;
31 Name := 'Gray 8-bit';
32 BitDepth := 8;
33 AddChannel('Gray', 0, 8);
34end;
35
36{ TPixmapGray8 }
37
38function TPixmapGray8.Gray8ToColor(Value: TColorGray8): TColor;
39begin
40 Result := (Value shl 16) or (Value shl 8) or (Value shl 0);
41end;
42
43
44end.
45
Note: See TracBrowser for help on using the repository browser.