source: trunk/Packages/TemplateGenerics/Generic/GenericBitmap.inc

Last change on this file was 18, checked in by chronos, 12 years ago
  • Used external packages are now stored in uncompressed form rather in zipped files. This allow better package version synchronisation.
File size: 2.2 KB
Line 
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 TGMatrixSortCompare := TGBitmapSortCompare}
11{$DEFINE TGMatrixToStringConverter := TGBitmapToStringConverter}
12{$DEFINE TGMatrixFromStringConverter := TGBitmapFromStringConverter}
13{$DEFINE TGMatrixMerge := TGBitmapMerge}
14{$DEFINE INTERFACE}
15{$I 'GenericMatrix.inc'}
16
17 // TGBitmap<TGBitmapIndex, TGBitmapIndex, TGBitmapItem> = class
18 TGBitmap = class(TGMatrix)
19 private
20 function GetWidth: TGBitmapIndexX;
21 function GetHeight: TGBitmapIndexX;
22 procedure SetWidth(Value: TGBitmapIndexX);
23 procedure SetHeight(Value: TGBitmapIndexY);
24 public
25 property Pixels[X: TGBitmapIndexX; Y: TGBitmapIndexY]: TGBitmapItem
26 read GetItemXY write PutItemXY;
27 property Width: TGBitmapIndexX read GetWidth write SetWidth;
28 property Height: TGBitmapIndexY read GetHeight write SetHeight;
29 end;
30
31{$UNDEF INTERFACE}
32{$ENDIF}
33
34{$IFDEF IMPLEMENTATION_USES}
35
36 {$DEFINE IMPLEMENTATION_USES}
37 {$I 'GenericMatrix.inc'}
38
39{$UNDEF IMPLEMENTATION_USES}
40{$ENDIF}
41
42{$IFDEF IMPLEMENTATION}
43
44// TGBitmap<TGBitmapIndexX, TGBitmapIndexY, TGBitmapItem>
45{$DEFINE TGMatrixIndexX := TGBitmapIndexX}
46{$DEFINE TGMatrixIndexY := TGBitmapIndexY}
47{$DEFINE TGMatrixItem := TGBitmapItem}
48{$DEFINE TGMatrixIndex := TGBitmapIndex}
49{$DEFINE TGMatrixRow := TGBitmapRow}
50{$DEFINE TGMatrix := TGBitmapMatrix}
51{$DEFINE TGMatrixSortCompare := TGBitmapSortCompare}
52{$DEFINE TGMatrixToStringConverter := TGBitmapToStringConverter}
53{$DEFINE TGMatrixFromStringConverter := TGBitmapFromStringConverter}
54{$DEFINE TGMatrixMerge := TGBitmapMerge}
55{$DEFINE IMPLEMENTATION}
56{$I 'GenericMatrix.inc'}
57
58function TGBitmap.GetWidth: TGBitmapIndexX;
59begin
60 Result := Count.X;
61end;
62
63function TGBitmap.GetHeight: TGBitmapIndexX;
64begin
65 Result := Count.Y;
66end;
67
68procedure TGBitmap.SetWidth(Value: TGBitmapIndexX);
69begin
70 Count := CreateIndex(Value, Count.Y);
71end;
72
73procedure TGBitmap.SetHeight(Value: TGBitmapIndexY);
74begin
75 Count := CreateIndex(Count.X, Value);
76end;
77
78{$UNDEF IMPLEMENTATION}
79{$ENDIF}
80
Note: See TracBrowser for help on using the repository browser.