Ignore:
Timestamp:
Dec 22, 2016, 1:01:41 PM (8 years ago)
Author:
chronos
Message:
  • Added: Color format manager.
  • Modified: Color formats moved to separate files.
Location:
branches/gbitmap
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/gbitmap

    • Property svn:ignore
      •  

        old new  
        44project1.res
        55project1.exe
         6heaptrclog.trc
  • branches/gbitmap/UPixmapSpecialized.pas

    r19 r21  
    99
    1010type
    11   TColorGray1 = Byte;
    12   TColorGray2 = Byte;
    13   TColorGray4 = Byte;
    14   TColorGray8 = Byte;
    1511  TColorGray16 = Word;
    1612  TColorGray32 = Cardinal;
     
    3733
    3834  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;
    5535
    5636  TPixmapGray16 = class(TGPixmap<TColorGray16>)
     
    9777end;
    9878
    99 
    100 function TPixmapGray1.Gray1ToColor(Value: TColorGray1): TColor;
    101 begin
    102   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 begin
    108   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 begin
    114   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 begin
    120   Result := (Value shl 16) or (Value shl 8) or (Value shl 0);
    121 end;
    122 
    12379function TPixmapGray16.Gray16ToColor(Value: TColorGray16): TColor;
    12480begin
Note: See TracChangeset for help on using the changeset viewer.