-
Notifications
You must be signed in to change notification settings - Fork 828
/
Mat.h
133 lines (121 loc) · 3.79 KB
/
Mat.h
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
#include "coreUtils.h"
#include "matUtils.h"
#include "Vec.h"
#include "Point2.h"
#include "Rect.h"
#include "RotatedRect.h"
#include "CatchCvExceptionWorker.h"
#include "macros.h"
#include "NativeNodeUtils.h"
#include "ExternalMemTracking.h"
#ifndef __FF_MAT_H__
#define __FF_MAT_H__
class Mat : public FF::ObjectWrap<Mat, cv::Mat> {
public:
static Nan::Persistent<v8::FunctionTemplate> constructor;
static const char* getClassName() {
return "Mat";
}
static NAN_MODULE_INIT(Init);
FF_GETTER(rows, FF::IntConverter);
FF_GETTER(cols, FF::IntConverter);
FF_GETTER_CUSTOM(type, FF::IntConverter, self.type());
FF_GETTER_CUSTOM(channels, FF::IntConverter, self.channels());
FF_GETTER_CUSTOM(dims, FF::IntConverter, self.dims);
FF_GETTER_CUSTOM(depth, FF::IntConverter, self.depth());
FF_GETTER_CUSTOM(empty, FF::IntConverter, self.empty());
static NAN_GETTER(GetElemSize) {
info.GetReturnValue().Set((int)Mat::unwrapSelf(info).elemSize());
};
static NAN_GETTER(GetStep) {
info.GetReturnValue().Set((int)Mat::unwrapSelf(info).step.operator size_t());
};
static NAN_GETTER(GetSizes) {
cv::Mat m = Mat::unwrapSelf(info);
std::vector<int> sizes;
for (int s = 0; s < m.dims; s++) {
sizes.push_back(m.size[s]);
}
info.GetReturnValue().Set(FF::IntArrayConverter::wrap(sizes));
};
FF_INIT_MAT_OPERATIONS();
static NAN_METHOD(Dot) {
FF_OPERATOR_RET_SCALAR(&cv::Mat::dot, FF_APPLY_CLASS_FUNC, Mat, "Dot");
}
static NAN_METHOD(New);
static NAN_METHOD(Eye);
static NAN_METHOD(FlattenFloat);
static NAN_METHOD(At);
static NAN_METHOD(AtRaw);
static NAN_METHOD(Set);
static NAN_METHOD(SetTo);
static NAN_METHOD(SetToAsync);
static NAN_METHOD(GetDataAsArray);
static NAN_METHOD(GetRegion);
static NAN_METHOD(Norm);
static NAN_METHOD(Row);
static NAN_METHOD(Release);
static NAN_METHOD(PushBack);
static NAN_METHOD(PushBackAsync);
static NAN_METHOD(PopBack);
static NAN_METHOD(PopBackAsync);
static NAN_METHOD(GetData);
static NAN_METHOD(GetDataAsync);
static NAN_METHOD(Copy);
static NAN_METHOD(CopyAsync);
static NAN_METHOD(CopyTo);
static NAN_METHOD(CopyToAsync);
static NAN_METHOD(ConvertTo);
static NAN_METHOD(ConvertToAsync);
static NAN_METHOD(PadToSquare);
static NAN_METHOD(PadToSquareAsync);
static NAN_METHOD(Dct);
static NAN_METHOD(DctAsync);
static NAN_METHOD(Idct);
static NAN_METHOD(IdctAsync);
static NAN_METHOD(Dft);
static NAN_METHOD(DftAsync);
static NAN_METHOD(Idft);
static NAN_METHOD(IdftAsync);
static NAN_METHOD(Flip);
static NAN_METHOD(FlipAsync);
static NAN_METHOD(CopyMakeBorder);
static NAN_METHOD(CopyMakeBorderAsync);
#if CV_VERSION_GREATER_EQUAL(3, 2, 0)
static NAN_METHOD(Rotate);
static NAN_METHOD(RotateAsync);
#endif
static NAN_METHOD(AddWeighted);
static NAN_METHOD(AddWeightedAsync);
static NAN_METHOD(MinMaxLoc);
static NAN_METHOD(MinMaxLocAsync);
static NAN_METHOD(FindNonZero);
static NAN_METHOD(FindNonZeroAsync);
static NAN_METHOD(CountNonZero);
static NAN_METHOD(CountNonZeroAsync);
static NAN_METHOD(Normalize);
static NAN_METHOD(NormalizeAsync);
static NAN_METHOD(Split);
static NAN_METHOD(SplitAsync);
static NAN_METHOD(MulSpectrums);
static NAN_METHOD(MulSpectrumsAsync);
static NAN_METHOD(Transform);
static NAN_METHOD(TransformAsync);
static NAN_METHOD(PerspectiveTransform);
static NAN_METHOD(PerspectiveTransformAsync);
static NAN_METHOD(Sum);
static NAN_METHOD(SumAsync);
static NAN_METHOD(ConvertScaleAbs);
static NAN_METHOD(ConvertScaleAbsAsync);
static NAN_METHOD(Mean);
static NAN_METHOD(MeanAsync);
static NAN_METHOD(MeanStdDev);
static NAN_METHOD(MeanStdDevAsync);
static NAN_METHOD(Reduce);
static NAN_METHOD(ReduceAsync);
static NAN_METHOD(Eigen);
static NAN_METHOD(EigenAsync);
static NAN_METHOD(Solve);
static NAN_METHOD(SolveAsync);
};
#endif