Skip to content

Commit

Permalink
Merge pull request justadudewhohacks#280 from nicholasc/getBuildInfor…
Browse files Browse the repository at this point in the history
…mation

Implemented getBuildInformation
  • Loading branch information
justadudewhohacks authored Apr 30, 2018
2 parents cd93f96 + 1bbff74 commit 8ed4b3b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
8 changes: 8 additions & 0 deletions cc/core/core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<v8::Value> 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);
Expand Down
3 changes: 2 additions & 1 deletion cc/core/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -23,4 +24,4 @@ class Core : public Nan::ObjectWrap {
static NAN_METHOD(PolarToCartAsync);
};

#endif
#endif
1 change: 1 addition & 0 deletions lib/typings/cv.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions test/tests/core/core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ const partitionTests = (createInstance) => {
};

describe('core', () => {
describe('getBuildInformation', () => {
generateAPITests({
getDut: () => cv,
methodName: 'getBuildInformation',
hasAsync: false,
expectOutput: () => {}
});
});

describe('partition', () => {
funcShouldRequireArgs(() => cv.partition());

Expand Down

0 comments on commit 8ed4b3b

Please sign in to comment.