mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Merge branch 'master' into videowriter
This commit is contained in:
commit
5b52c8c327
@ -30,6 +30,8 @@ void VideoCaptureWrap::Init(Local<Object> target) {
|
||||
Nan::SetPrototypeMethod(ctor, "read", Read);
|
||||
Nan::SetPrototypeMethod(ctor, "setWidth", SetWidth);
|
||||
Nan::SetPrototypeMethod(ctor, "setHeight", SetHeight);
|
||||
Nan::SetPrototypeMethod(ctor, "getWidth", GetWidth);
|
||||
Nan::SetPrototypeMethod(ctor, "getHeight", GetHeight);
|
||||
Nan::SetPrototypeMethod(ctor, "setPosition", SetPosition);
|
||||
Nan::SetPrototypeMethod(ctor, "getFrameAt", GetFrameAt);
|
||||
Nan::SetPrototypeMethod(ctor, "getFrameCount", GetFrameCount);
|
||||
@ -80,6 +82,15 @@ VideoCaptureWrap::VideoCaptureWrap(const std::string& filename) {
|
||||
}
|
||||
}
|
||||
|
||||
NAN_METHOD(VideoCaptureWrap::GetWidth) {
|
||||
Nan::HandleScope scope;
|
||||
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());
|
||||
|
||||
int cnt = int(v->cap.get(CV_CAP_PROP_FRAME_WIDTH));
|
||||
|
||||
info.GetReturnValue().Set(Nan::New<Number>(cnt));
|
||||
}
|
||||
|
||||
NAN_METHOD(VideoCaptureWrap::SetWidth) {
|
||||
Nan::HandleScope scope;
|
||||
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());
|
||||
@ -111,7 +122,17 @@ NAN_METHOD(VideoCaptureWrap::GetFPS) {
|
||||
|
||||
int fps = int(v->cap.get(CV_CAP_PROP_FPS));
|
||||
|
||||
info.GetReturnValue().Set(Nan::New<Number>(fps));
|
||||
info.GetReturnValue().Set(Nan::New<Number>(fps));
|
||||
}
|
||||
|
||||
|
||||
NAN_METHOD(VideoCaptureWrap::GetHeight) {
|
||||
Nan::HandleScope scope;
|
||||
VideoCaptureWrap *v = Nan::ObjectWrap::Unwrap<VideoCaptureWrap>(info.This());
|
||||
|
||||
int cnt = int(v->cap.get(CV_CAP_PROP_FRAME_HEIGHT));
|
||||
|
||||
info.GetReturnValue().Set(Nan::New<Number>(cnt));
|
||||
}
|
||||
|
||||
NAN_METHOD(VideoCaptureWrap::SetHeight) {
|
||||
|
||||
@ -17,6 +17,10 @@ public:
|
||||
static NAN_METHOD(Grab);
|
||||
static NAN_METHOD(Retrieve);
|
||||
|
||||
// For getting width and height of the input video stream
|
||||
static NAN_METHOD(GetWidth);
|
||||
static NAN_METHOD(GetHeight);
|
||||
|
||||
// (Optional) For setting width and height of the input video stream
|
||||
static NAN_METHOD(SetWidth);
|
||||
static NAN_METHOD(SetHeight);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user