Changeset 22 for branches/gbitmap/UPixmapSpecialized.pas
- Timestamp:
- Dec 22, 2016, 1:13:04 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gbitmap/UPixmapSpecialized.pas
r21 r22 11 11 TColorGray16 = Word; 12 12 TColorGray32 = Cardinal; 13 14 { TColorRGB8 }15 16 TColorRGB8 = record17 R: Byte;18 B: Byte;19 G: Byte;20 function Create(R, G, B: Byte): TColorRGB8;21 end;22 13 23 14 { TColorRGB16 } … … 40 31 TPixmapGray32 = class(TGPixmap<TColorGray32>) 41 32 function Gray32ToColor(Value: TColorGray32): TColor; 42 end;43 44 TPixmapRGB8 = class(TGPixmap<TColorRGB8>)45 function RGB8ToColor(Value: TColorRGB8): TColor;46 33 end; 47 34 … … 68 55 end; 69 56 70 { TColorRGB8 }71 72 function TColorRGB8.Create(R, G, B: Byte): TColorRGB8;73 begin74 Result.R := R;75 Result.G := G;76 Result.B := B;77 end;78 79 57 function TPixmapGray16.Gray16ToColor(Value: TColorGray16): TColor; 80 58 begin … … 87 65 Value := (Value shr 24) and $ff; 88 66 Result := (Value shl 16) or (Value shl 8) or (Value shl 0); 89 end;90 91 function TPixmapRGB8.RGB8ToColor(Value: TColorRGB8): TColor;92 begin93 Result := (Value.R shl 16) or (Value.G shl 8) or (Value.B shl 0);94 67 end; 95 68
Note:
See TracChangeset
for help on using the changeset viewer.