Changeset 23 for branches/gbitmap


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.

Location:
branches/gbitmap
Files:
2 added
2 deleted
11 edited

Legend:

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

    r21 r23  
    66
    77uses
    8   Classes, SysUtils, Graphics, GImage, GPixmap;
     8  Classes, SysUtils, Graphics, UFGraphics, UGGraphics;
    99
    1010type
     
    2020
    2121  TPixmapGray1 = class(TGPixmapBit<TColorGray1>)
    22     function Gray1ToColor(Value: TColorGray1): Graphics.TColor;
     22    function Gray1ToColor(Value: TColorGray1): TColor;
    2323  end;
    2424
     
    3232  end;
    3333
    34   { TBImageGray1 }
     34  { TBPixmapGray1 }
    3535
    36   TBImageGray1 = class(TBImage)
     36  TBPixmapGray1 = class(TBImage)
    3737  private
    3838    FillCallBack: TGetColorPos;
     
    6464  BitDepth := 1;
    6565  BackendColorClass := TBColorGray1;
    66   BackendImageClass := TBImageGray1;
     66  BackendImageClass := TBPixmapGray1;
    6767  AddChannel('Gray', 0, 1);
    6868end;
     
    7070{ TPixmapGray1 }
    7171
    72 function TPixmapGray1.Gray1ToColor(Value: TColorGray1): Graphics.TColor;
     72function TPixmapGray1.Gray1ToColor(Value: TColorGray1): TColor;
    7373begin
    7474  Value := (Value and $1) * $ff;
     
    9797end;
    9898
    99 { TBImageGray1 }
     99{ TBPixmapGray1 }
    100100
    101 function TBImageGray1.FillGetColor(Position: TPoint): TColorGray1;
     101function TBPixmapGray1.FillGetColor(Position: TPoint): TColorGray1;
    102102begin
    103103  Result := (FillCallBack(Position) as TBColorGray1).Value;
    104104end;
    105105
    106 procedure TBImageGray1.SetSize(AValue: TPoint);
     106procedure TBPixmapGray1.SetSize(AValue: TPoint);
    107107begin
    108108  inherited;
     
    110110end;
    111111
    112 function TBImageGray1.GetPixel(X, Y: Integer): IBColor;
     112function TBPixmapGray1.GetPixel(X, Y: Integer): IBColor;
    113113begin
    114114  Result := TBColorGray1.Create(Pixmap.Pixels[X, Y]);
    115115end;
    116116
    117 procedure TBImageGray1.SetPixel(X, Y: Integer; AValue: IBColor);
     117procedure TBPixmapGray1.SetPixel(X, Y: Integer; AValue: IBColor);
    118118begin
    119119  Pixmap.Pixels[X, Y] := (AValue as TBColorGray1).Value;
    120120end;
    121121
    122 procedure TBImageGray1.Fill(Color: IBColor);
     122procedure TBPixmapGray1.Fill(Color: IBColor);
    123123begin
    124124  if Color is TBColorGray1 then
     
    126126end;
    127127
    128 procedure TBImageGray1.Fill(Func: TGetColorPos);
     128procedure TBPixmapGray1.Fill(Func: TGetColorPos);
    129129begin
    130130  FillCallBack := Func;
     
    132132end;
    133133
    134 procedure TBImageGray1.PaintToCanvas(Canvas: TCanvas);
     134procedure TBPixmapGray1.PaintToCanvas(Canvas: TCanvas);
    135135begin
    136136  Pixmap.PaintToCanvas(Canvas, Pixmap.Gray1ToColor);
    137137end;
    138138
    139 function TBImageGray1.GetDataSize: Integer;
     139function TBPixmapGray1.GetDataSize: Integer;
    140140begin
    141141  Result := Pixmap.GetDataSize;
    142142end;
    143143
    144 constructor TBImageGray1.Create;
     144constructor TBPixmapGray1.Create;
    145145begin
    146146  Pixmap := TPixmapGray1.Create;
     
    148148end;
    149149
    150 destructor TBImageGray1.Destroy;
     150destructor TBPixmapGray1.Destroy;
    151151begin
    152152  FreeAndNil(Pixmap);
  • 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));
  • branches/gbitmap/ColorFormats/UColorGray4.pas

    r21 r23  
    66
    77uses
    8   Classes, SysUtils, GPixmap, GImage, Graphics;
     8  Classes, SysUtils, UGGraphics, UFGraphics, Graphics;
    99
    1010type
  • branches/gbitmap/ColorFormats/UColorGray8.pas

    r21 r23  
    66
    77uses
    8   Classes, SysUtils, GImage, GPixmap, Graphics;
     8  Classes, SysUtils, UFGraphics, UGGraphics, Graphics;
    99
    1010type
  • branches/gbitmap/ColorFormats/UColorRGB565.pas

    r21 r23  
    66
    77uses
    8   Classes, SysUtils, Graphics, GPixmap, GImage;
     8  Classes, SysUtils, Graphics, UGGraphics, UFGraphics;
    99
    1010type
  • branches/gbitmap/ColorFormats/UColorRGB8.pas

    r22 r23  
    66
    77uses
    8   Classes, SysUtils, GPixmap, GImage, Graphics;
     8  Classes, SysUtils, UGGraphics, UFGraphics, Graphics;
    99
    1010type
     
    3737  end;
    3838
    39   { TBImageRGB8 }
     39  { TBPixmapRGB8 }
    4040
    41   TBImageRGB8 = class(TBImage)
     41  TBPixmapRGB8 = class(TBImage)
    4242  private
    4343    FillCallBack: TGetColorPos;
     
    6666  BitDepth := 24;
    6767  Name := 'RGB8';
    68   BackendImageClass := TBImageRGB8;
     68  BackendImageClass := TBPixmapRGB8;
    6969  BackendColorClass := TBColorRGB8;
    7070  AddChannel('Red', 0, 8);
     
    112112end;
    113113
    114 { TBImageRGB8 }
     114{ TBPixmapRGB8 }
    115115
    116 function TBImageRGB8.FillGetColor(Position: TPoint): TColorRGB8;
     116function TBPixmapRGB8.FillGetColor(Position: TPoint): TColorRGB8;
    117117begin
    118118  Result := (FillCallBack(Position) as TBColorRGB8).Value;
    119119end;
    120120
    121 procedure TBImageRGB8.SetSize(AValue: TPoint);
     121procedure TBPixmapRGB8.SetSize(AValue: TPoint);
    122122begin
    123123  inherited;
     
    125125end;
    126126
    127 procedure TBImageRGB8.Fill(Color: IBColor);
     127procedure TBPixmapRGB8.Fill(Color: IBColor);
    128128begin
    129129  if Color is TBColorRGB8 then
     
    131131end;
    132132
    133 procedure TBImageRGB8.Fill(Func: TGetColorPos);
     133procedure TBPixmapRGB8.Fill(Func: TGetColorPos);
    134134begin
    135135  FillCallBack := Func;
     
    137137end;
    138138
    139 procedure TBImageRGB8.PaintToCanvas(Canvas: TCanvas);
     139procedure TBPixmapRGB8.PaintToCanvas(Canvas: TCanvas);
    140140begin
    141141  Pixmap.PaintToCanvas(Canvas, Pixmap.RGB8ToColor);
    142142end;
    143143
    144 function TBImageRGB8.GetDataSize: Integer;
     144function TBPixmapRGB8.GetDataSize: Integer;
    145145begin
    146146  Result := Pixmap.GetDataSize;
    147147end;
    148148
    149 constructor TBImageRGB8.Create;
     149constructor TBPixmapRGB8.Create;
    150150begin
    151151  Pixmap := TPixmapRGB8.Create;
    152152end;
    153153
    154 destructor TBImageRGB8.Destroy;
     154destructor TBPixmapRGB8.Destroy;
    155155begin
    156156  FreeAndNil(Pixmap);
  • branches/gbitmap/ColorFormats/UColorRGBA8.pas

    r21 r23  
    66
    77uses
    8   Classes, SysUtils, Graphics, GPixmap, GImage;
     8  Classes, SysUtils, Graphics, UGGraphics, UFGraphics;
    99
    1010type
  • branches/gbitmap/UFormMain.pas

    r22 r23  
    66
    77uses
    8   GImage, Classes, SysUtils, FileUtil, Forms, Graphics, Controls, Dialogs, Menus,
    9   ExtCtrls, StdCtrls, GPixmap, UPixmapSpecialized, UColorGray1, UColorGray2,
     8  UFGraphics, Classes, SysUtils, FileUtil, Forms, Graphics, Controls, Dialogs, Menus,
     9  ExtCtrls, StdCtrls, UGGraphics, UPixmapSpecialized, UColorGray1, UColorGray2,
    1010  UColorGray4, UColorGray8, UColorRGB8, UColorRGBA8, UColorRGB565;
    1111
     
    2929    function RGB8Random(Position: TPoint): TColorRGB8;
    3030    function RGB16Random(Position: TPoint): TColorRGB16;
    31     function ColorRandom(Position: TPoint; ColorFormat: TColorFormat): GImage.TColor;
     31    function ColorRandom(Position: TPoint; ColorFormat: TColorFormat): UFGraphics.TFColor;
    3232  public
    3333    procedure TestGray1;
     
    9898end;
    9999
    100 function TForm1.ColorRandom(Position: TPoint; ColorFormat: TColorFormat): GImage.TColor;
    101 begin
    102   Result := GImage.TColor.Create;
     100function TForm1.ColorRandom(Position: TPoint; ColorFormat: TColorFormat): UFGraphics.TFColor;
     101begin
     102  Result := UFGraphics.TFColor.Create;
    103103  Result.ColorFormat := ColorFormat;
    104104  Result.SetRandom;
     
    271271procedure TForm1.TestImage;
    272272var
    273   Image: GImage.TPixmap;
    274 begin
    275   Image := GImage.TPixmap.Create;
     273  Image: TFPixmap;
     274begin
     275  Image := TFPixmap.Create;
    276276  with Image do begin
    277277    Size := Point(100, 100);
    278278    ColorFormat := ColorFormatManager.Formats[5];
    279     Fill(GImage.TColor.Create(ColorFormat, cnWhite));
    280     Pixels[0, 0] := GImage.TColor.Create(ColorFormat, cnBlack);
     279    Fill(TFColor.Create(ColorFormat, cnWhite));
     280    Pixels[0, 0] := TFColor.Create(ColorFormat, cnBlack);
    281281    Fill(ColorRandom);
    282282    PaintToCanvas(Image1.Picture.Bitmap.Canvas);
  • branches/gbitmap/UPixmapSpecialized.pas

    r22 r23  
    66
    77uses
    8   Classes, SysUtils, Graphics, GPixmap;
     8  Classes, SysUtils, Graphics, UGGraphics;
    99
    1010type
  • branches/gbitmap/project1.lpi

    r21 r23  
    8383      </Unit1>
    8484      <Unit2>
    85         <Filename Value="GPixmap.pas"/>
     85        <Filename Value="UGGraphics.pas"/>
    8686        <IsPartOfProject Value="True"/>
    8787      </Unit2>
    8888      <Unit3>
    89         <Filename Value="GImage.pas"/>
     89        <Filename Value="UFGraphics.pas"/>
    9090        <IsPartOfProject Value="True"/>
    9191      </Unit3>
  • branches/gbitmap/project1.lpr

    r21 r23  
    88  {$ENDIF}{$ENDIF}
    99  Interfaces, // this includes the LCL widgetset
    10   SysUtils, Forms, UFormMain, GPixmap, GImage, UPixmapSpecialized, UColorRGB8
     10  SysUtils, Forms, UFormMain, UGGraphics,
     11UFGraphics, UPixmapSpecialized, UColorRGB8
    1112  { you can add units after this };
    1213
Note: See TracChangeset for help on using the changeset viewer.