-
Notifications
You must be signed in to change notification settings - Fork 3
/
OCRTypes.pas
107 lines (88 loc) · 2.84 KB
/
OCRTypes.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
unit OCRTypes;
{==============================================================================]
Copyright (c) 2016, Jarl `slacky` Holta
Project: SimpleOCR
Project URL: https://github.com/WarPie/SimpleOCR
License: GNU Lesser GPL (http://www.gnu.org/licenses/lgpl.html)
[==============================================================================}
{$mode objfpc}{$H+}
{$macro on}
{$inline on}
interface
uses
SysUtils;
type
PParamArray = ^TParamArray;
TParamArray = array[Word] of Pointer;
PPoint = ^TPoint;
TPoint = packed record x,y:Int32; end;
PPointArray = ^TPointArray;
TPointArray = array of TPoint;
PIntArray = ^TIntArray;
TIntArray = array of Int32;
PIntMatrix = ^TIntMatrix;
TIntMatrix = array of TIntArray;
TBoolArray = array of ByteBool;
TBoolMatrix = array of TBoolArray;
TStringArray = array of String;
PBox = ^TBox;
TBox = packed record
X1,Y1,X2,Y2: Int32;
end;
PRGB32 = ^TRGB32;
TRGB32 = packed record
B,G,R,A: UInt8;
end;
//Simba client data --------->>>
TRetData = record
Ptr: PRGB32;
IncPtrWith: Int32;
RowLen: Int32;
end;
PTarget = ^TTarget;
TTarget = record
Target: Pointer;
//client
GetTargetDim: procedure(target: Pointer; var w,h: Int32); stdcall;
GetTargetPos: procedure(target: Pointer; var top,left: Int32); stdcall;
GetColor: function (target: Pointer; x,y: Int32): Int32; stdcall;
ReturnData: function (target: Pointer; xs,ys, width,height: Int32): TRetData; stdcall;
FreeReturnData: procedure(target: Pointer); stdcall;
//mouse
GetMousePos: procedure(target: Pointer; var x,y: Int32); stdcall;
MoveMouse: procedure(target: Pointer; x,y: Int32); stdcall;
ScrollMouse: procedure(target: Pointer; x,y: Int32; Lines: Int32); stdcall;
HoldMouse: procedure(target: Pointer; x,y: Int32; left: Boolean); stdcall;
ReleaseMouse: procedure(target: Pointer; x,y: Int32; left: Boolean); stdcall;
//keybd
SendString: procedure(target: Pointer; str: PChar; keywait,keymodwait: Int32); stdcall;
HoldKey: procedure(target: Pointer; key: Int32); stdcall;
ReleaseKey: procedure(target: Pointer; key: Int32); stdcall;
IsKeyHeld: function (target: Pointer; key: Int32): Boolean; stdcall;
GetKeyCode: function (target: Pointer; C: Char): Int32; stdcall;
end;
//end
function RGB32(RGB:Int32): TRGB32; inline;
function Point(x,y:Int32): TPoint; inline;
function Box(x1,y1,x2,y2:Int32): TBox; inline;
implementation
function RGB32(RGB:Int32): TRGB32;
begin
Result.R := RGB and $ff;
Result.G := RGB shr 8 and $ff;
Result.B := RGB shr 16 and $ff;
Result.A := 0;
end;
function Point(x,y:Int32): TPoint;
begin
Result.x := x;
Result.y := y;
end;
function Box(x1,y1,x2,y2:Int32): TBox;
begin
Result.x1 := x1;
Result.y1 := y1;
Result.x2 := x2;
Result.y2 := y2;
end;
end.