diff --git a/cc/core/core.cc b/cc/core/core.cc index 0fd47fc68..b3d1ee813 100644 --- a/cc/core/core.cc +++ b/cc/core/core.cc @@ -33,6 +33,7 @@ NAN_MODULE_INIT(Core::Init) { RotatedRect::Init(target); TermCriteria::Init(target); + Nan::SetMethod(target, "getBuildInformation", GetBuildInformation); Nan::SetMethod(target, "partition", Partition); Nan::SetMethod(target, "kmeans", Kmeans); Nan::SetMethod(target, "cartToPolar", CartToPolar); @@ -41,6 +42,13 @@ NAN_MODULE_INIT(Core::Init) { Nan::SetMethod(target, "polarToCartAsync", PolarToCartAsync); }; +NAN_METHOD(Core::GetBuildInformation) { + FF_METHOD_CONTEXT("Core::GetBuildInformation"); + + v8::Local ret = FF_NEW_STRING(cv::getBuildInformation()); + FF_RETURN(ret); +} + NAN_METHOD(Core::Partition) { FF_METHOD_CONTEXT("Core::Partition"); FF_ARG_ARRAY(0, FF_ARR jsData); diff --git a/cc/core/core.h b/cc/core/core.h index 460949742..5d12b9b3f 100644 --- a/cc/core/core.h +++ b/cc/core/core.h @@ -15,6 +15,7 @@ class Core : public Nan::ObjectWrap { public: static NAN_MODULE_INIT(Init); + static NAN_METHOD(GetBuildInformation); static NAN_METHOD(Partition); static NAN_METHOD(Kmeans); static NAN_METHOD(CartToPolar); @@ -23,4 +24,4 @@ class Core : public Nan::ObjectWrap { static NAN_METHOD(PolarToCartAsync); }; -#endif \ No newline at end of file +#endif diff --git a/lib/typings/cv.d.ts b/lib/typings/cv.d.ts index 14938264c..0f006d423 100644 --- a/lib/typings/cv.d.ts +++ b/lib/typings/cv.d.ts @@ -59,6 +59,7 @@ export function findHomography(srcPoints: Point2[], dstPoints: Point2[], method? export function fitLine(points: Point2[], distType: number, param: number, reps: number, aeps: number): number[]; export function fitLine(points: Point3[], distType: number, param: number, reps: number, aeps: number): number[]; export function getAffineTransform(srcPoints: Point2[], dstPoints: Point2[]): Mat; +export function getBuildInformation(): string; export function getPerspectiveTransform(srcPoints: Point2[], dstPoints: Point2[]): Mat; export function getRotationMatrix2D(center: Point2, angle: number, scale?: number): Mat; export function getStructuringElement(shape: number, kernelSize: Size, anchor?: Point2): Mat; diff --git a/test/tests/core/core.test.js b/test/tests/core/core.test.js index 68507d8d5..aabb109c0 100644 --- a/test/tests/core/core.test.js +++ b/test/tests/core/core.test.js @@ -34,6 +34,15 @@ const partitionTests = (createInstance) => { }; describe('core', () => { + describe('getBuildInformation', () => { + generateAPITests({ + getDut: () => cv, + methodName: 'getBuildInformation', + hasAsync: false, + expectOutput: () => {} + }); + }); + describe('partition', () => { funcShouldRequireArgs(() => cv.partition());