Skip to content

Commit

Permalink
With previous commit, TSimbaImage can be renamed to TImage
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Jul 30, 2023
1 parent 32fdaad commit 8cb4865
Show file tree
Hide file tree
Showing 13 changed files with 382 additions and 382 deletions.
28 changes: 14 additions & 14 deletions Source/script/imports/simba/simba.import_debugimage.pas
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,13 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
addGlobalFunc('procedure ShowDebugImage(Width, Height: Integer); overload;', @_LapeShowDebugImage1);
addGlobalFunc('procedure ShowDebugImage(X, Y, Width, Height: Integer); overload;', @_LapeShowDebugImage2);
addGlobalFunc('procedure HideDebugImage;', @_LapeHideDebugImage);
addGlobalFunc('procedure UpdateDebugImage(Bitmap: TSimbaImage);', @_LapeUpdateDebugImage);
addGlobalFunc('procedure Show(Bitmap: TSimbaImage; EnsureVisible: Boolean = True);', @_LapeShowBitmap);
addGlobalFunc('procedure UpdateDebugImage(Bitmap: TImage);', @_LapeUpdateDebugImage);
addGlobalFunc('procedure Show(Bitmap: TImage; EnsureVisible: Boolean = True);', @_LapeShowBitmap);

ImportingSection := 'TSimbaImage';
ImportingSection := 'TImage';

addGlobalFunc(
'procedure TSimbaImage.Show(EnsureVisible: Boolean = True);', [
'procedure TImage.Show(EnsureVisible: Boolean = True);', [
'begin',
' Show(Self, EnsureVisible);',
'end;'
Expand All @@ -212,7 +212,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
addGlobalFunc(
'procedure Show(Matrix: TIntegerMatrix); overload;', [
'begin',
' with TSimbaImage.Create(Matrix.Width(), Matrix.Height()) do',
' with TImage.Create(Matrix.Width(), Matrix.Height()) do',
' try',
' DrawMatrix(Matrix);',
' Show();',
Expand All @@ -225,7 +225,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
addGlobalFunc(
'procedure Show(Matrix: TSingleMatrix; ColorMapID: Integer = 0); overload;', [
'begin',
' with TSimbaImage.Create(Matrix.Width(), Matrix.Height()) do',
' with TImage.Create(Matrix.Width(), Matrix.Height()) do',
' try',
' DrawMatrix(Matrix, ColorMapID);',
' Show();',
Expand All @@ -239,7 +239,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
'procedure Show(Boxes: TBoxArray; Filled: Boolean = False); overload;', [
'begin',
' with Boxes.Merge() do',
' with TSimbaImage.Create(X1+X2+1, Y1+Y2+1) do',
' with TImage.Create(X1+X2+1, Y1+Y2+1) do',
' try',
' DrawBoxArray(Boxes, Filled);',
' Show();',
Expand All @@ -260,7 +260,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
'procedure Show(TPA: TPointArray; Color: Integer = $0000FF); overload;', [
'begin',
' with TPA.Bounds() do',
' with TSimbaImage.Create(X1+X2+1, Y1+Y2+1) do',
' with TImage.Create(X1+X2+1, Y1+Y2+1) do',
' try',
' DrawTPA(TPA, Color);',
' Show();',
Expand All @@ -274,7 +274,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
'procedure Show(ATPA: T2DPointArray; Color: Integer = $0000FF); overload;', [
'begin',
' with ATPA.Bounds() do',
' with TSimbaImage.Create(X1+X2+1, Y1+Y2+1) do',
' with TImage.Create(X1+X2+1, Y1+Y2+1) do',
' try',
' DrawATPA(ATPA);',
' Show();',
Expand All @@ -294,7 +294,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
' Boxes += Quad.Bounds();',
'',
' with Boxes.Merge() do',
' with TSimbaImage.Create(X1+X2+1, Y1+Y2+1) do',
' with TImage.Create(X1+X2+1, Y1+Y2+1) do',
' try',
' DrawQuadArray(Quads, Filled);',
' Show();',
Expand All @@ -314,7 +314,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
addGlobalFunc(
'procedure ShowOnClient(Quads: TQuadArray; Filled: Boolean = False); overload;', [
'begin',
' with TSimbaImage.CreateFromTarget() do',
' with TImage.CreateFromTarget() do',
' try',
' DrawQuadArray(Quads, Filled);',
' Show();',
Expand All @@ -334,7 +334,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
addGlobalFunc(
'procedure ShowOnClient(Boxes: TBoxArray; Filled: Boolean = False); overload;', [
'begin',
' with TSimbaImage.CreateFromTarget() do',
' with TImage.CreateFromTarget() do',
' try',
' DrawBoxArray(Boxes, Filled);',
' Show();',
Expand All @@ -354,7 +354,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
addGlobalFunc(
'procedure ShowOnClient(TPA: TPointArray; Color: Integer = $0000FF); overload;', [
'begin',
' with TSimbaImage.CreateFromTarget() do',
' with TImage.CreateFromTarget() do',
' try',
' DrawTPA(TPA, Color);',
' Show();',
Expand All @@ -367,7 +367,7 @@ procedure ImportDebugImage(Compiler: TSimbaScript_Compiler);
addGlobalFunc(
'procedure ShowOnClient(ATPA: T2DPointArray; Color: Integer = $0000FF); overload;', [
'begin',
' with TSimbaImage.CreateFromTarget() do',
' with TImage.CreateFromTarget() do',
' try',
' DrawATPA(ATPA);',
' Show();',
Expand Down
14 changes: 7 additions & 7 deletions Source/script/imports/simba/simba.import_finder.pas
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,12 @@ procedure ImportFinder(Compiler: TSimbaScript_Compiler);
addInputMethod('function TSimbaFinder.FindDTM(DTM: TDTM; Bounds: TBox = [-1,-1,-1,-1]): TPoint', @_LapeSimbaFinder_FindDTM);
addInputMethod('function TSimbaFinder.FindDTMRotated(DTM: TDTM; StartDegrees, EndDegrees: Double; Step: Double; out FoundDegrees: TDoubleArray; Bounds: TBox = [-1,-1,-1,-1]): TPoint', @_LapeSimbaFinder_FindDTMRotated);

addInputMethod('function TSimbaFinder.FindImageEx(Bitmap: TSimbaImage; Tolerance: Single; MaxToFind: Integer = -1; Bounds: TBox = [-1,-1,-1,-1]): TPointArray; overload', @_LapeSimbaFinder_FindImageEx1);
addInputMethod('function TSimbaFinder.FindImageEx(Bitmap: TSimbaImage; Tolerance: Single; ColorSpace: EColorSpace; Multipliers: TChannelMultipliers; MaxToFind: Integer = -1; Bounds: TBox = [-1,-1,-1,-1]): TPointArray; overload', @_LapeSimbaFinder_FindImageEx2);
addInputMethod('function TSimbaFinder.FindImage(Bitmap: TSimbaImage; Tolerance: Single; Bounds: TBox = [-1,-1,-1,-1]): TPoint; overload', @_LapeSimbaFinder_FindImage1);
addInputMethod('function TSimbaFinder.FindImage(Bitmap: TSimbaImage; Tolerance: Single; ColorSpace: EColorSpace; Multipliers: TChannelMultipliers; Bounds: TBox = [-1,-1,-1,-1]): TPoint; overload', @_LapeSimbaFinder_FindImage2);
addInputMethod('function TSimbaFinder.FindImageEx(Bitmap: TImage; Tolerance: Single; MaxToFind: Integer = -1; Bounds: TBox = [-1,-1,-1,-1]): TPointArray; overload', @_LapeSimbaFinder_FindImageEx1);
addInputMethod('function TSimbaFinder.FindImageEx(Bitmap: TImage; Tolerance: Single; ColorSpace: EColorSpace; Multipliers: TChannelMultipliers; MaxToFind: Integer = -1; Bounds: TBox = [-1,-1,-1,-1]): TPointArray; overload', @_LapeSimbaFinder_FindImageEx2);
addInputMethod('function TSimbaFinder.FindImage(Bitmap: TImage; Tolerance: Single; Bounds: TBox = [-1,-1,-1,-1]): TPoint; overload', @_LapeSimbaFinder_FindImage1);
addInputMethod('function TSimbaFinder.FindImage(Bitmap: TImage; Tolerance: Single; ColorSpace: EColorSpace; Multipliers: TChannelMultipliers; Bounds: TBox = [-1,-1,-1,-1]): TPoint; overload', @_LapeSimbaFinder_FindImage2);

addInputMethod('function TSimbaFinder.FindTemplate(Bitmap: TSimbaImage; MinMatch: Single; Bounds: TBox = [-1,-1,-1,-1]): TPoint', @_LapeSimbaFinder_FindTemplate);
addInputMethod('function TSimbaFinder.FindTemplate(Bitmap: TImage; MinMatch: Single; Bounds: TBox = [-1,-1,-1,-1]): TPoint', @_LapeSimbaFinder_FindTemplate);

addInputMethod('function TSimbaFinder.MatchColor(Color: TColor; ColorSpace: EColorSpace; Multipliers: TChannelMultipliers; Bounds: TBox = [-1,-1,-1,-1]): TSingleMatrix', @_LapeSimbaFinder_MatchColor);

Expand All @@ -427,10 +427,10 @@ procedure ImportFinder(Compiler: TSimbaScript_Compiler);
addInputMethod('function TSimbaFinder.AverageBrightness(Area: TBox = [-1,-1,-1,-1]): Integer', @_LapeSimbaFinder_AverageBrightness);
addInputMethod('function TSimbaFinder.PeakBrightness(Area: TBox = [-1,-1,-1,-1]): Integer', @_LapeSimbaFinder_PeakBrightness);

ImportingSection := 'TSimbaImage';
ImportingSection := 'TImage';

addGlobalFunc(
'function TSimbaImage.Finder: TSimbaFinder;', [
'function TImage.Finder: TSimbaFinder;', [
'begin',
' Result.Target.SetImage(Self);',
'end;'
Expand Down
8 changes: 4 additions & 4 deletions Source/script/imports/simba/simba.import_matchtemplate.pas
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,17 @@ procedure ImportMatchTemplate(Compiler: TSimbaScript_Compiler);
addGlobalType('(TM_CCORR, TM_CCORR_NORMED, TM_CCOEFF, TM_CCOEFF_NORMED, TM_SQDIFF, TM_SQDIFF_NORMED)', 'ETMFormula');

addGlobalFunc('function TMatchTemplateCache.Create(Image, Template: TIntegerMatrix; Formula: ETMFormula): TMatchTemplateCache; static; overload', @_LapeMatchTemplateCache_Create);
addGlobalFunc('function TMatchTemplateCache.Create(Image, Template: TSimbaImage; Formula: ETMFormula): TMatchTemplateCache; static; overload', @_LapeMatchTemplateCache_CreateEx);
addGlobalFunc('function TMatchTemplateCache.Create(Image, Template: TImage; Formula: ETMFormula): TMatchTemplateCache; static; overload', @_LapeMatchTemplateCache_CreateEx);
addGlobalFunc('procedure TMatchTemplateCache.FreeOnTerminate(Enable: Boolean);', @_LapeMatchTemplateCache_FreeOnTerminate);

addGlobalFunc('function MatchTemplateMask(Cache: TMatchTemplateCache; Template: TIntegerMatrix; Formula: ETMFormula): TSingleMatrix; overload', @_LapeMatchTemplateMaskCache);
addGlobalFunc('function MatchTemplateMask(Cache: TMatchTemplateCache; Template: TSimbaImage; Formula: ETMFormula): TSingleMatrix; overload', @_LapeMatchTemplateMaskCacheEx);
addGlobalFunc('function MatchTemplateMask(Cache: TMatchTemplateCache; Template: TImage; Formula: ETMFormula): TSingleMatrix; overload', @_LapeMatchTemplateMaskCacheEx);
addGlobalFunc('function MatchTemplateMask(Image, Template: TIntegerMatrix; Formula: ETMFormula): TSingleMatrix; overload', @_LapeMatchTemplateMask);

addGlobalFunc('function MatchTemplate(Image, Template: TIntegerMatrix; Formula: ETMFormula): TSingleMatrix', @_LapeMatchTemplate);

addGlobalFunc('function TSimbaImage.MatchTemplate(Template: TSimbaImage; Formula: ETMFormula): TSingleMatrix;', @_LapeMufasaBitmap_MatchTemplate);
addGlobalFunc('function TSimbaImage.MatchTemplateMask(Template: TSimbaImage; Formula: ETMFormula): TSingleMatrix;', @_LapeMufasaBitmap_MatchTemplateMask);
addGlobalFunc('function TImage.MatchTemplate(Template: TImage; Formula: ETMFormula): TSingleMatrix;', @_LapeMufasaBitmap_MatchTemplate);
addGlobalFunc('function TImage.MatchTemplateMask(Template: TImage; Formula: ETMFormula): TSingleMatrix;', @_LapeMufasaBitmap_MatchTemplateMask);

ImportingSection := '';
end;
Expand Down
22 changes: 11 additions & 11 deletions Source/script/imports/simba/simba.import_target.pas
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,11 @@ procedure ImportTarget(Compiler: TSimbaScript_Compiler);
addGlobalFunc('function TSimbaTarget.GetClientArea: TBox', @_LapeSimbaTarget_GetClientArea);

addGlobalFunc('procedure TSimbaTarget.SetDesktop', @_LapeSimbaTarget_SetDesktop);
addGlobalFunc('procedure TSimbaTarget.SetImage(TSimbaImage: TSimbaImage)', @_LapeSimbaTarget_SetImage);
addGlobalFunc('procedure TSimbaTarget.SetImage(TImage: TImage)', @_LapeSimbaTarget_SetImage);
addGlobalFunc('procedure TSimbaTarget.SetWindow(Window: TWindowHandle)', @_LapeSimbaTarget_SetWindow);
addGlobalFunc('procedure TSimbaTarget.SetEIOS(Plugin, Args: String)', @_LapeSimbaTarget_SetEIOS);

addGlobalFunc('function TSimbaTarget.GetImage(Bounds: TBox = [-1,-1,-1,-1]): TSimbaImage', @_LapeSimbaTarget_GetImage);
addGlobalFunc('function TSimbaTarget.GetImage(Bounds: TBox = [-1,-1,-1,-1]): TImage', @_LapeSimbaTarget_GetImage);
addGlobalFunc('procedure TSimbaTarget.GetDimensions(out Width, Height: Integer)', @_LapeSimbaTarget_GetDimensions);
addGlobalFunc('function TSimbaTarget.GetWidth: Integer', @_LapeSimbaTarget_GetWidth);
addGlobalFunc('function TSimbaTarget.GetHeight: Integer', @_LapeSimbaTarget_GetHeight);
Expand All @@ -291,41 +291,41 @@ procedure ImportTarget(Compiler: TSimbaScript_Compiler);
addGlobalFunc('function TSimbaTarget.IsWindowTarget: Boolean; overload', @_LapeSimbaTarget_IsWindowTarget1);
addGlobalFunc('function TSimbaTarget.IsWindowTarget(out Window: TWindowHandle): Boolean; overload', @_LapeSimbaTarget_IsWindowTarget2);
addGlobalFunc('function TSimbaTarget.IsImageTarget: Boolean; overload', @_LapeSimbaTarget_IsImageTarget1);
addGlobalFunc('function TSimbaTarget.IsImageTarget(out TSimbaImage: TSimbaImage): Boolean; overload', @_LapeSimbaTarget_IsImageTarget2);
addGlobalFunc('function TSimbaTarget.IsImageTarget(out TImage: TImage): Boolean; overload', @_LapeSimbaTarget_IsImageTarget2);
addGlobalFunc('function TSimbaTarget.IsEIOSTarget: Boolean', @_LapeSimbaTarget_IsEIOSTarget);

addGlobalFunc('function TSimbaTarget.IsDefault: Boolean', @_LapeSimbaTarget_IsDefault);

addGlobalFunc('function ToString(constref Target: TSimbaTarget): String; override;', @_LapeSimbaTarget_ToString);


ImportingSection := 'TSimbaImage';
ImportingSection := 'TImage';

addGlobalFunc(
'function TSimbaImage.CreateFromTarget(Target: TSimbaTarget; Bounds: TBox = [-1,-1,-1,-1]): TSimbaImage; static; overload;', [
'function TImage.CreateFromTarget(Target: TSimbaTarget; Bounds: TBox = [-1,-1,-1,-1]): TImage; static; overload;', [
'begin',
' Result := Target.GetImage(Bounds);',
'end;'
]);
addGlobalFunc(
'function TSimbaImage.CreateFromTarget(Bounds: TBox = [-1,-1,-1,-1]): TSimbaImage; static; overload;', [
'function TImage.CreateFromTarget(Bounds: TBox = [-1,-1,-1,-1]): TImage; static; overload;', [
'begin',
' Result := TSimbaImage.CreateFromTarget(System.Target, Bounds);',
' Result := TImage.CreateFromTarget(System.Target, Bounds);',
'end;'
]);

addGlobalFunc(
'procedure TSimbaImage.DrawTarget(Target: TSimbaTarget; P: TPoint; Bounds: TBox = [-1,-1,-1,-1]); overload;', [
'procedure TImage.DrawTarget(Target: TSimbaTarget; P: TPoint; Bounds: TBox = [-1,-1,-1,-1]); overload;', [
'var',
' Image: TSimbaImage;',
' Image: TImage;',
'begin',
' Image := TSimbaImage.CreateFromTarget(Target, Bounds);',
' Image := TImage.CreateFromTarget(Target, Bounds);',
' Self.Draw(Image, P);',
' Image.Free();',
'end;'
]);
addGlobalFunc(
'procedure TSimbaImage.DrawTarget(P: TPoint; Bounds: TBox = [-1,-1,-1,-1]); overload;', [
'procedure TImage.DrawTarget(P: TPoint; Bounds: TBox = [-1,-1,-1,-1]); overload;', [
'begin',
' Self.DrawTarget(System.Target, P, Bounds);',
'end;'
Expand Down
Loading

0 comments on commit 8cb4865

Please sign in to comment.