Added pushBack

This commit is contained in:
Yu Jiang Tham 2014-03-18 16:10:21 -07:00
parent 021a4bf9d8
commit e66e0d250e
2 changed files with 20 additions and 0 deletions

View File

@ -96,6 +96,8 @@ Matrix::Init(Handle<Object> target) {
NODE_SET_PROTOTYPE_METHOD(constructor, "matchTemplate", MatchTemplate);
NODE_SET_PROTOTYPE_METHOD(constructor, "minMaxLoc", MinMaxLoc);
NODE_SET_PROTOTYPE_METHOD(constructor, "pushBack", PushBack);
NODE_SET_METHOD(constructor, "Eye", Eye);
@ -1633,3 +1635,19 @@ Matrix::MinMaxLoc(const v8::Arguments& args) {
return scope.Close(result);
}
// @author ytham
// Pushes some matrix (argument) the back of a matrix (self)
Handle<Value>
Matrix::PushBack(const v8::Arguments& args) {
HandleScope scope;
Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This());
Matrix *m_input = ObjectWrap::Unwrap<Matrix>(args[0]->ToObject());
self->mat.push_back(m_input->mat);
return scope.Close(args.This());
}

View File

@ -88,6 +88,8 @@ class Matrix: public node::ObjectWrap {
JSFUNC(MatchTemplate)
JSFUNC(MinMaxLoc)
JSFUNC(PushBack)
/*
static Handle<Value> Val(const Arguments& args);
static Handle<Value> RowRange(const Arguments& args);