1
- #include " Size.h"
2
1
#include " coreUtils.h"
3
2
#include " matUtils.h"
4
3
#include " Vec.h"
5
4
#include " Point2.h"
6
5
#include " Rect.h"
7
6
#include " RotatedRect.h"
8
- #include " Converters.h"
9
7
#include " CatchCvExceptionWorker.h"
10
8
#include " macros.h"
9
+ #include " NativeNodeUtils.h"
10
+ #include " ExternalMemTracking.h"
11
11
12
12
#ifndef __FF_MAT_H__
13
13
#define __FF_MAT_H__
14
14
15
15
class Mat : public Nan ::ObjectWrap {
16
16
public:
17
17
cv::Mat mat;
18
-
19
- static NAN_MODULE_INIT (Init);
20
- static NAN_METHOD (New);
21
18
22
- static NAN_METHOD (Eye);
23
- static NAN_METHOD (FlattenFloat);
19
+ static Nan::Persistent<v8::FunctionTemplate> constructor;
20
+
21
+ void setNativeProps (cv::Mat);
22
+
23
+ cv::Mat* getNativeObjectPtr () { return &mat; }
24
+ cv::Mat getNativeObject () { return mat; }
25
+
26
+ typedef InstanceConverter<Mat, cv::Mat> Converter;
27
+
28
+ static const char * getClassName () {
29
+ return " Mat" ;
30
+ }
31
+
32
+ static NAN_MODULE_INIT (Init);
24
33
25
34
static FF_GETTER (Mat, GetRows, mat.rows);
26
35
static FF_GETTER (Mat, GetCols, mat.cols);
@@ -44,134 +53,76 @@ class Mat : public Nan::ObjectWrap {
44
53
info.GetReturnValue ().Set (IntArrayConverter::wrap (sizes));
45
54
};
46
55
47
- static NAN_METHOD (At);
48
- static NAN_METHOD (AtRaw);
49
- static NAN_METHOD (Set);
50
-
51
- struct PushBackWorker ;
52
- static NAN_METHOD (PushBack);
53
- static NAN_METHOD (PushBackAsync);
54
- struct PopBackWorker ;
55
- static NAN_METHOD (PopBack);
56
- static NAN_METHOD (PopBackAsync);
57
-
58
- struct GetDataWorker ;
59
- static NAN_METHOD (GetData);
60
- static NAN_METHOD (GetDataAsync);
61
-
62
- static NAN_METHOD (GetDataAsArray);
63
- static NAN_METHOD (GetRegion);
64
- static NAN_METHOD (Row);
65
-
66
- struct CopyWorker ;
67
- static NAN_METHOD (Copy);
68
- static NAN_METHOD (CopyAsync);
69
-
70
- struct CopyToWorker ;
71
- static NAN_METHOD (CopyTo);
72
- static NAN_METHOD (CopyToAsync);
73
-
74
- struct ConvertToWorker ;
75
- static NAN_METHOD (ConvertTo);
76
- static NAN_METHOD (ConvertToAsync);
77
-
78
- static NAN_METHOD (Norm);
79
- static NAN_METHOD (Normalize);
80
-
81
- struct SplitChannelsWorker ;
82
- static NAN_METHOD (SplitChannels);
83
- static NAN_METHOD (SplitChannelsAsync);
84
-
85
- struct AddWeightedWorker ;
86
- static NAN_METHOD (AddWeighted);
87
- static NAN_METHOD (AddWeightedAsync);
88
-
89
- struct MinMaxLocWorker ;
90
- static NAN_METHOD (MinMaxLoc);
91
- static NAN_METHOD (MinMaxLocAsync);
92
-
93
- struct FindNonZeroWorker ;
94
- static NAN_METHOD (FindNonZero);
95
- static NAN_METHOD (FindNonZeroAsync);
96
-
97
- struct CountNonZeroWorker ;
98
- static NAN_METHOD (CountNonZero);
99
- static NAN_METHOD (CountNonZeroAsync);
100
-
101
- struct PadToSquareWorker ;
102
- static NAN_METHOD (PadToSquare);
103
- static NAN_METHOD (PadToSquareAsync);
104
-
105
- struct SumWorker ;
106
- static NAN_METHOD (Sum);
107
- static NAN_METHOD (SumAsync);
108
-
109
- struct ConvertScaleAbsWorker ;
110
- static NAN_METHOD (ConvertScaleAbs);
111
- static NAN_METHOD (ConvertScaleAbsAsync);
112
-
113
- struct GoodFeaturesToTrackWorker ;
114
- static NAN_METHOD (GoodFeaturesToTrack);
115
- static NAN_METHOD (GoodFeaturesToTrackAsync);
116
-
117
56
FF_INIT_MAT_OPERATIONS ();
118
57
static NAN_METHOD (Dot) {
119
58
FF_OPERATOR_RET_SCALAR (&cv::Mat::dot, FF_APPLY_CLASS_FUNC, FF_UNWRAP_MAT_AND_GET, Mat);
120
59
}
121
60
122
- struct DTWorker ;
123
- struct DCTWorker ;
124
- struct DFTWorker ;
125
- static NAN_METHOD (Dct);
126
- static NAN_METHOD (DctAsync);
127
- static NAN_METHOD (Idct);
128
- static NAN_METHOD (IdctAsync);
129
- static NAN_METHOD (Dft);
130
- static NAN_METHOD (DftAsync);
131
- static NAN_METHOD (Idft);
132
- static NAN_METHOD (IdftAsync);
133
-
134
- struct MulSpectrumsWorker ;
135
- static NAN_METHOD (MulSpectrums);
136
- static NAN_METHOD (MulSpectrumsAsync);
137
-
138
- struct TransformWorker ;
139
- struct PerspectiveTransformWorker ;
140
- static NAN_METHOD (Transform);
141
- static NAN_METHOD (TransformAsync);
142
- static NAN_METHOD (PerspectiveTransform);
143
- static NAN_METHOD (PerspectiveTransformAsync);
144
-
145
- struct OpWithCodeWorker ;
146
- struct FlipWorker ;
147
- static NAN_METHOD (Flip);
148
- static NAN_METHOD (FlipAsync);
149
-
150
- struct MeanStdDevWorker ;
151
- static NAN_METHOD (MeanStdDev);
152
- static NAN_METHOD (MeanStdDevAsync);
153
-
61
+ static NAN_METHOD (New);
62
+ static NAN_METHOD (Eye);
63
+ static NAN_METHOD (FlattenFloat);
64
+ static NAN_METHOD (At);
65
+ static NAN_METHOD (AtRaw);
66
+ static NAN_METHOD (Set);
67
+ static NAN_METHOD (GetDataAsArray);
68
+ static NAN_METHOD (GetRegion);
69
+ static NAN_METHOD (Norm);
70
+ static NAN_METHOD (Normalize);
71
+ static NAN_METHOD (Row);
72
+ static NAN_METHOD (Release);
73
+ static NAN_METHOD (PushBack);
74
+ static NAN_METHOD (PushBackAsync);
75
+ static NAN_METHOD (PopBack);
76
+ static NAN_METHOD (PopBackAsync);
77
+ static NAN_METHOD (GetData);
78
+ static NAN_METHOD (GetDataAsync);
79
+ static NAN_METHOD (Copy);
80
+ static NAN_METHOD (CopyAsync);
81
+ static NAN_METHOD (CopyTo);
82
+ static NAN_METHOD (CopyToAsync);
83
+ static NAN_METHOD (ConvertTo);
84
+ static NAN_METHOD (ConvertToAsync);
85
+ static NAN_METHOD (SplitChannels);
86
+ static NAN_METHOD (SplitChannelsAsync);
87
+ static NAN_METHOD (AddWeighted);
88
+ static NAN_METHOD (AddWeightedAsync);
89
+ static NAN_METHOD (MinMaxLoc);
90
+ static NAN_METHOD (MinMaxLocAsync);
91
+ static NAN_METHOD (FindNonZero);
92
+ static NAN_METHOD (FindNonZeroAsync);
93
+ static NAN_METHOD (CountNonZero);
94
+ static NAN_METHOD (CountNonZeroAsync);
95
+ static NAN_METHOD (PadToSquare);
96
+ static NAN_METHOD (PadToSquareAsync);
97
+ static NAN_METHOD (Dct);
98
+ static NAN_METHOD (DctAsync);
99
+ static NAN_METHOD (Idct);
100
+ static NAN_METHOD (IdctAsync);
101
+ static NAN_METHOD (Dft);
102
+ static NAN_METHOD (DftAsync);
103
+ static NAN_METHOD (Idft);
104
+ static NAN_METHOD (IdftAsync);
105
+ static NAN_METHOD (MulSpectrums);
106
+ static NAN_METHOD (MulSpectrumsAsync);
107
+ static NAN_METHOD (Transform);
108
+ static NAN_METHOD (TransformAsync);
109
+ static NAN_METHOD (PerspectiveTransform);
110
+ static NAN_METHOD (PerspectiveTransformAsync);
111
+ static NAN_METHOD (Flip);
112
+ static NAN_METHOD (FlipAsync);
113
+ static NAN_METHOD (Sum);
114
+ static NAN_METHOD (SumAsync);
115
+ static NAN_METHOD (ConvertScaleAbs);
116
+ static NAN_METHOD (ConvertScaleAbsAsync);
117
+ static NAN_METHOD (GoodFeaturesToTrack);
118
+ static NAN_METHOD (GoodFeaturesToTrackAsync);
119
+ static NAN_METHOD (MeanStdDev);
120
+ static NAN_METHOD (MeanStdDevAsync);
154
121
#if CV_VERSION_MINOR > 1
155
- struct RotateWorker ;
156
- static NAN_METHOD (Rotate);
157
- static NAN_METHOD (RotateAsync);
122
+ static NAN_METHOD (Rotate);
123
+ static NAN_METHOD (RotateAsync);
158
124
#endif
159
125
160
- static NAN_METHOD (Release);
161
-
162
-
163
- static Nan::Persistent<v8::FunctionTemplate> constructor;
164
-
165
- void setNativeProps (cv::Mat);
166
-
167
- cv::Mat* getNativeObjectPtr () { return &mat; }
168
- cv::Mat getNativeObject () { return mat; }
169
-
170
- typedef InstanceConverter<Mat, cv::Mat> Converter;
171
-
172
- static const char * getClassName () {
173
- return " Mat" ;
174
- }
175
126
};
176
127
177
128
#endif
0 commit comments