mirror of
https://github.com/peterbraden/node-opencv.git
synced 2025-12-08 19:45:55 +00:00
Add bitwiseNot, bitwiseAnd methods
Modelled after existing BitwiseXor method
This commit is contained in:
parent
fee6a05f9e
commit
06ccd6919d
@ -67,6 +67,8 @@ Matrix::Init(Handle<Object> target) {
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "absDiff", AbsDiff);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "addWeighted", AddWeighted);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "bitwiseXor", BitwiseXor);
|
||||
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, "canny", Canny);
|
||||
NODE_SET_PROTOTYPE_METHOD(constructor, "dilate", Dilate);
|
||||
@ -999,6 +1001,33 @@ Matrix::BitwiseXor(const v8::Arguments& args) {
|
||||
return scope.Close(v8::Null());
|
||||
}
|
||||
|
||||
Handle<Value>
|
||||
Matrix::BitwiseNot(const v8::Arguments& args) {
|
||||
HandleScope scope;
|
||||
|
||||
Matrix *self = ObjectWrap::Unwrap<Matrix>(args.This());
|
||||
|
||||
Matrix *dst = ObjectWrap::Unwrap<Matrix>(args[0]->ToObject());
|
||||
|
||||
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>
|
||||
Matrix::CountNonZero(const v8::Arguments& args) {
|
||||
HandleScope scope;
|
||||
|
||||
@ -57,6 +57,8 @@ class Matrix: public node::ObjectWrap {
|
||||
JSFUNC(AbsDiff)
|
||||
JSFUNC(AddWeighted)
|
||||
JSFUNC(BitwiseXor)
|
||||
JSFUNC(BitwiseNot)
|
||||
JSFUNC(BitwiseAnd)
|
||||
JSFUNC(CountNonZero)
|
||||
//JSFUNC(Split)
|
||||
JSFUNC(Canny)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user