mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
add matrix clone
This commit is contained in:
parent
77279a33c0
commit
55cbf0a37f
@ -37,6 +37,7 @@ Matrix::Init(Handle<Object> target) {
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "width", Width);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "height", Height);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "size", Size);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "clone", Clone);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "toBuffer", ToBuffer);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "toBufferAsync", ToBufferAsync);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "ellipse", Ellipse);
|
||||
@ -210,6 +211,18 @@ Matrix::Size(const Arguments& args){
|
||||
return scope.Close(arr);
|
||||
}
|
||||
|
||||
Handle<Value>
|
||||
Matrix::Clone(const Arguments& args){
|
||||
SETUP_FUNCTION(Matrix)
|
||||
|
||||
Local<Object> im_h = Matrix::constructor->GetFunction()->NewInstance();
|
||||
Matrix *m = ObjectWrap::Unwrap<Matrix>(im_h);
|
||||
m->mat = self->mat.clone();
|
||||
|
||||
return scope.Close(im_h);
|
||||
}
|
||||
|
||||
|
||||
Handle<Value>
|
||||
Matrix::Row(const Arguments& args){
|
||||
SETUP_FUNCTION(Matrix)
|
||||
|
||||
@ -28,6 +28,7 @@ class Matrix: public node::ObjectWrap {
|
||||
JSFUNC(Width)
|
||||
JSFUNC(Height)
|
||||
JSFUNC(Channels)
|
||||
JSFUNC(Clone)
|
||||
|
||||
JSFUNC(Ellipse)
|
||||
JSFUNC(Rectangle)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user