@@ -91,6 +91,8 @@ NAN_MODULE_INIT(Mat::Init) {
9191 Nan::SetPrototypeMethod (ctor, " meanStdDevAsync" , MeanStdDevAsync);
9292 Nan::SetPrototypeMethod (ctor, " copyMakeBorder" , CopyMakeBorder);
9393 Nan::SetPrototypeMethod (ctor, " copyMakeBorderAsync" , CopyMakeBorderAsync);
94+ Nan::SetPrototypeMethod (ctor, " reduce" , Reduce);
95+ Nan::SetPrototypeMethod (ctor, " reduceAsync" , ReduceAsync);
9496#if CV_VERSION_MINOR > 1
9597 Nan::SetPrototypeMethod (ctor, " rotate" , Rotate);
9698 Nan::SetPrototypeMethod (ctor, " rotateAsync" , RotateAsync);
@@ -191,7 +193,7 @@ NAN_METHOD(Mat::New) {
191193 self->setNativeProps (mat);
192194 }
193195 self->Wrap (info.Holder ());
194-
196+
195197 // if ExternalMemTracking is disabled, the following instruction will be a no op
196198 // notes: I *think* New should be called in JS thread where cv::mat has been created async,
197199 // so a good place to rationalise memory
@@ -823,6 +825,22 @@ NAN_METHOD(Mat::CopyMakeBorderAsync) {
823825 );
824826}
825827
828+ NAN_METHOD (Mat::Reduce) {
829+ FF::SyncBinding (
830+ std::make_shared<MatBindings::ReduceWorker>(Mat::Converter::unwrap (info.This ())),
831+ " Mat::Reduce" ,
832+ info
833+ );
834+ }
835+
836+ NAN_METHOD (Mat::ReduceAsync) {
837+ FF::AsyncBinding (
838+ std::make_shared<MatBindings::ReduceWorker>(Mat::Converter::unwrap (info.This ())),
839+ " Mat::ReduceAsync" ,
840+ info
841+ );
842+ }
843+
826844#if CV_VERSION_MINOR > 1
827845NAN_METHOD (Mat::Rotate) {
828846 FF::SyncBinding (
@@ -839,4 +857,4 @@ NAN_METHOD(Mat::RotateAsync) {
839857 info
840858 );
841859}
842- #endif
860+ #endif
0 commit comments