| 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 |
|
|---|
| 58 | function TGBitmap.GetWidth: TGBitmapIndexX;
|
|---|
| 59 | begin
|
|---|
| 60 | Result := Count.X;
|
|---|
| 61 | end;
|
|---|
| 62 |
|
|---|
| 63 | function TGBitmap.GetHeight: TGBitmapIndexX;
|
|---|
| 64 | begin
|
|---|
| 65 | Result := Count.Y;
|
|---|
| 66 | end;
|
|---|
| 67 |
|
|---|
| 68 | procedure TGBitmap.SetWidth(Value: TGBitmapIndexX);
|
|---|
| 69 | begin
|
|---|
| 70 | Count := CreateIndex(Value, Count.Y);
|
|---|
| 71 | end;
|
|---|
| 72 |
|
|---|
| 73 | procedure TGBitmap.SetHeight(Value: TGBitmapIndexY);
|
|---|
| 74 | begin
|
|---|
| 75 | Count := CreateIndex(Count.X, Value);
|
|---|
| 76 | end;
|
|---|
| 77 |
|
|---|
| 78 | {$UNDEF IMPLEMENTATION}
|
|---|
| 79 | {$ENDIF}
|
|---|
| 80 |
|
|---|