Skip to content

Commit 24bff92

Browse files
Merge pull request justadudewhohacks#729 from lolikung/master
Add putTextAsync method
2 parents 0725d42 + 1cba511 commit 24bff92

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

cc/imgproc/MatImgproc.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ void MatImgproc::Init(v8::Local<v8::FunctionTemplate> ctor) {
6060
Nan::SetPrototypeMethod(ctor, "drawFillPoly", DrawFillPoly);
6161
Nan::SetPrototypeMethod(ctor, "drawFillConvexPoly", DrawFillConvexPoly);
6262
Nan::SetPrototypeMethod(ctor, "putText", PutText);
63+
Nan::SetPrototypeMethod(ctor, "putTextAsync", PutTextAsync);
6364
Nan::SetPrototypeMethod(ctor, "matchTemplate", MatchTemplate);
6465
Nan::SetPrototypeMethod(ctor, "matchTemplateAsync", MatchTemplateAsync);
6566
Nan::SetPrototypeMethod(ctor, "canny", Canny);
@@ -546,6 +547,14 @@ NAN_METHOD(MatImgproc::PutText) {
546547
);
547548
}
548549

550+
NAN_METHOD(MatImgproc::PutTextAsync) {
551+
FF::executeAsyncBinding(
552+
std::make_shared<MatImgprocBindings::PutTextWorker>(Mat::unwrapSelf(info)),
553+
"Mat::PutTextAsync",
554+
info
555+
);
556+
}
557+
549558
NAN_METHOD(MatImgproc::MatchTemplate) {
550559
FF::executeSyncBinding(
551560
std::make_shared<MatImgprocBindings::MatchTemplateWorker>(Mat::unwrapSelf(info)),

cc/imgproc/MatImgproc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class MatImgproc {
6464
static NAN_METHOD(DrawFillPoly);
6565
static NAN_METHOD(DrawFillConvexPoly);
6666
static NAN_METHOD(PutText);
67+
static NAN_METHOD(PutTextAsync);
6768
static NAN_METHOD(MatchTemplate);
6869
static NAN_METHOD(MatchTemplateAsync);
6970
static NAN_METHOD(Canny);

lib/typings/Mat.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ export class Mat {
245245
pushBack(mat: Mat): Mat;
246246
pushBackAsync(mat: Mat): Promise<Mat>;
247247
putText(text: string, origin: Point2, fontFace: number, fontScale: number, color?: Vec3, thickness?: number, lineType?: number, bottomLeftOrigin?: boolean): void;
248+
putTextAsync(text: string, origin: Point2, fontFace: number, fontScale: number, color?: Vec3, thickness?: number, lineType?: number, bottomLeftOrigin?: boolean): Promise<void>;
248249
pyrDown(size?: Size, borderType?: number): Mat;
249250
pyrDownAsync(size?: Size, borderType?: number): Promise<Mat>;
250251
pyrUp(size?: Size, borderType?: number): Mat;

0 commit comments

Comments
 (0)