~chronoscz/vcard-studio/trunk

« back to all changes in this revision

Viewing changes to Packages/TemplateGenerics/Generic/GenericBitmap.inc

  • Committer: chronos
  • Date: 2019-05-08 10:11:40 UTC
  • Revision ID: svn-v4:b2f690cb-8b89-471c-b043-dbd4632e1e77:trunk:21
* Fixed: Build under Lazarus 2.0.
* Modified: Used .lrj files instead of .lrt files.
* Removed: TemplateGenerics package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{$IFDEF INTERFACE}
2
 
 
3
 
// TGBitmap<TGBitmapIndexX, TGBitmapIndexY, TGBitmapItem>
4
 
{$DEFINE TGMatrixIndexX := TGBitmapIndexX}
5
 
{$DEFINE TGMatrixIndexY := TGBitmapIndexY}
6
 
{$DEFINE TGMatrixItem := TGBitmapItem}
7
 
{$DEFINE TGMatrixIndex := TGBitmapIndex}
8
 
{$DEFINE TGMatrixRow := TGBitmapRow}
9
 
{$DEFINE TGMatrix := TGBitmapMatrix}
10
 
{$DEFINE INTERFACE}
11
 
{$I 'GenericMatrix.inc'}
12
 
 
13
 
  // TGBitmap<TGBitmapIndex, TGBitmapIndex, TGBitmapItem> = class
14
 
  TGBitmap = class(TGMatrix)
15
 
  private
16
 
    function GetWidth: TGBitmapIndexX;
17
 
    function GetHeight: TGBitmapIndexX;
18
 
    procedure SetWidth(Value: TGBitmapIndexX);
19
 
    procedure SetHeight(Value: TGBitmapIndexY);
20
 
  public
21
 
    property Pixels[X: TGBitmapIndexX; Y: TGBitmapIndexY]: TGBitmapItem
22
 
      read GetItemXY write PutItemXY;
23
 
    property Width: TGBitmapIndexX read GetWidth write SetWidth;
24
 
    property Height: TGBitmapIndexY read GetHeight write SetHeight;
25
 
  end;
26
 
 
27
 
{$UNDEF INTERFACE}
28
 
{$ENDIF}
29
 
 
30
 
{$IFDEF IMPLEMENTATION_USES}
31
 
 
32
 
  {$DEFINE IMPLEMENTATION_USES}
33
 
  {$I 'GenericMatrix.inc'}
34
 
 
35
 
{$UNDEF IMPLEMENTATION_USES}
36
 
{$ENDIF}
37
 
 
38
 
{$IFDEF IMPLEMENTATION}
39
 
 
40
 
// TGBitmap<TGBitmapIndexX, TGBitmapIndexY, TGBitmapItem>
41
 
{$DEFINE TGMatrixIndexX := TGBitmapIndexX}
42
 
{$DEFINE TGMatrixIndexY := TGBitmapIndexY}
43
 
{$DEFINE TGMatrixItem := TGBitmapItem}
44
 
{$DEFINE TGMatrixIndex := TGBitmapIndex}
45
 
{$DEFINE TGMatrixRow := TGBitmapRow}
46
 
{$DEFINE TGMatrix := TGBitmapMatrix}
47
 
{$DEFINE IMPLEMENTATION}
48
 
{$I 'GenericMatrix.inc'}
49
 
 
50
 
function TGBitmap.GetWidth: TGBitmapIndexX;
51
 
begin
52
 
  Result := Count.X;
53
 
end;
54
 
 
55
 
function TGBitmap.GetHeight: TGBitmapIndexX;
56
 
begin
57
 
  Result := Count.Y;
58
 
end;
59
 
 
60
 
procedure TGBitmap.SetWidth(Value: TGBitmapIndexX);
61
 
begin
62
 
  Count := CreateIndex(Value, Count.Y);
63
 
end;
64
 
 
65
 
procedure TGBitmap.SetHeight(Value: TGBitmapIndexY);
66
 
begin
67
 
  Count := CreateIndex(Count.X, Value);
68
 
end;
69
 
 
70
 
{$UNDEF IMPLEMENTATION}
71
 
{$ENDIF}
72