File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ NAN_MODULE_INIT(Io::Init) {
1616 Nan::SetMethod (target, " imshowWait" , ImshowWait);
1717 Nan::SetMethod (target, " imwrite" , Imwrite);
1818 Nan::SetMethod (target, " waitKey" , WaitKey);
19+ Nan::SetMethod (target, " waitKeyEx" , WaitKeyEx);
1920 Nan::SetMethod (target, " imencode" , Imencode);
2021 Nan::SetMethod (target, " imdecode" , Imdecode);
2122 Nan::SetMethod (target, " moveWindow" , MoveWindow);
@@ -105,6 +106,16 @@ NAN_METHOD(Io::WaitKey) {
105106 info.GetReturnValue ().Set (Nan::New (key));
106107}
107108
109+ NAN_METHOD (Io::WaitKeyEx) {
110+ int key;
111+ if (info[0 ]->IsNumber ()) {
112+ key = cv::waitKeyEx (info[0 ]->ToNumber (Nan::GetCurrentContext ()).ToLocalChecked ()->Value ());
113+ } else {
114+ key = cv::waitKeyEx ();
115+ }
116+ info.GetReturnValue ().Set (Nan::New (key));
117+ }
118+
108119NAN_METHOD (Io::MoveWindow) {
109120 FF::TryCatch tryCatch (" Io::MoveWindow" );
110121 std::string winName;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class Io {
1616 static NAN_METHOD (Imshow);
1717 static NAN_METHOD (ImshowWait);
1818 static NAN_METHOD (WaitKey);
19+ static NAN_METHOD (WaitKeyEx);
1920 static NAN_METHOD (MoveWindow);
2021 static NAN_METHOD (DestroyWindow);
2122 static NAN_METHOD (DestroyAllWindows);
@@ -29,4 +30,4 @@ class Io {
2930 static NAN_METHOD (ImdecodeAsync);
3031};
3132
32- #endif
33+ #endif
Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ export function transformAsync(mat: Mat, m: Mat): Promise<Mat>;
205205export function undistortPoints ( srcPoints : Point2 [ ] , cameraMatrix : Mat , distCoeffs : Mat ) : Point2 [ ] ;
206206export function undistortPointsAsync ( srcPoints : Point2 [ ] , cameraMatrix : Mat , distCoeffs : Mat ) : Promise < Point2 [ ] > ;
207207export function waitKey ( delay ?: number ) : number ;
208+ export function waitKeyEx ( delay ?: number ) : number ;
208209
209210export type DrawParams = {
210211 thickness ?: number ;
You can’t perform that action at this time.
0 commit comments