forked from adamgf/react-native-opencv3
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.d.ts
More file actions
141 lines (116 loc) · 2.74 KB
/
index.d.ts
File metadata and controls
141 lines (116 loc) · 2.74 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/**
* [See docs](https://github.com/dmydry/react-native-opencv3
*
* [Repo](https://github.com/dmydry/react-native-opencv3)
*/
interface MatRef {
cols: number;
rows: number;
matIndex: number;
CvType?: typeof CvType;
}
interface ImageMap {
width: number;
height: number;
uri: string;
}
export abstract class RNCv {
public static imageToMat(inPath: string): Promise<MatRef>;
/**
* Android only!
* @param inPath
*/
public static imageReadToMat(inPath: string): Promise<MatRef>;
public static matToImage(srcMat: MatRef, outPath: string): Promise<ImageMap>;
/**
* Android only!
* @param srcMat
* @param outPath
*/
public static matWriteToImage(
srcMat: MatRef,
outPath: string
): Promise<ImageMap>;
public static deleteMat(srcMat: MatRef): void;
public static invokeMethod(method: string, params: {}): void;
public static invokeInOutMethod(
input: string,
method: string,
params: {},
output: string
): void;
public static invokeMethodWithCallback(
input: string,
method: string,
params: {},
output: string,
callback: string
): void;
public static drawLine(
inMat: MatRef,
pt1: CvPoint,
pt2: CvPoint,
scalarVal: CvScalar,
thickness: number,
lineType: number,
): void;
public static cvtColor(
sourceMat: MatRef,
destMat: MatRef,
convColorCode: typeof ColorConv
): void;
}
export class CvPoint {
constructor(xval: number, yval: number);
set(vals: number[]): void;
dot(otherPt: CvPoint): number;
}
export class CvScalar {
constructor(v0val?: number, v1val?: number, v2val?: number, v3val?: number);
static all(allval: number): CvScalar;
set(vals: number[]): void;
}
export class CvSize {
constructor(width?: number, height?: number);
}
export class CvRect {
constructor(top?: number, left?: number, width?: number, height?: number);
static all(allval: number): CvScalar;
set(vals: number[]): void;
}
export const Core: {
[key: string]: number;
};
export const Imgproc: {
[key: string]: number;
};
export const ColorConv: {
[key: string]: number | string;
};
export const CvType: {
[key: string]: number;
};
export class Mat {
constructor(
numRows: number,
numCols: number,
cvtype: typeof CvType,
scalarval?: CvScalar
);
init(): Promise<MatRef>;
setTo(color: CvScalar): void;
}
export class MatOfInt {
constructor(lowintvalue: number, highintvalue: number);
init(): Promise<MatRef>;
}
export class MatOfFloat {
constructor(lowfloatvalue: number, highfloatvalue: number);
init(): Promise<MatRef>;
}
export class CvImage extends React.Component<{ cvinvoke?: {} }> {}
export class CvCamera extends React.Component<{
useStorage?: boolean;
cvinvoke?: {};
facing?: string;
}> {}