Merge branch 'bitwiseNot,-bitwiseAnd' of github.com:jhludwig/node-opencv into jhudliwig-bitwiseNot,-bitwiseAnd

Conflicts:
	src/Matrix.cc
	src/Matrix.h
This commit is contained in:
Peter Braden 2014-06-19 15:12:07 +02:00
commit e8e8170b46
2 changed files with 22 additions and 5 deletions

View File

@ -68,6 +68,7 @@ Matrix::Init(Handle<Object> target) {
NODE_SET_PROTOTYPE_METHOD(constructor, "addWeighted", AddWeighted); NODE_SET_PROTOTYPE_METHOD(constructor, "addWeighted", AddWeighted);
NODE_SET_PROTOTYPE_METHOD(constructor, "bitwiseXor", BitwiseXor); NODE_SET_PROTOTYPE_METHOD(constructor, "bitwiseXor", BitwiseXor);
NODE_SET_PROTOTYPE_METHOD(constructor, "bitwiseNot", BitwiseNot); NODE_SET_PROTOTYPE_METHOD(constructor, "bitwiseNot", BitwiseNot);
NODE_SET_PROTOTYPE_METHOD(constructor, "bitwiseAnd", BitwiseAnd);
NODE_SET_PROTOTYPE_METHOD(constructor, "countNonZero", CountNonZero); NODE_SET_PROTOTYPE_METHOD(constructor, "countNonZero", CountNonZero);
NODE_SET_PROTOTYPE_METHOD(constructor, "canny", Canny); NODE_SET_PROTOTYPE_METHOD(constructor, "canny", Canny);
NODE_SET_PROTOTYPE_METHOD(constructor, "dilate", Dilate); NODE_SET_PROTOTYPE_METHOD(constructor, "dilate", Dilate);
@ -1052,14 +1053,29 @@ Matrix::BitwiseXor(const v8::Arguments& args) {
Handle<Value> Handle<Value>
Matrix::BitwiseNot(const v8::Arguments& args) { Matrix::BitwiseNot(const v8::Arguments& args) {
HandleScope scope; HandleScope scope;
Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This()); Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This());
Matrix *src1 = ObjectWrap::Unwrap<Matrix>(args[0]->ToObject()); Matrix *dst = ObjectWrap::Unwrap<Matrix>(args[0]->ToObject());
cv::bitwise_not(src1->mat, self->mat);
return scope.Close(v8::Null()); cv::bitwise_not(self->mat, dst->mat);
return scope.Close(v8::Null());
}
Handle<Value>
Matrix::BitwiseAnd(const v8::Arguments& args) {
HandleScope scope;
Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This());
Matrix *src1 = ObjectWrap::Unwrap<Matrix>(args[0]->ToObject());
Matrix *src2 = ObjectWrap::Unwrap<Matrix>(args[1]->ToObject());
cv::bitwise_and(src1->mat, src2->mat, self->mat);
return scope.Close(v8::Null());
} }
Handle<Value> Handle<Value>

View File

@ -58,6 +58,7 @@ class Matrix: public node::ObjectWrap {
JSFUNC(AddWeighted) JSFUNC(AddWeighted)
JSFUNC(BitwiseXor) JSFUNC(BitwiseXor)
JSFUNC(BitwiseNot) JSFUNC(BitwiseNot)
JSFUNC(BitwiseAnd)
JSFUNC(CountNonZero) JSFUNC(CountNonZero)
//JSFUNC(Split) //JSFUNC(Split)
JSFUNC(Canny) JSFUNC(Canny)