Skip to content

Commit df863ea

Browse files
committed
chore: reintroduce magnitude
merge master into PR118, uncomment changes from commit:fa5e99c
1 parent 81ad906 commit df863ea

File tree

5 files changed

+13
-17
lines changed

5 files changed

+13
-17
lines changed

cc/core/core.cc

+8-8
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ NAN_MODULE_INIT(Core::Init) {
6565
Nan::SetMethod(target, "solve", Solve);
6666
Nan::SetMethod(target, "solveAsync", SolveAsync);
6767

68-
// Nan::SetMethod(target, "magnitude", Magnitude);
69-
// Nan::SetMethod(target, "magnitudeAsync", MagnitudeAsync);
68+
Nan::SetMethod(target, "magnitude", Magnitude);
69+
Nan::SetMethod(target, "magnitudeAsync", MagnitudeAsync);
7070

7171
Nan::SetMethod(target, "getTickFrequency", GetTickFrequency);
7272
Nan::SetMethod(target, "getTickCount", GetTickCount);
@@ -407,13 +407,13 @@ NAN_METHOD(Core::SolveAsync) {
407407
FF::asyncBinding<CoreBindings::Solve>("Core", "Solve", info);
408408
}
409409

410-
// NAN_METHOD(Core::Magnitude) {
411-
// FF::syncBinding<CoreBindings::Magnitude>("Core", "Magnitude", info);
412-
// }
410+
NAN_METHOD(Core::Magnitude) {
411+
FF::syncBinding<CoreBindings::Magnitude>("Core", "Magnitude", info);
412+
}
413413

414-
// NAN_METHOD(Core::MagnitudeAsync) {
415-
// FF::asyncBinding<CoreBindings::Magnitude>("Core", "Magnitude", info);
416-
// }
414+
NAN_METHOD(Core::MagnitudeAsync) {
415+
FF::asyncBinding<CoreBindings::Magnitude>("Core", "Magnitude", info);
416+
}
417417

418418
NAN_METHOD(Core::GetTickFrequency) {
419419
info.GetReturnValue().Set(FF::IntConverter::wrap(cv::getTickFrequency()));

cc/core/core.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class Core : public Nan::ObjectWrap {
6363
static NAN_METHOD(EigenAsync);
6464
static NAN_METHOD(Solve);
6565
static NAN_METHOD(SolveAsync);
66-
// static NAN_METHOD(Magnitude);
67-
// static NAN_METHOD(MagnitudeAsync);
66+
static NAN_METHOD(Magnitude);
67+
static NAN_METHOD(MagnitudeAsync);
6868

6969
static NAN_METHOD(GetTickFrequency);
7070
static NAN_METHOD(GetTickCount);

cc/core/coreBindings.h

+1-3
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,7 @@ namespace CoreBindings {
285285
};
286286
};
287287

288-
/*
289-
class Magnitude: public CvBinding {
288+
class Magnitude : public CvBinding {
290289
public:
291290
void setup() {
292291
auto x = req<Mat::Converter>();
@@ -298,7 +297,6 @@ namespace CoreBindings {
298297
};
299298
};
300299
};
301-
*/
302300

303301
}
304302

test/tests/core/coreTests.ts

-2
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,6 @@ export default function (args: TestContext) {
764764
describe('Solve y = x equation on Id = X Id', makeTest([[1, 2], [3, 4]], [[5, 6], [7, 8]], cv.DECOMP_LU, [[-3, -4], [4, 5]]));
765765
});
766766

767-
/*
768767
describe('magnitude', () => {
769768
const x = new cv.Mat([[0, 1]], cv.CV_32F);
770769
const y = new cv.Mat([[0, -1]], cv.CV_32F);
@@ -783,6 +782,5 @@ export default function (args: TestContext) {
783782
expectOutput,
784783
});
785784
});
786-
*/
787785

788786
}

typings/cv.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,5 @@ export function minAsync(src1: Mat, src2: Mat, dst: Mat): Promise<Mat>;
221221
export function max(src1: Mat, src2: Mat, dst: Mat): Mat;
222222
export function maxAsync(src1: Mat, src2: Mat, dst: Mat): Promise<Mat>;
223223

224-
// export function magnitude(x: Mat, y: Mat, magnitude: Mat): Mat;
225-
// export function magnitudeAsync(x: Mat, y: Mat, magnitude: Mat): Promise<Mat>;
224+
export function magnitude(x: Mat, y: Mat, magnitude: Mat): Mat;
225+
export function magnitudeAsync(x: Mat, y: Mat, magnitude: Mat): Promise<Mat>;

0 commit comments

Comments
 (0)