Ignore:
Timestamp:
Dec 22, 2016, 1:20:06 PM (8 years ago)
Author:
chronos
Message:

Generic classes unit renamed to UGGraphics and non generic component like class renamed to UFGraphics.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gbitmap/ColorFormats/UColorGray2.pas

    r21 r23  
    66
    77uses
    8   Classes, SysUtils, Graphics, GPixmap, GImage;
     8  Classes, SysUtils, Graphics, UGGraphics, UFGraphics;
    99
    1010type
     
    2020
    2121  TPixmapGray2 = class(TGPixmapBit<TColorGray2>)
    22     function Gray2ToColor(Value: TColorGray2): Graphics.TColor;
     22    function Gray2ToColor(Value: TColorGray2): TColor;
    2323  end;
    2424
     
    3232  end;
    3333
    34   { TBImageGray2 }
     34  { TBPixmapGray2 }
    3535
    36   TBImageGray2 = class(TBImage)
     36  TBPixmapGray2 = class(TBImage)
    3737  private
    3838    FillCallBack: TGetColorPos;
     
    6565  BitDepth := 2;
    6666  BackendColorClass := TBColorGray2;
    67   BackendImageClass := TBImageGray2;
     67  BackendImageClass := TBPixmapGray2;
    6868  AddChannel('Gray', 0, 2);
    6969end;
     
    9292end;
    9393
    94 { TBImageGray2 }
     94{ TBPixmapGray2 }
    9595
    96 function TBImageGray2.FillGetColor(Position: TPoint): TColorGray2;
     96function TBPixmapGray2.FillGetColor(Position: TPoint): TColorGray2;
    9797begin
    9898  Result := (FillCallBack(Position) as TBColorGray2).Value;
    9999end;
    100100
    101 procedure TBImageGray2.SetSize(AValue: TPoint);
     101procedure TBPixmapGray2.SetSize(AValue: TPoint);
    102102begin
    103103  inherited;
     
    105105end;
    106106
    107 function TBImageGray2.GetPixel(X, Y: Integer): IBColor;
     107function TBPixmapGray2.GetPixel(X, Y: Integer): IBColor;
    108108begin
    109109  Result := TBColorGray2.Create(Pixmap.Pixels[X, Y]);
    110110end;
    111111
    112 procedure TBImageGray2.SetPixel(X, Y: Integer; AValue: IBColor);
     112procedure TBPixmapGray2.SetPixel(X, Y: Integer; AValue: IBColor);
    113113begin
    114114  Pixmap.Pixels[X, Y] := (AValue as TBColorGray2).Value;
    115115end;
    116116
    117 procedure TBImageGray2.Fill(Color: IBColor);
     117procedure TBPixmapGray2.Fill(Color: IBColor);
    118118begin
    119119  if Color is TBColorGray2 then
     
    121121end;
    122122
    123 procedure TBImageGray2.Fill(Func: TGetColorPos);
     123procedure TBPixmapGray2.Fill(Func: TGetColorPos);
    124124begin
    125125  FillCallBack := Func;
     
    127127end;
    128128
    129 procedure TBImageGray2.PaintToCanvas(Canvas: TCanvas);
     129procedure TBPixmapGray2.PaintToCanvas(Canvas: TCanvas);
    130130begin
    131131  Pixmap.PaintToCanvas(Canvas, Pixmap.Gray2ToColor);
    132132end;
    133133
    134 function TBImageGray2.GetDataSize: Integer;
     134function TBPixmapGray2.GetDataSize: Integer;
    135135begin
    136136  Result := Pixmap.GetDataSize;
    137137end;
    138138
    139 constructor TBImageGray2.Create;
     139constructor TBPixmapGray2.Create;
    140140begin
    141141  Pixmap := TPixmapGray2.Create;
     
    143143end;
    144144
    145 destructor TBImageGray2.Destroy;
     145destructor TBPixmapGray2.Destroy;
    146146begin
    147147  FreeAndNil(Pixmap);
     
    151151{ TPixmapGray2 }
    152152
    153 function TPixmapGray2.Gray2ToColor(Value: TColorGray2): Graphics.TColor;
     153function TPixmapGray2.Gray2ToColor(Value: TColorGray2): TColor;
    154154begin
    155155  Value := (Value and $3) * (255 div (4 - 1));
Note: See TracChangeset for help on using the changeset viewer.