Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 8ed4b3b

Browse files
Merge pull request justadudewhohacks#280 from nicholasc/getBuildInformation
Implemented getBuildInformation
2 parents cd93f96 + 1bbff74 commit 8ed4b3b

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

cc/core/core.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ NAN_MODULE_INIT(Core::Init) {
3333
RotatedRect::Init(target);
3434
TermCriteria::Init(target);
3535

36+
Nan::SetMethod(target, "getBuildInformation", GetBuildInformation);
3637
Nan::SetMethod(target, "partition", Partition);
3738
Nan::SetMethod(target, "kmeans", Kmeans);
3839
Nan::SetMethod(target, "cartToPolar", CartToPolar);
@@ -41,6 +42,13 @@ NAN_MODULE_INIT(Core::Init) {
4142
Nan::SetMethod(target, "polarToCartAsync", PolarToCartAsync);
4243
};
4344

45+
NAN_METHOD(Core::GetBuildInformation) {
46+
FF_METHOD_CONTEXT("Core::GetBuildInformation");
47+
48+
v8::Local<v8::Value> ret = FF_NEW_STRING(cv::getBuildInformation());
49+
FF_RETURN(ret);
50+
}
51+
4452
NAN_METHOD(Core::Partition) {
4553
FF_METHOD_CONTEXT("Core::Partition");
4654
FF_ARG_ARRAY(0, FF_ARR jsData);

cc/core/core.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Core : public Nan::ObjectWrap {
1515
public:
1616
static NAN_MODULE_INIT(Init);
1717

18+
static NAN_METHOD(GetBuildInformation);
1819
static NAN_METHOD(Partition);
1920
static NAN_METHOD(Kmeans);
2021
static NAN_METHOD(CartToPolar);
@@ -23,4 +24,4 @@ class Core : public Nan::ObjectWrap {
2324
static NAN_METHOD(PolarToCartAsync);
2425
};
2526

26-
#endif
27+
#endif

lib/typings/cv.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export function findHomography(srcPoints: Point2[], dstPoints: Point2[], method?
5959
export function fitLine(points: Point2[], distType: number, param: number, reps: number, aeps: number): number[];
6060
export function fitLine(points: Point3[], distType: number, param: number, reps: number, aeps: number): number[];
6161
export function getAffineTransform(srcPoints: Point2[], dstPoints: Point2[]): Mat;
62+
export function getBuildInformation(): string;
6263
export function getPerspectiveTransform(srcPoints: Point2[], dstPoints: Point2[]): Mat;
6364
export function getRotationMatrix2D(center: Point2, angle: number, scale?: number): Mat;
6465
export function getStructuringElement(shape: number, kernelSize: Size, anchor?: Point2): Mat;

test/tests/core/core.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ const partitionTests = (createInstance) => {
3434
};
3535

3636
describe('core', () => {
37+
describe('getBuildInformation', () => {
38+
generateAPITests({
39+
getDut: () => cv,
40+
methodName: 'getBuildInformation',
41+
hasAsync: false,
42+
expectOutput: () => {}
43+
});
44+
});
45+
3746
describe('partition', () => {
3847
funcShouldRequireArgs(() => cv.partition());
3948

0 commit comments

Comments
 (0)