Changeset 21 for branches/gbitmap/UPixmapSpecialized.pas
- Timestamp:
- Dec 22, 2016, 1:01:41 PM (8 years ago)
- Location:
- branches/gbitmap
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gbitmap
- Property svn:ignore
-
old new 4 4 project1.res 5 5 project1.exe 6 heaptrclog.trc
-
- Property svn:ignore
-
branches/gbitmap/UPixmapSpecialized.pas
r19 r21 9 9 10 10 type 11 TColorGray1 = Byte;12 TColorGray2 = Byte;13 TColorGray4 = Byte;14 TColorGray8 = Byte;15 11 TColorGray16 = Word; 16 12 TColorGray32 = Cardinal; … … 37 33 38 34 TColorGrayVar = PByte; 39 40 TPixmapGray1 = class(TGPixmapBit<TColorGray1>)41 function Gray1ToColor(Value: TColorGray1): TColor;42 end;43 44 TPixmapGray2 = class(TGPixmapBit<TColorGray2>)45 function Gray2ToColor(Value: TColorGray2): TColor;46 end;47 48 TPixmapGray4 = class(TGPixmapBit<TColorGray4>)49 function Gray4ToColor(Value: TColorGray4): TColor;50 end;51 52 TPixmapGray8 = class(TGPixmap<TColorGray8>)53 function Gray8ToColor(Value: TColorGray8): TColor;54 end;55 35 56 36 TPixmapGray16 = class(TGPixmap<TColorGray16>) … … 97 77 end; 98 78 99 100 function TPixmapGray1.Gray1ToColor(Value: TColorGray1): TColor;101 begin102 Value := (Value and $1) * $ff;103 Result := (Value shl 16) or (Value shl 8) or (Value shl 0);104 end;105 106 function TPixmapGray2.Gray2ToColor(Value: TColorGray2): TColor;107 begin108 Value := (Value and $3) * (255 div (4 - 1));109 Result := (Value shl 16) or (Value shl 8) or (Value shl 0);110 end;111 112 function TPixmapGray4.Gray4ToColor(Value: TColorGray4): TColor;113 begin114 Value := (Value and $f) * (255 div (16 - 1));115 Result := (Value shl 16) or (Value shl 8) or (Value shl 0);116 end;117 118 function TPixmapGray8.Gray8ToColor(Value: TColorGray8): TColor;119 begin120 Result := (Value shl 16) or (Value shl 8) or (Value shl 0);121 end;122 123 79 function TPixmapGray16.Gray16ToColor(Value: TColorGray16): TColor; 124 80 begin
Note:
See TracChangeset
for help on using the changeset viewer.