mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
updated VideoCaptureWrap with setWidth() and setHeight()
This commit is contained in:
parent
28750d1275
commit
b62b09502c
@ -88,10 +88,15 @@ VideoCaptureWrap::SetWidth(const Arguments &args){
|
||||
HandleScope scope;
|
||||
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
||||
|
||||
if(v->cap.isOpened())
|
||||
v->cap.set(CV_CAP_PROP_FRAME_WIDTH, 320);
|
||||
if(args.Length() != 1)
|
||||
return scope.Close(Undefined());
|
||||
|
||||
int w = args[0]->IntegerValue();
|
||||
|
||||
return Undefined();
|
||||
if(v->cap.isOpened())
|
||||
v->cap.set(CV_CAP_PROP_FRAME_WIDTH, w);
|
||||
|
||||
return scope.Close(Undefined());
|
||||
}
|
||||
|
||||
Handle<Value>
|
||||
@ -100,7 +105,12 @@ VideoCaptureWrap::SetHeight(const Arguments &args){
|
||||
HandleScope scope;
|
||||
VideoCaptureWrap *v = ObjectWrap::Unwrap<VideoCaptureWrap>(args.This());
|
||||
|
||||
v->cap.set(CV_CAP_PROP_FRAME_HEIGHT, 240);
|
||||
if(args.Length() != 1)
|
||||
return scope.Close(Undefined());
|
||||
|
||||
int h = args[0]->IntegerValue();
|
||||
|
||||
v->cap.set(CV_CAP_PROP_FRAME_HEIGHT, h);
|
||||
|
||||
return Undefined();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user